From 391c43cfcd30f99d8c863bb1eff3bc7c2b618567 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Fri, 16 Jan 2026 22:41:27 +0000 Subject: [PATCH 1/9] experiment: docs diff for vision api --- .librarian/generate-request.json | 40 ++ .../google/cloud/vision/__init__.py | 2 +- .../google/cloud/vision_v1/__init__.py | 13 +- .../services/image_annotator/async_client.py | 40 +- .../services/image_annotator/client.py | 40 +- .../image_annotator/transports/base.py | 11 +- .../image_annotator/transports/grpc.py | 20 +- .../transports/grpc_asyncio.py | 20 +- .../services/product_search/async_client.py | 556 ++++++++++-------- .../services/product_search/client.py | 556 ++++++++++-------- .../product_search/transports/base.py | 11 +- .../product_search/transports/grpc.py | 216 +++---- .../product_search/transports/grpc_asyncio.py | 216 +++---- .../product_search/transports/rest.py | 105 ++-- .../cloud/vision_v1/types/image_annotator.py | 458 ++++++++------- .../cloud/vision_v1/types/product_search.py | 12 +- .../vision_v1/types/product_search_service.py | 408 +++++++------ .../cloud/vision_v1/types/text_annotation.py | 144 +++-- .../cloud/vision_v1/types/web_detection.py | 4 +- .../google/cloud/vision_v1p1beta1/__init__.py | 13 +- .../image_annotator/transports/base.py | 11 +- .../vision_v1p1beta1/types/image_annotator.py | 254 ++++---- .../vision_v1p1beta1/types/text_annotation.py | 143 +++-- .../vision_v1p1beta1/types/web_detection.py | 4 +- .../google/cloud/vision_v1p2beta1/__init__.py | 13 +- .../services/image_annotator/async_client.py | 19 +- .../services/image_annotator/client.py | 19 +- .../image_annotator/transports/base.py | 11 +- .../image_annotator/transports/grpc.py | 9 +- .../transports/grpc_asyncio.py | 9 +- .../vision_v1p2beta1/types/image_annotator.py | 325 +++++----- .../vision_v1p2beta1/types/text_annotation.py | 142 +++-- .../vision_v1p2beta1/types/web_detection.py | 4 +- .../google/cloud/vision_v1p3beta1/__init__.py | 13 +- .../services/image_annotator/async_client.py | 21 +- .../services/image_annotator/client.py | 21 +- .../image_annotator/transports/base.py | 11 +- .../image_annotator/transports/grpc.py | 11 +- .../transports/grpc_asyncio.py | 11 +- .../services/product_search/async_client.py | 496 +++++++++------- .../services/product_search/client.py | 496 +++++++++------- .../product_search/transports/base.py | 11 +- .../product_search/transports/grpc.py | 197 ++++--- .../product_search/transports/grpc_asyncio.py | 197 ++++--- .../product_search/transports/rest.py | 103 ++-- .../vision_v1p3beta1/types/image_annotator.py | 332 ++++++----- .../vision_v1p3beta1/types/product_search.py | 14 +- .../types/product_search_service.py | 352 ++++++----- .../vision_v1p3beta1/types/text_annotation.py | 142 +++-- .../vision_v1p3beta1/types/web_detection.py | 4 +- .../google/cloud/vision_v1p4beta1/__init__.py | 13 +- .../services/image_annotator/async_client.py | 40 +- .../services/image_annotator/client.py | 40 +- .../image_annotator/transports/base.py | 11 +- .../image_annotator/transports/grpc.py | 20 +- .../transports/grpc_asyncio.py | 20 +- .../services/product_search/async_client.py | 554 +++++++++-------- .../services/product_search/client.py | 554 +++++++++-------- .../product_search/transports/base.py | 11 +- .../product_search/transports/grpc.py | 216 +++---- .../product_search/transports/grpc_asyncio.py | 216 +++---- .../product_search/transports/rest.py | 105 ++-- .../cloud/vision_v1p4beta1/types/face.py | 17 +- .../vision_v1p4beta1/types/image_annotator.py | 384 ++++++------ .../vision_v1p4beta1/types/product_search.py | 13 +- .../types/product_search_service.py | 405 +++++++------ .../vision_v1p4beta1/types/text_annotation.py | 142 +++-- .../vision_v1p4beta1/types/web_detection.py | 4 +- packages/google-cloud-vision/mypy.ini | 2 +- 69 files changed, 4996 insertions(+), 4051 deletions(-) create mode 100644 .librarian/generate-request.json diff --git a/.librarian/generate-request.json b/.librarian/generate-request.json new file mode 100644 index 000000000000..31b573bd01da --- /dev/null +++ b/.librarian/generate-request.json @@ -0,0 +1,40 @@ +{ + "id": "google-cloud-vision", + "version": "3.12.0", + "apis": [ + { + "path": "google/cloud/vision/v1p3beta1", + "service_config": "vision_v1p3beta1.yaml" + }, + { + "path": "google/cloud/vision/v1", + "service_config": "vision_v1.yaml" + }, + { + "path": "google/cloud/vision/v1p1beta1", + "service_config": "vision_v1p1beta1.yaml" + }, + { + "path": "google/cloud/vision/v1p2beta1", + "service_config": "vision_v1p2beta1.yaml" + }, + { + "path": "google/cloud/vision/v1p4beta1", + "service_config": "vision_v1p4beta1.yaml" + } + ], + "source_roots": [ + "packages/google-cloud-vision" + ], + "preserve_regex": [ + "packages/google-cloud-vision/CHANGELOG.md", + "docs/CHANGELOG.md", + "samples/README.txt", + "samples/snippets/README.rst", + "tests/system" + ], + "remove_regex": [ + "packages/google-cloud-vision/" + ], + "tag_format": "{id}-v{version}" +} \ No newline at end of file diff --git a/packages/google-cloud-vision/google/cloud/vision/__init__.py b/packages/google-cloud-vision/google/cloud/vision/__init__.py index 271a36da1815..192424525de8 100644 --- a/packages/google-cloud-vision/google/cloud/vision/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision/__init__.py @@ -21,7 +21,7 @@ from google.cloud.vision_v1.services.image_annotator.async_client import ( ImageAnnotatorAsyncClient, ) -from google.cloud.vision_v1 import ImageAnnotatorClient +from google.cloud.vision_v1.services.image_annotator.client import ImageAnnotatorClient from google.cloud.vision_v1.services.product_search.async_client import ( ProductSearchAsyncClient, ) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1/__init__.py index 99375917c1b9..a5a545abfc13 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/__init__.py @@ -28,11 +28,7 @@ # this code path once we drop support for Python 3.7 import importlib_metadata as metadata -from google.cloud.vision_helpers import VisionHelpers -from google.cloud.vision_helpers.decorators import add_single_feature_methods - -from .services.image_annotator import ImageAnnotatorAsyncClient -from .services.image_annotator import ImageAnnotatorClient as IacImageAnnotatorClient +from .services.image_annotator import ImageAnnotatorAsyncClient, ImageAnnotatorClient from .services.product_search import ProductSearchAsyncClient, ProductSearchClient from .types.geometry import BoundingPoly, NormalizedVertex, Position, Vertex from .types.image_annotator import ( @@ -208,13 +204,6 @@ def _get_version(dependency_name): + "https://devguide.python.org/versions/" ) - -@add_single_feature_methods -class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient): - __doc__ = IacImageAnnotatorClient.__doc__ - Feature = Feature - - __all__ = ( "ImageAnnotatorAsyncClient", "ProductSearchAsyncClient", diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py index 6efcecc5173a..485622eb9f78 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py @@ -533,17 +533,16 @@ async def async_batch_annotate_images( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Run asynchronous image detection and annotation for a list of - images. - + r"""Run asynchronous image detection and annotation for a + list of images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + This service will write image annotation outputs to json + files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -603,11 +602,13 @@ async def sample_async_batch_annotate_images(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running operation. - - The result type for the operation will be + An object representing a long-running + operation. + The result type for the operation will + be :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse` - Response to an async batch image annotation request. + Response to an async batch image + annotation request. """ # Create or coerce a protobuf request object. @@ -676,11 +677,12 @@ async def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` + r"""Run asynchronous image detection and annotation for a + list of generic files, such as PDF files, which may + contain multiple pages and multiple images per page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -735,11 +737,13 @@ async def sample_async_batch_annotate_files(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running operation. - - The result type for the operation will be + An object representing a long-running + operation. + The result type for the operation will + be :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py index 76fbff8ab683..784c1469a4f3 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py @@ -990,17 +990,16 @@ def async_batch_annotate_images( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Run asynchronous image detection and annotation for a list of - images. - + r"""Run asynchronous image detection and annotation for a + list of images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + This service will write image annotation outputs to json + files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -1060,11 +1059,13 @@ def sample_async_batch_annotate_images(): Returns: google.api_core.operation.Operation: - An object representing a long-running operation. - - The result type for the operation will be + An object representing a long-running + operation. + The result type for the operation will + be :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse` - Response to an async batch image annotation request. + Response to an async batch image + annotation request. """ # Create or coerce a protobuf request object. @@ -1132,11 +1133,12 @@ def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` + r"""Run asynchronous image detection and annotation for a + list of generic files, such as PDF files, which may + contain multiple pages and multiple images per page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -1191,11 +1193,13 @@ def sample_async_batch_annotate_files(): Returns: google.api_core.operation.Operation: - An object representing a long-running operation. - - The result type for the operation will be + An object representing a long-running + operation. + The result type for the operation will + be :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/base.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/base.py index 6444874ad13b..62943d99c81a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/base.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/base.py @@ -86,8 +86,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -102,11 +100,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) elif credentials is None and not self._ignore_credentials: credentials, _ = google.auth.default( - **scopes_kwargs, quota_project_id=quota_project_id + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) # Don't apply audience if the credentials file passed from user. if hasattr(credentials, "with_gdch_audience"): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py index a4f87b772d49..0c910249e9ab 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py @@ -417,17 +417,16 @@ def async_batch_annotate_images( ]: r"""Return a callable for the async batch annotate images method over gRPC. - Run asynchronous image detection and annotation for a list of - images. - + Run asynchronous image detection and annotation for a + list of images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + This service will write image annotation outputs to json + files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -458,11 +457,12 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` + Run asynchronous image detection and annotation for a + list of generic files, such as PDF files, which may + contain multiple pages and multiple images per page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py index 1c8c7a631000..bd5c0539f8ba 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py @@ -426,17 +426,16 @@ def async_batch_annotate_images( ]: r"""Return a callable for the async batch annotate images method over gRPC. - Run asynchronous image detection and annotation for a list of - images. - + Run asynchronous image detection and annotation for a + list of images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + This service will write image annotation outputs to json + files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -468,11 +467,12 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` + Run asynchronous image detection and annotation for a + list of generic files, such as PDF files, which may + contain multiple pages and multiple images per page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py index bf2a1db0a73a..0b273a62706a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py @@ -73,20 +73,21 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1.ProductSet] resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1.Product] resources, named + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1.Product] has a collection of - [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, - named ``projects/*/locations/*/products/*/referenceImages/*`` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -335,8 +336,8 @@ async def create_product_set( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, + or is longer than 4096 characters. .. code-block:: python @@ -366,12 +367,13 @@ async def sample_create_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.CreateProductSetRequest, dict]]): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the + ``CreateProductSet`` method. parent (:class:`str`): - Required. The project in which the ProductSet should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + ProductSet should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -382,11 +384,14 @@ async def sample_create_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_set_id (:class:`str`): - A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for this + ProductSet. If set, the server will + attempt to use this value as the + resource id. If it is already in use, an + error is returned with code + ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the + character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -476,8 +481,8 @@ async def list_product_sets( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100, or less than 1. .. code-block:: python @@ -508,12 +513,13 @@ async def sample_list_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListProductSetsRequest, dict]]): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the + ``ListProductSets`` method. parent (:class:`str`): - Required. The project from which ProductSets should be - listed. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which + ProductSets should be listed. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -528,10 +534,11 @@ async def sample_list_product_sets(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductSetsAsyncPager: - Response message for the ListProductSets method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProductSets`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -609,7 +616,7 @@ async def get_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. .. code-block:: python @@ -639,11 +646,13 @@ async def sample_get_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.GetProductSetRequest, dict]]): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the + ``GetProductSet`` method. name (:class:`str`): - Required. Resource name of the ProductSet to get. - + Required. Resource name of the + ProductSet to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -727,15 +736,15 @@ async def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. Only display_name can be - updated currently. + r"""Makes changes to a ProductSet resource. + Only display_name can be updated currently. Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer + than 4096 characters. .. code-block:: python @@ -764,7 +773,8 @@ async def sample_update_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.UpdateProductSetRequest, dict]]): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the + ``UpdateProductSet`` method. product_set (:class:`google.cloud.vision_v1.types.ProductSet`): Required. The ProductSet resource which replaces the one on the server. @@ -773,10 +783,12 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask + `__ that + specifies which fields to update. If + update_mask isn't specified, all mutable + fields are to be updated. Valid mask + path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -893,11 +905,13 @@ async def sample_delete_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.DeleteProductSetRequest, dict]]): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the + ``DeleteProductSet`` method. name (:class:`str`): - Required. Resource name of the ProductSet to delete. - + Required. Resource name of the + ProductSet to delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -974,12 +988,12 @@ async def create_product( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - - Returns INVALID_ARGUMENT if product_category is missing or - invalid. + * Returns INVALID_ARGUMENT if display_name is missing or + longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than + 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. .. code-block:: python @@ -1009,12 +1023,13 @@ async def sample_create_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.CreateProductRequest, dict]]): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the + ``CreateProduct`` method. parent (:class:`str`): - Required. The project in which the Product should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + Product should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1025,11 +1040,13 @@ async def sample_create_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_id (:class:`str`): - A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for this + Product. If set, the server will attempt + to use this value as the resource id. If + it is already in use, an error is + returned with code ALREADY_EXISTS. Must + be at most 128 characters long. It + cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1114,8 +1131,8 @@ async def list_products( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. .. code-block:: python @@ -1146,12 +1163,14 @@ async def sample_list_products(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListProductsRequest, dict]]): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the ``ListProducts`` + method. parent (:class:`str`): - Required. The project OR ProductSet from which Products - should be listed. + Required. The project OR ProductSet from + which Products should be listed. + Format: - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1166,10 +1185,11 @@ async def sample_list_products(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsAsyncPager: - Response message for the ListProducts method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProducts`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -1245,7 +1265,7 @@ async def get_product( Possible errors: - - Returns NOT_FOUND if the Product does not exist. + * Returns NOT_FOUND if the Product does not exist. .. code-block:: python @@ -1275,11 +1295,13 @@ async def sample_get_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.GetProductRequest, dict]]): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the ``GetProduct`` + method. name (:class:`str`): - Required. Resource name of the Product to get. - + Required. Resource name of the Product + to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field @@ -1358,22 +1380,25 @@ async def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + r"""Makes changes to a Product resource. + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. - If labels are updated, the change will not be reflected in - queries until the next index time. + If labels are updated, the change will not be reflected + in queries until the next index time. Possible errors: - - Returns NOT_FOUND if the Product does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - - Returns INVALID_ARGUMENT if product_category is present in - update_mask. + * Returns NOT_FOUND if the Product does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is + present in update_mask. .. code-block:: python @@ -1402,7 +1427,8 @@ async def sample_update_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.UpdateProductRequest, dict]]): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the + ``UpdateProduct`` method. product (:class:`google.cloud.vision_v1.types.Product`): Required. The Product resource which replaces the one on the server. @@ -1412,11 +1438,13 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, - and ``description``. + The `FieldMask + `__ that + specifies which fields to update. If + update_mask isn't specified, all mutable + fields are to be updated. Valid mask + paths include ``product_labels``, + ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1529,11 +1557,13 @@ async def sample_delete_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.DeleteProductRequest, dict]]): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the + ``DeleteProduct`` method. name (:class:`str`): - Required. Resource name of product to delete. - + Required. Resource name of product to + delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field @@ -1608,26 +1638,29 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If + ``bounding_poly`` is not specified, the system will try + to detect regions of interest in the image that are + compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the + image resolution is too large to process (above 50MP). Possible errors: - - Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if the product does not exist. - - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - - Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing + or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not + exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent + product's product_category is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains + more than 10 polygons. .. code-block:: python @@ -1661,10 +1694,11 @@ async def sample_create_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1.types.CreateReferenceImageRequest, dict]]): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the + ``CreateReferenceImage`` method. parent (:class:`str`): - Required. Resource name of the product in which to - create the reference image. + Required. Resource name of the product + in which to create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -1681,11 +1715,14 @@ async def sample_create_reference_image(): on the ``request`` instance; if ``request`` is provided, this should not be set. reference_image_id (:class:`str`): - A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for the + ReferenceImage to be added. If set, the + server will attempt to use this value as + the resource id. If it is already in + use, an error is returned with code + ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the + character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1700,8 +1737,9 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A ReferenceImage represents a product image and its associated metadata, - such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1802,12 +1840,13 @@ async def sample_delete_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1.types.DeleteReferenceImageRequest, dict]]): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the + ``DeleteReferenceImage`` method. name (:class:`str`): - Required. The resource name of the reference image to - delete. - + Required. The resource name of the + reference image to delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field @@ -1882,9 +1921,9 @@ async def list_reference_images( Possible errors: - - Returns NOT_FOUND if the parent product does not exist. - - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not + exist. * Returns INVALID_ARGUMENT if the page_size is + greater than 100, or less than 1. .. code-block:: python @@ -1915,11 +1954,11 @@ async def sample_list_reference_images(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListReferenceImagesRequest, dict]]): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the + ``ListReferenceImages`` method. parent (:class:`str`): - Required. Resource name of the product containing the - reference images. - + Required. Resource name of the product + containing the reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -1936,10 +1975,11 @@ async def sample_list_reference_images(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListReferenceImagesAsyncPager: - Response message for the ListReferenceImages method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListReferenceImages`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -2017,7 +2057,8 @@ async def get_reference_image( Possible errors: - - Returns NOT_FOUND if the specified image does not exist. + * Returns NOT_FOUND if the specified image does not + exist. .. code-block:: python @@ -2047,12 +2088,13 @@ async def sample_get_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1.types.GetReferenceImageRequest, dict]]): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the + ``GetReferenceImage`` method. name (:class:`str`): - Required. The resource name of the ReferenceImage to - get. - + Required. The resource name of the + ReferenceImage to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field @@ -2068,8 +2110,9 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A ReferenceImage represents a product image and its associated metadata, - such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2133,15 +2176,15 @@ async def add_product_to_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: - r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + r"""Adds a Product to the specified ProductSet. If the + Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - - Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + * Returns NOT_FOUND if the Product or the ProductSet + doesn't exist. .. code-block:: python @@ -2169,23 +2212,23 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the + ``AddProductToProductSet`` method. name (:class:`str`): - Required. The resource name for the ProductSet to - modify. - + Required. The resource name for the + ProductSet to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): - Required. The resource name for the Product to be added - to this ProductSet. - + Required. The resource name for the + Product to be added to this ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field @@ -2289,23 +2332,25 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the + ``RemoveProductFromProductSet`` method. name (:class:`str`): - Required. The resource name for the ProductSet to - modify. - + Required. The resource name for the + ProductSet to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): - Required. The resource name for the Product to be - removed from this ProductSet. + Required. The resource name for the + Product to be removed from this + ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field @@ -2380,14 +2425,14 @@ async def list_products_in_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: - r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + r"""Lists the Products in a ProductSet, in an unspecified + order. If the ProductSet does not exist, the products + field of the response will be empty. Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. .. code-block:: python @@ -2418,13 +2463,13 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the + ``ListProductsInProductSet`` method. name (:class:`str`): - Required. The ProductSet resource for which to retrieve - Products. - + Required. The ProductSet resource for + which to retrieve Products. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -2440,11 +2485,11 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the ListProductsInProductSet - method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProductsInProductSet`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -2523,18 +2568,22 @@ async def import_product_sets( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` - contains ``ImportProductSetsResponse``. (results) + r"""Asynchronous API that imports a list of reference images + to specified product sets based on a list of image + information. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains + ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. + The input source of this method is a csv file on Google + Cloud Storage. For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri + `__. .. code-block:: python @@ -2568,12 +2617,13 @@ async def sample_import_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1.types.ImportProductSetsRequest, dict]]): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the + ``ImportProductSets`` method. parent (:class:`str`): - Required. The project in which the ProductSets should be - imported. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + ProductSets should be imported. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2595,17 +2645,21 @@ async def sample_import_product_sets(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running operation. - - The result type for the operation will be - :class:`google.cloud.vision_v1.types.ImportProductSetsResponse` - Response message for the ImportProductSets method. - - This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] - method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field. + An object representing a long-running + operation. + The result type for the operation will + be + :class:`google.cloud.vision_v1.types.ImportProductSetsResponse`` + Response message for the + ``ImportProductSets` method. + + This message is returned by the + `google.longrunning.Operations.GetOperation + `__ + method in the returned + `google.longrunning.Operation.response + `__ + field. """ # Create or coerce a protobuf request object. @@ -2678,32 +2732,36 @@ async def purge_products( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + r"""Asynchronous API to delete all Products in a ProductSet + or all Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + If a Product is a member of the specified ProductSet in + addition to other ProductSets, the Product will still be + deleted. - It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + It is recommended to not delete the specified ProductSet + until after this operation has completed. It is also + recommended to not add any of the Products involved in + the batch delete to a new ProductSet while this + operation is running because those Products may still + end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. - - If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains + Therefore, it is recommended to keep the csv files used + in ImportProductSets (if that was how you originally + built the Product Set) before starting PurgeProducts, in + case you need to re-import the data after deletion. + + If the plan is to purge all of the Products from a + ProductSet and then re-use the empty ProductSet to + re-import new Products into the empty ProductSet, you + must wait until the PurgeProducts operation has finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -2738,12 +2796,13 @@ async def sample_purge_products(): Args: request (Optional[Union[google.cloud.vision_v1.types.PurgeProductsRequest, dict]]): - The request object. Request message for the ``PurgeProducts`` method. + The request object. Request message for the + ``PurgeProducts`` method. parent (:class:`str`): - Required. The project and location in which the Products - should be deleted. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project and location in + which the Products should be deleted. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2758,18 +2817,21 @@ async def sample_purge_products(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running operation. - - The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated - empty messages in your APIs. A typical example is to - use it as the request or the response type of an API - method. For instance: - - service Foo { - rpc Bar(google.protobuf.Empty) returns - (google.protobuf.Empty); - - } + An object representing a long-running + operation. + The result type for the operation will + be + :class:`google.protobuf.empty_pb2.Empty` + A generic empty message that you can + re-use to avoid defining duplicated + empty messages in your APIs. A typical + example is to use it as the request or + the response type of an API method. For + instance: + + service Foo { + rpc Bar(google.protobuf.Empty) + returns (google.protobuf.Empty); } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py index 9419a8f2769c..1b1029f34c8a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py @@ -117,20 +117,21 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1.ProductSet] resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1.Product] resources, named + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1.Product] has a collection of - [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, - named ``projects/*/locations/*/products/*/referenceImages/*`` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -816,8 +817,8 @@ def create_product_set( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, + or is longer than 4096 characters. .. code-block:: python @@ -847,12 +848,13 @@ def sample_create_product_set(): Args: request (Union[google.cloud.vision_v1.types.CreateProductSetRequest, dict]): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the + ``CreateProductSet`` method. parent (str): - Required. The project in which the ProductSet should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + ProductSet should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -863,11 +865,14 @@ def sample_create_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_set_id (str): - A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for this + ProductSet. If set, the server will + attempt to use this value as the + resource id. If it is already in use, an + error is returned with code + ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the + character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -954,8 +959,8 @@ def list_product_sets( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100, or less than 1. .. code-block:: python @@ -986,12 +991,13 @@ def sample_list_product_sets(): Args: request (Union[google.cloud.vision_v1.types.ListProductSetsRequest, dict]): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the + ``ListProductSets`` method. parent (str): - Required. The project from which ProductSets should be - listed. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which + ProductSets should be listed. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1006,10 +1012,11 @@ def sample_list_product_sets(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductSetsPager: - Response message for the ListProductSets method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProductSets`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -1084,7 +1091,7 @@ def get_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. .. code-block:: python @@ -1114,11 +1121,13 @@ def sample_get_product_set(): Args: request (Union[google.cloud.vision_v1.types.GetProductSetRequest, dict]): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the + ``GetProductSet`` method. name (str): - Required. Resource name of the ProductSet to get. - + Required. Resource name of the + ProductSet to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -1199,15 +1208,15 @@ def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. Only display_name can be - updated currently. + r"""Makes changes to a ProductSet resource. + Only display_name can be updated currently. Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer + than 4096 characters. .. code-block:: python @@ -1236,7 +1245,8 @@ def sample_update_product_set(): Args: request (Union[google.cloud.vision_v1.types.UpdateProductSetRequest, dict]): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the + ``UpdateProductSet`` method. product_set (google.cloud.vision_v1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. @@ -1245,10 +1255,12 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask + `__ that + specifies which fields to update. If + update_mask isn't specified, all mutable + fields are to be updated. Valid mask + path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1362,11 +1374,13 @@ def sample_delete_product_set(): Args: request (Union[google.cloud.vision_v1.types.DeleteProductSetRequest, dict]): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the + ``DeleteProductSet`` method. name (str): - Required. Resource name of the ProductSet to delete. - + Required. Resource name of the + ProductSet to delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -1440,12 +1454,12 @@ def create_product( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - - Returns INVALID_ARGUMENT if product_category is missing or - invalid. + * Returns INVALID_ARGUMENT if display_name is missing or + longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than + 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. .. code-block:: python @@ -1475,12 +1489,13 @@ def sample_create_product(): Args: request (Union[google.cloud.vision_v1.types.CreateProductRequest, dict]): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the + ``CreateProduct`` method. parent (str): - Required. The project in which the Product should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + Product should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1491,11 +1506,13 @@ def sample_create_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_id (str): - A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for this + Product. If set, the server will attempt + to use this value as the resource id. If + it is already in use, an error is + returned with code ALREADY_EXISTS. Must + be at most 128 characters long. It + cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1577,8 +1594,8 @@ def list_products( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. .. code-block:: python @@ -1609,12 +1626,14 @@ def sample_list_products(): Args: request (Union[google.cloud.vision_v1.types.ListProductsRequest, dict]): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the ``ListProducts`` + method. parent (str): - Required. The project OR ProductSet from which Products - should be listed. + Required. The project OR ProductSet from + which Products should be listed. + Format: - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1629,10 +1648,11 @@ def sample_list_products(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsPager: - Response message for the ListProducts method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProducts`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -1705,7 +1725,7 @@ def get_product( Possible errors: - - Returns NOT_FOUND if the Product does not exist. + * Returns NOT_FOUND if the Product does not exist. .. code-block:: python @@ -1735,11 +1755,13 @@ def sample_get_product(): Args: request (Union[google.cloud.vision_v1.types.GetProductRequest, dict]): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the ``GetProduct`` + method. name (str): - Required. Resource name of the Product to get. - + Required. Resource name of the Product + to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field @@ -1815,22 +1837,25 @@ def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + r"""Makes changes to a Product resource. + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. - If labels are updated, the change will not be reflected in - queries until the next index time. + If labels are updated, the change will not be reflected + in queries until the next index time. Possible errors: - - Returns NOT_FOUND if the Product does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - - Returns INVALID_ARGUMENT if product_category is present in - update_mask. + * Returns NOT_FOUND if the Product does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is + present in update_mask. .. code-block:: python @@ -1859,7 +1884,8 @@ def sample_update_product(): Args: request (Union[google.cloud.vision_v1.types.UpdateProductRequest, dict]): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the + ``UpdateProduct`` method. product (google.cloud.vision_v1.types.Product): Required. The Product resource which replaces the one on the server. @@ -1869,11 +1895,13 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, - and ``description``. + The `FieldMask + `__ that + specifies which fields to update. If + update_mask isn't specified, all mutable + fields are to be updated. Valid mask + paths include ``product_labels``, + ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1983,11 +2011,13 @@ def sample_delete_product(): Args: request (Union[google.cloud.vision_v1.types.DeleteProductRequest, dict]): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the + ``DeleteProduct`` method. name (str): - Required. Resource name of product to delete. - + Required. Resource name of product to + delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field @@ -2059,26 +2089,29 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If + ``bounding_poly`` is not specified, the system will try + to detect regions of interest in the image that are + compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the + image resolution is too large to process (above 50MP). Possible errors: - - Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if the product does not exist. - - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - - Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing + or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not + exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent + product's product_category is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains + more than 10 polygons. .. code-block:: python @@ -2112,10 +2145,11 @@ def sample_create_reference_image(): Args: request (Union[google.cloud.vision_v1.types.CreateReferenceImageRequest, dict]): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the + ``CreateReferenceImage`` method. parent (str): - Required. Resource name of the product in which to - create the reference image. + Required. Resource name of the product + in which to create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -2132,11 +2166,14 @@ def sample_create_reference_image(): on the ``request`` instance; if ``request`` is provided, this should not be set. reference_image_id (str): - A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for the + ReferenceImage to be added. If set, the + server will attempt to use this value as + the resource id. If it is already in + use, an error is returned with code + ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the + character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2151,8 +2188,9 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A ReferenceImage represents a product image and its associated metadata, - such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2250,12 +2288,13 @@ def sample_delete_reference_image(): Args: request (Union[google.cloud.vision_v1.types.DeleteReferenceImageRequest, dict]): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the + ``DeleteReferenceImage`` method. name (str): - Required. The resource name of the reference image to - delete. - + Required. The resource name of the + reference image to delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field @@ -2327,9 +2366,9 @@ def list_reference_images( Possible errors: - - Returns NOT_FOUND if the parent product does not exist. - - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not + exist. * Returns INVALID_ARGUMENT if the page_size is + greater than 100, or less than 1. .. code-block:: python @@ -2360,11 +2399,11 @@ def sample_list_reference_images(): Args: request (Union[google.cloud.vision_v1.types.ListReferenceImagesRequest, dict]): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the + ``ListReferenceImages`` method. parent (str): - Required. Resource name of the product containing the - reference images. - + Required. Resource name of the product + containing the reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -2381,10 +2420,11 @@ def sample_list_reference_images(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListReferenceImagesPager: - Response message for the ListReferenceImages method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListReferenceImages`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -2459,7 +2499,8 @@ def get_reference_image( Possible errors: - - Returns NOT_FOUND if the specified image does not exist. + * Returns NOT_FOUND if the specified image does not + exist. .. code-block:: python @@ -2489,12 +2530,13 @@ def sample_get_reference_image(): Args: request (Union[google.cloud.vision_v1.types.GetReferenceImageRequest, dict]): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the + ``GetReferenceImage`` method. name (str): - Required. The resource name of the ReferenceImage to - get. - + Required. The resource name of the + ReferenceImage to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field @@ -2510,8 +2552,9 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A ReferenceImage represents a product image and its associated metadata, - such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2572,15 +2615,15 @@ def add_product_to_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: - r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + r"""Adds a Product to the specified ProductSet. If the + Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - - Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + * Returns NOT_FOUND if the Product or the ProductSet + doesn't exist. .. code-block:: python @@ -2608,23 +2651,23 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the + ``AddProductToProductSet`` method. name (str): - Required. The resource name for the ProductSet to - modify. - + Required. The resource name for the + ProductSet to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): - Required. The resource name for the Product to be added - to this ProductSet. - + Required. The resource name for the + Product to be added to this ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field @@ -2727,23 +2770,25 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the + ``RemoveProductFromProductSet`` method. name (str): - Required. The resource name for the ProductSet to - modify. - + Required. The resource name for the + ProductSet to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): - Required. The resource name for the Product to be - removed from this ProductSet. + Required. The resource name for the + Product to be removed from this + ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field @@ -2817,14 +2862,14 @@ def list_products_in_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: - r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + r"""Lists the Products in a ProductSet, in an unspecified + order. If the ProductSet does not exist, the products + field of the response will be empty. Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. .. code-block:: python @@ -2855,13 +2900,13 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the + ``ListProductsInProductSet`` method. name (str): - Required. The ProductSet resource for which to retrieve - Products. - + Required. The ProductSet resource for + which to retrieve Products. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -2877,11 +2922,11 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the ListProductsInProductSet - method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProductsInProductSet`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -2959,18 +3004,22 @@ def import_product_sets( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` - contains ``ImportProductSetsResponse``. (results) + r"""Asynchronous API that imports a list of reference images + to specified product sets based on a list of image + information. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains + ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. + The input source of this method is a csv file on Google + Cloud Storage. For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri + `__. .. code-block:: python @@ -3004,12 +3053,13 @@ def sample_import_product_sets(): Args: request (Union[google.cloud.vision_v1.types.ImportProductSetsRequest, dict]): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the + ``ImportProductSets`` method. parent (str): - Required. The project in which the ProductSets should be - imported. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + ProductSets should be imported. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3031,17 +3081,21 @@ def sample_import_product_sets(): Returns: google.api_core.operation.Operation: - An object representing a long-running operation. - - The result type for the operation will be - :class:`google.cloud.vision_v1.types.ImportProductSetsResponse` - Response message for the ImportProductSets method. - - This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] - method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field. + An object representing a long-running + operation. + The result type for the operation will + be + :class:`google.cloud.vision_v1.types.ImportProductSetsResponse`` + Response message for the + ``ImportProductSets` method. + + This message is returned by the + `google.longrunning.Operations.GetOperation + `__ + method in the returned + `google.longrunning.Operation.response + `__ + field. """ # Create or coerce a protobuf request object. @@ -3111,32 +3165,36 @@ def purge_products( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + r"""Asynchronous API to delete all Products in a ProductSet + or all Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + If a Product is a member of the specified ProductSet in + addition to other ProductSets, the Product will still be + deleted. - It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + It is recommended to not delete the specified ProductSet + until after this operation has completed. It is also + recommended to not add any of the Products involved in + the batch delete to a new ProductSet while this + operation is running because those Products may still + end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. - - If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains + Therefore, it is recommended to keep the csv files used + in ImportProductSets (if that was how you originally + built the Product Set) before starting PurgeProducts, in + case you need to re-import the data after deletion. + + If the plan is to purge all of the Products from a + ProductSet and then re-use the empty ProductSet to + re-import new Products into the empty ProductSet, you + must wait until the PurgeProducts operation has finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -3171,12 +3229,13 @@ def sample_purge_products(): Args: request (Union[google.cloud.vision_v1.types.PurgeProductsRequest, dict]): - The request object. Request message for the ``PurgeProducts`` method. + The request object. Request message for the + ``PurgeProducts`` method. parent (str): - Required. The project and location in which the Products - should be deleted. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project and location in + which the Products should be deleted. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3191,18 +3250,21 @@ def sample_purge_products(): Returns: google.api_core.operation.Operation: - An object representing a long-running operation. - - The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated - empty messages in your APIs. A typical example is to - use it as the request or the response type of an API - method. For instance: - - service Foo { - rpc Bar(google.protobuf.Empty) returns - (google.protobuf.Empty); - - } + An object representing a long-running + operation. + The result type for the operation will + be + :class:`google.protobuf.empty_pb2.Empty` + A generic empty message that you can + re-use to avoid defining duplicated + empty messages in your APIs. A typical + example is to use it as the request or + the response type of an API method. For + instance: + + service Foo { + rpc Bar(google.protobuf.Empty) + returns (google.protobuf.Empty); } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/base.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/base.py index 68aa99040a97..fcf2ce051155 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/base.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/base.py @@ -87,8 +87,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -103,11 +101,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) elif credentials is None and not self._ignore_credentials: credentials, _ = google.auth.default( - **scopes_kwargs, quota_project_id=quota_project_id + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) # Don't apply audience if the credentials file passed from user. if hasattr(credentials, "with_gdch_audience"): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py index e75e8b70e142..c8b78badefba 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py @@ -115,20 +115,21 @@ class ProductSearchGrpcTransport(ProductSearchTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1.ProductSet] resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1.Product] resources, named + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1.Product] has a collection of - [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, - named ``projects/*/locations/*/products/*/referenceImages/*`` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -369,8 +370,8 @@ def create_product_set( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, + or is longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -403,8 +404,8 @@ def list_product_sets( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100, or less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -436,7 +437,7 @@ def get_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. Returns: Callable[[~.GetProductSetRequest], @@ -465,15 +466,15 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. Only display_name can be - updated currently. + Makes changes to a ProductSet resource. + Only display_name can be updated currently. Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer + than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -535,12 +536,12 @@ def create_product( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - - Returns INVALID_ARGUMENT if product_category is missing or - invalid. + * Returns INVALID_ARGUMENT if display_name is missing or + longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than + 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -573,8 +574,8 @@ def list_products( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. Returns: Callable[[~.ListProductsRequest], @@ -606,7 +607,7 @@ def get_product( Possible errors: - - Returns NOT_FOUND if the Product does not exist. + * Returns NOT_FOUND if the Product does not exist. Returns: Callable[[~.GetProductRequest], @@ -634,22 +635,25 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + Makes changes to a Product resource. + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. - If labels are updated, the change will not be reflected in - queries until the next index time. + If labels are updated, the change will not be reflected + in queries until the next index time. Possible errors: - - Returns NOT_FOUND if the Product does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - - Returns INVALID_ARGUMENT if product_category is present in - update_mask. + * Returns NOT_FOUND if the Product does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is + present in update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -711,26 +715,29 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If + ``bounding_poly`` is not specified, the system will try + to detect regions of interest in the image that are + compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the + image resolution is too large to process (above 50MP). Possible errors: - - Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if the product does not exist. - - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - - Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing + or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not + exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent + product's product_category is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains + more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -798,9 +805,9 @@ def list_reference_images( Possible errors: - - Returns NOT_FOUND if the parent product does not exist. - - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not + exist. * Returns INVALID_ARGUMENT if the page_size is + greater than 100, or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -833,7 +840,8 @@ def get_reference_image( Possible errors: - - Returns NOT_FOUND if the specified image does not exist. + * Returns NOT_FOUND if the specified image does not + exist. Returns: Callable[[~.GetReferenceImageRequest], @@ -861,15 +869,15 @@ def add_product_to_product_set( ]: r"""Return a callable for the add product to product set method over gRPC. - Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + Adds a Product to the specified ProductSet. If the + Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - - Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + * Returns NOT_FOUND if the Product or the ProductSet + doesn't exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -931,14 +939,14 @@ def list_products_in_product_set( ]: r"""Return a callable for the list products in product set method over gRPC. - Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + Lists the Products in a ProductSet, in an unspecified + order. If the ProductSet does not exist, the products + field of the response will be empty. Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -968,18 +976,22 @@ def import_product_sets( ]: r"""Return a callable for the import product sets method over gRPC. - Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + Asynchronous API that imports a list of reference images + to specified product sets based on a list of image + information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` - contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains + ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. + The input source of this method is a csv file on Google + Cloud Storage. For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri + `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1007,32 +1019,36 @@ def purge_products( ]: r"""Return a callable for the purge products method over gRPC. - Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Asynchronous API to delete all Products in a ProductSet + or all Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + If a Product is a member of the specified ProductSet in + addition to other ProductSets, the Product will still be + deleted. - It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + It is recommended to not delete the specified ProductSet + until after this operation has completed. It is also + recommended to not add any of the Products involved in + the batch delete to a new ProductSet while this + operation is running because those Products may still + end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. - - If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains + Therefore, it is recommended to keep the csv files used + in ImportProductSets (if that was how you originally + built the Product Set) before starting PurgeProducts, in + case you need to re-import the data after deletion. + + If the plan is to purge all of the Products from a + ProductSet and then re-use the empty ProductSet to + re-import new Products into the empty ProductSet, you + must wait until the PurgeProducts operation has finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py index 2d25de74b853..376d4aacbecd 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py @@ -121,20 +121,21 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1.ProductSet] resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1.Product] resources, named + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1.Product] has a collection of - [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, - named ``projects/*/locations/*/products/*/referenceImages/*`` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -377,8 +378,8 @@ def create_product_set( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, + or is longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -411,8 +412,8 @@ def list_product_sets( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100, or less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -445,7 +446,7 @@ def get_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. Returns: Callable[[~.GetProductSetRequest], @@ -474,15 +475,15 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. Only display_name can be - updated currently. + Makes changes to a ProductSet resource. + Only display_name can be updated currently. Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer + than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -547,12 +548,12 @@ def create_product( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - - Returns INVALID_ARGUMENT if product_category is missing or - invalid. + * Returns INVALID_ARGUMENT if display_name is missing or + longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than + 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -585,8 +586,8 @@ def list_products( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. Returns: Callable[[~.ListProductsRequest], @@ -619,7 +620,7 @@ def get_product( Possible errors: - - Returns NOT_FOUND if the Product does not exist. + * Returns NOT_FOUND if the Product does not exist. Returns: Callable[[~.GetProductRequest], @@ -648,22 +649,25 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + Makes changes to a Product resource. + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. - If labels are updated, the change will not be reflected in - queries until the next index time. + If labels are updated, the change will not be reflected + in queries until the next index time. Possible errors: - - Returns NOT_FOUND if the Product does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - - Returns INVALID_ARGUMENT if product_category is present in - update_mask. + * Returns NOT_FOUND if the Product does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is + present in update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -727,26 +731,29 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If + ``bounding_poly`` is not specified, the system will try + to detect regions of interest in the image that are + compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the + image resolution is too large to process (above 50MP). Possible errors: - - Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if the product does not exist. - - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - - Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing + or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not + exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent + product's product_category is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains + more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -814,9 +821,9 @@ def list_reference_images( Possible errors: - - Returns NOT_FOUND if the parent product does not exist. - - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not + exist. * Returns INVALID_ARGUMENT if the page_size is + greater than 100, or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -849,7 +856,8 @@ def get_reference_image( Possible errors: - - Returns NOT_FOUND if the specified image does not exist. + * Returns NOT_FOUND if the specified image does not + exist. Returns: Callable[[~.GetReferenceImageRequest], @@ -878,15 +886,15 @@ def add_product_to_product_set( ]: r"""Return a callable for the add product to product set method over gRPC. - Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + Adds a Product to the specified ProductSet. If the + Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - - Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + * Returns NOT_FOUND if the Product or the ProductSet + doesn't exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -949,14 +957,14 @@ def list_products_in_product_set( ]: r"""Return a callable for the list products in product set method over gRPC. - Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + Lists the Products in a ProductSet, in an unspecified + order. If the ProductSet does not exist, the products + field of the response will be empty. Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -987,18 +995,22 @@ def import_product_sets( ]: r"""Return a callable for the import product sets method over gRPC. - Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + Asynchronous API that imports a list of reference images + to specified product sets based on a list of image + information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` - contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains + ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. + The input source of this method is a csv file on Google + Cloud Storage. For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri + `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1027,32 +1039,36 @@ def purge_products( ]: r"""Return a callable for the purge products method over gRPC. - Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Asynchronous API to delete all Products in a ProductSet + or all Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + If a Product is a member of the specified ProductSet in + addition to other ProductSets, the Product will still be + deleted. - It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + It is recommended to not delete the specified ProductSet + until after this operation has completed. It is also + recommended to not add any of the Products involved in + the batch delete to a new ProductSet while this + operation is running because those Products may still + end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. - - If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains + Therefore, it is recommended to keep the csv files used + in ImportProductSets (if that was how you originally + built the Product Set) before starting PurgeProducts, in + case you need to re-import the data after deletion. + + If the plan is to purge all of the Products from a + ProductSet and then re-use the empty ProductSet to + re-import new Products into the empty ProductSet, you + must wait until the PurgeProducts operation has finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py index 65c13eb81d75..3de8c00ebefe 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py @@ -1034,20 +1034,21 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1.ProductSet] resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1.Product] resources, named + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1.Product] has a collection of - [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, - named ``projects/*/locations/*/products/*/referenceImages/*`` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -1214,8 +1215,8 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the + ``AddProductToProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1329,7 +1330,8 @@ def __call__( Args: request (~.product_search_service.CreateProductRequest): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the + ``CreateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1479,7 +1481,8 @@ def __call__( Args: request (~.product_search_service.CreateProductSetRequest): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the + ``CreateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1638,7 +1641,8 @@ def __call__( Args: request (~.product_search_service.CreateReferenceImageRequest): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the + ``CreateReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1649,8 +1653,9 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ @@ -1793,7 +1798,8 @@ def __call__( Args: request (~.product_search_service.DeleteProductRequest): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the + ``DeleteProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1899,7 +1905,8 @@ def __call__( Args: request (~.product_search_service.DeleteProductSetRequest): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the + ``DeleteProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2007,7 +2014,8 @@ def __call__( Args: request (~.product_search_service.DeleteReferenceImageRequest): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the + ``DeleteReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2115,7 +2123,8 @@ def __call__( Args: request (~.product_search_service.GetProductRequest): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the ``GetProduct`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2263,7 +2272,8 @@ def __call__( Args: request (~.product_search_service.GetProductSetRequest): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the + ``GetProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2414,7 +2424,8 @@ def __call__( Args: request (~.product_search_service.GetReferenceImageRequest): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the + ``GetReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2425,8 +2436,9 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ @@ -2565,7 +2577,8 @@ def __call__( Args: request (~.product_search_service.ImportProductSetsRequest): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the + ``ImportProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2717,7 +2730,8 @@ def __call__( Args: request (~.product_search_service.ListProductsRequest): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the ``ListProducts`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2728,7 +2742,9 @@ def __call__( Returns: ~.product_search_service.ListProductsResponse: - Response message for the ``ListProducts`` method. + Response message for the + ``ListProducts`` method. + """ http_options = ( @@ -2863,7 +2879,8 @@ def __call__( Args: request (~.product_search_service.ListProductSetsRequest): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the + ``ListProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2874,7 +2891,9 @@ def __call__( Returns: ~.product_search_service.ListProductSetsResponse: - Response message for the ``ListProductSets`` method. + Response message for the + ``ListProductSets`` method. + """ http_options = ( @@ -3013,8 +3032,8 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the + ``ListProductsInProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3025,8 +3044,8 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the ``ListProductsInProductSet`` - method. + Response message for the + ``ListProductsInProductSet`` method. """ @@ -3168,7 +3187,8 @@ def __call__( Args: request (~.product_search_service.ListReferenceImagesRequest): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the + ``ListReferenceImages`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3179,7 +3199,9 @@ def __call__( Returns: ~.product_search_service.ListReferenceImagesResponse: - Response message for the ``ListReferenceImages`` method. + Response message for the + ``ListReferenceImages`` method. + """ http_options = ( @@ -3319,7 +3341,8 @@ def __call__( Args: request (~.product_search_service.PurgeProductsRequest): - The request object. Request message for the ``PurgeProducts`` method. + The request object. Request message for the + ``PurgeProducts`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3472,8 +3495,8 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the + ``RemoveProductFromProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3589,7 +3612,8 @@ def __call__( Args: request (~.product_search_service.UpdateProductRequest): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the + ``UpdateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3739,7 +3763,8 @@ def __call__( Args: request (~.product_search_service.UpdateProductSetRequest): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the + ``UpdateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py index 524c4df5c0c9..90840a1d4c0c 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py @@ -100,23 +100,24 @@ class Likelihood(proto.Enum): class Feature(proto.Message): - r"""The type of Google Cloud Vision API detection to perform, and the - maximum number of results to return for that type. Multiple + r"""The type of Google Cloud Vision API detection to perform, and + the maximum number of results to return for that type. Multiple ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1.types.Feature.Type): The feature type. max_results (int): - Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. + Maximum number of results of this type. Does not + apply to ``TEXT_DETECTION``, + ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): - Model to use for the feature. Supported values: - "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" for the - bleeding edge release updated weekly. + Model to use for the feature. + Supported values: "builtin/stable" (the default + if unset) and "builtin/latest". + ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also support "builtin/weekly" + for the bleeding edge release updated weekly. """ class Type(proto.Enum): @@ -134,14 +135,15 @@ class Type(proto.Enum): LABEL_DETECTION (4): Run label detection. TEXT_DETECTION (5): - Run text detection / optical character recognition (OCR). - Text detection is optimized for areas of text within a - larger image; if the image is a document, use + Run text detection / optical character + recognition (OCR). Text detection is optimized + for areas of text within a larger image; if the + image is a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): - Run dense text document OCR. Takes precedence when both - ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are - present. + Run dense text document OCR. Takes precedence + when both ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` are present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -194,31 +196,38 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See `Google Cloud Storage Request - URIs `__ + The Google Cloud Storage URI of the form + ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google Cloud + Storage Request + URIs + `__ for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is - not supported. See `Google Cloud Storage Request - URIs `__ - for more info. - - 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from HTTP/HTTPS URLs, Google cannot guarantee that - the request will be completed. Your request may fail if - the specified host denies the request (e.g. due to - request throttling or DOS prevention), or if Google - throttles requests to the site for abuse prevention. You - should not depend on externally-hosted images for - production applications. - - When both ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes precedence. + ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google + Cloud Storage Request + URIs + `__ + for more info. + + 2. A publicly-accessible image HTTP/HTTPS URL. + When fetching images from HTTP/HTTPS + URLs, Google cannot guarantee that the + request will be completed. Your request + may fail if the specified host denies the + request (e.g. due to request throttling or + DOS prevention), or if Google throttles + requests to the site for abuse prevention. + You should not depend on + externally-hosted images for production + applications. + + When both ``gcs_image_uri`` and ``image_uri`` + are specified, ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -236,18 +245,20 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. Note: As - with all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. - - Currently, this field only works for BatchAnnotateImages - requests. It does not work for AsyncBatchAnnotateImages - requests. + Image content, represented as a stream of bytes. + Note: As with all ``bytes`` fields, protobuffers + use a pure binary representation, whereas JSON + representations use base64. + + Currently, this field only works for + BatchAnnotateImages requests. It does not work + for AsyncBatchAnnotateImages requests. source (google.cloud.vision_v1.types.ImageSource): - Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided - for an image, ``content`` takes precedence and is used to - perform the image annotation request. + Google Cloud Storage image location, or + publicly-accessible image URL. If both + ``content`` and ``source`` are provided for an + image, ``content`` takes precedence and is used + to perform the image annotation request. """ content: bytes = proto.Field( @@ -267,35 +278,42 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1.types.BoundingPoly): - The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale. The bounding - box is computed to "frame" the face in accordance with human - expectations. It is based on the landmarker results. Note - that one or more x and/or y coordinates may not be generated - in the ``BoundingPoly`` (the polygon will be unbounded) if - only a partial face appears in the image to be annotated. + The bounding polygon around the face. The + coordinates of the bounding box are in the + original image's scale. The bounding box is + computed to "frame" the face in accordance with + human expectations. It is based on the + landmarker results. Note that one or more x + and/or y coordinates may not be generated in the + ``BoundingPoly`` (the polygon will be unbounded) + if only a partial face appears in the image to + be annotated. fd_bounding_poly (google.cloud.vision_v1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the ``boundingPoly``, and encloses only the skin part of the - face. Typically, it is used to eliminate the face from any - image analysis that detects the "amount of skin" visible in - an image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face detection) - prefix. + The ``fd_bounding_poly`` bounding polygon is + tighter than the ``boundingPoly``, and encloses + only the skin part of the face. Typically, it is + used to eliminate the face from any image + analysis that detects the "amount of skin" + visible in an image. It is not based on the + landmarker results, only on the initial face + detection, hence the fd (face + detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the face. - Range [-180,180]. + clockwise/anti-clockwise rotation of the face + relative to the image vertical about the axis + perpendicular to the face. Range [-180,180]. pan_angle (float): - Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane + Yaw angle, which indicates the + leftward/rightward angle that the face is + pointing relative to the vertical plane perpendicular to the image. Range [-180,180]. tilt_angle (float): - Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's horizontal + Pitch angle, which indicates the + upwards/downwards angle that the face is + pointing relative to the image's horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. @@ -328,10 +346,10 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. Left and right are defined from the - vantage of the viewer of the image without considering mirror - projections typical of photos. So, ``LEFT_EYE``, typically, is the - person's right eye. + r"""Face landmark (feature) type. + Left and right are defined from the vantage of the viewer of the + image without considering mirror projections typical of photos. + So, ``LEFT_EYE``, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -577,44 +595,49 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search - API `__. + Opaque entity ID. Some IDs may be available in + `Google Knowledge Graph Search + API + `__. locale (str): - The language code for the locale in which the entity textual - ``description`` is expressed. + The language code for the locale in which the + entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its ``locale`` - language. + Entity textual description, expressed in its + ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field - represents the confidence that there is a tower in the query - image. Range [0, 1]. + **Deprecated. Use ``score`` instead.** + The accuracy of the entity detection in an + image. For example, for an image in which the + "Eiffel Tower" entity is detected, this field + represents the confidence that there is a tower + in the query image. Range [0, 1]. topicality (float): - The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower - in each image may be the same. Range [0, 1]. + The relevancy of the ICA (Image Content + Annotation) label to the image. For example, the + relevancy of "tower" is likely higher to an + image containing the detected "Eiffel Tower" + than to an image containing a detected distant + towering building, even though the confidence + that there is a tower in each image may be the + same. Range [0, 1]. bounding_poly (google.cloud.vision_v1.types.BoundingPoly): - Image region to which this entity belongs. Not produced for - ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not + produced for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1.types.LocationInfo]): - The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may indicate the location of the scene in the - image, and another location may indicate the location of the - place where the image was taken. Location information is - usually present for landmarks. + The location information for the detected + entity. Multiple ``LocationInfo`` elements can + be present because one location may indicate the + location of the scene in the image, and another + location may indicate the location of the place + where the image was taken. Location information + is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1.types.Property]): - Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies - the entity. + Some entities may have optional user-supplied + ``Property`` (name/value) fields, such a score + or string that qualifies the entity. """ mid: str = proto.Field( @@ -666,11 +689,12 @@ class LocalizedObjectAnnotation(proto.Message): Object ID that should align with EntityAnnotation mid. language_code (str): - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + The BCP-47 language code, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` language. + Object name, expressed in its ``language_code`` + language. score (float): Score of the result. Range [0, 1]. bounding_poly (google.cloud.vision_v1.types.BoundingPoly): @@ -789,10 +813,11 @@ class ColorInfo(proto.Message): color (google.type.color_pb2.Color): RGB components of the color. score (float): - Image-specific score for this color. Value in range [0, 1]. + Image-specific score for this color. Value in + range [0, 1]. pixel_fraction (float): - The fraction of pixels the color occupies in the image. - Value in range [0, 1]. + The fraction of pixels the color occupies in the + image. Value in range [0, 1]. """ color: color_pb2.Color = proto.Field( @@ -852,7 +877,8 @@ class CropHint(proto.Message): coordinates of the bounding box are in the original image's scale. confidence (float): - Confidence of this being a salient region. Range [0, 1]. + Confidence of this being a salient region. + Range [0, 1]. importance_fraction (float): Fraction of importance of this salient region with respect to the original image. @@ -930,17 +956,20 @@ class TextDetectionParams(proto.Message): Attributes: enable_text_detection_confidence_score (bool): - By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + By default, Cloud Vision API only includes + confidence score for DOCUMENT_TEXT_DETECTION + result. Set the flag to true to include + confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): - A list of advanced OCR options to further fine-tune OCR - behavior. Current valid values are: - - - ``legacy_layout``: a heuristics layout detection - algorithm, which serves as an alternative to the current - ML-based layout detection algorithm. Customers can choose - the best suitable layout algorithm based on their + A list of advanced OCR options to further + fine-tune OCR behavior. Current valid values + are: + + - ``legacy_layout``: a heuristics layout + detection algorithm, which serves as an + alternative to the current ML-based layout + detection algorithm. Customers can choose the + best suitable layout algorithm based on their situation. """ @@ -961,16 +990,19 @@ class ImageContext(proto.Message): lat_long_rect (google.cloud.vision_v1.types.LatLongRect): Not used. language_hints (MutableSequence[str]): - List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In - rare cases, when the language of the text in the image is - known, setting a hint will help get better results (although - it will be a significant hindrance if the hint is wrong). - Text detection returns an error if one or more of the - specified languages is not one of the `supported - languages `__. + List of languages to use for TEXT_DETECTION. In + most cases, an empty value yields the best + results since it enables automatic language + detection. For languages based on the Latin + alphabet, setting ``language_hints`` is not + needed. In rare cases, when the language of the + text in the image is known, setting a hint will + help get better results (although it will be a + significant hindrance if the hint is wrong). + Text detection returns an error if one or more + of the specified languages is not one of the + `supported languages + `__. crop_hints_params (google.cloud.vision_v1.types.CropHintsParams): Parameters for crop hints annotation request. product_search_params (google.cloud.vision_v1.types.ProductSearchParams): @@ -1113,9 +1145,10 @@ class AnnotateImageResponse(proto.Message): If present, product search has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the operation. Note - that filled-in image annotations are guaranteed to be - correct, even when ``error`` is set. + If set, represents the error message for the + operation. Note that filled-in image annotations + are guaranteed to be correct, even when + ``error`` is set. context (google.cloud.vision_v1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1204,16 +1237,19 @@ class BatchAnnotateImagesRequest(proto.Message): Required. Individual image annotation requests for this batch. parent (str): - Optional. Target project and location to make a call. + Optional. Target project and location to make a + call. + Format: + ``projects/{project-id}/locations/{location-id}``. - Format: ``projects/{project-id}/locations/{location-id}``. + If no parent is specified, a region will be + chosen automatically. - If no parent is specified, a region will be chosen - automatically. + Supported location-ids: - Supported location-ids: ``us``: USA country only, ``asia``: - East asia areas, like Japan, Taiwan, ``eu``: The European - Union. + ``us``: USA country only, + ``asia``: East asia areas, like Japan, + Taiwan, ``eu``: The European Union. Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): @@ -1322,14 +1358,16 @@ class AnnotateFileResponse(proto.Message): Information about the file for which this response is generated. responses (MutableSequence[google.cloud.vision_v1.types.AnnotateImageResponse]): - Individual responses to images found within the file. This - field will be empty if the ``error`` field is set. + Individual responses to images found within the + file. This field will be empty if the ``error`` + field is set. total_pages (int): This field gives the total number of pages in the file. error (google.rpc.status_pb2.Status): - If set, represents the error message for the failed request. - The ``responses`` field will not be set in this case. + If set, represents the error message for the + failed request. The ``responses`` field will not + be set in this case. """ input_config: "InputConfig" = proto.Field( @@ -1364,16 +1402,19 @@ class BatchAnnotateFilesRequest(proto.Message): AnnotateFileRequest in BatchAnnotateFilesRequest. parent (str): - Optional. Target project and location to make a call. + Optional. Target project and location to make a + call. + Format: + ``projects/{project-id}/locations/{location-id}``. - Format: ``projects/{project-id}/locations/{location-id}``. + If no parent is specified, a region will be + chosen automatically. - If no parent is specified, a region will be chosen - automatically. + Supported location-ids: - Supported location-ids: ``us``: USA country only, ``asia``: - East asia areas, like Japan, Taiwan, ``eu``: The European - Union. + ``us``: USA country only, + ``asia``: East asia areas, like Japan, + Taiwan, ``eu``: The European Union. Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): @@ -1486,16 +1527,19 @@ class AsyncBatchAnnotateImagesRequest(proto.Message): Required. The desired output location and metadata (e.g. format). parent (str): - Optional. Target project and location to make a call. + Optional. Target project and location to make a + call. + Format: + ``projects/{project-id}/locations/{location-id}``. - Format: ``projects/{project-id}/locations/{location-id}``. + If no parent is specified, a region will be + chosen automatically. - If no parent is specified, a region will be chosen - automatically. + Supported location-ids: - Supported location-ids: ``us``: USA country only, ``asia``: - East asia areas, like Japan, Taiwan, ``eu``: The European - Union. + ``us``: USA country only, + ``asia``: East asia areas, like Japan, + Taiwan, ``eu``: The European Union. Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): @@ -1555,16 +1599,19 @@ class AsyncBatchAnnotateFilesRequest(proto.Message): Required. Individual async file annotation requests for this batch. parent (str): - Optional. Target project and location to make a call. + Optional. Target project and location to make a + call. + Format: + ``projects/{project-id}/locations/{location-id}``. - Format: ``projects/{project-id}/locations/{location-id}``. + If no parent is specified, a region will be + chosen automatically. - If no parent is specified, a region will be chosen - automatically. + Supported location-ids: - Supported location-ids: ``us``: USA country only, ``asia``: - East asia areas, like Japan, Taiwan, ``eu``: The European - Union. + ``us``: USA country only, + ``asia``: East asia areas, like Japan, + Taiwan, ``eu``: The European Union. Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): @@ -1619,13 +1666,14 @@ class InputConfig(proto.Message): The Google Cloud Storage location to read the input from. content (bytes): - File content, represented as a stream of bytes. Note: As - with all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. - - Currently, this field only works for BatchAnnotateFiles - requests. It does not work for AsyncBatchAnnotateFiles - requests. + File content, represented as a stream of bytes. + Note: As with all ``bytes`` fields, protobuffers + use a pure binary representation, whereas JSON + representations use base64. + + Currently, this field only works for + BatchAnnotateFiles requests. It does not work + for AsyncBatchAnnotateFiles requests. mime_type (str): The type of the file. Currently only "application/pdf", "image/tiff" and "image/gif" @@ -1655,17 +1703,20 @@ class OutputConfig(proto.Message): The Google Cloud Storage location to write the output(s) to. batch_size (int): - The max number of response protos to put into each output - JSON file on Google Cloud Storage. The valid range is [1, - 100]. If not specified, the default value is 20. - - For example, for one pdf file with 100 pages, 100 response - protos will be generated. If ``batch_size`` = 20, then 5 - json files each containing 20 response protos will be - written under the prefix ``gcs_destination``.\ ``uri``. - - Currently, batch_size only applies to GcsDestination, with - potential future support for other output configurations. + The max number of response protos to put into + each output JSON file on Google Cloud Storage. + The valid range is [1, 100]. If not specified, + the default value is 20. + + For example, for one pdf file with 100 pages, + 100 response protos will be generated. If + ``batch_size`` = 20, then 5 json files each + containing 20 response protos will be written + under the prefix ``gcs_destination``.``uri``. + + Currently, batch_size only applies to + GcsDestination, with potential future support + for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1702,32 +1753,37 @@ class GcsDestination(proto.Message): Attributes: uri (str): - Google Cloud Storage URI prefix where the results will be - stored. Results will be in JSON format and preceded by its - corresponding input URI prefix. This field can either - represent a gcs file prefix or gcs directory. In either - case, the uri should be unique because in order to get all - of the output files, you will need to do a wildcard gcs - search on the uri prefix you provide. + Google Cloud Storage URI prefix where the + results will be stored. Results will be in JSON + format and preceded by its corresponding input + URI prefix. This field can either represent a + gcs file prefix or gcs directory. In either + case, the uri should be unique because in order + to get all of the output files, you will need to + do a wildcard gcs search on the uri prefix you + provide. Examples: - - File Prefix: gs://bucket-name/here/filenameprefix The - output files will be created in gs://bucket-name/here/ and - the names of the output files will begin with - "filenameprefix". + * File Prefix: + gs://bucket-name/here/filenameprefix The + output files will be created in + gs://bucket-name/here/ and the names of the + output files will begin with "filenameprefix". - - Directory Prefix: gs://bucket-name/some/location/ The - output files will be created in - gs://bucket-name/some/location/ and the names of the - output files could be anything because there was no - filename prefix specified. + * Directory Prefix: + gs://bucket-name/some/location/ The output + files will be created in + gs://bucket-name/some/location/ and the names of + the output files could be anything because there + was no filename prefix specified. If multiple outputs, each response is still - AnnotateFileResponse, each of which contains some subset of - the full list of AnnotateImageResponse. Multiple outputs can - happen if, for example, the output JSON is too large and - overflows into multiple sharded files. + AnnotateFileResponse, each of which contains + some subset of the full list of + AnnotateImageResponse. Multiple outputs can + happen if, for example, the output JSON is too + large and overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py index 7b745e9b0bbb..7bed9cc147f9 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py @@ -40,11 +40,12 @@ class ProductSearchParams(proto.Message): interest in the image. If it is not specified, system discretion will be applied. product_set (str): - The resource name of a - [ProductSet][google.cloud.vision.v1.ProductSet] to be + The resource name of a `ProductSet + `__ to be searched for similar images. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. @@ -148,11 +149,12 @@ class ObjectAnnotation(proto.Message): Object ID that should align with EntityAnnotation mid. language_code (str): - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + The BCP-47 language code, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` language. + Object name, expressed in its ``language_code`` + language. score (float): Score of the result. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py index 857fe4832ef3..f2d74b474b14 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py @@ -70,6 +70,7 @@ class Product(proto.Message): The resource name of the product. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This field is ignored when creating a product. @@ -89,21 +90,23 @@ class Product(proto.Message): and "toys" are still supported, but these should not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1.types.Product.KeyValue]): - Key-value pairs that can be attached to a product. At query - time, constraints can be specified based on the - product_labels. - - Note that integer values can be provided as strings, e.g. - "1199". Only strings with integer values can match a - range-based restriction which is to be supported soon. - - Multiple values can be assigned to the same key. One product - may have up to 500 product_labels. - - Notice that the total number of distinct product_labels over - all products in one ProductSet cannot exceed 1M, otherwise - the product search pipeline will refuse to work for that - ProductSet. + Key-value pairs that can be attached to a + product. At query time, constraints can be + specified based on the product_labels. + + Note that integer values can be provided as + strings, e.g. "1199". Only strings with integer + values can match a range-based restriction which + is to be supported soon. + + Multiple values can be assigned to the same key. + One product may have up to 500 product_labels. + + Notice that the total number of distinct + product_labels over all products in one + ProductSet cannot exceed 1M, otherwise the + product search pipeline will refuse to work for + that ProductSet. """ class KeyValue(proto.Message): @@ -161,9 +164,11 @@ class ProductSet(proto.Message): The resource name of the ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. - This field is ignored when creating a ProductSet. + This field is ignored when creating a + ProductSet. display_name (str): The user-provided name for this ProductSet. Must not be empty. Must be at most 4096 @@ -208,21 +213,22 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): - r"""A ``ReferenceImage`` represents a product image and its associated - metadata, such as bounding boxes. + r"""A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. Attributes: name (str): The resource name of the reference image. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. - This field is ignored when creating a reference image. - uri (str): - Required. The Google Cloud Storage URI of the reference + This field is ignored when creating a reference image. - + uri (str): + Required. The Google Cloud Storage URI of the + reference image. The URI must start with ``gs://``. bounding_polys (MutableSequence[google.cloud.vision_v1.types.BoundingPoly]): Optional. Bounding polygons around the areas @@ -258,18 +264,19 @@ class CreateProductRequest(proto.Message): Attributes: parent (str): - Required. The project in which the Product should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the Product + should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1.types.Product): Required. The product to create. product_id (str): - A user-supplied resource id for this Product. If set, the - server will attempt to use this value as the resource id. If - it is already in use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 characters long. It - cannot contain the character ``/``. + A user-supplied resource id for this Product. If + set, the server will attempt to use this value + as the resource id. If it is already in use, an + error is returned with code ALREADY_EXISTS. Must + be at most 128 characters long. It cannot + contain the character ``/``. """ parent: str = proto.Field( @@ -292,16 +299,17 @@ class ListProductsRequest(proto.Message): Attributes: parent (str): - Required. The project OR ProductSet from which Products - should be listed. + Required. The project OR ProductSet from which + Products should be listed. + Format: - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + ``projects/PROJECT_ID/locations/LOC_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous List request, - if any. + The next_page_token returned from a previous + List request, if any. """ parent: str = proto.Field( @@ -353,6 +361,7 @@ class GetProductRequest(proto.Message): Required. Resource name of the Product to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ @@ -371,10 +380,12 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that specifies - which fields to update. If update_mask isn't specified, all - mutable fields are to be updated. Valid mask paths include - ``product_labels``, ``display_name``, and ``description``. + The `FieldMask `__ + that specifies which fields to update. + If update_mask isn't specified, all mutable + fields are to be updated. Valid mask paths + include ``product_labels``, ``display_name``, + and ``description``. """ product: "Product" = proto.Field( @@ -397,6 +408,7 @@ class DeleteProductRequest(proto.Message): Required. Resource name of product to delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ @@ -411,18 +423,19 @@ class CreateProductSetRequest(proto.Message): Attributes: parent (str): - Required. The project in which the ProductSet should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSet + should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. product_set (google.cloud.vision_v1.types.ProductSet): Required. The ProductSet to create. product_set_id (str): - A user-supplied resource id for this ProductSet. If set, the - server will attempt to use this value as the resource id. If - it is already in use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 characters long. It - cannot contain the character ``/``. + A user-supplied resource id for this ProductSet. + If set, the server will attempt to use this + value as the resource id. If it is already in + use, an error is returned with code + ALREADY_EXISTS. Must be at most 128 characters + long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -445,16 +458,16 @@ class ListProductSetsRequest(proto.Message): Attributes: parent (str): - Required. The project from which ProductSets should be - listed. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which ProductSets + should be listed. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous List request, - if any. + The next_page_token returned from a previous + List request, if any. """ parent: str = proto.Field( @@ -503,9 +516,10 @@ class GetProductSetRequest(proto.Message): Attributes: name (str): - Required. Resource name of the ProductSet to get. - + Required. Resource name of the ProductSet to + get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ @@ -523,9 +537,10 @@ class UpdateProductSetRequest(proto.Message): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that specifies - which fields to update. If update_mask isn't specified, all - mutable fields are to be updated. Valid mask path is + The `FieldMask `__ + that specifies which fields to update. + If update_mask isn't specified, all mutable + fields are to be updated. Valid mask path is ``display_name``. """ @@ -546,9 +561,10 @@ class DeleteProductSetRequest(proto.Message): Attributes: name (str): - Required. Resource name of the ProductSet to delete. - + Required. Resource name of the ProductSet to + delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ @@ -563,8 +579,8 @@ class CreateReferenceImageRequest(proto.Message): Attributes: parent (str): - Required. Resource name of the product in which to create - the reference image. + Required. Resource name of the product in which + to create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -572,11 +588,13 @@ class CreateReferenceImageRequest(proto.Message): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): - A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value as - the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for the + ReferenceImage to be added. If set, the server + will attempt to use this value as the resource + id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at + most 128 characters long. It cannot contain the + character ``/``. """ parent: str = proto.Field( @@ -599,18 +617,18 @@ class ListReferenceImagesRequest(proto.Message): Attributes: parent (str): - Required. Resource name of the product containing the - reference images. - + Required. Resource name of the product + containing the reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - A token identifying a page of results to be returned. This - is the value of ``nextPageToken`` returned in a previous - reference image list request. + A token identifying a page of results to be + returned. This is the value of ``nextPageToken`` + returned in a previous reference image list + request. Defaults to the first page if not specified. """ @@ -639,8 +657,8 @@ class ListReferenceImagesResponse(proto.Message): The maximum number of items to return. Default 10, maximum 100. next_page_token (str): - The next_page_token returned from a previous List request, - if any. + The next_page_token returned from a previous + List request, if any. """ @property @@ -667,9 +685,10 @@ class GetReferenceImageRequest(proto.Message): Attributes: name (str): - Required. The resource name of the ReferenceImage to get. - + Required. The resource name of the + ReferenceImage to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. """ @@ -684,10 +703,10 @@ class DeleteReferenceImageRequest(proto.Message): Attributes: name (str): - Required. The resource name of the reference image to - delete. - + Required. The resource name of the reference + image to delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` """ @@ -702,15 +721,16 @@ class AddProductToProductSetRequest(proto.Message): Attributes: name (str): - Required. The resource name for the ProductSet to modify. - + Required. The resource name for the ProductSet + to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): - Required. The resource name for the Product to be added to - this ProductSet. - + Required. The resource name for the Product to + be added to this ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ @@ -729,15 +749,17 @@ class RemoveProductFromProductSetRequest(proto.Message): Attributes: name (str): - Required. The resource name for the ProductSet to modify. - + Required. The resource name for the ProductSet + to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): - Required. The resource name for the Product to be removed - from this ProductSet. + Required. The resource name for the Product to + be removed from this ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ @@ -756,17 +778,17 @@ class ListProductsInProductSetRequest(proto.Message): Attributes: name (str): - Required. The ProductSet resource for which to retrieve - Products. - + Required. The ProductSet resource for which to + retrieve Products. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous List request, - if any. + The next_page_token returned from a previous + List request, if any. """ name: str = proto.Field( @@ -816,79 +838,90 @@ class ImportProductSetsGcsSource(proto.Message): Attributes: csv_file_uri (str): - The Google Cloud Storage URI of the input csv file. - + The Google Cloud Storage URI of the input csv + file. The URI must start with ``gs://``. - The format of the input csv file should be one image per - line. In each line, there are 8 columns. - - 1. image-uri - 2. image-id - 3. product-set-id - 4. product-id - 5. product-category - 6. product-display-name - 7. labels - 8. bounding-poly - - The ``image-uri``, ``product-set-id``, ``product-id``, and - ``product-category`` columns are required. All other columns - are optional. - - If the ``ProductSet`` or ``Product`` specified by the - ``product-set-id`` and ``product-id`` values does not exist, - then the system will create a new ``ProductSet`` or - ``Product`` for the image. In this case, the + The format of the input csv file should be one + image per line. In each line, there are 8 + columns. + + 1. image-uri + 2. image-id + 3. product-set-id + 4. product-id + 5. product-category + 6. product-display-name + 7. labels + 8. bounding-poly + + The ``image-uri``, ``product-set-id``, + ``product-id``, and ``product-category`` columns + are required. All other columns are optional. + + If the ``ProductSet`` or ``Product`` specified + by the ``product-set-id`` and ``product-id`` + values does not exist, then the system will + create a new ``ProductSet`` or ``Product`` for + the image. In this case, the ``product-display-name`` column refers to - [display_name][google.cloud.vision.v1.Product.display_name], + `display_name + `__, the ``product-category`` column refers to - [product_category][google.cloud.vision.v1.Product.product_category], + `product_category + `__, and the ``labels`` column refers to - [product_labels][google.cloud.vision.v1.Product.product_labels]. - - The ``image-id`` column is optional but must be unique if - provided. If it is empty, the system will automatically - assign a unique id to the image. - - The ``product-display-name`` column is optional. If it is - empty, the system sets the - [display_name][google.cloud.vision.v1.Product.display_name] - field for the product to a space (" "). You can update the - ``display_name`` later by using the API. - - If a ``Product`` with the specified ``product-id`` already - exists, then the system ignores the - ``product-display-name``, ``product-category``, and - ``labels`` columns. - - The ``labels`` column (optional) is a line containing a list - of comma-separated key-value pairs, in the following format: + `product_labels + `__. - :: - - "key_1=value_1,key_2=value_2,...,key_n=value_n" + The ``image-id`` column is optional but must be + unique if provided. If it is empty, the system + will automatically assign a unique id to the + image. - The ``bounding-poly`` column (optional) identifies one - region of interest from the image in the same manner as - ``CreateReferenceImage``. If you do not specify the - ``bounding-poly`` column, then the system will try to detect + The ``product-display-name`` column is optional. + If it is empty, the system sets the + `display_name + `__ + field for the product to a space (" "). You can + update the ``display_name`` later by using the + API. + + If a ``Product`` with the specified + ``product-id`` already exists, then the system + ignores the ``product-display-name``, + ``product-category``, and ``labels`` columns. + + The ``labels`` column (optional) is a line + containing a list of comma-separated key-value + pairs, in the following format: + + "key_1=value_1,key_2=value_2,...,key_n=value_n" + + The ``bounding-poly`` column (optional) + identifies one region of interest from the image + in the same manner as ``CreateReferenceImage``. + If you do not specify the ``bounding-poly`` + column, then the system will try to detect regions of interest automatically. - At most one ``bounding-poly`` column is allowed per line. If - the image contains multiple regions of interest, add a line - to the CSV file that includes the same product information, - and the ``bounding-poly`` values for each region of + At most one ``bounding-poly`` column is allowed + per line. If the image contains multiple regions + of interest, add a line to the CSV file that + includes the same product information, and the + ``bounding-poly`` values for each region of interest. - The ``bounding-poly`` column must contain an even number of - comma-separated numbers, in the format - "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative - integers for absolute bounding polygons, and float values in - [0, 1] for normalized bounding polygons. + The ``bounding-poly`` column must contain an + even number of comma-separated numbers, in the + format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use + non-negative integers for absolute bounding + polygons, and float values in [0, 1] for + normalized bounding polygons. - The system will resize the image if the image resolution is - too large to process (larger than 20MP). + The system will resize the image if the image + resolution is too large to process (larger than + 20MP). """ csv_file_uri: str = proto.Field( @@ -924,10 +957,10 @@ class ImportProductSetsRequest(proto.Message): Attributes: parent (str): - Required. The project in which the ProductSets should be - imported. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSets + should be imported. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. input_config (google.cloud.vision_v1.types.ImportProductSetsInputConfig): Required. The input content for the list of requests. @@ -948,22 +981,24 @@ class ImportProductSetsResponse(proto.Message): r"""Response message for the ``ImportProductSets`` method. This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] - method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field. + `google.longrunning.Operations.GetOperation + `__ method in the + returned + `google.longrunning.Operation.response + `__ field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1.types.ReferenceImage]): - The list of reference_images that are imported successfully. + The list of reference_images that are imported + successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): - The rpc status for each ImportProductSet request, including - both successes and errors. + The rpc status for each ImportProductSet + request, including both successes and errors. - The number of statuses here matches the number of lines in - the csv file, and statuses[i] stores the success or failure - status of processing the i-th line of the csv, starting from - line 0. + The number of statuses here matches the number + of lines in the csv file, and statuses[i] stores + the success or failure status of processing the + i-th line of the csv, starting from line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -981,9 +1016,8 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` - returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. + This is included in the ``metadata`` field of the ``Operation`` returned by the + ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1.types.BatchOperationMetadata.State): @@ -993,8 +1027,9 @@ class BatchOperationMetadata(proto.Message): to the server. end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and - [google.longrunning.Operation.done][google.longrunning.Operation.done] - is set to true. + `google.longrunning.Operation.done + `__ is set to + true. """ class State(proto.Enum): @@ -1048,9 +1083,10 @@ class ProductSetPurgeConfig(proto.Message): Attributes: product_set_id (str): - The ProductSet that contains the Products to delete. If a - Product is a member of product_set_id in addition to other - ProductSets, the Product will still be deleted. + The ProductSet that contains the Products to + delete. If a Product is a member of + product_set_id in addition to other ProductSets, + the Product will still be deleted. """ product_set_id: str = proto.Field( @@ -1076,15 +1112,15 @@ class PurgeProductsRequest(proto.Message): This field is a member of `oneof`_ ``target``. delete_orphan_products (bool): - If delete_orphan_products is true, all Products that are not - in any ProductSet will be deleted. + If delete_orphan_products is true, all Products + that are not in any ProductSet will be deleted. This field is a member of `oneof`_ ``target``. parent (str): - Required. The project and location in which the Products - should be deleted. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project and location in which the + Products should be deleted. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. force (bool): The default value is false. Override this value to true to actually perform the purge. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py index 8461cf71f80f..bb1a5408580b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py @@ -35,14 +35,17 @@ class TextAnnotation(proto.Message): - r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like this: - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each - structural component, starting from Page, may further have their own - properties. Properties describe detected languages, breaks etc.. - Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1.TextAnnotation.TextProperty] - message definition below for more detail. + r"""TextAnnotation contains a structured representation of OCR + extracted text. The hierarchy of an OCR extracted text structure + is like this: + + TextAnnotation -> Page -> Block -> Paragraph -> Word -> + Symbol Each structural component, starting from Page, may + further have their own properties. Properties describe detected + languages, breaks etc.. Please refer to the + `TextAnnotation.TextProperty + `__ message + definition below for more detail. Attributes: pages (MutableSequence[google.cloud.vision_v1.types.Page]): @@ -56,8 +59,8 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + The BCP-47 language code, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -95,9 +98,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or - ``LINE_BREAK``. + End-line hyphen that is not present in text; + does not co-occur with ``SPACE``, + ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -169,7 +172,8 @@ class Page(proto.Message): List of blocks of text, images etc on this page. confidence (float): - Confidence of the OCR results on the page. Range [0, 1]. + Confidence of the OCR results on the page. Range + [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -210,24 +214,24 @@ class Block(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: + - when the text is horizontal it might look like: - :: + :: - 0----1 - | | - 3----2 + 0----1 + | | + 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: + - when it's rotated 180 degrees around the top-left corner + it becomes: - :: + :: - 2----3 - | | - 1----0 + 2----3 + | | + 1----0 - and the vertex order will still be (0, 1, 2, 3). + and the vertex order will still be (0, 1, 2, 3). paragraphs (MutableSequence[google.cloud.vision_v1.types.Paragraph]): List of paragraphs in this block (if this blocks is of type text). @@ -235,7 +239,8 @@ class Block(proto.Message): Detected block type (text, image etc) for this block. confidence (float): - Confidence of the OCR results on the block. Range [0, 1]. + Confidence of the OCR results on the block. + Range [0, 1]. """ class BlockType(proto.Enum): @@ -297,22 +302,25 @@ class Paragraph(proto.Message): Additional information detected for the paragraph. bounding_box (google.cloud.vision_v1.types.BoundingPoly): - The bounding box for the paragraph. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. - When a rotation of the bounding box is detected the rotation - is represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertex order will - still be (0, 1, 2, 3). + The bounding box for the paragraph. The vertices + are in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertex order will still be + (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1.types.Word]): List of all words in this paragraph. confidence (float): - Confidence of the OCR results for the paragraph. Range [0, - 1]. + Confidence of the OCR results for the paragraph. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -343,23 +351,27 @@ class Word(proto.Message): property (google.cloud.vision_v1.types.TextAnnotation.TextProperty): Additional information detected for the word. bounding_box (google.cloud.vision_v1.types.BoundingPoly): - The bounding box for the word. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertex order will - still be (0, 1, 2, 3). + The bounding box for the word. The vertices are + in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertex order will still be + (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural reading order. confidence (float): - Confidence of the OCR results for the word. Range [0, 1]. + Confidence of the OCR results for the word. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -391,22 +403,26 @@ class Symbol(proto.Message): Additional information detected for the symbol. bounding_box (google.cloud.vision_v1.types.BoundingPoly): - The bounding box for the symbol. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. - When a rotation of the bounding box is detected the rotation - is represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertex order will - still be (0, 1, 2, 3). + The bounding box for the symbol. The vertices + are in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertex order will still be + (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. confidence (float): - Confidence of the OCR results for the symbol. Range [0, 1]. + Confidence of the OCR results for the symbol. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py index 11ce1af125ac..4254abe6daf0 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py @@ -159,8 +159,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as + "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/__init__.py index 097c67e1b303..ebd5bcd9a09f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/__init__.py @@ -28,11 +28,7 @@ # this code path once we drop support for Python 3.7 import importlib_metadata as metadata -from google.cloud.vision_helpers import VisionHelpers -from google.cloud.vision_helpers.decorators import add_single_feature_methods - -from .services.image_annotator import ImageAnnotatorAsyncClient -from .services.image_annotator import ImageAnnotatorClient as IacImageAnnotatorClient +from .services.image_annotator import ImageAnnotatorAsyncClient, ImageAnnotatorClient from .types.geometry import BoundingPoly, Position, Vertex from .types.image_annotator import ( AnnotateImageRequest, @@ -156,13 +152,6 @@ def _get_version(dependency_name): + "https://devguide.python.org/versions/" ) - -@add_single_feature_methods -class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient): - __doc__ = IacImageAnnotatorClient.__doc__ - Feature = Feature - - __all__ = ( "ImageAnnotatorAsyncClient", "AnnotateImageRequest", diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/services/image_annotator/transports/base.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/services/image_annotator/transports/base.py index aaa523f9a02a..8c801f40de89 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/services/image_annotator/transports/base.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/services/image_annotator/transports/base.py @@ -85,8 +85,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -101,11 +99,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) elif credentials is None and not self._ignore_credentials: credentials, _ = google.auth.default( - **scopes_kwargs, quota_project_id=quota_project_id + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) # Don't apply audience if the credentials file passed from user. if hasattr(credentials, "with_gdch_audience"): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py index 5d1e6d68c11e..fd562aa94f18 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py @@ -87,11 +87,11 @@ class Likelihood(proto.Enum): class Feature(proto.Message): - r"""Users describe the type of Google Cloud Vision API tasks to perform - over images by using *Feature*\ s. Each Feature indicates a type of - image detection task to perform. Features encode the Cloud Vision - API vertical to operate on and the number of top-scoring results to - return. + r"""Users describe the type of Google Cloud Vision API tasks to + perform over images by using *Feature*s. Each Feature indicates + a type of image detection task to perform. Features encode the + Cloud Vision API vertical to operate on and the number of + top-scoring results to return. Attributes: type_ (google.cloud.vision_v1p1beta1.types.Feature.Type): @@ -99,11 +99,12 @@ class Feature(proto.Message): max_results (int): Maximum number of results of this type. model (str): - Model to use for the feature. Supported values: - "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" for the - bleeding edge release updated weekly. + Model to use for the feature. + Supported values: "builtin/stable" (the default + if unset) and "builtin/latest". + ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also support "builtin/weekly" + for the bleeding edge release updated weekly. """ class Type(proto.Enum): @@ -123,8 +124,9 @@ class Type(proto.Enum): TEXT_DETECTION (5): Run OCR. DOCUMENT_TEXT_DETECTION (11): - Run dense text document OCR. Takes precedence when both - DOCUMENT_TEXT_DETECTION and TEXT_DETECTION are present. + Run dense text document OCR. Takes precedence + when both DOCUMENT_TEXT_DETECTION and + TEXT_DETECTION are present. SAFE_SEARCH_DETECTION (6): Run computer vision models to compute image safe-search properties. @@ -168,24 +170,33 @@ class ImageSource(proto.Message): Attributes: gcs_image_uri (str): - NOTE: For new code ``image_uri`` below is preferred. Google - Cloud Storage image URI, which must be in the following - form: ``gs://bucket_name/object_name`` (for details, see - `Google Cloud Storage Request - URIs `__). - NOTE: Cloud Storage object versioning is not supported. + NOTE: For new code ``image_uri`` below is + preferred. Google Cloud Storage image URI, which + must be in the following form: + + ``gs://bucket_name/object_name`` (for details, + see `Google Cloud Storage Request + URIs + `__). + NOTE: Cloud Storage object versioning is not + supported. image_uri (str): Image URI which supports: - 1) Google Cloud Storage image URI, which must be in the - following form: ``gs://bucket_name/object_name`` (for - details, see `Google Cloud Storage Request - URIs `__). - NOTE: Cloud Storage object versioning is not supported. - 2) Publicly accessible image HTTP/HTTPS URL. This is - preferred over the legacy ``gcs_image_uri`` above. When - both ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes precedence. + 1) Google Cloud Storage image URI, which must be + in the following form: + + ``gs://bucket_name/object_name`` (for details, + see `Google Cloud Storage Request + URIs + `__). + NOTE: Cloud Storage object versioning is not + supported. 2) Publicly accessible image + HTTP/HTTPS URL. + This is preferred over the legacy + ``gcs_image_uri`` above. When both + ``gcs_image_uri`` and ``image_uri`` are + specified, ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -203,14 +214,15 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. Note: as - with all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. + Image content, represented as a stream of bytes. + Note: as with all ``bytes`` fields, protobuffers + use a pure binary representation, whereas JSON + representations use base64. source (google.cloud.vision_v1p1beta1.types.ImageSource): - Google Cloud Storage image location. If both ``content`` and - ``source`` are provided for an image, ``content`` takes - precedence and is used to perform the image annotation - request. + Google Cloud Storage image location. If both + ``content`` and ``source`` are provided for an + image, ``content`` takes precedence and is used + to perform the image annotation request. """ content: bytes = proto.Field( @@ -230,36 +242,43 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale, as returned - in ``ImageParams``. The bounding box is computed to "frame" - the face in accordance with human expectations. It is based - on the landmarker results. Note that one or more x and/or y - coordinates may not be generated in the ``BoundingPoly`` - (the polygon will be unbounded) if only a partial face - appears in the image to be annotated. + The bounding polygon around the face. The + coordinates of the bounding box are in the + original image's scale, as returned in + ``ImageParams``. The bounding box is computed to + "frame" the face in accordance with human + expectations. It is based on the landmarker + results. Note that one or more x and/or y + coordinates may not be generated in the + ``BoundingPoly`` (the polygon will be unbounded) + if only a partial face appears in the image to + be annotated. fd_bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the ``boundingPoly``, and encloses only the skin part of the - face. Typically, it is used to eliminate the face from any - image analysis that detects the "amount of skin" visible in - an image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face detection) - prefix. + The ``fd_bounding_poly`` bounding polygon is + tighter than the ``boundingPoly``, and encloses + only the skin part of the face. Typically, it is + used to eliminate the face from any image + analysis that detects the "amount of skin" + visible in an image. It is not based on the + landmarker results, only on the initial face + detection, hence the fd (face + detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p1beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the face. - Range [-180,180]. + clockwise/anti-clockwise rotation of the face + relative to the image vertical about the axis + perpendicular to the face. Range [-180,180]. pan_angle (float): - Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane + Yaw angle, which indicates the + leftward/rightward angle that the face is + pointing relative to the vertical plane perpendicular to the image. Range [-180,180]. tilt_angle (float): - Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's horizontal + Pitch angle, which indicates the + upwards/downwards angle that the face is + pointing relative to the image's horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. @@ -292,10 +311,10 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. Left and right are defined from the - vantage of the viewer of the image without considering mirror - projections typical of photos. So, ``LEFT_EYE``, typically, is the - person's right eye. + r"""Face landmark (feature) type. + Left and right are defined from the vantage of the viewer of the + image without considering mirror projections typical of photos. + So, ``LEFT_EYE``, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -535,43 +554,48 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search - API `__. + Opaque entity ID. Some IDs may be available in + `Google Knowledge Graph Search + API + `__. locale (str): - The language code for the locale in which the entity textual - ``description`` is expressed. + The language code for the locale in which the + entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its ``locale`` - language. + Entity textual description, expressed in its + ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - The accuracy of the entity detection in an image. For - example, for an image in which the "Eiffel Tower" entity is - detected, this field represents the confidence that there is - a tower in the query image. Range [0, 1]. + The accuracy of the entity detection in an + image. For example, for an image in which the + "Eiffel Tower" entity is detected, this field + represents the confidence that there is a tower + in the query image. Range [0, 1]. topicality (float): - The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower - in each image may be the same. Range [0, 1]. + The relevancy of the ICA (Image Content + Annotation) label to the image. For example, the + relevancy of "tower" is likely higher to an + image containing the detected "Eiffel Tower" + than to an image containing a detected distant + towering building, even though the confidence + that there is a tower in each image may be the + same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): - Image region to which this entity belongs. Not produced for - ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not + produced for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p1beta1.types.LocationInfo]): - The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may indicate the location of the scene in the - image, and another location may indicate the location of the - place where the image was taken. Location information is - usually present for landmarks. + The location information for the detected + entity. Multiple ``LocationInfo`` elements can + be present because one location may indicate the + location of the scene in the image, and another + location may indicate the location of the place + where the image was taken. Location information + is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p1beta1.types.Property]): - Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies - the entity. + Some entities may have optional user-supplied + ``Property`` (name/value) fields, such a score + or string that qualifies the entity. """ mid: str = proto.Field( @@ -701,10 +725,11 @@ class ColorInfo(proto.Message): color (google.type.color_pb2.Color): RGB components of the color. score (float): - Image-specific score for this color. Value in range [0, 1]. + Image-specific score for this color. Value in + range [0, 1]. pixel_fraction (float): - The fraction of pixels the color occupies in the image. - Value in range [0, 1]. + The fraction of pixels the color occupies in the + image. Value in range [0, 1]. """ color: color_pb2.Color = proto.Field( @@ -760,11 +785,13 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The bounding polygon for the crop region. The coordinates of - the bounding box are in the original image's scale, as - returned in ``ImageParams``. + The bounding polygon for the crop region. The + coordinates of the bounding box are in the + original image's scale, as returned in + ``ImageParams``. confidence (float): - Confidence of this being a salient region. Range [0, 1]. + Confidence of this being a salient region. + Range [0, 1]. importance_fraction (float): Fraction of importance of this salient region with respect to the original image. @@ -843,9 +870,10 @@ class TextDetectionParams(proto.Message): Attributes: enable_text_detection_confidence_score (bool): - By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + By default, Cloud Vision API only includes + confidence score for DOCUMENT_TEXT_DETECTION + result. Set the flag to true to include + confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -869,16 +897,19 @@ class ImageContext(proto.Message): lat/long rectangle that specifies the location of the image. language_hints (MutableSequence[str]): - List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In - rare cases, when the language of the text in the image is - known, setting a hint will help get better results (although - it will be a significant hindrance if the hint is wrong). - Text detection returns an error if one or more of the - specified languages is not one of the `supported - languages `__. + List of languages to use for TEXT_DETECTION. In + most cases, an empty value yields the best + results since it enables automatic language + detection. For languages based on the Latin + alphabet, setting ``language_hints`` is not + needed. In rare cases, when the language of the + text in the image is known, setting a hint will + help get better results (although it will be a + significant hindrance if the hint is wrong). + Text detection returns an error if one or more + of the specified languages is not one of the + `supported languages + `__. crop_hints_params (google.cloud.vision_v1p1beta1.types.CropHintsParams): Parameters for crop hints annotation request. web_detection_params (google.cloud.vision_v1p1beta1.types.WebDetectionParams): @@ -982,9 +1013,10 @@ class AnnotateImageResponse(proto.Message): If present, web detection has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the operation. Note - that filled-in image annotations are guaranteed to be - correct, even when ``error`` is set. + If set, represents the error message for the + operation. Note that filled-in image annotations + are guaranteed to be correct, even when + ``error`` is set. """ face_annotations: MutableSequence["FaceAnnotation"] = proto.RepeatedField( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py index 6a1893ff64f2..6c898df4278d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py @@ -35,13 +35,16 @@ class TextAnnotation(proto.Message): - r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like this: - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each - structural component, starting from Page, may further have their own - properties. Properties describe detected languages, breaks etc.. - Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty] + r"""TextAnnotation contains a structured representation of OCR + extracted text. The hierarchy of an OCR extracted text structure + is like this: + + TextAnnotation -> Page -> Block -> Paragraph -> Word -> + Symbol Each structural component, starting from Page, may + further have their own properties. Properties describe detected + languages, breaks etc.. Please refer to the + `TextAnnotation.TextProperty + `__ message definition below for more detail. Attributes: @@ -56,8 +59,8 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + The BCP-47 language code, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -95,9 +98,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or - ``LINE_BREAK``. + End-line hyphen that is not present in text; + does not co-occur with ``SPACE``, + ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -167,7 +170,8 @@ class Page(proto.Message): List of blocks of text, images etc on this page. confidence (float): - Confidence of the OCR results on the page. Range [0, 1]. + Confidence of the OCR results on the page. Range + [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -202,17 +206,20 @@ class Block(proto.Message): Additional information detected for the block. bounding_box (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The bounding box for the block. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. - When a rotation of the bounding box is detected the rotation - is represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order will - still be (0, 1, 2, 3). + The bounding box for the block. The vertices are + in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertice order will still be + (0, 1, 2, 3). paragraphs (MutableSequence[google.cloud.vision_v1p1beta1.types.Paragraph]): List of paragraphs in this block (if this blocks is of type text). @@ -220,7 +227,8 @@ class Block(proto.Message): Detected block type (text, image etc) for this block. confidence (float): - Confidence of the OCR results on the block. Range [0, 1]. + Confidence of the OCR results on the block. + Range [0, 1]. """ class BlockType(proto.Enum): @@ -282,22 +290,25 @@ class Paragraph(proto.Message): Additional information detected for the paragraph. bounding_box (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The bounding box for the paragraph. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. - When a rotation of the bounding box is detected the rotation - is represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order will - still be (0, 1, 2, 3). + The bounding box for the paragraph. The vertices + are in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertice order will still be + (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1p1beta1.types.Word]): List of words in this paragraph. confidence (float): - Confidence of the OCR results for the paragraph. Range [0, - 1]. + Confidence of the OCR results for the paragraph. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -328,23 +339,27 @@ class Word(proto.Message): property (google.cloud.vision_v1p1beta1.types.TextAnnotation.TextProperty): Additional information detected for the word. bounding_box (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The bounding box for the word. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order will - still be (0, 1, 2, 3). + The bounding box for the word. The vertices are + in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertice order will still be + (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1p1beta1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural reading order. confidence (float): - Confidence of the OCR results for the word. Range [0, 1]. + Confidence of the OCR results for the word. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -376,22 +391,26 @@ class Symbol(proto.Message): Additional information detected for the symbol. bounding_box (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The bounding box for the symbol. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. - When a rotation of the bounding box is detected the rotation - is represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order will - still be (0, 1, 2, 3). + The bounding box for the symbol. The vertices + are in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertice order will still be + (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. confidence (float): - Confidence of the OCR results for the symbol. Range [0, 1]. + Confidence of the OCR results for the symbol. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py index bdfaf20fc558..1192622d2304 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py @@ -157,8 +157,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as + "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/__init__.py index 38b15b5dabec..807ec4dc6be4 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/__init__.py @@ -28,11 +28,7 @@ # this code path once we drop support for Python 3.7 import importlib_metadata as metadata -from google.cloud.vision_helpers import VisionHelpers -from google.cloud.vision_helpers.decorators import add_single_feature_methods - -from .services.image_annotator import ImageAnnotatorAsyncClient -from .services.image_annotator import ImageAnnotatorClient as IacImageAnnotatorClient +from .services.image_annotator import ImageAnnotatorAsyncClient, ImageAnnotatorClient from .types.geometry import BoundingPoly, NormalizedVertex, Position, Vertex from .types.image_annotator import ( AnnotateFileResponse, @@ -167,13 +163,6 @@ def _get_version(dependency_name): + "https://devguide.python.org/versions/" ) - -@add_single_feature_methods -class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient): - __doc__ = IacImageAnnotatorClient.__doc__ - Feature = Feature - - __all__ = ( "ImageAnnotatorAsyncClient", "AnnotateFileResponse", diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py index fb5632ad071d..ab1d33436766 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py @@ -414,10 +414,11 @@ async def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Run async image detection and annotation for a list of generic - files (e.g. PDF) which may contain multiple pages and multiple - images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. + r"""Run async image detection and annotation for a list of + generic files (e.g. PDF) which may contain multiple + pages and multiple images per page. Progress and results + can be retrieved through the + ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -473,11 +474,13 @@ async def sample_async_batch_annotate_files(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running operation. - - The result type for the operation will be + An object representing a long-running + operation. + The result type for the operation will + be :class:`google.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py index aa9125703821..d2ee85b89581 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py @@ -832,10 +832,11 @@ def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Run async image detection and annotation for a list of generic - files (e.g. PDF) which may contain multiple pages and multiple - images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. + r"""Run async image detection and annotation for a list of + generic files (e.g. PDF) which may contain multiple + pages and multiple images per page. Progress and results + can be retrieved through the + ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -891,11 +892,13 @@ def sample_async_batch_annotate_files(): Returns: google.api_core.operation.Operation: - An object representing a long-running operation. - - The result type for the operation will be + An object representing a long-running + operation. + The result type for the operation will + be :class:`google.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/base.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/base.py index 0e16cba7627b..404a1726b8de 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/base.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/base.py @@ -86,8 +86,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -102,11 +100,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) elif credentials is None and not self._ignore_credentials: credentials, _ = google.auth.default( - **scopes_kwargs, quota_project_id=quota_project_id + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) # Don't apply audience if the credentials file passed from user. if hasattr(credentials, "with_gdch_audience"): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py index 7fe5866362e2..2e8fd4f7a8d8 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py @@ -380,10 +380,11 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run async image detection and annotation for a list of generic - files (e.g. PDF) which may contain multiple pages and multiple - images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. + Run async image detection and annotation for a list of + generic files (e.g. PDF) which may contain multiple + pages and multiple images per page. Progress and results + can be retrieved through the + ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py index 41879c4326a0..295569347d12 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py @@ -389,10 +389,11 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run async image detection and annotation for a list of generic - files (e.g. PDF) which may contain multiple pages and multiple - images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. + Run async image detection and annotation for a list of + generic files (e.g. PDF) which may contain multiple + pages and multiple images per page. Progress and results + can be retrieved through the + ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py index 89143e766721..9b30dbbb8f4e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py @@ -99,23 +99,24 @@ class Likelihood(proto.Enum): class Feature(proto.Message): - r"""The type of Google Cloud Vision API detection to perform, and the - maximum number of results to return for that type. Multiple + r"""The type of Google Cloud Vision API detection to perform, and + the maximum number of results to return for that type. Multiple ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p2beta1.types.Feature.Type): The feature type. max_results (int): - Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. + Maximum number of results of this type. Does not + apply to ``TEXT_DETECTION``, + ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): - Model to use for the feature. Supported values: - "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" for the - bleeding edge release updated weekly. + Model to use for the feature. + Supported values: "builtin/stable" (the default + if unset) and "builtin/latest". + ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also support "builtin/weekly" + for the bleeding edge release updated weekly. """ class Type(proto.Enum): @@ -133,14 +134,15 @@ class Type(proto.Enum): LABEL_DETECTION (4): Run label detection. TEXT_DETECTION (5): - Run text detection / optical character recognition (OCR). - Text detection is optimized for areas of text within a - larger image; if the image is a document, use + Run text detection / optical character + recognition (OCR). Text detection is optimized + for areas of text within a larger image; if the + image is a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): - Run dense text document OCR. Takes precedence when both - ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are - present. + Run dense text document OCR. Takes precedence + when both ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` are present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -187,31 +189,38 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See `Google Cloud Storage Request - URIs `__ + The Google Cloud Storage URI of the form + ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google Cloud + Storage Request + URIs + `__ for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is - not supported. See `Google Cloud Storage Request - URIs `__ - for more info. - - 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from HTTP/HTTPS URLs, Google cannot guarantee that - the request will be completed. Your request may fail if - the specified host denies the request (e.g. due to - request throttling or DOS prevention), or if Google - throttles requests to the site for abuse prevention. You - should not depend on externally-hosted images for - production applications. - - When both ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes precedence. + ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google + Cloud Storage Request + URIs + `__ + for more info. + + 2. A publicly-accessible image HTTP/HTTPS URL. + When fetching images from HTTP/HTTPS + URLs, Google cannot guarantee that the + request will be completed. Your request + may fail if the specified host denies the + request (e.g. due to request throttling or + DOS prevention), or if Google throttles + requests to the site for abuse prevention. + You should not depend on + externally-hosted images for production + applications. + + When both ``gcs_image_uri`` and ``image_uri`` + are specified, ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -229,14 +238,16 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. Note: As - with all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. + Image content, represented as a stream of bytes. + Note: As with all ``bytes`` fields, protobuffers + use a pure binary representation, whereas JSON + representations use base64. source (google.cloud.vision_v1p2beta1.types.ImageSource): - Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided - for an image, ``content`` takes precedence and is used to - perform the image annotation request. + Google Cloud Storage image location, or + publicly-accessible image URL. If both + ``content`` and ``source`` are provided for an + image, ``content`` takes precedence and is used + to perform the image annotation request. """ content: bytes = proto.Field( @@ -256,36 +267,43 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale, as returned - in ``ImageParams``. The bounding box is computed to "frame" - the face in accordance with human expectations. It is based - on the landmarker results. Note that one or more x and/or y - coordinates may not be generated in the ``BoundingPoly`` - (the polygon will be unbounded) if only a partial face - appears in the image to be annotated. + The bounding polygon around the face. The + coordinates of the bounding box are in the + original image's scale, as returned in + ``ImageParams``. The bounding box is computed to + "frame" the face in accordance with human + expectations. It is based on the landmarker + results. Note that one or more x and/or y + coordinates may not be generated in the + ``BoundingPoly`` (the polygon will be unbounded) + if only a partial face appears in the image to + be annotated. fd_bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the ``boundingPoly``, and encloses only the skin part of the - face. Typically, it is used to eliminate the face from any - image analysis that detects the "amount of skin" visible in - an image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face detection) - prefix. + The ``fd_bounding_poly`` bounding polygon is + tighter than the ``boundingPoly``, and encloses + only the skin part of the face. Typically, it is + used to eliminate the face from any image + analysis that detects the "amount of skin" + visible in an image. It is not based on the + landmarker results, only on the initial face + detection, hence the fd (face + detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p2beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the face. - Range [-180,180]. + clockwise/anti-clockwise rotation of the face + relative to the image vertical about the axis + perpendicular to the face. Range [-180,180]. pan_angle (float): - Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane + Yaw angle, which indicates the + leftward/rightward angle that the face is + pointing relative to the vertical plane perpendicular to the image. Range [-180,180]. tilt_angle (float): - Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's horizontal + Pitch angle, which indicates the + upwards/downwards angle that the face is + pointing relative to the image's horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. @@ -318,10 +336,10 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. Left and right are defined from the - vantage of the viewer of the image without considering mirror - projections typical of photos. So, ``LEFT_EYE``, typically, is the - person's right eye. + r"""Face landmark (feature) type. + Left and right are defined from the vantage of the viewer of the + image without considering mirror projections typical of photos. + So, ``LEFT_EYE``, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -561,44 +579,49 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search - API `__. + Opaque entity ID. Some IDs may be available in + `Google Knowledge Graph Search + API + `__. locale (str): - The language code for the locale in which the entity textual - ``description`` is expressed. + The language code for the locale in which the + entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its ``locale`` - language. + Entity textual description, expressed in its + ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field - represents the confidence that there is a tower in the query - image. Range [0, 1]. + **Deprecated. Use ``score`` instead.** + The accuracy of the entity detection in an + image. For example, for an image in which the + "Eiffel Tower" entity is detected, this field + represents the confidence that there is a tower + in the query image. Range [0, 1]. topicality (float): - The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower - in each image may be the same. Range [0, 1]. + The relevancy of the ICA (Image Content + Annotation) label to the image. For example, the + relevancy of "tower" is likely higher to an + image containing the detected "Eiffel Tower" + than to an image containing a detected distant + towering building, even though the confidence + that there is a tower in each image may be the + same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): - Image region to which this entity belongs. Not produced for - ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not + produced for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p2beta1.types.LocationInfo]): - The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may indicate the location of the scene in the - image, and another location may indicate the location of the - place where the image was taken. Location information is - usually present for landmarks. + The location information for the detected + entity. Multiple ``LocationInfo`` elements can + be present because one location may indicate the + location of the scene in the image, and another + location may indicate the location of the place + where the image was taken. Location information + is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p2beta1.types.Property]): - Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies - the entity. + Some entities may have optional user-supplied + ``Property`` (name/value) fields, such a score + or string that qualifies the entity. """ mid: str = proto.Field( @@ -728,10 +751,11 @@ class ColorInfo(proto.Message): color (google.type.color_pb2.Color): RGB components of the color. score (float): - Image-specific score for this color. Value in range [0, 1]. + Image-specific score for this color. Value in + range [0, 1]. pixel_fraction (float): - The fraction of pixels the color occupies in the image. - Value in range [0, 1]. + The fraction of pixels the color occupies in the + image. Value in range [0, 1]. """ color: color_pb2.Color = proto.Field( @@ -787,11 +811,13 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The bounding polygon for the crop region. The coordinates of - the bounding box are in the original image's scale, as - returned in ``ImageParams``. + The bounding polygon for the crop region. The + coordinates of the bounding box are in the + original image's scale, as returned in + ``ImageParams``. confidence (float): - Confidence of this being a salient region. Range [0, 1]. + Confidence of this being a salient region. + Range [0, 1]. importance_fraction (float): Fraction of importance of this salient region with respect to the original image. @@ -870,9 +896,10 @@ class TextDetectionParams(proto.Message): Attributes: enable_text_detection_confidence_score (bool): - By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + By default, Cloud Vision API only includes + confidence score for DOCUMENT_TEXT_DETECTION + result. Set the flag to true to include + confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -895,16 +922,19 @@ class ImageContext(proto.Message): lat_long_rect (google.cloud.vision_v1p2beta1.types.LatLongRect): Not used. language_hints (MutableSequence[str]): - List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In - rare cases, when the language of the text in the image is - known, setting a hint will help get better results (although - it will be a significant hindrance if the hint is wrong). - Text detection returns an error if one or more of the - specified languages is not one of the `supported - languages `__. + List of languages to use for TEXT_DETECTION. In + most cases, an empty value yields the best + results since it enables automatic language + detection. For languages based on the Latin + alphabet, setting ``language_hints`` is not + needed. In rare cases, when the language of the + text in the image is known, setting a hint will + help get better results (although it will be a + significant hindrance if the hint is wrong). + Text detection returns an error if one or more + of the specified languages is not one of the + `supported languages + `__. crop_hints_params (google.cloud.vision_v1p2beta1.types.CropHintsParams): Parameters for crop hints annotation request. web_detection_params (google.cloud.vision_v1p2beta1.types.WebDetectionParams): @@ -1032,9 +1062,10 @@ class AnnotateImageResponse(proto.Message): If present, web detection has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the operation. Note - that filled-in image annotations are guaranteed to be - correct, even when ``error`` is set. + If set, represents the error message for the + operation. Note that filled-in image annotations + are guaranteed to be correct, even when + ``error`` is set. context (google.cloud.vision_v1p2beta1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1281,17 +1312,20 @@ class OutputConfig(proto.Message): The Google Cloud Storage location to write the output(s) to. batch_size (int): - The max number of response protos to put into each output - JSON file on GCS. The valid range is [1, 100]. If not - specified, the default value is 20. - - For example, for one pdf file with 100 pages, 100 response - protos will be generated. If ``batch_size`` = 20, then 5 - json files each containing 20 response protos will be - written under the prefix ``gcs_destination``.\ ``uri``. - - Currently, batch_size only applies to GcsDestination, with - potential future support for other output configurations. + The max number of response protos to put into + each output JSON file on GCS. The valid range is + [1, 100]. If not specified, the default value is + 20. + + For example, for one pdf file with 100 pages, + 100 response protos will be generated. If + ``batch_size`` = 20, then 5 json files each + containing 20 response protos will be written + under the prefix ``gcs_destination``.``uri``. + + Currently, batch_size only applies to + GcsDestination, with potential future support + for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1328,23 +1362,26 @@ class GcsDestination(proto.Message): Attributes: uri (str): - Google Cloud Storage URI where the results will be stored. - Results will be in JSON format and preceded by its - corresponding input URI. This field can either represent a - single file, or a prefix for multiple outputs. Prefixes must - end in a ``/``. + Google Cloud Storage URI where the results will + be stored. Results will be in JSON format and + preceded by its corresponding input URI. This + field can either represent a single file, or a + prefix for multiple outputs. Prefixes must end + in a ``/``. Examples: - - File: gs://bucket-name/filename.json - - Prefix: gs://bucket-name/prefix/here/ - - File: gs://bucket-name/prefix/here + * File: gs://bucket-name/filename.json + * Prefix: gs://bucket-name/prefix/here/ + + * File: gs://bucket-name/prefix/here If multiple outputs, each response is still - AnnotateFileResponse, each of which contains some subset of - the full list of AnnotateImageResponse. Multiple outputs can - happen if, for example, the output JSON is too large and - overflows into multiple sharded files. + AnnotateFileResponse, each of which contains + some subset of the full list of + AnnotateImageResponse. Multiple outputs can + happen if, for example, the output JSON is too + large and overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py index 1fed739872b4..7cec33c2adaa 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py @@ -35,13 +35,16 @@ class TextAnnotation(proto.Message): - r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like this: - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each - structural component, starting from Page, may further have their own - properties. Properties describe detected languages, breaks etc.. - Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty] + r"""TextAnnotation contains a structured representation of OCR + extracted text. The hierarchy of an OCR extracted text structure + is like this: + + TextAnnotation -> Page -> Block -> Paragraph -> Word -> + Symbol Each structural component, starting from Page, may + further have their own properties. Properties describe detected + languages, breaks etc.. Please refer to the + `TextAnnotation.TextProperty + `__ message definition below for more detail. Attributes: @@ -56,8 +59,8 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + The BCP-47 language code, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -95,9 +98,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or - ``LINE_BREAK``. + End-line hyphen that is not present in text; + does not co-occur with ``SPACE``, + ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -169,7 +172,8 @@ class Page(proto.Message): List of blocks of text, images etc on this page. confidence (float): - Confidence of the OCR results on the page. Range [0, 1]. + Confidence of the OCR results on the page. Range + [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -210,24 +214,24 @@ class Block(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: + - when the text is horizontal it might look like: - :: + :: - 0----1 - | | - 3----2 + 0----1 + | | + 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: + - when it's rotated 180 degrees around the top-left corner + it becomes: - :: + :: - 2----3 - | | - 1----0 + 2----3 + | | + 1----0 - and the vertice order will still be (0, 1, 2, 3). + and the vertice order will still be (0, 1, 2, 3). paragraphs (MutableSequence[google.cloud.vision_v1p2beta1.types.Paragraph]): List of paragraphs in this block (if this blocks is of type text). @@ -235,7 +239,8 @@ class Block(proto.Message): Detected block type (text, image etc) for this block. confidence (float): - Confidence of the OCR results on the block. Range [0, 1]. + Confidence of the OCR results on the block. + Range [0, 1]. """ class BlockType(proto.Enum): @@ -297,22 +302,25 @@ class Paragraph(proto.Message): Additional information detected for the paragraph. bounding_box (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The bounding box for the paragraph. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. - When a rotation of the bounding box is detected the rotation - is represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order will - still be (0, 1, 2, 3). + The bounding box for the paragraph. The vertices + are in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertice order will still be + (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1p2beta1.types.Word]): List of words in this paragraph. confidence (float): - Confidence of the OCR results for the paragraph. Range [0, - 1]. + Confidence of the OCR results for the paragraph. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -343,23 +351,27 @@ class Word(proto.Message): property (google.cloud.vision_v1p2beta1.types.TextAnnotation.TextProperty): Additional information detected for the word. bounding_box (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The bounding box for the word. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order will - still be (0, 1, 2, 3). + The bounding box for the word. The vertices are + in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertice order will still be + (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1p2beta1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural reading order. confidence (float): - Confidence of the OCR results for the word. Range [0, 1]. + Confidence of the OCR results for the word. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -391,22 +403,26 @@ class Symbol(proto.Message): Additional information detected for the symbol. bounding_box (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The bounding box for the symbol. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. - When a rotation of the bounding box is detected the rotation - is represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order will - still be (0, 1, 2, 3). + The bounding box for the symbol. The vertices + are in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertice order will still be + (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. confidence (float): - Confidence of the OCR results for the symbol. Range [0, 1]. + Confidence of the OCR results for the symbol. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py index 648d4e415953..623e17fe8c2b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py @@ -157,8 +157,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as + "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/__init__.py index a2e768f2a3da..43d6ef217f8b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/__init__.py @@ -28,11 +28,7 @@ # this code path once we drop support for Python 3.7 import importlib_metadata as metadata -from google.cloud.vision_helpers import VisionHelpers -from google.cloud.vision_helpers.decorators import add_single_feature_methods - -from .services.image_annotator import ImageAnnotatorAsyncClient -from .services.image_annotator import ImageAnnotatorClient as IacImageAnnotatorClient +from .services.image_annotator import ImageAnnotatorAsyncClient, ImageAnnotatorClient from .services.product_search import ProductSearchAsyncClient, ProductSearchClient from .types.geometry import BoundingPoly, NormalizedVertex, Position, Vertex from .types.image_annotator import ( @@ -201,13 +197,6 @@ def _get_version(dependency_name): + "https://devguide.python.org/versions/" ) - -@add_single_feature_methods -class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient): - __doc__ = IacImageAnnotatorClient.__doc__ - Feature = Feature - - __all__ = ( "ImageAnnotatorAsyncClient", "ProductSearchAsyncClient", diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py index 2d7135564480..e79170f58f1e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py @@ -417,11 +417,12 @@ async def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` + r"""Run asynchronous image detection and annotation for a + list of generic files, such as PDF files, which may + contain multiple pages and multiple images per page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -476,11 +477,13 @@ async def sample_async_batch_annotate_files(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running operation. - - The result type for the operation will be + An object representing a long-running + operation. + The result type for the operation will + be :class:`google.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py index d459e909b674..278cd080d435 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py @@ -877,11 +877,12 @@ def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` + r"""Run asynchronous image detection and annotation for a + list of generic files, such as PDF files, which may + contain multiple pages and multiple images per page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -936,11 +937,13 @@ def sample_async_batch_annotate_files(): Returns: google.api_core.operation.Operation: - An object representing a long-running operation. - - The result type for the operation will be + An object representing a long-running + operation. + The result type for the operation will + be :class:`google.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/base.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/base.py index 1f027daad808..178bf370dae7 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/base.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/base.py @@ -86,8 +86,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -102,11 +100,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) elif credentials is None and not self._ignore_credentials: credentials, _ = google.auth.default( - **scopes_kwargs, quota_project_id=quota_project_id + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) # Don't apply audience if the credentials file passed from user. if hasattr(credentials, "with_gdch_audience"): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py index 19d16fc5d3a5..e178a7b0dc99 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py @@ -380,11 +380,12 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` + Run asynchronous image detection and annotation for a + list of generic files, such as PDF files, which may + contain multiple pages and multiple images per page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py index 73745c486211..47db7b5889dd 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py @@ -389,11 +389,12 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` + Run asynchronous image detection and annotation for a + list of generic files, such as PDF files, which may + contain multiple pages and multiple images per page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py index 5902002a7d3d..ea2c5328e154 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py @@ -71,21 +71,21 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, - named ``projects/*/locations/*/productSets/*``, which acts as a - way to put different products into groups to limit identification. + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p3beta1.Product] resources, named + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p3beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] - resources, named + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` """ @@ -335,8 +335,8 @@ async def create_product_set( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, + or is longer than 4096 characters. .. code-block:: python @@ -366,12 +366,13 @@ async def sample_create_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.CreateProductSetRequest, dict]]): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the + ``CreateProductSet`` method. parent (:class:`str`): - Required. The project in which the ProductSet should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + ProductSet should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -382,11 +383,14 @@ async def sample_create_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_set_id (:class:`str`): - A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for this + ProductSet. If set, the server will + attempt to use this value as the + resource id. If it is already in use, an + error is returned with code + ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the + character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -476,8 +480,8 @@ async def list_product_sets( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100, or less than 1. .. code-block:: python @@ -508,12 +512,13 @@ async def sample_list_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListProductSetsRequest, dict]]): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the + ``ListProductSets`` method. parent (:class:`str`): - Required. The project from which ProductSets should be - listed. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which + ProductSets should be listed. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -528,10 +533,11 @@ async def sample_list_product_sets(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductSetsAsyncPager: - Response message for the ListProductSets method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProductSets`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -609,7 +615,7 @@ async def get_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. .. code-block:: python @@ -639,11 +645,13 @@ async def sample_get_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.GetProductSetRequest, dict]]): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the + ``GetProductSet`` method. name (:class:`str`): - Required. Resource name of the ProductSet to get. - + Required. Resource name of the + ProductSet to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -727,15 +735,15 @@ async def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. Only display_name can be - updated currently. + r"""Makes changes to a ProductSet resource. + Only display_name can be updated currently. Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer + than 4096 characters. .. code-block:: python @@ -764,7 +772,8 @@ async def sample_update_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.UpdateProductSetRequest, dict]]): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the + ``UpdateProductSet`` method. product_set (:class:`google.cloud.vision_v1p3beta1.types.ProductSet`): Required. The ProductSet resource which replaces the one on the server. @@ -773,10 +782,12 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask + `__ that + specifies which fields to update. If + update_mask isn't specified, all mutable + fields are to be updated. Valid mask + path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -870,7 +881,7 @@ async def delete_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. .. code-block:: python @@ -897,11 +908,13 @@ async def sample_delete_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.DeleteProductSetRequest, dict]]): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the + ``DeleteProductSet`` method. name (:class:`str`): - Required. Resource name of the ProductSet to delete. - + Required. Resource name of the + ProductSet to delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -978,12 +991,12 @@ async def create_product( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - - Returns INVALID_ARGUMENT if product_category is missing or - invalid. + * Returns INVALID_ARGUMENT if display_name is missing or + longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than + 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. .. code-block:: python @@ -1013,12 +1026,13 @@ async def sample_create_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.CreateProductRequest, dict]]): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the + ``CreateProduct`` method. parent (:class:`str`): - Required. The project in which the Product should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + Product should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1029,11 +1043,13 @@ async def sample_create_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_id (:class:`str`): - A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for this + Product. If set, the server will attempt + to use this value as the resource id. If + it is already in use, an error is + returned with code ALREADY_EXISTS. Must + be at most 128 characters long. It + cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1118,8 +1134,8 @@ async def list_products( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. .. code-block:: python @@ -1150,12 +1166,14 @@ async def sample_list_products(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListProductsRequest, dict]]): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the ``ListProducts`` + method. parent (:class:`str`): - Required. The project OR ProductSet from which Products - should be listed. + Required. The project OR ProductSet from + which Products should be listed. + Format: - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1170,10 +1188,11 @@ async def sample_list_products(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsAsyncPager: - Response message for the ListProducts method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProducts`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -1249,7 +1268,7 @@ async def get_product( Possible errors: - - Returns NOT_FOUND if the Product does not exist. + * Returns NOT_FOUND if the Product does not exist. .. code-block:: python @@ -1279,11 +1298,13 @@ async def sample_get_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.GetProductRequest, dict]]): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the ``GetProduct`` + method. name (:class:`str`): - Required. Resource name of the Product to get. - + Required. Resource name of the Product + to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field @@ -1362,22 +1383,25 @@ async def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. Only display_name, - description and labels can be updated right now. + r"""Makes changes to a Product resource. + Only display_name, description and labels can be updated + right now. - If labels are updated, the change will not be reflected in - queries until the next index time. + If labels are updated, the change will not be reflected + in queries until the next index time. Possible errors: - - Returns NOT_FOUND if the Product does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - - Returns INVALID_ARGUMENT if product_category is present in - update_mask. + * Returns NOT_FOUND if the Product does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is + present in update_mask. .. code-block:: python @@ -1406,7 +1430,8 @@ async def sample_update_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.UpdateProductRequest, dict]]): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the + ``UpdateProduct`` method. product (:class:`google.cloud.vision_v1p3beta1.types.Product`): Required. The Product resource which replaces the one on the server. @@ -1416,11 +1441,13 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, - and ``description``. + The `FieldMask + `__ that + specifies which fields to update. If + update_mask isn't specified, all mutable + fields are to be updated. Valid mask + paths include ``product_labels``, + ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1503,13 +1530,14 @@ async def delete_product( ) -> None: r"""Permanently deletes a product and its reference images. - Metadata of the product and all its images will be deleted right - away, but search queries against ProductSets containing the - product may still work until all related caches are refreshed. + Metadata of the product and all its images will be + deleted right away, but search queries against + ProductSets containing the product may still work until + all related caches are refreshed. Possible errors: - - Returns NOT_FOUND if the product does not exist. + * Returns NOT_FOUND if the product does not exist. .. code-block:: python @@ -1536,11 +1564,13 @@ async def sample_delete_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.DeleteProductRequest, dict]]): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the + ``DeleteProduct`` method. name (:class:`str`): - Required. Resource name of product to delete. - + Required. Resource name of product to + delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field @@ -1615,26 +1645,29 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If + ``bounding_poly`` is not specified, the system will try + to detect regions of interest in the image that are + compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the + image resolution is too large to process (above 50MP). Possible errors: - - Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if the product does not exist. - - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - - Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing + or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not + exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent + product's product_category is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains + more than 10 polygons. .. code-block:: python @@ -1668,11 +1701,11 @@ async def sample_create_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.CreateReferenceImageRequest, dict]]): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the + ``CreateReferenceImage`` method. parent (:class:`str`): - Required. Resource name of the product in which to - create the reference image. - + Required. Resource name of the product + in which to create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -1688,11 +1721,14 @@ async def sample_create_reference_image(): on the ``request`` instance; if ``request`` is provided, this should not be set. reference_image_id (:class:`str`): - A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for the + ReferenceImage to be added. If set, the + server will attempt to use this value as + the resource id. If it is already in + use, an error is returned with code + ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the + character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1707,8 +1743,9 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A ReferenceImage represents a product image and its associated metadata, - such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1777,16 +1814,17 @@ async def delete_reference_image( ) -> None: r"""Permanently deletes a reference image. - The image metadata will be deleted right away, but search - queries against ProductSets containing the image may still work - until all related caches are refreshed. + The image metadata will be deleted right away, but + search queries against ProductSets containing the image + may still work until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. Possible errors: - - Returns NOT_FOUND if the reference image does not exist. + * Returns NOT_FOUND if the reference image does not + exist. .. code-block:: python @@ -1813,11 +1851,11 @@ async def sample_delete_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.DeleteReferenceImageRequest, dict]]): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the + ``DeleteReferenceImage`` method. name (:class:`str`): - Required. The resource name of the reference image to - delete. - + Required. The resource name of the + reference image to delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -1894,9 +1932,9 @@ async def list_reference_images( Possible errors: - - Returns NOT_FOUND if the parent product does not exist. - - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not + exist. * Returns INVALID_ARGUMENT if the page_size is + greater than 100, or less than 1. .. code-block:: python @@ -1927,11 +1965,11 @@ async def sample_list_reference_images(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListReferenceImagesRequest, dict]]): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the + ``ListReferenceImages`` method. parent (:class:`str`): - Required. Resource name of the product containing the - reference images. - + Required. Resource name of the product + containing the reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -1948,10 +1986,11 @@ async def sample_list_reference_images(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListReferenceImagesAsyncPager: - Response message for the ListReferenceImages method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListReferenceImages`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -2029,7 +2068,8 @@ async def get_reference_image( Possible errors: - - Returns NOT_FOUND if the specified image does not exist. + * Returns NOT_FOUND if the specified image does not + exist. .. code-block:: python @@ -2059,11 +2099,11 @@ async def sample_get_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.GetReferenceImageRequest, dict]]): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the + ``GetReferenceImage`` method. name (:class:`str`): - Required. The resource name of the ReferenceImage to - get. - + Required. The resource name of the + ReferenceImage to get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -2081,8 +2121,9 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A ReferenceImage represents a product image and its associated metadata, - such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2146,15 +2187,15 @@ async def add_product_to_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: - r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + r"""Adds a Product to the specified ProductSet. If the + Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - - Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + * Returns NOT_FOUND if the Product or the ProductSet + doesn't exist. .. code-block:: python @@ -2182,23 +2223,23 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the + ``AddProductToProductSet`` method. name (:class:`str`): - Required. The resource name for the ProductSet to - modify. - + Required. The resource name for the + ProductSet to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): - Required. The resource name for the Product to be added - to this ProductSet. - + Required. The resource name for the + Product to be added to this ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field @@ -2278,8 +2319,8 @@ async def remove_product_from_product_set( Possible errors: - - Returns NOT_FOUND If the Product is not found under the - ProductSet. + * Returns NOT_FOUND If the Product is not found under + the ProductSet. .. code-block:: python @@ -2307,23 +2348,23 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the + ``RemoveProductFromProductSet`` method. name (:class:`str`): - Required. The resource name for the ProductSet to - modify. - + Required. The resource name for the + ProductSet to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): - Required. The resource name for the Product to be - removed from this ProductSet. + Required. The resource name for the + Product to be removed from this + ProductSet. Format is: - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field @@ -2398,14 +2439,14 @@ async def list_products_in_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: - r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + r"""Lists the Products in a ProductSet, in an unspecified + order. If the ProductSet does not exist, the products + field of the response will be empty. Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. .. code-block:: python @@ -2436,13 +2477,13 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the + ``ListProductsInProductSet`` method. name (:class:`str`): - Required. The ProductSet resource for which to retrieve - Products. - + Required. The ProductSet resource for + which to retrieve Products. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -2458,11 +2499,11 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the ListProductsInProductSet - method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProductsInProductSet`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -2541,18 +2582,22 @@ async def import_product_sets( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` - contains ``ImportProductSetsResponse``. (results) - - The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + r"""Asynchronous API that imports a list of reference images + to specified product sets based on a list of image + information. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains + ``ImportProductSetsResponse``. (results) + + The input source of this method is a csv file on Google + Cloud Storage. For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri + `__. .. code-block:: python @@ -2586,12 +2631,13 @@ async def sample_import_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ImportProductSetsRequest, dict]]): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the + ``ImportProductSets`` method. parent (:class:`str`): - Required. The project in which the ProductSets should be - imported. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + ProductSets should be imported. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2613,17 +2659,21 @@ async def sample_import_product_sets(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running operation. - - The result type for the operation will be - :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse` - Response message for the ImportProductSets method. - - This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] - method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field. + An object representing a long-running + operation. + The result type for the operation will + be + :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` + Response message for the + ``ImportProductSets` method. + + This message is returned by the + `google.longrunning.Operations.GetOperation + `__ + method in the returned + `google.longrunning.Operation.response + `__ + field. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py index 49204ee8fdac..3ce442d0f680 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py @@ -115,21 +115,21 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, - named ``projects/*/locations/*/productSets/*``, which acts as a - way to put different products into groups to limit identification. + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p3beta1.Product] resources, named + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p3beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] - resources, named + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` """ @@ -816,8 +816,8 @@ def create_product_set( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, + or is longer than 4096 characters. .. code-block:: python @@ -847,12 +847,13 @@ def sample_create_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.CreateProductSetRequest, dict]): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the + ``CreateProductSet`` method. parent (str): - Required. The project in which the ProductSet should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + ProductSet should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -863,11 +864,14 @@ def sample_create_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_set_id (str): - A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for this + ProductSet. If set, the server will + attempt to use this value as the + resource id. If it is already in use, an + error is returned with code + ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the + character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -954,8 +958,8 @@ def list_product_sets( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100, or less than 1. .. code-block:: python @@ -986,12 +990,13 @@ def sample_list_product_sets(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListProductSetsRequest, dict]): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the + ``ListProductSets`` method. parent (str): - Required. The project from which ProductSets should be - listed. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which + ProductSets should be listed. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1006,10 +1011,11 @@ def sample_list_product_sets(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductSetsPager: - Response message for the ListProductSets method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProductSets`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -1084,7 +1090,7 @@ def get_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. .. code-block:: python @@ -1114,11 +1120,13 @@ def sample_get_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.GetProductSetRequest, dict]): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the + ``GetProductSet`` method. name (str): - Required. Resource name of the ProductSet to get. - + Required. Resource name of the + ProductSet to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -1199,15 +1207,15 @@ def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. Only display_name can be - updated currently. + r"""Makes changes to a ProductSet resource. + Only display_name can be updated currently. Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer + than 4096 characters. .. code-block:: python @@ -1236,7 +1244,8 @@ def sample_update_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.UpdateProductSetRequest, dict]): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the + ``UpdateProductSet`` method. product_set (google.cloud.vision_v1p3beta1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. @@ -1245,10 +1254,12 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask + `__ that + specifies which fields to update. If + update_mask isn't specified, all mutable + fields are to be updated. Valid mask + path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1339,7 +1350,7 @@ def delete_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. .. code-block:: python @@ -1366,11 +1377,13 @@ def sample_delete_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.DeleteProductSetRequest, dict]): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the + ``DeleteProductSet`` method. name (str): - Required. Resource name of the ProductSet to delete. - + Required. Resource name of the + ProductSet to delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -1444,12 +1457,12 @@ def create_product( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - - Returns INVALID_ARGUMENT if product_category is missing or - invalid. + * Returns INVALID_ARGUMENT if display_name is missing or + longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than + 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. .. code-block:: python @@ -1479,12 +1492,13 @@ def sample_create_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.CreateProductRequest, dict]): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the + ``CreateProduct`` method. parent (str): - Required. The project in which the Product should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + Product should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1495,11 +1509,13 @@ def sample_create_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_id (str): - A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for this + Product. If set, the server will attempt + to use this value as the resource id. If + it is already in use, an error is + returned with code ALREADY_EXISTS. Must + be at most 128 characters long. It + cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1581,8 +1597,8 @@ def list_products( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. .. code-block:: python @@ -1613,12 +1629,14 @@ def sample_list_products(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListProductsRequest, dict]): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the ``ListProducts`` + method. parent (str): - Required. The project OR ProductSet from which Products - should be listed. + Required. The project OR ProductSet from + which Products should be listed. + Format: - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1633,10 +1651,11 @@ def sample_list_products(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsPager: - Response message for the ListProducts method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProducts`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -1709,7 +1728,7 @@ def get_product( Possible errors: - - Returns NOT_FOUND if the Product does not exist. + * Returns NOT_FOUND if the Product does not exist. .. code-block:: python @@ -1739,11 +1758,13 @@ def sample_get_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.GetProductRequest, dict]): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the ``GetProduct`` + method. name (str): - Required. Resource name of the Product to get. - + Required. Resource name of the Product + to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field @@ -1819,22 +1840,25 @@ def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. Only display_name, - description and labels can be updated right now. + r"""Makes changes to a Product resource. + Only display_name, description and labels can be updated + right now. - If labels are updated, the change will not be reflected in - queries until the next index time. + If labels are updated, the change will not be reflected + in queries until the next index time. Possible errors: - - Returns NOT_FOUND if the Product does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - - Returns INVALID_ARGUMENT if product_category is present in - update_mask. + * Returns NOT_FOUND if the Product does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is + present in update_mask. .. code-block:: python @@ -1863,7 +1887,8 @@ def sample_update_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.UpdateProductRequest, dict]): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the + ``UpdateProduct`` method. product (google.cloud.vision_v1p3beta1.types.Product): Required. The Product resource which replaces the one on the server. @@ -1873,11 +1898,13 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, - and ``description``. + The `FieldMask + `__ that + specifies which fields to update. If + update_mask isn't specified, all mutable + fields are to be updated. Valid mask + paths include ``product_labels``, + ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1957,13 +1984,14 @@ def delete_product( ) -> None: r"""Permanently deletes a product and its reference images. - Metadata of the product and all its images will be deleted right - away, but search queries against ProductSets containing the - product may still work until all related caches are refreshed. + Metadata of the product and all its images will be + deleted right away, but search queries against + ProductSets containing the product may still work until + all related caches are refreshed. Possible errors: - - Returns NOT_FOUND if the product does not exist. + * Returns NOT_FOUND if the product does not exist. .. code-block:: python @@ -1990,11 +2018,13 @@ def sample_delete_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.DeleteProductRequest, dict]): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the + ``DeleteProduct`` method. name (str): - Required. Resource name of product to delete. - + Required. Resource name of product to + delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field @@ -2066,26 +2096,29 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If + ``bounding_poly`` is not specified, the system will try + to detect regions of interest in the image that are + compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the + image resolution is too large to process (above 50MP). Possible errors: - - Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if the product does not exist. - - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - - Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing + or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not + exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent + product's product_category is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains + more than 10 polygons. .. code-block:: python @@ -2119,11 +2152,11 @@ def sample_create_reference_image(): Args: request (Union[google.cloud.vision_v1p3beta1.types.CreateReferenceImageRequest, dict]): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the + ``CreateReferenceImage`` method. parent (str): - Required. Resource name of the product in which to - create the reference image. - + Required. Resource name of the product + in which to create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -2139,11 +2172,14 @@ def sample_create_reference_image(): on the ``request`` instance; if ``request`` is provided, this should not be set. reference_image_id (str): - A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for the + ReferenceImage to be added. If set, the + server will attempt to use this value as + the resource id. If it is already in + use, an error is returned with code + ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the + character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2158,8 +2194,9 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A ReferenceImage represents a product image and its associated metadata, - such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2225,16 +2262,17 @@ def delete_reference_image( ) -> None: r"""Permanently deletes a reference image. - The image metadata will be deleted right away, but search - queries against ProductSets containing the image may still work - until all related caches are refreshed. + The image metadata will be deleted right away, but + search queries against ProductSets containing the image + may still work until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. Possible errors: - - Returns NOT_FOUND if the reference image does not exist. + * Returns NOT_FOUND if the reference image does not + exist. .. code-block:: python @@ -2261,11 +2299,11 @@ def sample_delete_reference_image(): Args: request (Union[google.cloud.vision_v1p3beta1.types.DeleteReferenceImageRequest, dict]): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the + ``DeleteReferenceImage`` method. name (str): - Required. The resource name of the reference image to - delete. - + Required. The resource name of the + reference image to delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -2339,9 +2377,9 @@ def list_reference_images( Possible errors: - - Returns NOT_FOUND if the parent product does not exist. - - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not + exist. * Returns INVALID_ARGUMENT if the page_size is + greater than 100, or less than 1. .. code-block:: python @@ -2372,11 +2410,11 @@ def sample_list_reference_images(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListReferenceImagesRequest, dict]): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the + ``ListReferenceImages`` method. parent (str): - Required. Resource name of the product containing the - reference images. - + Required. Resource name of the product + containing the reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -2393,10 +2431,11 @@ def sample_list_reference_images(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListReferenceImagesPager: - Response message for the ListReferenceImages method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListReferenceImages`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -2471,7 +2510,8 @@ def get_reference_image( Possible errors: - - Returns NOT_FOUND if the specified image does not exist. + * Returns NOT_FOUND if the specified image does not + exist. .. code-block:: python @@ -2501,11 +2541,11 @@ def sample_get_reference_image(): Args: request (Union[google.cloud.vision_v1p3beta1.types.GetReferenceImageRequest, dict]): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the + ``GetReferenceImage`` method. name (str): - Required. The resource name of the ReferenceImage to - get. - + Required. The resource name of the + ReferenceImage to get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -2523,8 +2563,9 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A ReferenceImage represents a product image and its associated metadata, - such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2585,15 +2626,15 @@ def add_product_to_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: - r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + r"""Adds a Product to the specified ProductSet. If the + Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - - Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + * Returns NOT_FOUND if the Product or the ProductSet + doesn't exist. .. code-block:: python @@ -2621,23 +2662,23 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the + ``AddProductToProductSet`` method. name (str): - Required. The resource name for the ProductSet to - modify. - + Required. The resource name for the + ProductSet to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): - Required. The resource name for the Product to be added - to this ProductSet. - + Required. The resource name for the + Product to be added to this ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field @@ -2716,8 +2757,8 @@ def remove_product_from_product_set( Possible errors: - - Returns NOT_FOUND If the Product is not found under the - ProductSet. + * Returns NOT_FOUND If the Product is not found under + the ProductSet. .. code-block:: python @@ -2745,23 +2786,23 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the + ``RemoveProductFromProductSet`` method. name (str): - Required. The resource name for the ProductSet to - modify. - + Required. The resource name for the + ProductSet to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): - Required. The resource name for the Product to be - removed from this ProductSet. + Required. The resource name for the + Product to be removed from this + ProductSet. Format is: - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field @@ -2835,14 +2876,14 @@ def list_products_in_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: - r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + r"""Lists the Products in a ProductSet, in an unspecified + order. If the ProductSet does not exist, the products + field of the response will be empty. Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. .. code-block:: python @@ -2873,13 +2914,13 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the + ``ListProductsInProductSet`` method. name (str): - Required. The ProductSet resource for which to retrieve - Products. - + Required. The ProductSet resource for + which to retrieve Products. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -2895,11 +2936,11 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the ListProductsInProductSet - method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProductsInProductSet`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -2977,18 +3018,22 @@ def import_product_sets( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` - contains ``ImportProductSetsResponse``. (results) - - The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + r"""Asynchronous API that imports a list of reference images + to specified product sets based on a list of image + information. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains + ``ImportProductSetsResponse``. (results) + + The input source of this method is a csv file on Google + Cloud Storage. For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri + `__. .. code-block:: python @@ -3022,12 +3067,13 @@ def sample_import_product_sets(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ImportProductSetsRequest, dict]): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the + ``ImportProductSets`` method. parent (str): - Required. The project in which the ProductSets should be - imported. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + ProductSets should be imported. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3049,17 +3095,21 @@ def sample_import_product_sets(): Returns: google.api_core.operation.Operation: - An object representing a long-running operation. - - The result type for the operation will be - :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse` - Response message for the ImportProductSets method. - - This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] - method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field. + An object representing a long-running + operation. + The result type for the operation will + be + :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` + Response message for the + ``ImportProductSets` method. + + This message is returned by the + `google.longrunning.Operations.GetOperation + `__ + method in the returned + `google.longrunning.Operation.response + `__ + field. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/base.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/base.py index dbc3b9149b32..0d52ea37512f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/base.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/base.py @@ -87,8 +87,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -103,11 +101,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) elif credentials is None and not self._ignore_credentials: credentials, _ = google.auth.default( - **scopes_kwargs, quota_project_id=quota_project_id + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) # Don't apply audience if the credentials file passed from user. if hasattr(credentials, "with_gdch_audience"): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py index 4ddca650fe7e..86b8cde1528e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py @@ -115,21 +115,21 @@ class ProductSearchGrpcTransport(ProductSearchTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, - named ``projects/*/locations/*/productSets/*``, which acts as a - way to put different products into groups to limit identification. + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p3beta1.Product] resources, named + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p3beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] - resources, named + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -371,8 +371,8 @@ def create_product_set( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, + or is longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -405,8 +405,8 @@ def list_product_sets( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100, or less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -438,7 +438,7 @@ def get_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. Returns: Callable[[~.GetProductSetRequest], @@ -467,15 +467,15 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. Only display_name can be - updated currently. + Makes changes to a ProductSet resource. + Only display_name can be updated currently. Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer + than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -509,7 +509,7 @@ def delete_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. Returns: Callable[[~.DeleteProductSetRequest], @@ -541,12 +541,12 @@ def create_product( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - - Returns INVALID_ARGUMENT if product_category is missing or - invalid. + * Returns INVALID_ARGUMENT if display_name is missing or + longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than + 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -579,8 +579,8 @@ def list_products( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. Returns: Callable[[~.ListProductsRequest], @@ -612,7 +612,7 @@ def get_product( Possible errors: - - Returns NOT_FOUND if the Product does not exist. + * Returns NOT_FOUND if the Product does not exist. Returns: Callable[[~.GetProductRequest], @@ -640,22 +640,25 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. Only display_name, - description and labels can be updated right now. + Makes changes to a Product resource. + Only display_name, description and labels can be updated + right now. - If labels are updated, the change will not be reflected in - queries until the next index time. + If labels are updated, the change will not be reflected + in queries until the next index time. Possible errors: - - Returns NOT_FOUND if the Product does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - - Returns INVALID_ARGUMENT if product_category is present in - update_mask. + * Returns NOT_FOUND if the Product does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is + present in update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -683,13 +686,14 @@ def delete_product( Permanently deletes a product and its reference images. - Metadata of the product and all its images will be deleted right - away, but search queries against ProductSets containing the - product may still work until all related caches are refreshed. + Metadata of the product and all its images will be + deleted right away, but search queries against + ProductSets containing the product may still work until + all related caches are refreshed. Possible errors: - - Returns NOT_FOUND if the product does not exist. + * Returns NOT_FOUND if the product does not exist. Returns: Callable[[~.DeleteProductRequest], @@ -720,26 +724,29 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If + ``bounding_poly`` is not specified, the system will try + to detect regions of interest in the image that are + compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the + image resolution is too large to process (above 50MP). Possible errors: - - Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if the product does not exist. - - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - - Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing + or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not + exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent + product's product_category is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains + more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -769,16 +776,17 @@ def delete_reference_image( Permanently deletes a reference image. - The image metadata will be deleted right away, but search - queries against ProductSets containing the image may still work - until all related caches are refreshed. + The image metadata will be deleted right away, but + search queries against ProductSets containing the image + may still work until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. Possible errors: - - Returns NOT_FOUND if the reference image does not exist. + * Returns NOT_FOUND if the reference image does not + exist. Returns: Callable[[~.DeleteReferenceImageRequest], @@ -811,9 +819,9 @@ def list_reference_images( Possible errors: - - Returns NOT_FOUND if the parent product does not exist. - - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not + exist. * Returns INVALID_ARGUMENT if the page_size is + greater than 100, or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -846,7 +854,8 @@ def get_reference_image( Possible errors: - - Returns NOT_FOUND if the specified image does not exist. + * Returns NOT_FOUND if the specified image does not + exist. Returns: Callable[[~.GetReferenceImageRequest], @@ -874,15 +883,15 @@ def add_product_to_product_set( ]: r"""Return a callable for the add product to product set method over gRPC. - Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + Adds a Product to the specified ProductSet. If the + Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - - Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + * Returns NOT_FOUND if the Product or the ProductSet + doesn't exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -917,8 +926,8 @@ def remove_product_from_product_set( Possible errors: - - Returns NOT_FOUND If the Product is not found under the - ProductSet. + * Returns NOT_FOUND If the Product is not found under + the ProductSet. Returns: Callable[[~.RemoveProductFromProductSetRequest], @@ -949,14 +958,14 @@ def list_products_in_product_set( ]: r"""Return a callable for the list products in product set method over gRPC. - Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + Lists the Products in a ProductSet, in an unspecified + order. If the ProductSet does not exist, the products + field of the response will be empty. Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -986,18 +995,22 @@ def import_product_sets( ]: r"""Return a callable for the import product sets method over gRPC. - Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` - contains ``ImportProductSetsResponse``. (results) - - The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + Asynchronous API that imports a list of reference images + to specified product sets based on a list of image + information. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains + ``ImportProductSetsResponse``. (results) + + The input source of this method is a csv file on Google + Cloud Storage. For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri + `__. Returns: Callable[[~.ImportProductSetsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py index cc26271ea70d..584c87639584 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py @@ -121,21 +121,21 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, - named ``projects/*/locations/*/productSets/*``, which acts as a - way to put different products into groups to limit identification. + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p3beta1.Product] resources, named + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p3beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] - resources, named + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -379,8 +379,8 @@ def create_product_set( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, + or is longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -413,8 +413,8 @@ def list_product_sets( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100, or less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -447,7 +447,7 @@ def get_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. Returns: Callable[[~.GetProductSetRequest], @@ -476,15 +476,15 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. Only display_name can be - updated currently. + Makes changes to a ProductSet resource. + Only display_name can be updated currently. Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer + than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -520,7 +520,7 @@ def delete_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. Returns: Callable[[~.DeleteProductSetRequest], @@ -553,12 +553,12 @@ def create_product( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - - Returns INVALID_ARGUMENT if product_category is missing or - invalid. + * Returns INVALID_ARGUMENT if display_name is missing or + longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than + 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -591,8 +591,8 @@ def list_products( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. Returns: Callable[[~.ListProductsRequest], @@ -625,7 +625,7 @@ def get_product( Possible errors: - - Returns NOT_FOUND if the Product does not exist. + * Returns NOT_FOUND if the Product does not exist. Returns: Callable[[~.GetProductRequest], @@ -654,22 +654,25 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. Only display_name, - description and labels can be updated right now. + Makes changes to a Product resource. + Only display_name, description and labels can be updated + right now. - If labels are updated, the change will not be reflected in - queries until the next index time. + If labels are updated, the change will not be reflected + in queries until the next index time. Possible errors: - - Returns NOT_FOUND if the Product does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - - Returns INVALID_ARGUMENT if product_category is present in - update_mask. + * Returns NOT_FOUND if the Product does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is + present in update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -699,13 +702,14 @@ def delete_product( Permanently deletes a product and its reference images. - Metadata of the product and all its images will be deleted right - away, but search queries against ProductSets containing the - product may still work until all related caches are refreshed. + Metadata of the product and all its images will be + deleted right away, but search queries against + ProductSets containing the product may still work until + all related caches are refreshed. Possible errors: - - Returns NOT_FOUND if the product does not exist. + * Returns NOT_FOUND if the product does not exist. Returns: Callable[[~.DeleteProductRequest], @@ -736,26 +740,29 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If + ``bounding_poly`` is not specified, the system will try + to detect regions of interest in the image that are + compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the + image resolution is too large to process (above 50MP). Possible errors: - - Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if the product does not exist. - - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - - Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing + or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not + exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent + product's product_category is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains + more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -785,16 +792,17 @@ def delete_reference_image( Permanently deletes a reference image. - The image metadata will be deleted right away, but search - queries against ProductSets containing the image may still work - until all related caches are refreshed. + The image metadata will be deleted right away, but + search queries against ProductSets containing the image + may still work until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. Possible errors: - - Returns NOT_FOUND if the reference image does not exist. + * Returns NOT_FOUND if the reference image does not + exist. Returns: Callable[[~.DeleteReferenceImageRequest], @@ -827,9 +835,9 @@ def list_reference_images( Possible errors: - - Returns NOT_FOUND if the parent product does not exist. - - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not + exist. * Returns INVALID_ARGUMENT if the page_size is + greater than 100, or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -862,7 +870,8 @@ def get_reference_image( Possible errors: - - Returns NOT_FOUND if the specified image does not exist. + * Returns NOT_FOUND if the specified image does not + exist. Returns: Callable[[~.GetReferenceImageRequest], @@ -891,15 +900,15 @@ def add_product_to_product_set( ]: r"""Return a callable for the add product to product set method over gRPC. - Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + Adds a Product to the specified ProductSet. If the + Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - - Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + * Returns NOT_FOUND if the Product or the ProductSet + doesn't exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -935,8 +944,8 @@ def remove_product_from_product_set( Possible errors: - - Returns NOT_FOUND If the Product is not found under the - ProductSet. + * Returns NOT_FOUND If the Product is not found under + the ProductSet. Returns: Callable[[~.RemoveProductFromProductSetRequest], @@ -967,14 +976,14 @@ def list_products_in_product_set( ]: r"""Return a callable for the list products in product set method over gRPC. - Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + Lists the Products in a ProductSet, in an unspecified + order. If the ProductSet does not exist, the products + field of the response will be empty. Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -1005,18 +1014,22 @@ def import_product_sets( ]: r"""Return a callable for the import product sets method over gRPC. - Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` - contains ``ImportProductSetsResponse``. (results) - - The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + Asynchronous API that imports a list of reference images + to specified product sets based on a list of image + information. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains + ``ImportProductSetsResponse``. (results) + + The input source of this method is a csv file on Google + Cloud Storage. For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri + `__. Returns: Callable[[~.ImportProductSetsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py index 157314187d5e..51a2a6c55fef 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py @@ -952,21 +952,21 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, - named ``projects/*/locations/*/productSets/*``, which acts as a - way to put different products into groups to limit identification. + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p3beta1.Product] resources, named + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p3beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] - resources, named + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -1115,8 +1115,8 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the + ``AddProductToProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1230,7 +1230,8 @@ def __call__( Args: request (~.product_search_service.CreateProductRequest): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the + ``CreateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1380,7 +1381,8 @@ def __call__( Args: request (~.product_search_service.CreateProductSetRequest): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the + ``CreateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1539,7 +1541,8 @@ def __call__( Args: request (~.product_search_service.CreateReferenceImageRequest): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the + ``CreateReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1550,8 +1553,9 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ @@ -1694,7 +1698,8 @@ def __call__( Args: request (~.product_search_service.DeleteProductRequest): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the + ``DeleteProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1800,7 +1805,8 @@ def __call__( Args: request (~.product_search_service.DeleteProductSetRequest): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the + ``DeleteProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1908,7 +1914,8 @@ def __call__( Args: request (~.product_search_service.DeleteReferenceImageRequest): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the + ``DeleteReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2016,7 +2023,8 @@ def __call__( Args: request (~.product_search_service.GetProductRequest): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the ``GetProduct`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2164,7 +2172,8 @@ def __call__( Args: request (~.product_search_service.GetProductSetRequest): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the + ``GetProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2315,7 +2324,8 @@ def __call__( Args: request (~.product_search_service.GetReferenceImageRequest): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the + ``GetReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2326,8 +2336,9 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ @@ -2466,7 +2477,8 @@ def __call__( Args: request (~.product_search_service.ImportProductSetsRequest): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the + ``ImportProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2618,7 +2630,8 @@ def __call__( Args: request (~.product_search_service.ListProductsRequest): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the ``ListProducts`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2629,7 +2642,9 @@ def __call__( Returns: ~.product_search_service.ListProductsResponse: - Response message for the ``ListProducts`` method. + Response message for the + ``ListProducts`` method. + """ http_options = ( @@ -2764,7 +2779,8 @@ def __call__( Args: request (~.product_search_service.ListProductSetsRequest): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the + ``ListProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2775,7 +2791,9 @@ def __call__( Returns: ~.product_search_service.ListProductSetsResponse: - Response message for the ``ListProductSets`` method. + Response message for the + ``ListProductSets`` method. + """ http_options = ( @@ -2914,8 +2932,8 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the + ``ListProductsInProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2926,8 +2944,8 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the ``ListProductsInProductSet`` - method. + Response message for the + ``ListProductsInProductSet`` method. """ @@ -3069,7 +3087,8 @@ def __call__( Args: request (~.product_search_service.ListReferenceImagesRequest): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the + ``ListReferenceImages`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3080,7 +3099,9 @@ def __call__( Returns: ~.product_search_service.ListReferenceImagesResponse: - Response message for the ``ListReferenceImages`` method. + Response message for the + ``ListReferenceImages`` method. + """ http_options = ( @@ -3222,8 +3243,8 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the + ``RemoveProductFromProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3339,7 +3360,8 @@ def __call__( Args: request (~.product_search_service.UpdateProductRequest): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the + ``UpdateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3489,7 +3511,8 @@ def __call__( Args: request (~.product_search_service.UpdateProductSetRequest): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the + ``UpdateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py index d9726c6461f3..bdf360dbaa90 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py @@ -104,23 +104,24 @@ class Likelihood(proto.Enum): class Feature(proto.Message): - r"""The type of Google Cloud Vision API detection to perform, and the - maximum number of results to return for that type. Multiple + r"""The type of Google Cloud Vision API detection to perform, and + the maximum number of results to return for that type. Multiple ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p3beta1.types.Feature.Type): The feature type. max_results (int): - Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. + Maximum number of results of this type. Does not + apply to ``TEXT_DETECTION``, + ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): - Model to use for the feature. Supported values: - "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" for the - bleeding edge release updated weekly. + Model to use for the feature. + Supported values: "builtin/stable" (the default + if unset) and "builtin/latest". + ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also support "builtin/weekly" + for the bleeding edge release updated weekly. """ class Type(proto.Enum): @@ -138,14 +139,15 @@ class Type(proto.Enum): LABEL_DETECTION (4): Run label detection. TEXT_DETECTION (5): - Run text detection / optical character recognition (OCR). - Text detection is optimized for areas of text within a - larger image; if the image is a document, use + Run text detection / optical character + recognition (OCR). Text detection is optimized + for areas of text within a larger image; if the + image is a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): - Run dense text document OCR. Takes precedence when both - ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are - present. + Run dense text document OCR. Takes precedence + when both ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` are present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -198,31 +200,38 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See `Google Cloud Storage Request - URIs `__ + The Google Cloud Storage URI of the form + ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google Cloud + Storage Request + URIs + `__ for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is - not supported. See `Google Cloud Storage Request - URIs `__ - for more info. - - 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from HTTP/HTTPS URLs, Google cannot guarantee that - the request will be completed. Your request may fail if - the specified host denies the request (e.g. due to - request throttling or DOS prevention), or if Google - throttles requests to the site for abuse prevention. You - should not depend on externally-hosted images for - production applications. - - When both ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes precedence. + ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google + Cloud Storage Request + URIs + `__ + for more info. + + 2. A publicly-accessible image HTTP/HTTPS URL. + When fetching images from HTTP/HTTPS + URLs, Google cannot guarantee that the + request will be completed. Your request + may fail if the specified host denies the + request (e.g. due to request throttling or + DOS prevention), or if Google throttles + requests to the site for abuse prevention. + You should not depend on + externally-hosted images for production + applications. + + When both ``gcs_image_uri`` and ``image_uri`` + are specified, ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -240,14 +249,16 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. Note: As - with all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. + Image content, represented as a stream of bytes. + Note: As with all ``bytes`` fields, protobuffers + use a pure binary representation, whereas JSON + representations use base64. source (google.cloud.vision_v1p3beta1.types.ImageSource): - Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided - for an image, ``content`` takes precedence and is used to - perform the image annotation request. + Google Cloud Storage image location, or + publicly-accessible image URL. If both + ``content`` and ``source`` are provided for an + image, ``content`` takes precedence and is used + to perform the image annotation request. """ content: bytes = proto.Field( @@ -267,36 +278,43 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale, as returned - in ``ImageParams``. The bounding box is computed to "frame" - the face in accordance with human expectations. It is based - on the landmarker results. Note that one or more x and/or y - coordinates may not be generated in the ``BoundingPoly`` - (the polygon will be unbounded) if only a partial face - appears in the image to be annotated. + The bounding polygon around the face. The + coordinates of the bounding box are in the + original image's scale, as returned in + ``ImageParams``. The bounding box is computed to + "frame" the face in accordance with human + expectations. It is based on the landmarker + results. Note that one or more x and/or y + coordinates may not be generated in the + ``BoundingPoly`` (the polygon will be unbounded) + if only a partial face appears in the image to + be annotated. fd_bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the ``boundingPoly``, and encloses only the skin part of the - face. Typically, it is used to eliminate the face from any - image analysis that detects the "amount of skin" visible in - an image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face detection) - prefix. + The ``fd_bounding_poly`` bounding polygon is + tighter than the ``boundingPoly``, and encloses + only the skin part of the face. Typically, it is + used to eliminate the face from any image + analysis that detects the "amount of skin" + visible in an image. It is not based on the + landmarker results, only on the initial face + detection, hence the fd (face + detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p3beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the face. - Range [-180,180]. + clockwise/anti-clockwise rotation of the face + relative to the image vertical about the axis + perpendicular to the face. Range [-180,180]. pan_angle (float): - Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane + Yaw angle, which indicates the + leftward/rightward angle that the face is + pointing relative to the vertical plane perpendicular to the image. Range [-180,180]. tilt_angle (float): - Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's horizontal + Pitch angle, which indicates the + upwards/downwards angle that the face is + pointing relative to the image's horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. @@ -329,10 +347,10 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. Left and right are defined from the - vantage of the viewer of the image without considering mirror - projections typical of photos. So, ``LEFT_EYE``, typically, is the - person's right eye. + r"""Face landmark (feature) type. + Left and right are defined from the vantage of the viewer of the + image without considering mirror projections typical of photos. + So, ``LEFT_EYE``, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -572,44 +590,49 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search - API `__. + Opaque entity ID. Some IDs may be available in + `Google Knowledge Graph Search + API + `__. locale (str): - The language code for the locale in which the entity textual - ``description`` is expressed. + The language code for the locale in which the + entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its ``locale`` - language. + Entity textual description, expressed in its + ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field - represents the confidence that there is a tower in the query - image. Range [0, 1]. + **Deprecated. Use ``score`` instead.** + The accuracy of the entity detection in an + image. For example, for an image in which the + "Eiffel Tower" entity is detected, this field + represents the confidence that there is a tower + in the query image. Range [0, 1]. topicality (float): - The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower - in each image may be the same. Range [0, 1]. + The relevancy of the ICA (Image Content + Annotation) label to the image. For example, the + relevancy of "tower" is likely higher to an + image containing the detected "Eiffel Tower" + than to an image containing a detected distant + towering building, even though the confidence + that there is a tower in each image may be the + same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): - Image region to which this entity belongs. Not produced for - ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not + produced for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p3beta1.types.LocationInfo]): - The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may indicate the location of the scene in the - image, and another location may indicate the location of the - place where the image was taken. Location information is - usually present for landmarks. + The location information for the detected + entity. Multiple ``LocationInfo`` elements can + be present because one location may indicate the + location of the scene in the image, and another + location may indicate the location of the place + where the image was taken. Location information + is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p3beta1.types.Property]): - Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies - the entity. + Some entities may have optional user-supplied + ``Property`` (name/value) fields, such a score + or string that qualifies the entity. """ mid: str = proto.Field( @@ -661,11 +684,12 @@ class LocalizedObjectAnnotation(proto.Message): Object ID that should align with EntityAnnotation mid. language_code (str): - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + The BCP-47 language code, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` language. + Object name, expressed in its ``language_code`` + language. score (float): Score of the result. Range [0, 1]. bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): @@ -782,10 +806,11 @@ class ColorInfo(proto.Message): color (google.type.color_pb2.Color): RGB components of the color. score (float): - Image-specific score for this color. Value in range [0, 1]. + Image-specific score for this color. Value in + range [0, 1]. pixel_fraction (float): - The fraction of pixels the color occupies in the image. - Value in range [0, 1]. + The fraction of pixels the color occupies in the + image. Value in range [0, 1]. """ color: color_pb2.Color = proto.Field( @@ -841,11 +866,13 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The bounding polygon for the crop region. The coordinates of - the bounding box are in the original image's scale, as - returned in ``ImageParams``. + The bounding polygon for the crop region. The + coordinates of the bounding box are in the + original image's scale, as returned in + ``ImageParams``. confidence (float): - Confidence of this being a salient region. Range [0, 1]. + Confidence of this being a salient region. + Range [0, 1]. importance_fraction (float): Fraction of importance of this salient region with respect to the original image. @@ -924,9 +951,10 @@ class TextDetectionParams(proto.Message): Attributes: enable_text_detection_confidence_score (bool): - By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + By default, Cloud Vision API only includes + confidence score for DOCUMENT_TEXT_DETECTION + result. Set the flag to true to include + confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -949,16 +977,19 @@ class ImageContext(proto.Message): lat_long_rect (google.cloud.vision_v1p3beta1.types.LatLongRect): Not used. language_hints (MutableSequence[str]): - List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In - rare cases, when the language of the text in the image is - known, setting a hint will help get better results (although - it will be a significant hindrance if the hint is wrong). - Text detection returns an error if one or more of the - specified languages is not one of the `supported - languages `__. + List of languages to use for TEXT_DETECTION. In + most cases, an empty value yields the best + results since it enables automatic language + detection. For languages based on the Latin + alphabet, setting ``language_hints`` is not + needed. In rare cases, when the language of the + text in the image is known, setting a hint will + help get better results (although it will be a + significant hindrance if the hint is wrong). + Text detection returns an error if one or more + of the specified languages is not one of the + `supported languages + `__. crop_hints_params (google.cloud.vision_v1p3beta1.types.CropHintsParams): Parameters for crop hints annotation request. product_search_params (google.cloud.vision_v1p3beta1.types.ProductSearchParams): @@ -1100,9 +1131,10 @@ class AnnotateImageResponse(proto.Message): If present, product search has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the operation. Note - that filled-in image annotations are guaranteed to be - correct, even when ``error`` is set. + If set, represents the error message for the + operation. Note that filled-in image annotations + are guaranteed to be correct, even when + ``error`` is set. context (google.cloud.vision_v1p3beta1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1361,17 +1393,20 @@ class OutputConfig(proto.Message): The Google Cloud Storage location to write the output(s) to. batch_size (int): - The max number of response protos to put into each output - JSON file on Google Cloud Storage. The valid range is [1, - 100]. If not specified, the default value is 20. - - For example, for one pdf file with 100 pages, 100 response - protos will be generated. If ``batch_size`` = 20, then 5 - json files each containing 20 response protos will be - written under the prefix ``gcs_destination``.\ ``uri``. - - Currently, batch_size only applies to GcsDestination, with - potential future support for other output configurations. + The max number of response protos to put into + each output JSON file on Google Cloud Storage. + The valid range is [1, 100]. If not specified, + the default value is 20. + + For example, for one pdf file with 100 pages, + 100 response protos will be generated. If + ``batch_size`` = 20, then 5 json files each + containing 20 response protos will be written + under the prefix ``gcs_destination``.``uri``. + + Currently, batch_size only applies to + GcsDestination, with potential future support + for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1408,23 +1443,26 @@ class GcsDestination(proto.Message): Attributes: uri (str): - Google Cloud Storage URI where the results will be stored. - Results will be in JSON format and preceded by its - corresponding input URI. This field can either represent a - single file, or a prefix for multiple outputs. Prefixes must - end in a ``/``. + Google Cloud Storage URI where the results will + be stored. Results will be in JSON format and + preceded by its corresponding input URI. This + field can either represent a single file, or a + prefix for multiple outputs. Prefixes must end + in a ``/``. Examples: - - File: gs://bucket-name/filename.json - - Prefix: gs://bucket-name/prefix/here/ - - File: gs://bucket-name/prefix/here + * File: gs://bucket-name/filename.json + * Prefix: gs://bucket-name/prefix/here/ + + * File: gs://bucket-name/prefix/here If multiple outputs, each response is still - AnnotateFileResponse, each of which contains some subset of - the full list of AnnotateImageResponse. Multiple outputs can - happen if, for example, the output JSON is too large and - overflows into multiple sharded files. + AnnotateFileResponse, each of which contains + some subset of the full list of + AnnotateImageResponse. Multiple outputs can + happen if, for example, the output JSON is too + large and overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py index 4cd22fcf75e0..71b9b9e5541d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py @@ -40,11 +40,10 @@ class ProductSearchParams(proto.Message): interest in the image. If it is not specified, system discretion will be applied. product_set (str): - The resource name of a - [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be - searched for similar images. + The resource name of a `ProductSet + `__ to + be searched for similar images. Format is: - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. @@ -148,11 +147,12 @@ class ObjectAnnotation(proto.Message): Object ID that should align with EntityAnnotation mid. language_code (str): - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + The BCP-47 language code, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` language. + Object name, expressed in its ``language_code`` + language. score (float): Score of the result. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py index b082ad202abf..bbf40f7baa1c 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py @@ -68,6 +68,7 @@ class Product(proto.Message): The resource name of the product. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This field is ignored when creating a product. @@ -86,16 +87,17 @@ class Product(proto.Message): "apparel", and "toys" are still supported, but these should not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1p3beta1.types.Product.KeyValue]): - Key-value pairs that can be attached to a product. At query - time, constraints can be specified based on the - product_labels. + Key-value pairs that can be attached to a + product. At query time, constraints can be + specified based on the product_labels. - Note that integer values can be provided as strings, e.g. - "1199". Only strings with integer values can match a - range-based restriction which is to be supported soon. + Note that integer values can be provided as + strings, e.g. "1199". Only strings with integer + values can match a range-based restriction which + is to be supported soon. - Multiple values can be assigned to the same key. One product - may have up to 100 product_labels. + Multiple values can be assigned to the same key. + One product may have up to 100 product_labels. """ class KeyValue(proto.Message): @@ -153,9 +155,11 @@ class ProductSet(proto.Message): The resource name of the ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. - This field is ignored when creating a ProductSet. + This field is ignored when creating a + ProductSet. display_name (str): The user-provided name for this ProductSet. Must not be empty. Must be at most 4096 @@ -199,8 +203,8 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): - r"""A ``ReferenceImage`` represents a product image and its associated - metadata, such as bounding boxes. + r"""A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. Attributes: name (str): @@ -210,11 +214,11 @@ class ReferenceImage(proto.Message): ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. - This field is ignored when creating a reference image. - uri (str): - Required. The Google Cloud Storage URI of the reference + This field is ignored when creating a reference image. - + uri (str): + Required. The Google Cloud Storage URI of the + reference image. The URI must start with ``gs://``. bounding_polys (MutableSequence[google.cloud.vision_v1p3beta1.types.BoundingPoly]): Optional. Bounding polygons around the areas @@ -250,18 +254,19 @@ class CreateProductRequest(proto.Message): Attributes: parent (str): - Required. The project in which the Product should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the Product + should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1p3beta1.types.Product): Required. The product to create. product_id (str): - A user-supplied resource id for this Product. If set, the - server will attempt to use this value as the resource id. If - it is already in use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 characters long. It - cannot contain the character ``/``. + A user-supplied resource id for this Product. If + set, the server will attempt to use this value + as the resource id. If it is already in use, an + error is returned with code ALREADY_EXISTS. Must + be at most 128 characters long. It cannot + contain the character ``/``. """ parent: str = proto.Field( @@ -284,16 +289,17 @@ class ListProductsRequest(proto.Message): Attributes: parent (str): - Required. The project OR ProductSet from which Products - should be listed. + Required. The project OR ProductSet from which + Products should be listed. + Format: - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + ``projects/PROJECT_ID/locations/LOC_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous List request, - if any. + The next_page_token returned from a previous + List request, if any. """ parent: str = proto.Field( @@ -345,6 +351,7 @@ class GetProductRequest(proto.Message): Required. Resource name of the Product to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ @@ -363,10 +370,12 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that specifies - which fields to update. If update_mask isn't specified, all - mutable fields are to be updated. Valid mask paths include - ``product_labels``, ``display_name``, and ``description``. + The `FieldMask `__ + that specifies which fields to update. + If update_mask isn't specified, all mutable + fields are to be updated. Valid mask paths + include ``product_labels``, ``display_name``, + and ``description``. """ product: "Product" = proto.Field( @@ -389,6 +398,7 @@ class DeleteProductRequest(proto.Message): Required. Resource name of product to delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ @@ -403,18 +413,19 @@ class CreateProductSetRequest(proto.Message): Attributes: parent (str): - Required. The project in which the ProductSet should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSet + should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. product_set (google.cloud.vision_v1p3beta1.types.ProductSet): Required. The ProductSet to create. product_set_id (str): - A user-supplied resource id for this ProductSet. If set, the - server will attempt to use this value as the resource id. If - it is already in use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 characters long. It - cannot contain the character ``/``. + A user-supplied resource id for this ProductSet. + If set, the server will attempt to use this + value as the resource id. If it is already in + use, an error is returned with code + ALREADY_EXISTS. Must be at most 128 characters + long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -437,16 +448,16 @@ class ListProductSetsRequest(proto.Message): Attributes: parent (str): - Required. The project from which ProductSets should be - listed. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which ProductSets + should be listed. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous List request, - if any. + The next_page_token returned from a previous + List request, if any. """ parent: str = proto.Field( @@ -495,9 +506,10 @@ class GetProductSetRequest(proto.Message): Attributes: name (str): - Required. Resource name of the ProductSet to get. - + Required. Resource name of the ProductSet to + get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ @@ -515,9 +527,10 @@ class UpdateProductSetRequest(proto.Message): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that specifies - which fields to update. If update_mask isn't specified, all - mutable fields are to be updated. Valid mask path is + The `FieldMask `__ + that specifies which fields to update. + If update_mask isn't specified, all mutable + fields are to be updated. Valid mask path is ``display_name``. """ @@ -538,9 +551,10 @@ class DeleteProductSetRequest(proto.Message): Attributes: name (str): - Required. Resource name of the ProductSet to delete. - + Required. Resource name of the ProductSet to + delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ @@ -555,20 +569,21 @@ class CreateReferenceImageRequest(proto.Message): Attributes: parent (str): - Required. Resource name of the product in which to create - the reference image. - + Required. Resource name of the product in which + to create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. reference_image (google.cloud.vision_v1p3beta1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): - A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value as - the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for the + ReferenceImage to be added. If set, the server + will attempt to use this value as the resource + id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at + most 128 characters long. It cannot contain the + character ``/``. """ parent: str = proto.Field( @@ -591,18 +606,18 @@ class ListReferenceImagesRequest(proto.Message): Attributes: parent (str): - Required. Resource name of the product containing the - reference images. - + Required. Resource name of the product + containing the reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - A token identifying a page of results to be returned. This - is the value of ``nextPageToken`` returned in a previous - reference image list request. + A token identifying a page of results to be + returned. This is the value of ``nextPageToken`` + returned in a previous reference image list + request. Defaults to the first page if not specified. """ @@ -631,8 +646,8 @@ class ListReferenceImagesResponse(proto.Message): The maximum number of items to return. Default 10, maximum 100. next_page_token (str): - The next_page_token returned from a previous List request, - if any. + The next_page_token returned from a previous + List request, if any. """ @property @@ -659,8 +674,8 @@ class GetReferenceImageRequest(proto.Message): Attributes: name (str): - Required. The resource name of the ReferenceImage to get. - + Required. The resource name of the + ReferenceImage to get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -677,9 +692,8 @@ class DeleteReferenceImageRequest(proto.Message): Attributes: name (str): - Required. The resource name of the reference image to - delete. - + Required. The resource name of the reference + image to delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -696,15 +710,16 @@ class AddProductToProductSetRequest(proto.Message): Attributes: name (str): - Required. The resource name for the ProductSet to modify. - + Required. The resource name for the ProductSet + to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): - Required. The resource name for the Product to be added to - this ProductSet. - + Required. The resource name for the Product to + be added to this ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ @@ -723,15 +738,16 @@ class RemoveProductFromProductSetRequest(proto.Message): Attributes: name (str): - Required. The resource name for the ProductSet to modify. - + Required. The resource name for the ProductSet + to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): - Required. The resource name for the Product to be removed - from this ProductSet. - + Required. The resource name for the Product to + be removed from this ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ @@ -750,17 +766,17 @@ class ListProductsInProductSetRequest(proto.Message): Attributes: name (str): - Required. The ProductSet resource for which to retrieve - Products. - + Required. The ProductSet resource for which to + retrieve Products. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous List request, - if any. + The next_page_token returned from a previous + List request, if any. """ name: str = proto.Field( @@ -810,66 +826,78 @@ class ImportProductSetsGcsSource(proto.Message): Attributes: csv_file_uri (str): - The Google Cloud Storage URI of the input csv file. - + The Google Cloud Storage URI of the input csv + file. The URI must start with ``gs://``. - The format of the input csv file should be one image per - line. In each line, there are 6 columns. - - 1. image_uri 2, image_id - 2. product_set_id - 3. product_id 5, product_category 6, product_display_name 7, - labels - 4. bounding_poly - - Columns 1, 3, 4, and 5 are required, other columns are - optional. A new ProductSet/Product with the same id will be - created on the fly if the ProductSet/Product specified by + The format of the input csv file should be one + image per line. In each line, there are 6 + columns. + 1. image_uri + 2, image_id + 3. product_set_id + 4. product_id + 5, product_category + 6, product_display_name + 7, labels + 8. bounding_poly + + Columns 1, 3, 4, and 5 are required, other + columns are optional. A new ProductSet/Product + with the same id will be created on the fly if + the ProductSet/Product specified by product_set_id/product_id does not exist. - The image_id field is optional but has to be unique if - provided. If it is empty, we will automatically assign an - unique id to the image. + The image_id field is optional but has to be + unique if provided. If it is empty, we will + automatically assign an unique id to the image. - The product_display_name field is optional. If it is empty, - a space (" ") is used as the place holder for the product - display_name, which can be updated later through the - realtime API. + The product_display_name field is optional. If + it is empty, a space (" ") is used as the place + holder for the product display_name, which can + be updated later through the realtime API. - If the Product with product_id already exists, the fields - product_display_name, product_category and labels are - ignored. + If the Product with product_id already exists, + the fields product_display_name, + product_category and labels are ignored. - If a Product doesn't exist and needs to be created on the - fly, the product_display_name field refers to - [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], + If a Product doesn't exist and needs to be + created on the fly, the product_display_name + field refers to + `Product.display_name + `__, the product_category field refers to - [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], - and the labels field refers to [Product.labels][]. - - Labels (optional) should be a line containing a list of - comma-separated key-value pairs, with the format + `Product.product_category + `__, + and the labels field refers to + [Product.labels][]. + + Labels (optional) should be a line containing a + list of comma-separated key-value pairs, with + the format "key_1=value_1,key_2=value_2,...,key_n=value_n". - The bounding_poly (optional) field is used to identify one - region of interest from the image in the same manner as - CreateReferenceImage. If no bounding_poly is specified, the - system will try to detect regions of interest automatically. - - Note that the pipeline will resize the image if the image - resolution is too large to process (above 20MP). - - Also note that at most one bounding_poly is allowed per - line. If the image contains multiple regions of interest, - the csv should contain one line per region of interest. - - The bounding_poly column should contain an even number of - comma-separated numbers, with the format - "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative integers - should be used for absolute bounding polygons, and float - values in [0, 1] should be used for normalized bounding - polygons. + The bounding_poly (optional) field is used to + identify one region of interest from the image + in the same manner as CreateReferenceImage. If + no bounding_poly is specified, the system will + try to detect regions of interest automatically. + + Note that the pipeline will resize the image if + the image resolution is too large to process + (above 20MP). + + Also note that at most one bounding_poly is + allowed per line. If the image contains multiple + regions of interest, the csv should contain one + line per region of interest. + + The bounding_poly column should contain an even + number of comma-separated numbers, with the + format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". + Nonnegative integers should be used for absolute + bounding polygons, and float values in [0, 1] + should be used for normalized bounding polygons. """ csv_file_uri: str = proto.Field( @@ -905,10 +933,10 @@ class ImportProductSetsRequest(proto.Message): Attributes: parent (str): - Required. The project in which the ProductSets should be - imported. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSets + should be imported. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. input_config (google.cloud.vision_v1p3beta1.types.ImportProductSetsInputConfig): Required. The input content for the list of requests. @@ -929,22 +957,24 @@ class ImportProductSetsResponse(proto.Message): r"""Response message for the ``ImportProductSets`` method. This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] - method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field. + `google.longrunning.Operations.GetOperation + `__ method in the + returned + `google.longrunning.Operation.response + `__ field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1p3beta1.types.ReferenceImage]): - The list of reference_images that are imported successfully. + The list of reference_images that are imported + successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): - The rpc status for each ImportProductSet request, including - both successes and errors. + The rpc status for each ImportProductSet + request, including both successes and errors. - The number of statuses here matches the number of lines in - the csv file, and statuses[i] stores the success or failure - status of processing the i-th line of the csv, starting from - line 0. + The number of statuses here matches the number + of lines in the csv file, and statuses[i] stores + the success or failure status of processing the + i-th line of the csv, starting from line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -962,9 +992,8 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` - returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. + This is included in the ``metadata`` field of the ``Operation`` returned by the + ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1p3beta1.types.BatchOperationMetadata.State): @@ -974,8 +1003,9 @@ class BatchOperationMetadata(proto.Message): to the server. end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and - [google.longrunning.Operation.done][google.longrunning.Operation.done] - is set to true. + `google.longrunning.Operation.done + `__ is set to + true. """ class State(proto.Enum): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py index 660990572b2e..199a91679ae7 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py @@ -35,13 +35,16 @@ class TextAnnotation(proto.Message): - r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like this: - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each - structural component, starting from Page, may further have their own - properties. Properties describe detected languages, breaks etc.. - Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty] + r"""TextAnnotation contains a structured representation of OCR + extracted text. The hierarchy of an OCR extracted text structure + is like this: + + TextAnnotation -> Page -> Block -> Paragraph -> Word -> + Symbol Each structural component, starting from Page, may + further have their own properties. Properties describe detected + languages, breaks etc.. Please refer to the + `TextAnnotation.TextProperty + `__ message definition below for more detail. Attributes: @@ -56,8 +59,8 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + The BCP-47 language code, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -95,9 +98,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or - ``LINE_BREAK``. + End-line hyphen that is not present in text; + does not co-occur with ``SPACE``, + ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -169,7 +172,8 @@ class Page(proto.Message): List of blocks of text, images etc on this page. confidence (float): - Confidence of the OCR results on the page. Range [0, 1]. + Confidence of the OCR results on the page. Range + [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -210,24 +214,24 @@ class Block(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: + - when the text is horizontal it might look like: - :: + :: - 0----1 - | | - 3----2 + 0----1 + | | + 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: + - when it's rotated 180 degrees around the top-left corner + it becomes: - :: + :: - 2----3 - | | - 1----0 + 2----3 + | | + 1----0 - and the vertice order will still be (0, 1, 2, 3). + and the vertice order will still be (0, 1, 2, 3). paragraphs (MutableSequence[google.cloud.vision_v1p3beta1.types.Paragraph]): List of paragraphs in this block (if this blocks is of type text). @@ -235,7 +239,8 @@ class Block(proto.Message): Detected block type (text, image etc) for this block. confidence (float): - Confidence of the OCR results on the block. Range [0, 1]. + Confidence of the OCR results on the block. + Range [0, 1]. """ class BlockType(proto.Enum): @@ -297,22 +302,25 @@ class Paragraph(proto.Message): Additional information detected for the paragraph. bounding_box (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The bounding box for the paragraph. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. - When a rotation of the bounding box is detected the rotation - is represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order will - still be (0, 1, 2, 3). + The bounding box for the paragraph. The vertices + are in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertice order will still be + (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1p3beta1.types.Word]): List of words in this paragraph. confidence (float): - Confidence of the OCR results for the paragraph. Range [0, - 1]. + Confidence of the OCR results for the paragraph. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -343,23 +351,27 @@ class Word(proto.Message): property (google.cloud.vision_v1p3beta1.types.TextAnnotation.TextProperty): Additional information detected for the word. bounding_box (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The bounding box for the word. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order will - still be (0, 1, 2, 3). + The bounding box for the word. The vertices are + in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertice order will still be + (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1p3beta1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural reading order. confidence (float): - Confidence of the OCR results for the word. Range [0, 1]. + Confidence of the OCR results for the word. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -391,22 +403,26 @@ class Symbol(proto.Message): Additional information detected for the symbol. bounding_box (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The bounding box for the symbol. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. - When a rotation of the bounding box is detected the rotation - is represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order will - still be (0, 1, 2, 3). + The bounding box for the symbol. The vertices + are in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertice order will still be + (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. confidence (float): - Confidence of the OCR results for the symbol. Range [0, 1]. + Confidence of the OCR results for the symbol. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py index 887e53444d05..b3e48f9a1373 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py @@ -157,8 +157,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as + "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/__init__.py index f921e4ab9124..b44f88b0ef8e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/__init__.py @@ -28,11 +28,7 @@ # this code path once we drop support for Python 3.7 import importlib_metadata as metadata -from google.cloud.vision_helpers import VisionHelpers -from google.cloud.vision_helpers.decorators import add_single_feature_methods - -from .services.image_annotator import ImageAnnotatorAsyncClient -from .services.image_annotator import ImageAnnotatorClient as IacImageAnnotatorClient +from .services.image_annotator import ImageAnnotatorAsyncClient, ImageAnnotatorClient from .services.product_search import ProductSearchAsyncClient, ProductSearchClient from .types.face import Celebrity, FaceRecognitionParams, FaceRecognitionResult from .types.geometry import BoundingPoly, NormalizedVertex, Position, Vertex @@ -209,13 +205,6 @@ def _get_version(dependency_name): + "https://devguide.python.org/versions/" ) - -@add_single_feature_methods -class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient): - __doc__ = IacImageAnnotatorClient.__doc__ - Feature = Feature - - __all__ = ( "ImageAnnotatorAsyncClient", "ProductSearchAsyncClient", diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py index 82d9164b0b9a..b7ff809c3582 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py @@ -532,17 +532,16 @@ async def async_batch_annotate_images( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Run asynchronous image detection and annotation for a list of - images. - + r"""Run asynchronous image detection and annotation for a + list of images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + This service will write image annotation outputs to json + files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -602,11 +601,13 @@ async def sample_async_batch_annotate_images(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running operation. - - The result type for the operation will be + An object representing a long-running + operation. + The result type for the operation will + be :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse` - Response to an async batch image annotation request. + Response to an async batch image + annotation request. """ # Create or coerce a protobuf request object. @@ -675,11 +676,12 @@ async def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` + r"""Run asynchronous image detection and annotation for a + list of generic files, such as PDF files, which may + contain multiple pages and multiple images per page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -734,11 +736,13 @@ async def sample_async_batch_annotate_files(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running operation. - - The result type for the operation will be + An object representing a long-running + operation. + The result type for the operation will + be :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py index bd2be3894228..326f8a7945db 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py @@ -989,17 +989,16 @@ def async_batch_annotate_images( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Run asynchronous image detection and annotation for a list of - images. - + r"""Run asynchronous image detection and annotation for a + list of images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + This service will write image annotation outputs to json + files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -1059,11 +1058,13 @@ def sample_async_batch_annotate_images(): Returns: google.api_core.operation.Operation: - An object representing a long-running operation. - - The result type for the operation will be + An object representing a long-running + operation. + The result type for the operation will + be :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse` - Response to an async batch image annotation request. + Response to an async batch image + annotation request. """ # Create or coerce a protobuf request object. @@ -1131,11 +1132,12 @@ def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` + r"""Run asynchronous image detection and annotation for a + list of generic files, such as PDF files, which may + contain multiple pages and multiple images per page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -1190,11 +1192,13 @@ def sample_async_batch_annotate_files(): Returns: google.api_core.operation.Operation: - An object representing a long-running operation. - - The result type for the operation will be + An object representing a long-running + operation. + The result type for the operation will + be :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/base.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/base.py index 3534da170b88..1d8c3375cd15 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/base.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/base.py @@ -86,8 +86,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -102,11 +100,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) elif credentials is None and not self._ignore_credentials: credentials, _ = google.auth.default( - **scopes_kwargs, quota_project_id=quota_project_id + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) # Don't apply audience if the credentials file passed from user. if hasattr(credentials, "with_gdch_audience"): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py index 3a4e2ca1115e..5f8203609a18 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py @@ -417,17 +417,16 @@ def async_batch_annotate_images( ]: r"""Return a callable for the async batch annotate images method over gRPC. - Run asynchronous image detection and annotation for a list of - images. - + Run asynchronous image detection and annotation for a + list of images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + This service will write image annotation outputs to json + files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -458,11 +457,12 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` + Run asynchronous image detection and annotation for a + list of generic files, such as PDF files, which may + contain multiple pages and multiple images per page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py index f78715e6006e..c220c12390a5 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py @@ -426,17 +426,16 @@ def async_batch_annotate_images( ]: r"""Return a callable for the async batch annotate images method over gRPC. - Run asynchronous image detection and annotation for a list of - images. - + Run asynchronous image detection and annotation for a + list of images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + This service will write image annotation outputs to json + files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -468,11 +467,12 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` + Run asynchronous image detection and annotation for a + list of generic files, such as PDF files, which may + contain multiple pages and multiple images per page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py index 25cfb5dfc83e..311c7f8ae063 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py @@ -73,20 +73,21 @@ class ProductSearchAsyncClient: product search. It uses the following resource model: - The API has a collection of - [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, - named ``projects/*/locations/*/productSets/*``, which acts as a - way to put different products into groups to limit identification. + `ProductSet `__ + resources, named ``projects/*/locations/*/productSets/*``, which + acts as a way to put different products into groups to limit + identification. In parallel, - The API has a collection of - [Product][google.cloud.vision.v1p4beta1.Product] resources, named - ``projects/*/locations/*/products/*`` + `Product `__ resources, + named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p4beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] - resources, named + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` """ @@ -336,8 +337,8 @@ async def create_product_set( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, + or is longer than 4096 characters. .. code-block:: python @@ -367,12 +368,13 @@ async def sample_create_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.CreateProductSetRequest, dict]]): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the + ``CreateProductSet`` method. parent (:class:`str`): - Required. The project in which the ProductSet should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + ProductSet should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -383,11 +385,14 @@ async def sample_create_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_set_id (:class:`str`): - A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for this + ProductSet. If set, the server will + attempt to use this value as the + resource id. If it is already in use, an + error is returned with code + ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the + character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -477,8 +482,8 @@ async def list_product_sets( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100, or less than 1. .. code-block:: python @@ -509,12 +514,13 @@ async def sample_list_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListProductSetsRequest, dict]]): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the + ``ListProductSets`` method. parent (:class:`str`): - Required. The project from which ProductSets should be - listed. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which + ProductSets should be listed. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -529,10 +535,11 @@ async def sample_list_product_sets(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductSetsAsyncPager: - Response message for the ListProductSets method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProductSets`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -610,7 +617,7 @@ async def get_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. .. code-block:: python @@ -640,11 +647,13 @@ async def sample_get_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.GetProductSetRequest, dict]]): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the + ``GetProductSet`` method. name (:class:`str`): - Required. Resource name of the ProductSet to get. - + Required. Resource name of the + ProductSet to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -728,15 +737,15 @@ async def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. Only display_name can be - updated currently. + r"""Makes changes to a ProductSet resource. + Only display_name can be updated currently. Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer + than 4096 characters. .. code-block:: python @@ -765,7 +774,8 @@ async def sample_update_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.UpdateProductSetRequest, dict]]): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the + ``UpdateProductSet`` method. product_set (:class:`google.cloud.vision_v1p4beta1.types.ProductSet`): Required. The ProductSet resource which replaces the one on the server. @@ -774,10 +784,12 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask + `__ that + specifies which fields to update. If + update_mask isn't specified, all mutable + fields are to be updated. Valid mask + path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -894,11 +906,13 @@ async def sample_delete_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.DeleteProductSetRequest, dict]]): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the + ``DeleteProductSet`` method. name (:class:`str`): - Required. Resource name of the ProductSet to delete. - + Required. Resource name of the + ProductSet to delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -975,12 +989,12 @@ async def create_product( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - - Returns INVALID_ARGUMENT if product_category is missing or - invalid. + * Returns INVALID_ARGUMENT if display_name is missing or + longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than + 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. .. code-block:: python @@ -1010,12 +1024,13 @@ async def sample_create_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.CreateProductRequest, dict]]): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the + ``CreateProduct`` method. parent (:class:`str`): - Required. The project in which the Product should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + Product should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1026,11 +1041,13 @@ async def sample_create_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_id (:class:`str`): - A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for this + Product. If set, the server will attempt + to use this value as the resource id. If + it is already in use, an error is + returned with code ALREADY_EXISTS. Must + be at most 128 characters long. It + cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1115,8 +1132,8 @@ async def list_products( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. .. code-block:: python @@ -1147,12 +1164,14 @@ async def sample_list_products(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListProductsRequest, dict]]): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the ``ListProducts`` + method. parent (:class:`str`): - Required. The project OR ProductSet from which Products - should be listed. + Required. The project OR ProductSet from + which Products should be listed. + Format: - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1167,10 +1186,11 @@ async def sample_list_products(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsAsyncPager: - Response message for the ListProducts method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProducts`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -1246,7 +1266,7 @@ async def get_product( Possible errors: - - Returns NOT_FOUND if the Product does not exist. + * Returns NOT_FOUND if the Product does not exist. .. code-block:: python @@ -1276,11 +1296,13 @@ async def sample_get_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.GetProductRequest, dict]]): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the ``GetProduct`` + method. name (:class:`str`): - Required. Resource name of the Product to get. - + Required. Resource name of the Product + to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field @@ -1359,22 +1381,25 @@ async def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + r"""Makes changes to a Product resource. + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. - If labels are updated, the change will not be reflected in - queries until the next index time. + If labels are updated, the change will not be reflected + in queries until the next index time. Possible errors: - - Returns NOT_FOUND if the Product does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - - Returns INVALID_ARGUMENT if product_category is present in - update_mask. + * Returns NOT_FOUND if the Product does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is + present in update_mask. .. code-block:: python @@ -1403,7 +1428,8 @@ async def sample_update_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.UpdateProductRequest, dict]]): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the + ``UpdateProduct`` method. product (:class:`google.cloud.vision_v1p4beta1.types.Product`): Required. The Product resource which replaces the one on the server. @@ -1413,11 +1439,13 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, - and ``description``. + The `FieldMask + `__ that + specifies which fields to update. If + update_mask isn't specified, all mutable + fields are to be updated. Valid mask + paths include ``product_labels``, + ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1530,11 +1558,13 @@ async def sample_delete_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.DeleteProductRequest, dict]]): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the + ``DeleteProduct`` method. name (:class:`str`): - Required. Resource name of product to delete. - + Required. Resource name of product to + delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field @@ -1609,26 +1639,29 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If + ``bounding_poly`` is not specified, the system will try + to detect regions of interest in the image that are + compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the + image resolution is too large to process (above 50MP). Possible errors: - - Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if the product does not exist. - - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - - Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing + or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not + exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent + product's product_category is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains + more than 10 polygons. .. code-block:: python @@ -1662,10 +1695,11 @@ async def sample_create_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.CreateReferenceImageRequest, dict]]): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the + ``CreateReferenceImage`` method. parent (:class:`str`): - Required. Resource name of the product in which to - create the reference image. + Required. Resource name of the product + in which to create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -1682,11 +1716,14 @@ async def sample_create_reference_image(): on the ``request`` instance; if ``request`` is provided, this should not be set. reference_image_id (:class:`str`): - A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for the + ReferenceImage to be added. If set, the + server will attempt to use this value as + the resource id. If it is already in + use, an error is returned with code + ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the + character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1701,8 +1738,9 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A ReferenceImage represents a product image and its associated metadata, - such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1803,11 +1841,11 @@ async def sample_delete_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.DeleteReferenceImageRequest, dict]]): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the + ``DeleteReferenceImage`` method. name (:class:`str`): - Required. The resource name of the reference image to - delete. - + Required. The resource name of the + reference image to delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -1884,9 +1922,9 @@ async def list_reference_images( Possible errors: - - Returns NOT_FOUND if the parent product does not exist. - - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not + exist. * Returns INVALID_ARGUMENT if the page_size is + greater than 100, or less than 1. .. code-block:: python @@ -1917,11 +1955,11 @@ async def sample_list_reference_images(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListReferenceImagesRequest, dict]]): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the + ``ListReferenceImages`` method. parent (:class:`str`): - Required. Resource name of the product containing the - reference images. - + Required. Resource name of the product + containing the reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -1938,10 +1976,11 @@ async def sample_list_reference_images(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListReferenceImagesAsyncPager: - Response message for the ListReferenceImages method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListReferenceImages`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -2019,7 +2058,8 @@ async def get_reference_image( Possible errors: - - Returns NOT_FOUND if the specified image does not exist. + * Returns NOT_FOUND if the specified image does not + exist. .. code-block:: python @@ -2049,11 +2089,11 @@ async def sample_get_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.GetReferenceImageRequest, dict]]): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the + ``GetReferenceImage`` method. name (:class:`str`): - Required. The resource name of the ReferenceImage to - get. - + Required. The resource name of the + ReferenceImage to get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -2071,8 +2111,9 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A ReferenceImage represents a product image and its associated metadata, - such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2136,15 +2177,15 @@ async def add_product_to_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: - r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + r"""Adds a Product to the specified ProductSet. If the + Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - - Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + * Returns NOT_FOUND if the Product or the ProductSet + doesn't exist. .. code-block:: python @@ -2172,23 +2213,23 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the + ``AddProductToProductSet`` method. name (:class:`str`): - Required. The resource name for the ProductSet to - modify. - + Required. The resource name for the + ProductSet to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): - Required. The resource name for the Product to be added - to this ProductSet. - + Required. The resource name for the + Product to be added to this ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field @@ -2292,23 +2333,25 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the + ``RemoveProductFromProductSet`` method. name (:class:`str`): - Required. The resource name for the ProductSet to - modify. - + Required. The resource name for the + ProductSet to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): - Required. The resource name for the Product to be - removed from this ProductSet. + Required. The resource name for the + Product to be removed from this + ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field @@ -2383,14 +2426,14 @@ async def list_products_in_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: - r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + r"""Lists the Products in a ProductSet, in an unspecified + order. If the ProductSet does not exist, the products + field of the response will be empty. Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. .. code-block:: python @@ -2421,13 +2464,13 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the + ``ListProductsInProductSet`` method. name (:class:`str`): - Required. The ProductSet resource for which to retrieve - Products. - + Required. The ProductSet resource for + which to retrieve Products. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -2443,11 +2486,11 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the ListProductsInProductSet - method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProductsInProductSet`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -2526,18 +2569,22 @@ async def import_product_sets( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` - contains ``ImportProductSetsResponse``. (results) + r"""Asynchronous API that imports a list of reference images + to specified product sets based on a list of image + information. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains + ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. + The input source of this method is a csv file on Google + Cloud Storage. For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri + `__. .. code-block:: python @@ -2571,12 +2618,13 @@ async def sample_import_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ImportProductSetsRequest, dict]]): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the + ``ImportProductSets`` method. parent (:class:`str`): - Required. The project in which the ProductSets should be - imported. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + ProductSets should be imported. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2598,17 +2646,21 @@ async def sample_import_product_sets(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running operation. - - The result type for the operation will be - :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse` - Response message for the ImportProductSets method. - - This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] - method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field. + An object representing a long-running + operation. + The result type for the operation will + be + :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` + Response message for the + ``ImportProductSets` method. + + This message is returned by the + `google.longrunning.Operations.GetOperation + `__ + method in the returned + `google.longrunning.Operation.response + `__ + field. """ # Create or coerce a protobuf request object. @@ -2681,32 +2733,36 @@ async def purge_products( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + r"""Asynchronous API to delete all Products in a ProductSet + or all Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + If a Product is a member of the specified ProductSet in + addition to other ProductSets, the Product will still be + deleted. - It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + It is recommended to not delete the specified ProductSet + until after this operation has completed. It is also + recommended to not add any of the Products involved in + the batch delete to a new ProductSet while this + operation is running because those Products may still + end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. - - If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains + Therefore, it is recommended to keep the csv files used + in ImportProductSets (if that was how you originally + built the Product Set) before starting PurgeProducts, in + case you need to re-import the data after deletion. + + If the plan is to purge all of the Products from a + ProductSet and then re-use the empty ProductSet to + re-import new Products into the empty ProductSet, you + must wait until the PurgeProducts operation has finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -2741,12 +2797,13 @@ async def sample_purge_products(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.PurgeProductsRequest, dict]]): - The request object. Request message for the ``PurgeProducts`` method. + The request object. Request message for the + ``PurgeProducts`` method. parent (:class:`str`): - Required. The project and location in which the Products - should be deleted. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project and location in + which the Products should be deleted. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2761,18 +2818,21 @@ async def sample_purge_products(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running operation. - - The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated - empty messages in your APIs. A typical example is to - use it as the request or the response type of an API - method. For instance: - - service Foo { - rpc Bar(google.protobuf.Empty) returns - (google.protobuf.Empty); - - } + An object representing a long-running + operation. + The result type for the operation will + be + :class:`google.protobuf.empty_pb2.Empty` + A generic empty message that you can + re-use to avoid defining duplicated + empty messages in your APIs. A typical + example is to use it as the request or + the response type of an API method. For + instance: + + service Foo { + rpc Bar(google.protobuf.Empty) + returns (google.protobuf.Empty); } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py index c34d87387b68..b609dab086ea 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py @@ -117,20 +117,21 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): product search. It uses the following resource model: - The API has a collection of - [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, - named ``projects/*/locations/*/productSets/*``, which acts as a - way to put different products into groups to limit identification. + `ProductSet `__ + resources, named ``projects/*/locations/*/productSets/*``, which + acts as a way to put different products into groups to limit + identification. In parallel, - The API has a collection of - [Product][google.cloud.vision.v1p4beta1.Product] resources, named - ``projects/*/locations/*/products/*`` + `Product `__ resources, + named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p4beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] - resources, named + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` """ @@ -817,8 +818,8 @@ def create_product_set( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, + or is longer than 4096 characters. .. code-block:: python @@ -848,12 +849,13 @@ def sample_create_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.CreateProductSetRequest, dict]): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the + ``CreateProductSet`` method. parent (str): - Required. The project in which the ProductSet should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + ProductSet should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -864,11 +866,14 @@ def sample_create_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_set_id (str): - A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for this + ProductSet. If set, the server will + attempt to use this value as the + resource id. If it is already in use, an + error is returned with code + ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the + character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -955,8 +960,8 @@ def list_product_sets( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100, or less than 1. .. code-block:: python @@ -987,12 +992,13 @@ def sample_list_product_sets(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListProductSetsRequest, dict]): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the + ``ListProductSets`` method. parent (str): - Required. The project from which ProductSets should be - listed. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which + ProductSets should be listed. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1007,10 +1013,11 @@ def sample_list_product_sets(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductSetsPager: - Response message for the ListProductSets method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProductSets`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -1085,7 +1092,7 @@ def get_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. .. code-block:: python @@ -1115,11 +1122,13 @@ def sample_get_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.GetProductSetRequest, dict]): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the + ``GetProductSet`` method. name (str): - Required. Resource name of the ProductSet to get. - + Required. Resource name of the + ProductSet to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -1200,15 +1209,15 @@ def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. Only display_name can be - updated currently. + r"""Makes changes to a ProductSet resource. + Only display_name can be updated currently. Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer + than 4096 characters. .. code-block:: python @@ -1237,7 +1246,8 @@ def sample_update_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.UpdateProductSetRequest, dict]): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the + ``UpdateProductSet`` method. product_set (google.cloud.vision_v1p4beta1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. @@ -1246,10 +1256,12 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask + `__ that + specifies which fields to update. If + update_mask isn't specified, all mutable + fields are to be updated. Valid mask + path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1363,11 +1375,13 @@ def sample_delete_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.DeleteProductSetRequest, dict]): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the + ``DeleteProductSet`` method. name (str): - Required. Resource name of the ProductSet to delete. - + Required. Resource name of the + ProductSet to delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -1441,12 +1455,12 @@ def create_product( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - - Returns INVALID_ARGUMENT if product_category is missing or - invalid. + * Returns INVALID_ARGUMENT if display_name is missing or + longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than + 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. .. code-block:: python @@ -1476,12 +1490,13 @@ def sample_create_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.CreateProductRequest, dict]): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the + ``CreateProduct`` method. parent (str): - Required. The project in which the Product should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + Product should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1492,11 +1507,13 @@ def sample_create_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_id (str): - A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for this + Product. If set, the server will attempt + to use this value as the resource id. If + it is already in use, an error is + returned with code ALREADY_EXISTS. Must + be at most 128 characters long. It + cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1578,8 +1595,8 @@ def list_products( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. .. code-block:: python @@ -1610,12 +1627,14 @@ def sample_list_products(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListProductsRequest, dict]): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the ``ListProducts`` + method. parent (str): - Required. The project OR ProductSet from which Products - should be listed. + Required. The project OR ProductSet from + which Products should be listed. + Format: - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1630,10 +1649,11 @@ def sample_list_products(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsPager: - Response message for the ListProducts method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProducts`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -1706,7 +1726,7 @@ def get_product( Possible errors: - - Returns NOT_FOUND if the Product does not exist. + * Returns NOT_FOUND if the Product does not exist. .. code-block:: python @@ -1736,11 +1756,13 @@ def sample_get_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.GetProductRequest, dict]): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the ``GetProduct`` + method. name (str): - Required. Resource name of the Product to get. - + Required. Resource name of the Product + to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field @@ -1816,22 +1838,25 @@ def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + r"""Makes changes to a Product resource. + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. - If labels are updated, the change will not be reflected in - queries until the next index time. + If labels are updated, the change will not be reflected + in queries until the next index time. Possible errors: - - Returns NOT_FOUND if the Product does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - - Returns INVALID_ARGUMENT if product_category is present in - update_mask. + * Returns NOT_FOUND if the Product does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is + present in update_mask. .. code-block:: python @@ -1860,7 +1885,8 @@ def sample_update_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.UpdateProductRequest, dict]): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the + ``UpdateProduct`` method. product (google.cloud.vision_v1p4beta1.types.Product): Required. The Product resource which replaces the one on the server. @@ -1870,11 +1896,13 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, - and ``description``. + The `FieldMask + `__ that + specifies which fields to update. If + update_mask isn't specified, all mutable + fields are to be updated. Valid mask + paths include ``product_labels``, + ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1984,11 +2012,13 @@ def sample_delete_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.DeleteProductRequest, dict]): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the + ``DeleteProduct`` method. name (str): - Required. Resource name of product to delete. - + Required. Resource name of product to + delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field @@ -2060,26 +2090,29 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If + ``bounding_poly`` is not specified, the system will try + to detect regions of interest in the image that are + compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the + image resolution is too large to process (above 50MP). Possible errors: - - Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if the product does not exist. - - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - - Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing + or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not + exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent + product's product_category is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains + more than 10 polygons. .. code-block:: python @@ -2113,10 +2146,11 @@ def sample_create_reference_image(): Args: request (Union[google.cloud.vision_v1p4beta1.types.CreateReferenceImageRequest, dict]): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the + ``CreateReferenceImage`` method. parent (str): - Required. Resource name of the product in which to - create the reference image. + Required. Resource name of the product + in which to create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -2133,11 +2167,14 @@ def sample_create_reference_image(): on the ``request`` instance; if ``request`` is provided, this should not be set. reference_image_id (str): - A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for the + ReferenceImage to be added. If set, the + server will attempt to use this value as + the resource id. If it is already in + use, an error is returned with code + ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the + character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2152,8 +2189,9 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A ReferenceImage represents a product image and its associated metadata, - such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2251,11 +2289,11 @@ def sample_delete_reference_image(): Args: request (Union[google.cloud.vision_v1p4beta1.types.DeleteReferenceImageRequest, dict]): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the + ``DeleteReferenceImage`` method. name (str): - Required. The resource name of the reference image to - delete. - + Required. The resource name of the + reference image to delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -2329,9 +2367,9 @@ def list_reference_images( Possible errors: - - Returns NOT_FOUND if the parent product does not exist. - - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not + exist. * Returns INVALID_ARGUMENT if the page_size is + greater than 100, or less than 1. .. code-block:: python @@ -2362,11 +2400,11 @@ def sample_list_reference_images(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListReferenceImagesRequest, dict]): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the + ``ListReferenceImages`` method. parent (str): - Required. Resource name of the product containing the - reference images. - + Required. Resource name of the product + containing the reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -2383,10 +2421,11 @@ def sample_list_reference_images(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListReferenceImagesPager: - Response message for the ListReferenceImages method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListReferenceImages`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -2461,7 +2500,8 @@ def get_reference_image( Possible errors: - - Returns NOT_FOUND if the specified image does not exist. + * Returns NOT_FOUND if the specified image does not + exist. .. code-block:: python @@ -2491,11 +2531,11 @@ def sample_get_reference_image(): Args: request (Union[google.cloud.vision_v1p4beta1.types.GetReferenceImageRequest, dict]): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the + ``GetReferenceImage`` method. name (str): - Required. The resource name of the ReferenceImage to - get. - + Required. The resource name of the + ReferenceImage to get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -2513,8 +2553,9 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A ReferenceImage represents a product image and its associated metadata, - such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2575,15 +2616,15 @@ def add_product_to_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: - r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + r"""Adds a Product to the specified ProductSet. If the + Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - - Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + * Returns NOT_FOUND if the Product or the ProductSet + doesn't exist. .. code-block:: python @@ -2611,23 +2652,23 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the + ``AddProductToProductSet`` method. name (str): - Required. The resource name for the ProductSet to - modify. - + Required. The resource name for the + ProductSet to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): - Required. The resource name for the Product to be added - to this ProductSet. - + Required. The resource name for the + Product to be added to this ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field @@ -2730,23 +2771,25 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the + ``RemoveProductFromProductSet`` method. name (str): - Required. The resource name for the ProductSet to - modify. - + Required. The resource name for the + ProductSet to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): - Required. The resource name for the Product to be - removed from this ProductSet. + Required. The resource name for the + Product to be removed from this + ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field @@ -2820,14 +2863,14 @@ def list_products_in_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: - r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + r"""Lists the Products in a ProductSet, in an unspecified + order. If the ProductSet does not exist, the products + field of the response will be empty. Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. .. code-block:: python @@ -2858,13 +2901,13 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the + ``ListProductsInProductSet`` method. name (str): - Required. The ProductSet resource for which to retrieve - Products. - + Required. The ProductSet resource for + which to retrieve Products. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field @@ -2880,11 +2923,11 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the ListProductsInProductSet - method. - - Iterating over this object will yield results and - resolve additional pages automatically. + Response message for the + ``ListProductsInProductSet`` method. + Iterating over this object will yield + results and resolve additional pages + automatically. """ # Create or coerce a protobuf request object. @@ -2962,18 +3005,22 @@ def import_product_sets( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` - contains ``ImportProductSetsResponse``. (results) + r"""Asynchronous API that imports a list of reference images + to specified product sets based on a list of image + information. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains + ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. + The input source of this method is a csv file on Google + Cloud Storage. For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri + `__. .. code-block:: python @@ -3007,12 +3054,13 @@ def sample_import_product_sets(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ImportProductSetsRequest, dict]): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the + ``ImportProductSets`` method. parent (str): - Required. The project in which the ProductSets should be - imported. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the + ProductSets should be imported. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3034,17 +3082,21 @@ def sample_import_product_sets(): Returns: google.api_core.operation.Operation: - An object representing a long-running operation. - - The result type for the operation will be - :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse` - Response message for the ImportProductSets method. - - This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] - method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field. + An object representing a long-running + operation. + The result type for the operation will + be + :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` + Response message for the + ``ImportProductSets` method. + + This message is returned by the + `google.longrunning.Operations.GetOperation + `__ + method in the returned + `google.longrunning.Operation.response + `__ + field. """ # Create or coerce a protobuf request object. @@ -3114,32 +3166,36 @@ def purge_products( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + r"""Asynchronous API to delete all Products in a ProductSet + or all Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + If a Product is a member of the specified ProductSet in + addition to other ProductSets, the Product will still be + deleted. - It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + It is recommended to not delete the specified ProductSet + until after this operation has completed. It is also + recommended to not add any of the Products involved in + the batch delete to a new ProductSet while this + operation is running because those Products may still + end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. - - If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains + Therefore, it is recommended to keep the csv files used + in ImportProductSets (if that was how you originally + built the Product Set) before starting PurgeProducts, in + case you need to re-import the data after deletion. + + If the plan is to purge all of the Products from a + ProductSet and then re-use the empty ProductSet to + re-import new Products into the empty ProductSet, you + must wait until the PurgeProducts operation has finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -3174,12 +3230,13 @@ def sample_purge_products(): Args: request (Union[google.cloud.vision_v1p4beta1.types.PurgeProductsRequest, dict]): - The request object. Request message for the ``PurgeProducts`` method. + The request object. Request message for the + ``PurgeProducts`` method. parent (str): - Required. The project and location in which the Products - should be deleted. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project and location in + which the Products should be deleted. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3194,18 +3251,21 @@ def sample_purge_products(): Returns: google.api_core.operation.Operation: - An object representing a long-running operation. - - The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated - empty messages in your APIs. A typical example is to - use it as the request or the response type of an API - method. For instance: - - service Foo { - rpc Bar(google.protobuf.Empty) returns - (google.protobuf.Empty); - - } + An object representing a long-running + operation. + The result type for the operation will + be + :class:`google.protobuf.empty_pb2.Empty` + A generic empty message that you can + re-use to avoid defining duplicated + empty messages in your APIs. A typical + example is to use it as the request or + the response type of an API method. For + instance: + + service Foo { + rpc Bar(google.protobuf.Empty) + returns (google.protobuf.Empty); } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/base.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/base.py index 64ce1bc97cbd..7e02477a5895 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/base.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/base.py @@ -87,8 +87,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -103,11 +101,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) elif credentials is None and not self._ignore_credentials: credentials, _ = google.auth.default( - **scopes_kwargs, quota_project_id=quota_project_id + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) # Don't apply audience if the credentials file passed from user. if hasattr(credentials, "with_gdch_audience"): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py index 452d930a604c..4095d72e6632 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py @@ -116,20 +116,21 @@ class ProductSearchGrpcTransport(ProductSearchTransport): product search. It uses the following resource model: - The API has a collection of - [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, - named ``projects/*/locations/*/productSets/*``, which acts as a - way to put different products into groups to limit identification. + `ProductSet `__ + resources, named ``projects/*/locations/*/productSets/*``, which + acts as a way to put different products into groups to limit + identification. In parallel, - The API has a collection of - [Product][google.cloud.vision.v1p4beta1.Product] resources, named - ``projects/*/locations/*/products/*`` + `Product `__ resources, + named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p4beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] - resources, named + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -371,8 +372,8 @@ def create_product_set( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, + or is longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -405,8 +406,8 @@ def list_product_sets( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100, or less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -438,7 +439,7 @@ def get_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. Returns: Callable[[~.GetProductSetRequest], @@ -467,15 +468,15 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. Only display_name can be - updated currently. + Makes changes to a ProductSet resource. + Only display_name can be updated currently. Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer + than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -537,12 +538,12 @@ def create_product( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - - Returns INVALID_ARGUMENT if product_category is missing or - invalid. + * Returns INVALID_ARGUMENT if display_name is missing or + longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than + 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -575,8 +576,8 @@ def list_products( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. Returns: Callable[[~.ListProductsRequest], @@ -608,7 +609,7 @@ def get_product( Possible errors: - - Returns NOT_FOUND if the Product does not exist. + * Returns NOT_FOUND if the Product does not exist. Returns: Callable[[~.GetProductRequest], @@ -636,22 +637,25 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + Makes changes to a Product resource. + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. - If labels are updated, the change will not be reflected in - queries until the next index time. + If labels are updated, the change will not be reflected + in queries until the next index time. Possible errors: - - Returns NOT_FOUND if the Product does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - - Returns INVALID_ARGUMENT if product_category is present in - update_mask. + * Returns NOT_FOUND if the Product does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is + present in update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -713,26 +717,29 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If + ``bounding_poly`` is not specified, the system will try + to detect regions of interest in the image that are + compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the + image resolution is too large to process (above 50MP). Possible errors: - - Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if the product does not exist. - - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - - Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing + or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not + exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent + product's product_category is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains + more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -800,9 +807,9 @@ def list_reference_images( Possible errors: - - Returns NOT_FOUND if the parent product does not exist. - - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not + exist. * Returns INVALID_ARGUMENT if the page_size is + greater than 100, or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -835,7 +842,8 @@ def get_reference_image( Possible errors: - - Returns NOT_FOUND if the specified image does not exist. + * Returns NOT_FOUND if the specified image does not + exist. Returns: Callable[[~.GetReferenceImageRequest], @@ -863,15 +871,15 @@ def add_product_to_product_set( ]: r"""Return a callable for the add product to product set method over gRPC. - Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + Adds a Product to the specified ProductSet. If the + Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - - Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + * Returns NOT_FOUND if the Product or the ProductSet + doesn't exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -933,14 +941,14 @@ def list_products_in_product_set( ]: r"""Return a callable for the list products in product set method over gRPC. - Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + Lists the Products in a ProductSet, in an unspecified + order. If the ProductSet does not exist, the products + field of the response will be empty. Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -970,18 +978,22 @@ def import_product_sets( ]: r"""Return a callable for the import product sets method over gRPC. - Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + Asynchronous API that imports a list of reference images + to specified product sets based on a list of image + information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` - contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains + ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. + The input source of this method is a csv file on Google + Cloud Storage. For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri + `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1009,32 +1021,36 @@ def purge_products( ]: r"""Return a callable for the purge products method over gRPC. - Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Asynchronous API to delete all Products in a ProductSet + or all Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + If a Product is a member of the specified ProductSet in + addition to other ProductSets, the Product will still be + deleted. - It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + It is recommended to not delete the specified ProductSet + until after this operation has completed. It is also + recommended to not add any of the Products involved in + the batch delete to a new ProductSet while this + operation is running because those Products may still + end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. - - If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains + Therefore, it is recommended to keep the csv files used + in ImportProductSets (if that was how you originally + built the Product Set) before starting PurgeProducts, in + case you need to re-import the data after deletion. + + If the plan is to purge all of the Products from a + ProductSet and then re-use the empty ProductSet to + re-import new Products into the empty ProductSet, you + must wait until the PurgeProducts operation has finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py index 16ae1eac3171..4d4c061198e9 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py @@ -122,20 +122,21 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): product search. It uses the following resource model: - The API has a collection of - [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, - named ``projects/*/locations/*/productSets/*``, which acts as a - way to put different products into groups to limit identification. + `ProductSet `__ + resources, named ``projects/*/locations/*/productSets/*``, which + acts as a way to put different products into groups to limit + identification. In parallel, - The API has a collection of - [Product][google.cloud.vision.v1p4beta1.Product] resources, named - ``projects/*/locations/*/products/*`` + `Product `__ resources, + named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p4beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] - resources, named + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -379,8 +380,8 @@ def create_product_set( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, + or is longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -413,8 +414,8 @@ def list_product_sets( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100, or less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -447,7 +448,7 @@ def get_product_set( Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. + * Returns NOT_FOUND if the ProductSet does not exist. Returns: Callable[[~.GetProductSetRequest], @@ -476,15 +477,15 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. Only display_name can be - updated currently. + Makes changes to a ProductSet resource. + Only display_name can be updated currently. Possible errors: - - Returns NOT_FOUND if the ProductSet does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer + than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -549,12 +550,12 @@ def create_product( Possible errors: - - Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - - Returns INVALID_ARGUMENT if product_category is missing or - invalid. + * Returns INVALID_ARGUMENT if display_name is missing or + longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than + 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -587,8 +588,8 @@ def list_products( Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. Returns: Callable[[~.ListProductsRequest], @@ -621,7 +622,7 @@ def get_product( Possible errors: - - Returns NOT_FOUND if the Product does not exist. + * Returns NOT_FOUND if the Product does not exist. Returns: Callable[[~.GetProductRequest], @@ -650,22 +651,25 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + Makes changes to a Product resource. + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. - If labels are updated, the change will not be reflected in - queries until the next index time. + If labels are updated, the change will not be reflected + in queries until the next index time. Possible errors: - - Returns NOT_FOUND if the Product does not exist. - - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - - Returns INVALID_ARGUMENT if product_category is present in - update_mask. + * Returns NOT_FOUND if the Product does not exist. * + Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is + present in update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -729,26 +733,29 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If + ``bounding_poly`` is not specified, the system will try + to detect regions of interest in the image that are + compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the + image resolution is too large to process (above 50MP). Possible errors: - - Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - - Returns INVALID_ARGUMENT if the product does not exist. - - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - - Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing + or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not + exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent + product's product_category is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains + more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -816,9 +823,9 @@ def list_reference_images( Possible errors: - - Returns NOT_FOUND if the parent product does not exist. - - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not + exist. * Returns INVALID_ARGUMENT if the page_size is + greater than 100, or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -851,7 +858,8 @@ def get_reference_image( Possible errors: - - Returns NOT_FOUND if the specified image does not exist. + * Returns NOT_FOUND if the specified image does not + exist. Returns: Callable[[~.GetReferenceImageRequest], @@ -880,15 +888,15 @@ def add_product_to_product_set( ]: r"""Return a callable for the add product to product set method over gRPC. - Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + Adds a Product to the specified ProductSet. If the + Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - - Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + * Returns NOT_FOUND if the Product or the ProductSet + doesn't exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -951,14 +959,14 @@ def list_products_in_product_set( ]: r"""Return a callable for the list products in product set method over gRPC. - Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + Lists the Products in a ProductSet, in an unspecified + order. If the ProductSet does not exist, the products + field of the response will be empty. Possible errors: - - Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than + 100 or less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -989,18 +997,22 @@ def import_product_sets( ]: r"""Return a callable for the import product sets method over gRPC. - Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + Asynchronous API that imports a list of reference images + to specified product sets based on a list of image + information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` - contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains + ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. + The input source of this method is a csv file on Google + Cloud Storage. For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri + `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1029,32 +1041,36 @@ def purge_products( ]: r"""Return a callable for the purge products method over gRPC. - Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Asynchronous API to delete all Products in a ProductSet + or all Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + If a Product is a member of the specified ProductSet in + addition to other ProductSets, the Product will still be + deleted. - It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + It is recommended to not delete the specified ProductSet + until after this operation has completed. It is also + recommended to not add any of the Products involved in + the batch delete to a new ProductSet while this + operation is running because those Products may still + end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. - - If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. ``Operation.metadata`` contains + Therefore, it is recommended to keep the csv files used + in ImportProductSets (if that was how you originally + built the Product Set) before starting PurgeProducts, in + case you need to re-import the data after deletion. + + If the plan is to purge all of the Products from a + ProductSet and then re-use the empty ProductSet to + re-import new Products into the empty ProductSet, you + must wait until the PurgeProducts operation has finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be used to + keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py index af54bbc62247..778acacac9fe 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py @@ -1010,20 +1010,21 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): product search. It uses the following resource model: - The API has a collection of - [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, - named ``projects/*/locations/*/productSets/*``, which acts as a - way to put different products into groups to limit identification. + `ProductSet `__ + resources, named ``projects/*/locations/*/productSets/*``, which + acts as a way to put different products into groups to limit + identification. In parallel, - The API has a collection of - [Product][google.cloud.vision.v1p4beta1.Product] resources, named - ``projects/*/locations/*/products/*`` + `Product `__ resources, + named ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p4beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] - resources, named + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -1172,8 +1173,8 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the + ``AddProductToProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1287,7 +1288,8 @@ def __call__( Args: request (~.product_search_service.CreateProductRequest): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the + ``CreateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1437,7 +1439,8 @@ def __call__( Args: request (~.product_search_service.CreateProductSetRequest): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the + ``CreateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1596,7 +1599,8 @@ def __call__( Args: request (~.product_search_service.CreateReferenceImageRequest): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the + ``CreateReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1607,8 +1611,9 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ @@ -1751,7 +1756,8 @@ def __call__( Args: request (~.product_search_service.DeleteProductRequest): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the + ``DeleteProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1857,7 +1863,8 @@ def __call__( Args: request (~.product_search_service.DeleteProductSetRequest): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the + ``DeleteProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1965,7 +1972,8 @@ def __call__( Args: request (~.product_search_service.DeleteReferenceImageRequest): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the + ``DeleteReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2073,7 +2081,8 @@ def __call__( Args: request (~.product_search_service.GetProductRequest): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the ``GetProduct`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2221,7 +2230,8 @@ def __call__( Args: request (~.product_search_service.GetProductSetRequest): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the + ``GetProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2372,7 +2382,8 @@ def __call__( Args: request (~.product_search_service.GetReferenceImageRequest): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the + ``GetReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2383,8 +2394,9 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a + product image and its associated + metadata, such as bounding boxes. """ @@ -2523,7 +2535,8 @@ def __call__( Args: request (~.product_search_service.ImportProductSetsRequest): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the + ``ImportProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2675,7 +2688,8 @@ def __call__( Args: request (~.product_search_service.ListProductsRequest): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the ``ListProducts`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2686,7 +2700,9 @@ def __call__( Returns: ~.product_search_service.ListProductsResponse: - Response message for the ``ListProducts`` method. + Response message for the + ``ListProducts`` method. + """ http_options = ( @@ -2821,7 +2837,8 @@ def __call__( Args: request (~.product_search_service.ListProductSetsRequest): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the + ``ListProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2832,7 +2849,9 @@ def __call__( Returns: ~.product_search_service.ListProductSetsResponse: - Response message for the ``ListProductSets`` method. + Response message for the + ``ListProductSets`` method. + """ http_options = ( @@ -2971,8 +2990,8 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the + ``ListProductsInProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2983,8 +3002,8 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the ``ListProductsInProductSet`` - method. + Response message for the + ``ListProductsInProductSet`` method. """ @@ -3126,7 +3145,8 @@ def __call__( Args: request (~.product_search_service.ListReferenceImagesRequest): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the + ``ListReferenceImages`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3137,7 +3157,9 @@ def __call__( Returns: ~.product_search_service.ListReferenceImagesResponse: - Response message for the ``ListReferenceImages`` method. + Response message for the + ``ListReferenceImages`` method. + """ http_options = ( @@ -3277,7 +3299,8 @@ def __call__( Args: request (~.product_search_service.PurgeProductsRequest): - The request object. Request message for the ``PurgeProducts`` method. + The request object. Request message for the + ``PurgeProducts`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3430,8 +3453,8 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the + ``RemoveProductFromProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3547,7 +3570,8 @@ def __call__( Args: request (~.product_search_service.UpdateProductRequest): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the + ``UpdateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3697,7 +3721,8 @@ def __call__( Args: request (~.product_search_service.UpdateProductSetRequest): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the + ``UpdateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py index fecbfe028373..2e2fbf8e667c 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py @@ -35,10 +35,12 @@ class FaceRecognitionParams(proto.Message): Attributes: celebrity_set (MutableSequence[str]): The resource names for one or more - [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]s. - A celebrity set is preloaded and can be specified as - "builtin/default". If this is specified, the algorithm will - try to match the faces detected in the input image to the + `CelebritySet + `__s. + A celebrity set is preloaded and can be + specified as "builtin/default". If this is + specified, the algorithm will try to match the + faces detected in the input image to the Celebrities in the CelebritySets. """ @@ -53,8 +55,8 @@ class Celebrity(proto.Message): Attributes: name (str): - The resource name of the preloaded Celebrity. Has the format - ``builtin/{mid}``. + The resource name of the preloaded Celebrity. + Has the format ``builtin/{mid}``. display_name (str): The Celebrity's display name. description (str): @@ -80,7 +82,8 @@ class FaceRecognitionResult(proto.Message): Attributes: celebrity (google.cloud.vision_v1p4beta1.types.Celebrity): - The [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] + The `Celebrity + `__ that this face was matched to. confidence (float): Recognition confidence. Range [0, 1]. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py index a0a0cf215916..2e6dbc02e437 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py @@ -105,23 +105,24 @@ class Likelihood(proto.Enum): class Feature(proto.Message): - r"""The type of Google Cloud Vision API detection to perform, and the - maximum number of results to return for that type. Multiple + r"""The type of Google Cloud Vision API detection to perform, and + the maximum number of results to return for that type. Multiple ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p4beta1.types.Feature.Type): The feature type. max_results (int): - Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. + Maximum number of results of this type. Does not + apply to ``TEXT_DETECTION``, + ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): - Model to use for the feature. Supported values: - "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" for the - bleeding edge release updated weekly. + Model to use for the feature. + Supported values: "builtin/stable" (the default + if unset) and "builtin/latest". + ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also support "builtin/weekly" + for the bleeding edge release updated weekly. """ class Type(proto.Enum): @@ -139,14 +140,15 @@ class Type(proto.Enum): LABEL_DETECTION (4): Run label detection. TEXT_DETECTION (5): - Run text detection / optical character recognition (OCR). - Text detection is optimized for areas of text within a - larger image; if the image is a document, use + Run text detection / optical character + recognition (OCR). Text detection is optimized + for areas of text within a larger image; if the + image is a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): - Run dense text document OCR. Takes precedence when both - ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are - present. + Run dense text document OCR. Takes precedence + when both ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` are present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -199,31 +201,38 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See `Google Cloud Storage Request - URIs `__ + The Google Cloud Storage URI of the form + ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google Cloud + Storage Request + URIs + `__ for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is - not supported. See `Google Cloud Storage Request - URIs `__ - for more info. - - 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from HTTP/HTTPS URLs, Google cannot guarantee that - the request will be completed. Your request may fail if - the specified host denies the request (e.g. due to - request throttling or DOS prevention), or if Google - throttles requests to the site for abuse prevention. You - should not depend on externally-hosted images for - production applications. - - When both ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes precedence. + ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google + Cloud Storage Request + URIs + `__ + for more info. + + 2. A publicly-accessible image HTTP/HTTPS URL. + When fetching images from HTTP/HTTPS + URLs, Google cannot guarantee that the + request will be completed. Your request + may fail if the specified host denies the + request (e.g. due to request throttling or + DOS prevention), or if Google throttles + requests to the site for abuse prevention. + You should not depend on + externally-hosted images for production + applications. + + When both ``gcs_image_uri`` and ``image_uri`` + are specified, ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -241,14 +250,16 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. Note: As - with all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. + Image content, represented as a stream of bytes. + Note: As with all ``bytes`` fields, protobuffers + use a pure binary representation, whereas JSON + representations use base64. source (google.cloud.vision_v1p4beta1.types.ImageSource): - Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided - for an image, ``content`` takes precedence and is used to - perform the image annotation request. + Google Cloud Storage image location, or + publicly-accessible image URL. If both + ``content`` and ``source`` are provided for an + image, ``content`` takes precedence and is used + to perform the image annotation request. """ content: bytes = proto.Field( @@ -268,35 +279,42 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): - The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale. The bounding - box is computed to "frame" the face in accordance with human - expectations. It is based on the landmarker results. Note - that one or more x and/or y coordinates may not be generated - in the ``BoundingPoly`` (the polygon will be unbounded) if - only a partial face appears in the image to be annotated. + The bounding polygon around the face. The + coordinates of the bounding box are in the + original image's scale. The bounding box is + computed to "frame" the face in accordance with + human expectations. It is based on the + landmarker results. Note that one or more x + and/or y coordinates may not be generated in the + ``BoundingPoly`` (the polygon will be unbounded) + if only a partial face appears in the image to + be annotated. fd_bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the ``boundingPoly``, and encloses only the skin part of the - face. Typically, it is used to eliminate the face from any - image analysis that detects the "amount of skin" visible in - an image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face detection) - prefix. + The ``fd_bounding_poly`` bounding polygon is + tighter than the ``boundingPoly``, and encloses + only the skin part of the face. Typically, it is + used to eliminate the face from any image + analysis that detects the "amount of skin" + visible in an image. It is not based on the + landmarker results, only on the initial face + detection, hence the fd (face + detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p4beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the face. - Range [-180,180]. + clockwise/anti-clockwise rotation of the face + relative to the image vertical about the axis + perpendicular to the face. Range [-180,180]. pan_angle (float): - Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane + Yaw angle, which indicates the + leftward/rightward angle that the face is + pointing relative to the vertical plane perpendicular to the image. Range [-180,180]. tilt_angle (float): - Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's horizontal + Pitch angle, which indicates the + upwards/downwards angle that the face is + pointing relative to the image's horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. @@ -317,14 +335,16 @@ class FaceAnnotation(proto.Message): headwear_likelihood (google.cloud.vision_v1p4beta1.types.Likelihood): Headwear likelihood. recognition_result (MutableSequence[google.cloud.vision_v1p4beta1.types.FaceRecognitionResult]): - Additional recognition information. Only computed if - image_context.face_recognition_params is provided, **and** a - match is found to a - [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] in the - input - [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]. - This field is sorted in order of decreasing confidence - values. + Additional recognition information. Only + computed if + image_context.face_recognition_params is + provided, **and** a match is found to a + `Celebrity + `__ in + the input `CelebritySet + `__. + This field is sorted in order of decreasing + confidence values. """ class Landmark(proto.Message): @@ -338,10 +358,10 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. Left and right are defined from the - vantage of the viewer of the image without considering mirror - projections typical of photos. So, ``LEFT_EYE``, typically, is the - person's right eye. + r"""Face landmark (feature) type. + Left and right are defined from the vantage of the viewer of the + image without considering mirror projections typical of photos. + So, ``LEFT_EYE``, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -588,44 +608,49 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search - API `__. + Opaque entity ID. Some IDs may be available in + `Google Knowledge Graph Search + API + `__. locale (str): - The language code for the locale in which the entity textual - ``description`` is expressed. + The language code for the locale in which the + entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its ``locale`` - language. + Entity textual description, expressed in its + ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field - represents the confidence that there is a tower in the query - image. Range [0, 1]. + **Deprecated. Use ``score`` instead.** + The accuracy of the entity detection in an + image. For example, for an image in which the + "Eiffel Tower" entity is detected, this field + represents the confidence that there is a tower + in the query image. Range [0, 1]. topicality (float): - The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower - in each image may be the same. Range [0, 1]. + The relevancy of the ICA (Image Content + Annotation) label to the image. For example, the + relevancy of "tower" is likely higher to an + image containing the detected "Eiffel Tower" + than to an image containing a detected distant + towering building, even though the confidence + that there is a tower in each image may be the + same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): - Image region to which this entity belongs. Not produced for - ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not + produced for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p4beta1.types.LocationInfo]): - The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may indicate the location of the scene in the - image, and another location may indicate the location of the - place where the image was taken. Location information is - usually present for landmarks. + The location information for the detected + entity. Multiple ``LocationInfo`` elements can + be present because one location may indicate the + location of the scene in the image, and another + location may indicate the location of the place + where the image was taken. Location information + is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p4beta1.types.Property]): - Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies - the entity. + Some entities may have optional user-supplied + ``Property`` (name/value) fields, such a score + or string that qualifies the entity. """ mid: str = proto.Field( @@ -677,11 +702,12 @@ class LocalizedObjectAnnotation(proto.Message): Object ID that should align with EntityAnnotation mid. language_code (str): - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + The BCP-47 language code, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` language. + Object name, expressed in its ``language_code`` + language. score (float): Score of the result. Range [0, 1]. bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): @@ -798,10 +824,11 @@ class ColorInfo(proto.Message): color (google.type.color_pb2.Color): RGB components of the color. score (float): - Image-specific score for this color. Value in range [0, 1]. + Image-specific score for this color. Value in + range [0, 1]. pixel_fraction (float): - The fraction of pixels the color occupies in the image. - Value in range [0, 1]. + The fraction of pixels the color occupies in the + image. Value in range [0, 1]. """ color: color_pb2.Color = proto.Field( @@ -861,7 +888,8 @@ class CropHint(proto.Message): coordinates of the bounding box are in the original image's scale. confidence (float): - Confidence of this being a salient region. Range [0, 1]. + Confidence of this being a salient region. + Range [0, 1]. importance_fraction (float): Fraction of importance of this salient region with respect to the original image. @@ -940,9 +968,10 @@ class TextDetectionParams(proto.Message): Attributes: enable_text_detection_confidence_score (bool): - By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + By default, Cloud Vision API only includes + confidence score for DOCUMENT_TEXT_DETECTION + result. Set the flag to true to include + confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -965,16 +994,19 @@ class ImageContext(proto.Message): lat_long_rect (google.cloud.vision_v1p4beta1.types.LatLongRect): Not used. language_hints (MutableSequence[str]): - List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In - rare cases, when the language of the text in the image is - known, setting a hint will help get better results (although - it will be a significant hindrance if the hint is wrong). - Text detection returns an error if one or more of the - specified languages is not one of the `supported - languages `__. + List of languages to use for TEXT_DETECTION. In + most cases, an empty value yields the best + results since it enables automatic language + detection. For languages based on the Latin + alphabet, setting ``language_hints`` is not + needed. In rare cases, when the language of the + text in the image is known, setting a hint will + help get better results (although it will be a + significant hindrance if the hint is wrong). + Text detection returns an error if one or more + of the specified languages is not one of the + `supported languages + `__. crop_hints_params (google.cloud.vision_v1p4beta1.types.CropHintsParams): Parameters for crop hints annotation request. face_recognition_params (google.cloud.vision_v1p4beta1.types.FaceRecognitionParams): @@ -1124,9 +1156,10 @@ class AnnotateImageResponse(proto.Message): If present, product search has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the operation. Note - that filled-in image annotations are guaranteed to be - correct, even when ``error`` is set. + If set, represents the error message for the + operation. Note that filled-in image annotations + are guaranteed to be correct, even when + ``error`` is set. context (google.cloud.vision_v1p4beta1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1302,14 +1335,16 @@ class AnnotateFileResponse(proto.Message): Information about the file for which this response is generated. responses (MutableSequence[google.cloud.vision_v1p4beta1.types.AnnotateImageResponse]): - Individual responses to images found within the file. This - field will be empty if the ``error`` field is set. + Individual responses to images found within the + file. This field will be empty if the ``error`` + field is set. total_pages (int): This field gives the total number of pages in the file. error (google.rpc.status_pb2.Status): - If set, represents the error message for the failed request. - The ``responses`` field will not be set in this case. + If set, represents the error message for the + failed request. The ``responses`` field will not + be set in this case. """ input_config: "InputConfig" = proto.Field( @@ -1506,13 +1541,14 @@ class InputConfig(proto.Message): The Google Cloud Storage location to read the input from. content (bytes): - File content, represented as a stream of bytes. Note: As - with all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. - - Currently, this field only works for BatchAnnotateFiles - requests. It does not work for AsyncBatchAnnotateFiles - requests. + File content, represented as a stream of bytes. + Note: As with all ``bytes`` fields, protobuffers + use a pure binary representation, whereas JSON + representations use base64. + + Currently, this field only works for + BatchAnnotateFiles requests. It does not work + for AsyncBatchAnnotateFiles requests. mime_type (str): The type of the file. Currently only "application/pdf", "image/tiff" and "image/gif" @@ -1542,17 +1578,20 @@ class OutputConfig(proto.Message): The Google Cloud Storage location to write the output(s) to. batch_size (int): - The max number of response protos to put into each output - JSON file on Google Cloud Storage. The valid range is [1, - 100]. If not specified, the default value is 20. - - For example, for one pdf file with 100 pages, 100 response - protos will be generated. If ``batch_size`` = 20, then 5 - json files each containing 20 response protos will be - written under the prefix ``gcs_destination``.\ ``uri``. - - Currently, batch_size only applies to GcsDestination, with - potential future support for other output configurations. + The max number of response protos to put into + each output JSON file on Google Cloud Storage. + The valid range is [1, 100]. If not specified, + the default value is 20. + + For example, for one pdf file with 100 pages, + 100 response protos will be generated. If + ``batch_size`` = 20, then 5 json files each + containing 20 response protos will be written + under the prefix ``gcs_destination``.``uri``. + + Currently, batch_size only applies to + GcsDestination, with potential future support + for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1589,32 +1628,37 @@ class GcsDestination(proto.Message): Attributes: uri (str): - Google Cloud Storage URI prefix where the results will be - stored. Results will be in JSON format and preceded by its - corresponding input URI prefix. This field can either - represent a gcs file prefix or gcs directory. In either - case, the uri should be unique because in order to get all - of the output files, you will need to do a wildcard gcs - search on the uri prefix you provide. + Google Cloud Storage URI prefix where the + results will be stored. Results will be in JSON + format and preceded by its corresponding input + URI prefix. This field can either represent a + gcs file prefix or gcs directory. In either + case, the uri should be unique because in order + to get all of the output files, you will need to + do a wildcard gcs search on the uri prefix you + provide. Examples: - - File Prefix: gs://bucket-name/here/filenameprefix The - output files will be created in gs://bucket-name/here/ and - the names of the output files will begin with - "filenameprefix". + * File Prefix: + gs://bucket-name/here/filenameprefix The + output files will be created in + gs://bucket-name/here/ and the names of the + output files will begin with "filenameprefix". - - Directory Prefix: gs://bucket-name/some/location/ The - output files will be created in - gs://bucket-name/some/location/ and the names of the - output files could be anything because there was no - filename prefix specified. + * Directory Prefix: + gs://bucket-name/some/location/ The output + files will be created in + gs://bucket-name/some/location/ and the names of + the output files could be anything because there + was no filename prefix specified. If multiple outputs, each response is still - AnnotateFileResponse, each of which contains some subset of - the full list of AnnotateImageResponse. Multiple outputs can - happen if, for example, the output JSON is too large and - overflows into multiple sharded files. + AnnotateFileResponse, each of which contains + some subset of the full list of + AnnotateImageResponse. Multiple outputs can + happen if, for example, the output JSON is too + large and overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py index 1d5fb1d412b1..af4fafb8891c 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py @@ -41,10 +41,12 @@ class ProductSearchParams(proto.Message): system discretion will be applied. product_set (str): The resource name of a - [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] to be - searched for similar images. + `ProductSet + `__ to + be searched for similar images. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. @@ -148,11 +150,12 @@ class ObjectAnnotation(proto.Message): Object ID that should align with EntityAnnotation mid. language_code (str): - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + The BCP-47 language code, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` language. + Object name, expressed in its ``language_code`` + language. score (float): Score of the result. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py index e2d1875066cc..b1a687b1152d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py @@ -70,6 +70,7 @@ class Product(proto.Message): The resource name of the product. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This field is ignored when creating a product. @@ -88,21 +89,23 @@ class Product(proto.Message): "apparel", and "toys" are still supported, but these should not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1p4beta1.types.Product.KeyValue]): - Key-value pairs that can be attached to a product. At query - time, constraints can be specified based on the - product_labels. - - Note that integer values can be provided as strings, e.g. - "1199". Only strings with integer values can match a - range-based restriction which is to be supported soon. - - Multiple values can be assigned to the same key. One product - may have up to 500 product_labels. - - Notice that the total number of distinct product_labels over - all products in one ProductSet cannot exceed 1M, otherwise - the product search pipeline will refuse to work for that - ProductSet. + Key-value pairs that can be attached to a + product. At query time, constraints can be + specified based on the product_labels. + + Note that integer values can be provided as + strings, e.g. "1199". Only strings with integer + values can match a range-based restriction which + is to be supported soon. + + Multiple values can be assigned to the same key. + One product may have up to 500 product_labels. + + Notice that the total number of distinct + product_labels over all products in one + ProductSet cannot exceed 1M, otherwise the + product search pipeline will refuse to work for + that ProductSet. """ class KeyValue(proto.Message): @@ -160,9 +163,11 @@ class ProductSet(proto.Message): The resource name of the ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. - This field is ignored when creating a ProductSet. + This field is ignored when creating a + ProductSet. display_name (str): The user-provided name for this ProductSet. Must not be empty. Must be at most 4096 @@ -207,8 +212,8 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): - r"""A ``ReferenceImage`` represents a product image and its associated - metadata, such as bounding boxes. + r"""A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. Attributes: name (str): @@ -218,11 +223,11 @@ class ReferenceImage(proto.Message): ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. - This field is ignored when creating a reference image. - uri (str): - Required. The Google Cloud Storage URI of the reference + This field is ignored when creating a reference image. - + uri (str): + Required. The Google Cloud Storage URI of the + reference image. The URI must start with ``gs://``. bounding_polys (MutableSequence[google.cloud.vision_v1p4beta1.types.BoundingPoly]): Optional. Bounding polygons around the areas @@ -258,18 +263,19 @@ class CreateProductRequest(proto.Message): Attributes: parent (str): - Required. The project in which the Product should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the Product + should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1p4beta1.types.Product): Required. The product to create. product_id (str): - A user-supplied resource id for this Product. If set, the - server will attempt to use this value as the resource id. If - it is already in use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 characters long. It - cannot contain the character ``/``. + A user-supplied resource id for this Product. If + set, the server will attempt to use this value + as the resource id. If it is already in use, an + error is returned with code ALREADY_EXISTS. Must + be at most 128 characters long. It cannot + contain the character ``/``. """ parent: str = proto.Field( @@ -292,16 +298,17 @@ class ListProductsRequest(proto.Message): Attributes: parent (str): - Required. The project OR ProductSet from which Products - should be listed. + Required. The project OR ProductSet from which + Products should be listed. + Format: - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + ``projects/PROJECT_ID/locations/LOC_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous List request, - if any. + The next_page_token returned from a previous + List request, if any. """ parent: str = proto.Field( @@ -353,6 +360,7 @@ class GetProductRequest(proto.Message): Required. Resource name of the Product to get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ @@ -371,10 +379,12 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that specifies - which fields to update. If update_mask isn't specified, all - mutable fields are to be updated. Valid mask paths include - ``product_labels``, ``display_name``, and ``description``. + The `FieldMask `__ + that specifies which fields to update. + If update_mask isn't specified, all mutable + fields are to be updated. Valid mask paths + include ``product_labels``, ``display_name``, + and ``description``. """ product: "Product" = proto.Field( @@ -397,6 +407,7 @@ class DeleteProductRequest(proto.Message): Required. Resource name of product to delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ @@ -411,18 +422,19 @@ class CreateProductSetRequest(proto.Message): Attributes: parent (str): - Required. The project in which the ProductSet should be - created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSet + should be created. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. product_set (google.cloud.vision_v1p4beta1.types.ProductSet): Required. The ProductSet to create. product_set_id (str): - A user-supplied resource id for this ProductSet. If set, the - server will attempt to use this value as the resource id. If - it is already in use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 characters long. It - cannot contain the character ``/``. + A user-supplied resource id for this ProductSet. + If set, the server will attempt to use this + value as the resource id. If it is already in + use, an error is returned with code + ALREADY_EXISTS. Must be at most 128 characters + long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -445,16 +457,16 @@ class ListProductSetsRequest(proto.Message): Attributes: parent (str): - Required. The project from which ProductSets should be - listed. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which ProductSets + should be listed. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous List request, - if any. + The next_page_token returned from a previous + List request, if any. """ parent: str = proto.Field( @@ -503,9 +515,10 @@ class GetProductSetRequest(proto.Message): Attributes: name (str): - Required. Resource name of the ProductSet to get. - + Required. Resource name of the ProductSet to + get. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ @@ -523,9 +536,10 @@ class UpdateProductSetRequest(proto.Message): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that specifies - which fields to update. If update_mask isn't specified, all - mutable fields are to be updated. Valid mask path is + The `FieldMask `__ + that specifies which fields to update. + If update_mask isn't specified, all mutable + fields are to be updated. Valid mask path is ``display_name``. """ @@ -546,9 +560,10 @@ class DeleteProductSetRequest(proto.Message): Attributes: name (str): - Required. Resource name of the ProductSet to delete. - + Required. Resource name of the ProductSet to + delete. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ @@ -563,8 +578,8 @@ class CreateReferenceImageRequest(proto.Message): Attributes: parent (str): - Required. Resource name of the product in which to create - the reference image. + Required. Resource name of the product in which + to create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -572,11 +587,13 @@ class CreateReferenceImageRequest(proto.Message): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): - A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value as - the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + A user-supplied resource id for the + ReferenceImage to be added. If set, the server + will attempt to use this value as the resource + id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at + most 128 characters long. It cannot contain the + character ``/``. """ parent: str = proto.Field( @@ -599,18 +616,18 @@ class ListReferenceImagesRequest(proto.Message): Attributes: parent (str): - Required. Resource name of the product containing the - reference images. - + Required. Resource name of the product + containing the reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - A token identifying a page of results to be returned. This - is the value of ``nextPageToken`` returned in a previous - reference image list request. + A token identifying a page of results to be + returned. This is the value of ``nextPageToken`` + returned in a previous reference image list + request. Defaults to the first page if not specified. """ @@ -639,8 +656,8 @@ class ListReferenceImagesResponse(proto.Message): The maximum number of items to return. Default 10, maximum 100. next_page_token (str): - The next_page_token returned from a previous List request, - if any. + The next_page_token returned from a previous + List request, if any. """ @property @@ -667,8 +684,8 @@ class GetReferenceImageRequest(proto.Message): Attributes: name (str): - Required. The resource name of the ReferenceImage to get. - + Required. The resource name of the + ReferenceImage to get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -685,9 +702,8 @@ class DeleteReferenceImageRequest(proto.Message): Attributes: name (str): - Required. The resource name of the reference image to - delete. - + Required. The resource name of the reference + image to delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -704,15 +720,16 @@ class AddProductToProductSetRequest(proto.Message): Attributes: name (str): - Required. The resource name for the ProductSet to modify. - + Required. The resource name for the ProductSet + to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): - Required. The resource name for the Product to be added to - this ProductSet. - + Required. The resource name for the Product to + be added to this ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ @@ -731,15 +748,17 @@ class RemoveProductFromProductSetRequest(proto.Message): Attributes: name (str): - Required. The resource name for the ProductSet to modify. - + Required. The resource name for the ProductSet + to modify. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): - Required. The resource name for the Product to be removed - from this ProductSet. + Required. The resource name for the Product to + be removed from this ProductSet. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ @@ -758,17 +777,17 @@ class ListProductsInProductSetRequest(proto.Message): Attributes: name (str): - Required. The ProductSet resource for which to retrieve - Products. - + Required. The ProductSet resource for which to + retrieve Products. Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous List request, - if any. + The next_page_token returned from a previous + List request, if any. """ name: str = proto.Field( @@ -818,79 +837,90 @@ class ImportProductSetsGcsSource(proto.Message): Attributes: csv_file_uri (str): - The Google Cloud Storage URI of the input csv file. - + The Google Cloud Storage URI of the input csv + file. The URI must start with ``gs://``. - The format of the input csv file should be one image per - line. In each line, there are 8 columns. - - 1. image-uri - 2. image-id - 3. product-set-id - 4. product-id - 5. product-category - 6. product-display-name - 7. labels - 8. bounding-poly - - The ``image-uri``, ``product-set-id``, ``product-id``, and - ``product-category`` columns are required. All other columns - are optional. - - If the ``ProductSet`` or ``Product`` specified by the - ``product-set-id`` and ``product-id`` values does not exist, - then the system will create a new ``ProductSet`` or - ``Product`` for the image. In this case, the + The format of the input csv file should be one + image per line. In each line, there are 8 + columns. + + 1. image-uri + 2. image-id + 3. product-set-id + 4. product-id + 5. product-category + 6. product-display-name + 7. labels + 8. bounding-poly + + The ``image-uri``, ``product-set-id``, + ``product-id``, and ``product-category`` columns + are required. All other columns are optional. + + If the ``ProductSet`` or ``Product`` specified + by the ``product-set-id`` and ``product-id`` + values does not exist, then the system will + create a new ``ProductSet`` or ``Product`` for + the image. In this case, the ``product-display-name`` column refers to - [display_name][google.cloud.vision.v1p4beta1.Product.display_name], + `display_name + `__, the ``product-category`` column refers to - [product_category][google.cloud.vision.v1p4beta1.Product.product_category], + `product_category + `__, and the ``labels`` column refers to - [product_labels][google.cloud.vision.v1p4beta1.Product.product_labels]. - - The ``image-id`` column is optional but must be unique if - provided. If it is empty, the system will automatically - assign a unique id to the image. - - The ``product-display-name`` column is optional. If it is - empty, the system sets the - [display_name][google.cloud.vision.v1p4beta1.Product.display_name] - field for the product to a space (" "). You can update the - ``display_name`` later by using the API. - - If a ``Product`` with the specified ``product-id`` already - exists, then the system ignores the - ``product-display-name``, ``product-category``, and - ``labels`` columns. - - The ``labels`` column (optional) is a line containing a list - of comma-separated key-value pairs, in the following format: + `product_labels + `__. - :: - - "key_1=value_1,key_2=value_2,...,key_n=value_n" + The ``image-id`` column is optional but must be + unique if provided. If it is empty, the system + will automatically assign a unique id to the + image. - The ``bounding-poly`` column (optional) identifies one - region of interest from the image in the same manner as - ``CreateReferenceImage``. If you do not specify the - ``bounding-poly`` column, then the system will try to detect + The ``product-display-name`` column is optional. + If it is empty, the system sets the + `display_name + `__ + field for the product to a space (" "). You can + update the ``display_name`` later by using the + API. + + If a ``Product`` with the specified + ``product-id`` already exists, then the system + ignores the ``product-display-name``, + ``product-category``, and ``labels`` columns. + + The ``labels`` column (optional) is a line + containing a list of comma-separated key-value + pairs, in the following format: + + "key_1=value_1,key_2=value_2,...,key_n=value_n" + + The ``bounding-poly`` column (optional) + identifies one region of interest from the image + in the same manner as ``CreateReferenceImage``. + If you do not specify the ``bounding-poly`` + column, then the system will try to detect regions of interest automatically. - At most one ``bounding-poly`` column is allowed per line. If - the image contains multiple regions of interest, add a line - to the CSV file that includes the same product information, - and the ``bounding-poly`` values for each region of + At most one ``bounding-poly`` column is allowed + per line. If the image contains multiple regions + of interest, add a line to the CSV file that + includes the same product information, and the + ``bounding-poly`` values for each region of interest. - The ``bounding-poly`` column must contain an even number of - comma-separated numbers, in the format - "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative - integers for absolute bounding polygons, and float values in - [0, 1] for normalized bounding polygons. + The ``bounding-poly`` column must contain an + even number of comma-separated numbers, in the + format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use + non-negative integers for absolute bounding + polygons, and float values in [0, 1] for + normalized bounding polygons. - The system will resize the image if the image resolution is - too large to process (larger than 20MP). + The system will resize the image if the image + resolution is too large to process (larger than + 20MP). """ csv_file_uri: str = proto.Field( @@ -926,10 +956,10 @@ class ImportProductSetsRequest(proto.Message): Attributes: parent (str): - Required. The project in which the ProductSets should be - imported. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSets + should be imported. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. input_config (google.cloud.vision_v1p4beta1.types.ImportProductSetsInputConfig): Required. The input content for the list of requests. @@ -950,22 +980,24 @@ class ImportProductSetsResponse(proto.Message): r"""Response message for the ``ImportProductSets`` method. This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] - method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field. + `google.longrunning.Operations.GetOperation + `__ method in the + returned + `google.longrunning.Operation.response + `__ field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1p4beta1.types.ReferenceImage]): - The list of reference_images that are imported successfully. + The list of reference_images that are imported + successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): - The rpc status for each ImportProductSet request, including - both successes and errors. + The rpc status for each ImportProductSet + request, including both successes and errors. - The number of statuses here matches the number of lines in - the csv file, and statuses[i] stores the success or failure - status of processing the i-th line of the csv, starting from - line 0. + The number of statuses here matches the number + of lines in the csv file, and statuses[i] stores + the success or failure status of processing the + i-th line of the csv, starting from line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -983,9 +1015,8 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` - returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. + This is included in the ``metadata`` field of the ``Operation`` returned by the + ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1p4beta1.types.BatchOperationMetadata.State): @@ -995,8 +1026,9 @@ class BatchOperationMetadata(proto.Message): to the server. end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and - [google.longrunning.Operation.done][google.longrunning.Operation.done] - is set to true. + `google.longrunning.Operation.done + `__ is set to + true. """ class State(proto.Enum): @@ -1050,9 +1082,10 @@ class ProductSetPurgeConfig(proto.Message): Attributes: product_set_id (str): - The ProductSet that contains the Products to delete. If a - Product is a member of product_set_id in addition to other - ProductSets, the Product will still be deleted. + The ProductSet that contains the Products to + delete. If a Product is a member of + product_set_id in addition to other ProductSets, + the Product will still be deleted. """ product_set_id: str = proto.Field( @@ -1078,15 +1111,15 @@ class PurgeProductsRequest(proto.Message): This field is a member of `oneof`_ ``target``. delete_orphan_products (bool): - If delete_orphan_products is true, all Products that are not - in any ProductSet will be deleted. + If delete_orphan_products is true, all Products + that are not in any ProductSet will be deleted. This field is a member of `oneof`_ ``target``. parent (str): - Required. The project and location in which the Products - should be deleted. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project and location in which the + Products should be deleted. + Format is + ``projects/PROJECT_ID/locations/LOC_ID``. force (bool): The default value is false. Override this value to true to actually perform the purge. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py index 8ff74951cbad..208832b1017b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py @@ -35,13 +35,16 @@ class TextAnnotation(proto.Message): - r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like this: - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each - structural component, starting from Page, may further have their own - properties. Properties describe detected languages, breaks etc.. - Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty] + r"""TextAnnotation contains a structured representation of OCR + extracted text. The hierarchy of an OCR extracted text structure + is like this: + + TextAnnotation -> Page -> Block -> Paragraph -> Word -> + Symbol Each structural component, starting from Page, may + further have their own properties. Properties describe detected + languages, breaks etc.. Please refer to the + `TextAnnotation.TextProperty + `__ message definition below for more detail. Attributes: @@ -56,8 +59,8 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + The BCP-47 language code, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -95,9 +98,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or - ``LINE_BREAK``. + End-line hyphen that is not present in text; + does not co-occur with ``SPACE``, + ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -169,7 +172,8 @@ class Page(proto.Message): List of blocks of text, images etc on this page. confidence (float): - Confidence of the OCR results on the page. Range [0, 1]. + Confidence of the OCR results on the page. Range + [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -210,24 +214,24 @@ class Block(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: + - when the text is horizontal it might look like: - :: + :: - 0----1 - | | - 3----2 + 0----1 + | | + 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: + - when it's rotated 180 degrees around the top-left corner + it becomes: - :: + :: - 2----3 - | | - 1----0 + 2----3 + | | + 1----0 - and the vertex order will still be (0, 1, 2, 3). + and the vertex order will still be (0, 1, 2, 3). paragraphs (MutableSequence[google.cloud.vision_v1p4beta1.types.Paragraph]): List of paragraphs in this block (if this blocks is of type text). @@ -235,7 +239,8 @@ class Block(proto.Message): Detected block type (text, image etc) for this block. confidence (float): - Confidence of the OCR results on the block. Range [0, 1]. + Confidence of the OCR results on the block. + Range [0, 1]. """ class BlockType(proto.Enum): @@ -297,22 +302,25 @@ class Paragraph(proto.Message): Additional information detected for the paragraph. bounding_box (google.cloud.vision_v1p4beta1.types.BoundingPoly): - The bounding box for the paragraph. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. - When a rotation of the bounding box is detected the rotation - is represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertex order will - still be (0, 1, 2, 3). + The bounding box for the paragraph. The vertices + are in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertex order will still be + (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1p4beta1.types.Word]): List of all words in this paragraph. confidence (float): - Confidence of the OCR results for the paragraph. Range [0, - 1]. + Confidence of the OCR results for the paragraph. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -343,23 +351,27 @@ class Word(proto.Message): property (google.cloud.vision_v1p4beta1.types.TextAnnotation.TextProperty): Additional information detected for the word. bounding_box (google.cloud.vision_v1p4beta1.types.BoundingPoly): - The bounding box for the word. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertex order will - still be (0, 1, 2, 3). + The bounding box for the word. The vertices are + in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertex order will still be + (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1p4beta1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural reading order. confidence (float): - Confidence of the OCR results for the word. Range [0, 1]. + Confidence of the OCR results for the word. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -391,22 +403,26 @@ class Symbol(proto.Message): Additional information detected for the symbol. bounding_box (google.cloud.vision_v1p4beta1.types.BoundingPoly): - The bounding box for the symbol. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. - When a rotation of the bounding box is detected the rotation - is represented as around the top-left corner as defined when - the text is read in the 'natural' orientation. For example: - - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertex order will - still be (0, 1, 2, 3). + The bounding box for the symbol. The vertices + are in the order of top-left, top-right, + bottom-right, bottom-left. When a rotation of + the bounding box is detected the rotation is + represented as around the top-left corner as + defined when the text is read in the 'natural' + orientation. For example: + + - when the text is horizontal it might look + like: 0----1 \| \| 3----2 + - when it's rotated 180 degrees around the + top-left corner it becomes: 2----3 \| \| + 1----0 and the vertex order will still be + (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. confidence (float): - Confidence of the OCR results for the symbol. Range [0, 1]. + Confidence of the OCR results for the symbol. + Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py index 3bfadec02406..ee8759fc039b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py @@ -159,8 +159,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as + "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/mypy.ini b/packages/google-cloud-vision/mypy.ini index 574c5aed394b..a3cb5c292172 100644 --- a/packages/google-cloud-vision/mypy.ini +++ b/packages/google-cloud-vision/mypy.ini @@ -1,3 +1,3 @@ [mypy] -python_version = 3.7 +python_version = 3.14 namespace_packages = True From 6a97d372cc7b4eaf7ae41244d3035d7416e4cc84 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Fri, 16 Jan 2026 22:52:10 +0000 Subject: [PATCH 2/9] version 2 --- .../google/cloud/vision/__init__.py | 2 +- .../google/cloud/vision_v1/__init__.py | 13 +- .../services/image_annotator/async_client.py | 38 +- .../services/image_annotator/client.py | 38 +- .../image_annotator/transports/grpc.py | 18 +- .../transports/grpc_asyncio.py | 18 +- .../services/product_search/async_client.py | 479 ++++++++--------- .../services/product_search/client.py | 479 ++++++++--------- .../product_search/transports/grpc.py | 183 +++---- .../product_search/transports/grpc_asyncio.py | 183 +++---- .../product_search/transports/rest.py | 96 ++-- .../cloud/vision_v1/types/image_annotator.py | 417 +++++++-------- .../cloud/vision_v1/types/product_search.py | 11 +- .../vision_v1/types/product_search_service.py | 354 ++++++------- .../cloud/vision_v1/types/text_annotation.py | 116 ++--- .../cloud/vision_v1/types/web_detection.py | 4 +- .../google/cloud/vision_v1p1beta1/__init__.py | 13 +- .../vision_v1p1beta1/types/image_annotator.py | 233 ++++----- .../vision_v1p1beta1/types/text_annotation.py | 141 +++-- .../vision_v1p1beta1/types/web_detection.py | 4 +- .../google/cloud/vision_v1p2beta1/__init__.py | 13 +- .../services/image_annotator/async_client.py | 19 +- .../services/image_annotator/client.py | 19 +- .../image_annotator/transports/grpc.py | 9 +- .../transports/grpc_asyncio.py | 9 +- .../vision_v1p2beta1/types/image_annotator.py | 290 +++++------ .../vision_v1p2beta1/types/text_annotation.py | 116 ++--- .../vision_v1p2beta1/types/web_detection.py | 4 +- .../google/cloud/vision_v1p3beta1/__init__.py | 13 +- .../services/image_annotator/async_client.py | 20 +- .../services/image_annotator/client.py | 20 +- .../image_annotator/transports/grpc.py | 10 +- .../transports/grpc_asyncio.py | 10 +- .../services/product_search/async_client.py | 419 +++++++-------- .../services/product_search/client.py | 419 +++++++-------- .../product_search/transports/grpc.py | 155 +++--- .../product_search/transports/grpc_asyncio.py | 155 +++--- .../product_search/transports/rest.py | 90 ++-- .../vision_v1p3beta1/types/image_annotator.py | 298 +++++------ .../vision_v1p3beta1/types/product_search.py | 11 +- .../types/product_search_service.py | 311 ++++++----- .../vision_v1p3beta1/types/text_annotation.py | 116 ++--- .../vision_v1p3beta1/types/web_detection.py | 4 +- .../google/cloud/vision_v1p4beta1/__init__.py | 13 +- .../services/image_annotator/async_client.py | 38 +- .../services/image_annotator/client.py | 38 +- .../image_annotator/transports/grpc.py | 18 +- .../transports/grpc_asyncio.py | 18 +- .../services/product_search/async_client.py | 483 ++++++++---------- .../services/product_search/client.py | 483 ++++++++---------- .../product_search/transports/grpc.py | 187 +++---- .../product_search/transports/grpc_asyncio.py | 187 +++---- .../product_search/transports/rest.py | 100 ++-- .../cloud/vision_v1p4beta1/types/face.py | 16 +- .../vision_v1p4beta1/types/image_annotator.py | 352 ++++++------- .../vision_v1p4beta1/types/product_search.py | 10 +- .../types/product_search_service.py | 348 ++++++------- .../vision_v1p4beta1/types/text_annotation.py | 116 ++--- .../vision_v1p4beta1/types/web_detection.py | 4 +- 59 files changed, 3489 insertions(+), 4292 deletions(-) diff --git a/packages/google-cloud-vision/google/cloud/vision/__init__.py b/packages/google-cloud-vision/google/cloud/vision/__init__.py index 192424525de8..271a36da1815 100644 --- a/packages/google-cloud-vision/google/cloud/vision/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision/__init__.py @@ -21,7 +21,7 @@ from google.cloud.vision_v1.services.image_annotator.async_client import ( ImageAnnotatorAsyncClient, ) -from google.cloud.vision_v1.services.image_annotator.client import ImageAnnotatorClient +from google.cloud.vision_v1 import ImageAnnotatorClient from google.cloud.vision_v1.services.product_search.async_client import ( ProductSearchAsyncClient, ) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1/__init__.py index a5a545abfc13..99375917c1b9 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/__init__.py @@ -28,7 +28,11 @@ # this code path once we drop support for Python 3.7 import importlib_metadata as metadata -from .services.image_annotator import ImageAnnotatorAsyncClient, ImageAnnotatorClient +from google.cloud.vision_helpers import VisionHelpers +from google.cloud.vision_helpers.decorators import add_single_feature_methods + +from .services.image_annotator import ImageAnnotatorAsyncClient +from .services.image_annotator import ImageAnnotatorClient as IacImageAnnotatorClient from .services.product_search import ProductSearchAsyncClient, ProductSearchClient from .types.geometry import BoundingPoly, NormalizedVertex, Position, Vertex from .types.image_annotator import ( @@ -204,6 +208,13 @@ def _get_version(dependency_name): + "https://devguide.python.org/versions/" ) + +@add_single_feature_methods +class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient): + __doc__ = IacImageAnnotatorClient.__doc__ + Feature = Feature + + __all__ = ( "ImageAnnotatorAsyncClient", "ProductSearchAsyncClient", diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py index 485622eb9f78..3bc14b37d8c1 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py @@ -533,16 +533,16 @@ async def async_batch_annotate_images( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Run asynchronous image detection and annotation for a - list of images. + r"""Run asynchronous image detection and annotation for a list of + images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json - files in customer GCS bucket, each json file containing + This service will write image annotation outputs to json files + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -602,13 +602,11 @@ async def sample_async_batch_annotate_images(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse` - Response to an async batch image - annotation request. + Response to an async batch image annotation request. """ # Create or coerce a protobuf request object. @@ -677,11 +675,11 @@ async def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Run asynchronous image detection and annotation for a - list of generic files, such as PDF files, which may - contain multiple pages and multiple images per page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. + r"""Run asynchronous image detection and annotation for a list of + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -737,13 +735,11 @@ async def sample_async_batch_annotate_files(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file - annotation request. + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py index 784c1469a4f3..75f5cae7a661 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py @@ -990,16 +990,16 @@ def async_batch_annotate_images( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Run asynchronous image detection and annotation for a - list of images. + r"""Run asynchronous image detection and annotation for a list of + images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json - files in customer GCS bucket, each json file containing + This service will write image annotation outputs to json files + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -1059,13 +1059,11 @@ def sample_async_batch_annotate_images(): Returns: google.api_core.operation.Operation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse` - Response to an async batch image - annotation request. + Response to an async batch image annotation request. """ # Create or coerce a protobuf request object. @@ -1133,11 +1131,11 @@ def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Run asynchronous image detection and annotation for a - list of generic files, such as PDF files, which may - contain multiple pages and multiple images per page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. + r"""Run asynchronous image detection and annotation for a list of + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -1193,13 +1191,11 @@ def sample_async_batch_annotate_files(): Returns: google.api_core.operation.Operation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file - annotation request. + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py index 0c910249e9ab..b620d322f9e8 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py @@ -417,16 +417,16 @@ def async_batch_annotate_images( ]: r"""Return a callable for the async batch annotate images method over gRPC. - Run asynchronous image detection and annotation for a - list of images. + Run asynchronous image detection and annotation for a list of + images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json - files in customer GCS bucket, each json file containing + This service will write image annotation outputs to json files + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -457,11 +457,11 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run asynchronous image detection and annotation for a - list of generic files, such as PDF files, which may - contain multiple pages and multiple images per page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. + Run asynchronous image detection and annotation for a list of + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py index bd5c0539f8ba..e0191631f616 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py @@ -426,16 +426,16 @@ def async_batch_annotate_images( ]: r"""Return a callable for the async batch annotate images method over gRPC. - Run asynchronous image detection and annotation for a - list of images. + Run asynchronous image detection and annotation for a list of + images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json - files in customer GCS bucket, each json file containing + This service will write image annotation outputs to json files + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -467,11 +467,11 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run asynchronous image detection and annotation for a - list of generic files, such as PDF files, which may - contain multiple pages and multiple images per page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. + Run asynchronous image detection and annotation for a list of + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py index 0b273a62706a..ca5663b048f6 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py @@ -75,8 +75,8 @@ class ProductSearchAsyncClient: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, @@ -84,9 +84,9 @@ class ProductSearchAsyncClient: `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ @@ -336,8 +336,8 @@ async def create_product_set( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing, - or is longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, or is + longer than 4096 characters. .. code-block:: python @@ -367,13 +367,11 @@ async def sample_create_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.CreateProductSetRequest, dict]]): - The request object. Request message for the - ``CreateProductSet`` method. + The request object. Request message for the ``CreateProductSet`` method. parent (:class:`str`): - Required. The project in which the - ProductSet should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSet should be + created. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -384,14 +382,11 @@ async def sample_create_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_set_id (:class:`str`): - A user-supplied resource id for this - ProductSet. If set, the server will - attempt to use this value as the - resource id. If it is already in use, an - error is returned with code - ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the - character ``/``. + A user-supplied resource id for this ProductSet. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -481,8 +476,8 @@ async def list_product_sets( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100, or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100, or + less than 1. .. code-block:: python @@ -513,13 +508,11 @@ async def sample_list_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListProductSetsRequest, dict]]): - The request object. Request message for the - ``ListProductSets`` method. + The request object. Request message for the ``ListProductSets`` method. parent (:class:`str`): - Required. The project from which - ProductSets should be listed. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which ProductSets should be + listed. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -534,11 +527,10 @@ async def sample_list_product_sets(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductSetsAsyncPager: - Response message for the - ``ListProductSets`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProductSets`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -646,11 +638,10 @@ async def sample_get_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.GetProductSetRequest, dict]]): - The request object. Request message for the - ``GetProductSet`` method. + The request object. Request message for the ``GetProductSet`` method. name (:class:`str`): - Required. Resource name of the - ProductSet to get. + Required. Resource name of the ProductSet to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -741,10 +732,9 @@ async def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer - than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. .. code-block:: python @@ -773,8 +763,7 @@ async def sample_update_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.UpdateProductSetRequest, dict]]): - The request object. Request message for the - ``UpdateProductSet`` method. + The request object. Request message for the ``UpdateProductSet`` method. product_set (:class:`google.cloud.vision_v1.types.ProductSet`): Required. The ProductSet resource which replaces the one on the server. @@ -783,12 +772,10 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask - `__ that - specifies which fields to update. If - update_mask isn't specified, all mutable - fields are to be updated. Valid mask - path is ``display_name``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -905,11 +892,10 @@ async def sample_delete_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.DeleteProductSetRequest, dict]]): - The request object. Request message for the - ``DeleteProductSet`` method. + The request object. Request message for the ``DeleteProductSet`` method. name (:class:`str`): - Required. Resource name of the - ProductSet to delete. + Required. Resource name of the ProductSet to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -988,12 +974,11 @@ async def create_product( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing or - longer than 4096 characters. - - * Returns INVALID_ARGUMENT if description is longer than - 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + * Returns INVALID_ARGUMENT if display_name is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is + missing or invalid. .. code-block:: python @@ -1023,11 +1008,10 @@ async def sample_create_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.CreateProductRequest, dict]]): - The request object. Request message for the - ``CreateProduct`` method. + The request object. Request message for the ``CreateProduct`` method. parent (:class:`str`): - Required. The project in which the - Product should be created. + Required. The project in which the Product should be + created. Format is ``projects/PROJECT_ID/locations/LOC_ID``. @@ -1040,13 +1024,11 @@ async def sample_create_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_id (:class:`str`): - A user-supplied resource id for this - Product. If set, the server will attempt - to use this value as the resource id. If - it is already in use, an error is - returned with code ALREADY_EXISTS. Must - be at most 128 characters long. It - cannot contain the character ``/``. + A user-supplied resource id for this Product. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1131,8 +1113,8 @@ async def list_products( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. .. code-block:: python @@ -1163,11 +1145,10 @@ async def sample_list_products(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListProductsRequest, dict]]): - The request object. Request message for the ``ListProducts`` - method. + The request object. Request message for the ``ListProducts`` method. parent (:class:`str`): - Required. The project OR ProductSet from - which Products should be listed. + Required. The project OR ProductSet from which Products + should be listed. Format: ``projects/PROJECT_ID/locations/LOC_ID`` @@ -1185,11 +1166,10 @@ async def sample_list_products(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsAsyncPager: - Response message for the - ``ListProducts`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProducts`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -1295,11 +1275,10 @@ async def sample_get_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.GetProductRequest, dict]]): - The request object. Request message for the ``GetProduct`` - method. + The request object. Request message for the ``GetProduct`` method. name (:class:`str`): - Required. Resource name of the Product - to get. + Required. Resource name of the Product to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -1381,24 +1360,21 @@ async def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated right now. - If labels are updated, the change will not be reflected - in queries until the next index time. + If labels are updated, the change will not be reflected in + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer - than 4096 characters. - - * Returns INVALID_ARGUMENT if description is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. - - * Returns INVALID_ARGUMENT if product_category is - present in update_mask. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. .. code-block:: python @@ -1427,8 +1403,7 @@ async def sample_update_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.UpdateProductRequest, dict]]): - The request object. Request message for the - ``UpdateProduct`` method. + The request object. Request message for the ``UpdateProduct`` method. product (:class:`google.cloud.vision_v1.types.Product`): Required. The Product resource which replaces the one on the server. @@ -1438,13 +1413,12 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask - `__ that - specifies which fields to update. If - update_mask isn't specified, all mutable - fields are to be updated. Valid mask - paths include ``product_labels``, - ``display_name``, and ``description``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include + ``product_labels``, ``display_name``, and + ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1557,11 +1531,10 @@ async def sample_delete_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.DeleteProductRequest, dict]]): - The request object. Request message for the - ``DeleteProduct`` method. + The request object. Request message for the ``DeleteProduct`` method. name (:class:`str`): - Required. Resource name of product to - delete. + Required. Resource name of product to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -1638,29 +1611,25 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If - ``bounding_poly`` is not specified, the system will try - to detect regions of interest in the image that are - compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, the system will try to detect regions of interest + in the image that are compatible with the product_category on + the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the - image resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the image + resolution is too large to process (above 50MP). Possible errors: - * Returns INVALID_ARGUMENT if the image_uri is missing - or longer than 4096 characters. - - * Returns INVALID_ARGUMENT if the product does not - exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent - product's product_category is detected. - - * Returns INVALID_ARGUMENT if bounding_poly contains - more than 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. * + Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. .. code-block:: python @@ -1694,11 +1663,10 @@ async def sample_create_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1.types.CreateReferenceImageRequest, dict]]): - The request object. Request message for the - ``CreateReferenceImage`` method. + The request object. Request message for the ``CreateReferenceImage`` method. parent (:class:`str`): - Required. Resource name of the product - in which to create the reference image. + Required. Resource name of the product in which to + create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -1715,14 +1683,11 @@ async def sample_create_reference_image(): on the ``request`` instance; if ``request`` is provided, this should not be set. reference_image_id (:class:`str`): - A user-supplied resource id for the - ReferenceImage to be added. If set, the - server will attempt to use this value as - the resource id. If it is already in - use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the - character ``/``. + A user-supplied resource id for the ReferenceImage to be + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1737,9 +1702,8 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1840,11 +1804,10 @@ async def sample_delete_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1.types.DeleteReferenceImageRequest, dict]]): - The request object. Request message for the - ``DeleteReferenceImage`` method. + The request object. Request message for the ``DeleteReferenceImage`` method. name (:class:`str`): - Required. The resource name of the - reference image to delete. + Required. The resource name of the reference image to + delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -1921,9 +1884,9 @@ async def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not - exist. * Returns INVALID_ARGUMENT if the page_size is - greater than 100, or less than 1. + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. .. code-block:: python @@ -1954,11 +1917,10 @@ async def sample_list_reference_images(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListReferenceImagesRequest, dict]]): - The request object. Request message for the - ``ListReferenceImages`` method. + The request object. Request message for the ``ListReferenceImages`` method. parent (:class:`str`): - Required. Resource name of the product - containing the reference images. + Required. Resource name of the product containing the + reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -1975,11 +1937,10 @@ async def sample_list_reference_images(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListReferenceImagesAsyncPager: - Response message for the - ``ListReferenceImages`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListReferenceImages`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -2057,8 +2018,7 @@ async def get_reference_image( Possible errors: - * Returns NOT_FOUND if the specified image does not - exist. + * Returns NOT_FOUND if the specified image does not exist. .. code-block:: python @@ -2088,11 +2048,10 @@ async def sample_get_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1.types.GetReferenceImageRequest, dict]]): - The request object. Request message for the - ``GetReferenceImage`` method. + The request object. Request message for the ``GetReferenceImage`` method. name (:class:`str`): - Required. The resource name of the - ReferenceImage to get. + Required. The resource name of the ReferenceImage to + get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -2110,9 +2069,8 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2176,15 +2134,15 @@ async def add_product_to_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: - r"""Adds a Product to the specified ProductSet. If the - Product is already present, no change is made. + r"""Adds a Product to the specified ProductSet. If the Product is + already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - * Returns NOT_FOUND if the Product or the ProductSet - doesn't exist. + * Returns NOT_FOUND if the Product or the ProductSet doesn't + exist. .. code-block:: python @@ -2212,11 +2170,11 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the - ``AddProductToProductSet`` method. + The request object. Request message for the ``AddProductToProductSet`` + method. name (:class:`str`): - Required. The resource name for the - ProductSet to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2225,8 +2183,8 @@ async def sample_add_product_to_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): - Required. The resource name for the - Product to be added to this ProductSet. + Required. The resource name for the Product to be added + to this ProductSet. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -2332,11 +2290,11 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the - ``RemoveProductFromProductSet`` method. + The request object. Request message for the ``RemoveProductFromProductSet`` + method. name (:class:`str`): - Required. The resource name for the - ProductSet to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2345,9 +2303,8 @@ async def sample_remove_product_from_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): - Required. The resource name for the - Product to be removed from this - ProductSet. + Required. The resource name for the Product to be + removed from this ProductSet. Format is: @@ -2425,14 +2382,14 @@ async def list_products_in_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: - r"""Lists the Products in a ProductSet, in an unspecified - order. If the ProductSet does not exist, the products - field of the response will be empty. + r"""Lists the Products in a ProductSet, in an unspecified order. If + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. .. code-block:: python @@ -2463,11 +2420,11 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the - ``ListProductsInProductSet`` method. + The request object. Request message for the ``ListProductsInProductSet`` + method. name (:class:`str`): - Required. The ProductSet resource for - which to retrieve Products. + Required. The ProductSet resource for which to retrieve + Products. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2485,11 +2442,10 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the - ``ListProductsInProductSet`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProductsInProductSet`` + method. + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -2568,20 +2524,18 @@ async def import_product_sets( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Asynchronous API that imports a list of reference images - to specified product sets based on a list of image - information. + r"""Asynchronous API that imports a list of reference images to + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google - Cloud Storage. For the format of the csv file please see + The input source of this method is a csv file on Google Cloud + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -2617,13 +2571,11 @@ async def sample_import_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1.types.ImportProductSetsRequest, dict]]): - The request object. Request message for the - ``ImportProductSets`` method. + The request object. Request message for the ``ImportProductSets`` method. parent (:class:`str`): - Required. The project in which the - ProductSets should be imported. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSets should be + imported. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2645,21 +2597,18 @@ async def sample_import_product_sets(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1.types.ImportProductSetsResponse`` - Response message for the - ``ImportProductSets` method. + Response message for the ``ImportProductSets` method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned + `__ method + in the returned `google.longrunning.Operation.response - `__ - field. + `__ field. """ # Create or coerce a protobuf request object. @@ -2732,37 +2681,34 @@ async def purge_products( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Asynchronous API to delete all Products in a ProductSet - or all Products that are in no ProductSet. + r"""Asynchronous API to delete all Products in a ProductSet or all + Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in - addition to other ProductSets, the Product will still be - deleted. + If a Product is a member of the specified ProductSet in addition + to other ProductSets, the Product will still be deleted. - It is recommended to not delete the specified ProductSet - until after this operation has completed. It is also - recommended to not add any of the Products involved in - the batch delete to a new ProductSet while this - operation is running because those Products may still - end up deleted. + It is recommended to not delete the specified ProductSet until + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used - in ImportProductSets (if that was how you originally - built the Product Set) before starting PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. - If the plan is to purge all of the Products from a - ProductSet and then re-use the empty ProductSet to - re-import new Products into the empty ProductSet, you - must wait until the PurgeProducts operation has finished - for that ProductSet. + If the plan is to purge all of the Products from a ProductSet + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) .. code-block:: python @@ -2796,13 +2742,11 @@ async def sample_purge_products(): Args: request (Optional[Union[google.cloud.vision_v1.types.PurgeProductsRequest, dict]]): - The request object. Request message for the - ``PurgeProducts`` method. + The request object. Request message for the ``PurgeProducts`` method. parent (:class:`str`): - Required. The project and location in - which the Products should be deleted. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project and location in which the Products + should be deleted. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2817,21 +2761,18 @@ async def sample_purge_products(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running - operation. - The result type for the operation will - be - :class:`google.protobuf.empty_pb2.Empty` - A generic empty message that you can - re-use to avoid defining duplicated - empty messages in your APIs. A typical - example is to use it as the request or - the response type of an API method. For - instance: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.protobuf.empty_pb2.Empty` A generic empty + message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to use + it as the request or the response type of an API method. + For instance: service Foo { - rpc Bar(google.protobuf.Empty) - returns (google.protobuf.Empty); } + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py index 1b1029f34c8a..316e18371513 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py @@ -119,8 +119,8 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, @@ -128,9 +128,9 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ @@ -817,8 +817,8 @@ def create_product_set( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing, - or is longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, or is + longer than 4096 characters. .. code-block:: python @@ -848,13 +848,11 @@ def sample_create_product_set(): Args: request (Union[google.cloud.vision_v1.types.CreateProductSetRequest, dict]): - The request object. Request message for the - ``CreateProductSet`` method. + The request object. Request message for the ``CreateProductSet`` method. parent (str): - Required. The project in which the - ProductSet should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSet should be + created. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -865,14 +863,11 @@ def sample_create_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_set_id (str): - A user-supplied resource id for this - ProductSet. If set, the server will - attempt to use this value as the - resource id. If it is already in use, an - error is returned with code - ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the - character ``/``. + A user-supplied resource id for this ProductSet. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -959,8 +954,8 @@ def list_product_sets( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100, or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100, or + less than 1. .. code-block:: python @@ -991,13 +986,11 @@ def sample_list_product_sets(): Args: request (Union[google.cloud.vision_v1.types.ListProductSetsRequest, dict]): - The request object. Request message for the - ``ListProductSets`` method. + The request object. Request message for the ``ListProductSets`` method. parent (str): - Required. The project from which - ProductSets should be listed. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which ProductSets should be + listed. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1012,11 +1005,10 @@ def sample_list_product_sets(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductSetsPager: - Response message for the - ``ListProductSets`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProductSets`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -1121,11 +1113,10 @@ def sample_get_product_set(): Args: request (Union[google.cloud.vision_v1.types.GetProductSetRequest, dict]): - The request object. Request message for the - ``GetProductSet`` method. + The request object. Request message for the ``GetProductSet`` method. name (str): - Required. Resource name of the - ProductSet to get. + Required. Resource name of the ProductSet to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -1213,10 +1204,9 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer - than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. .. code-block:: python @@ -1245,8 +1235,7 @@ def sample_update_product_set(): Args: request (Union[google.cloud.vision_v1.types.UpdateProductSetRequest, dict]): - The request object. Request message for the - ``UpdateProductSet`` method. + The request object. Request message for the ``UpdateProductSet`` method. product_set (google.cloud.vision_v1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. @@ -1255,12 +1244,10 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask - `__ that - specifies which fields to update. If - update_mask isn't specified, all mutable - fields are to be updated. Valid mask - path is ``display_name``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1374,11 +1361,10 @@ def sample_delete_product_set(): Args: request (Union[google.cloud.vision_v1.types.DeleteProductSetRequest, dict]): - The request object. Request message for the - ``DeleteProductSet`` method. + The request object. Request message for the ``DeleteProductSet`` method. name (str): - Required. Resource name of the - ProductSet to delete. + Required. Resource name of the ProductSet to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -1454,12 +1440,11 @@ def create_product( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing or - longer than 4096 characters. - - * Returns INVALID_ARGUMENT if description is longer than - 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + * Returns INVALID_ARGUMENT if display_name is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is + missing or invalid. .. code-block:: python @@ -1489,11 +1474,10 @@ def sample_create_product(): Args: request (Union[google.cloud.vision_v1.types.CreateProductRequest, dict]): - The request object. Request message for the - ``CreateProduct`` method. + The request object. Request message for the ``CreateProduct`` method. parent (str): - Required. The project in which the - Product should be created. + Required. The project in which the Product should be + created. Format is ``projects/PROJECT_ID/locations/LOC_ID``. @@ -1506,13 +1490,11 @@ def sample_create_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_id (str): - A user-supplied resource id for this - Product. If set, the server will attempt - to use this value as the resource id. If - it is already in use, an error is - returned with code ALREADY_EXISTS. Must - be at most 128 characters long. It - cannot contain the character ``/``. + A user-supplied resource id for this Product. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1594,8 +1576,8 @@ def list_products( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. .. code-block:: python @@ -1626,11 +1608,10 @@ def sample_list_products(): Args: request (Union[google.cloud.vision_v1.types.ListProductsRequest, dict]): - The request object. Request message for the ``ListProducts`` - method. + The request object. Request message for the ``ListProducts`` method. parent (str): - Required. The project OR ProductSet from - which Products should be listed. + Required. The project OR ProductSet from which Products + should be listed. Format: ``projects/PROJECT_ID/locations/LOC_ID`` @@ -1648,11 +1629,10 @@ def sample_list_products(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsPager: - Response message for the - ``ListProducts`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProducts`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -1755,11 +1735,10 @@ def sample_get_product(): Args: request (Union[google.cloud.vision_v1.types.GetProductRequest, dict]): - The request object. Request message for the ``GetProduct`` - method. + The request object. Request message for the ``GetProduct`` method. name (str): - Required. Resource name of the Product - to get. + Required. Resource name of the Product to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -1838,24 +1817,21 @@ def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated right now. - If labels are updated, the change will not be reflected - in queries until the next index time. + If labels are updated, the change will not be reflected in + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer - than 4096 characters. - - * Returns INVALID_ARGUMENT if description is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. - - * Returns INVALID_ARGUMENT if product_category is - present in update_mask. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. .. code-block:: python @@ -1884,8 +1860,7 @@ def sample_update_product(): Args: request (Union[google.cloud.vision_v1.types.UpdateProductRequest, dict]): - The request object. Request message for the - ``UpdateProduct`` method. + The request object. Request message for the ``UpdateProduct`` method. product (google.cloud.vision_v1.types.Product): Required. The Product resource which replaces the one on the server. @@ -1895,13 +1870,12 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask - `__ that - specifies which fields to update. If - update_mask isn't specified, all mutable - fields are to be updated. Valid mask - paths include ``product_labels``, - ``display_name``, and ``description``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include + ``product_labels``, ``display_name``, and + ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -2011,11 +1985,10 @@ def sample_delete_product(): Args: request (Union[google.cloud.vision_v1.types.DeleteProductRequest, dict]): - The request object. Request message for the - ``DeleteProduct`` method. + The request object. Request message for the ``DeleteProduct`` method. name (str): - Required. Resource name of product to - delete. + Required. Resource name of product to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -2089,29 +2062,25 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If - ``bounding_poly`` is not specified, the system will try - to detect regions of interest in the image that are - compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, the system will try to detect regions of interest + in the image that are compatible with the product_category on + the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the - image resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the image + resolution is too large to process (above 50MP). Possible errors: - * Returns INVALID_ARGUMENT if the image_uri is missing - or longer than 4096 characters. - - * Returns INVALID_ARGUMENT if the product does not - exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent - product's product_category is detected. - - * Returns INVALID_ARGUMENT if bounding_poly contains - more than 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. * + Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. .. code-block:: python @@ -2145,11 +2114,10 @@ def sample_create_reference_image(): Args: request (Union[google.cloud.vision_v1.types.CreateReferenceImageRequest, dict]): - The request object. Request message for the - ``CreateReferenceImage`` method. + The request object. Request message for the ``CreateReferenceImage`` method. parent (str): - Required. Resource name of the product - in which to create the reference image. + Required. Resource name of the product in which to + create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -2166,14 +2134,11 @@ def sample_create_reference_image(): on the ``request`` instance; if ``request`` is provided, this should not be set. reference_image_id (str): - A user-supplied resource id for the - ReferenceImage to be added. If set, the - server will attempt to use this value as - the resource id. If it is already in - use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the - character ``/``. + A user-supplied resource id for the ReferenceImage to be + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2188,9 +2153,8 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2288,11 +2252,10 @@ def sample_delete_reference_image(): Args: request (Union[google.cloud.vision_v1.types.DeleteReferenceImageRequest, dict]): - The request object. Request message for the - ``DeleteReferenceImage`` method. + The request object. Request message for the ``DeleteReferenceImage`` method. name (str): - Required. The resource name of the - reference image to delete. + Required. The resource name of the reference image to + delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -2366,9 +2329,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not - exist. * Returns INVALID_ARGUMENT if the page_size is - greater than 100, or less than 1. + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. .. code-block:: python @@ -2399,11 +2362,10 @@ def sample_list_reference_images(): Args: request (Union[google.cloud.vision_v1.types.ListReferenceImagesRequest, dict]): - The request object. Request message for the - ``ListReferenceImages`` method. + The request object. Request message for the ``ListReferenceImages`` method. parent (str): - Required. Resource name of the product - containing the reference images. + Required. Resource name of the product containing the + reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -2420,11 +2382,10 @@ def sample_list_reference_images(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListReferenceImagesPager: - Response message for the - ``ListReferenceImages`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListReferenceImages`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -2499,8 +2460,7 @@ def get_reference_image( Possible errors: - * Returns NOT_FOUND if the specified image does not - exist. + * Returns NOT_FOUND if the specified image does not exist. .. code-block:: python @@ -2530,11 +2490,10 @@ def sample_get_reference_image(): Args: request (Union[google.cloud.vision_v1.types.GetReferenceImageRequest, dict]): - The request object. Request message for the - ``GetReferenceImage`` method. + The request object. Request message for the ``GetReferenceImage`` method. name (str): - Required. The resource name of the - ReferenceImage to get. + Required. The resource name of the ReferenceImage to + get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -2552,9 +2511,8 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2615,15 +2573,15 @@ def add_product_to_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: - r"""Adds a Product to the specified ProductSet. If the - Product is already present, no change is made. + r"""Adds a Product to the specified ProductSet. If the Product is + already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - * Returns NOT_FOUND if the Product or the ProductSet - doesn't exist. + * Returns NOT_FOUND if the Product or the ProductSet doesn't + exist. .. code-block:: python @@ -2651,11 +2609,11 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the - ``AddProductToProductSet`` method. + The request object. Request message for the ``AddProductToProductSet`` + method. name (str): - Required. The resource name for the - ProductSet to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2664,8 +2622,8 @@ def sample_add_product_to_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): - Required. The resource name for the - Product to be added to this ProductSet. + Required. The resource name for the Product to be added + to this ProductSet. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -2770,11 +2728,11 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the - ``RemoveProductFromProductSet`` method. + The request object. Request message for the ``RemoveProductFromProductSet`` + method. name (str): - Required. The resource name for the - ProductSet to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2783,9 +2741,8 @@ def sample_remove_product_from_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): - Required. The resource name for the - Product to be removed from this - ProductSet. + Required. The resource name for the Product to be + removed from this ProductSet. Format is: @@ -2862,14 +2819,14 @@ def list_products_in_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: - r"""Lists the Products in a ProductSet, in an unspecified - order. If the ProductSet does not exist, the products - field of the response will be empty. + r"""Lists the Products in a ProductSet, in an unspecified order. If + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. .. code-block:: python @@ -2900,11 +2857,11 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the - ``ListProductsInProductSet`` method. + The request object. Request message for the ``ListProductsInProductSet`` + method. name (str): - Required. The ProductSet resource for - which to retrieve Products. + Required. The ProductSet resource for which to retrieve + Products. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2922,11 +2879,10 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the - ``ListProductsInProductSet`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProductsInProductSet`` + method. + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -3004,20 +2960,18 @@ def import_product_sets( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Asynchronous API that imports a list of reference images - to specified product sets based on a list of image - information. + r"""Asynchronous API that imports a list of reference images to + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google - Cloud Storage. For the format of the csv file please see + The input source of this method is a csv file on Google Cloud + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -3053,13 +3007,11 @@ def sample_import_product_sets(): Args: request (Union[google.cloud.vision_v1.types.ImportProductSetsRequest, dict]): - The request object. Request message for the - ``ImportProductSets`` method. + The request object. Request message for the ``ImportProductSets`` method. parent (str): - Required. The project in which the - ProductSets should be imported. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSets should be + imported. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3081,21 +3033,18 @@ def sample_import_product_sets(): Returns: google.api_core.operation.Operation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1.types.ImportProductSetsResponse`` - Response message for the - ``ImportProductSets` method. + Response message for the ``ImportProductSets` method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned + `__ method + in the returned `google.longrunning.Operation.response - `__ - field. + `__ field. """ # Create or coerce a protobuf request object. @@ -3165,37 +3114,34 @@ def purge_products( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Asynchronous API to delete all Products in a ProductSet - or all Products that are in no ProductSet. + r"""Asynchronous API to delete all Products in a ProductSet or all + Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in - addition to other ProductSets, the Product will still be - deleted. + If a Product is a member of the specified ProductSet in addition + to other ProductSets, the Product will still be deleted. - It is recommended to not delete the specified ProductSet - until after this operation has completed. It is also - recommended to not add any of the Products involved in - the batch delete to a new ProductSet while this - operation is running because those Products may still - end up deleted. + It is recommended to not delete the specified ProductSet until + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used - in ImportProductSets (if that was how you originally - built the Product Set) before starting PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. - If the plan is to purge all of the Products from a - ProductSet and then re-use the empty ProductSet to - re-import new Products into the empty ProductSet, you - must wait until the PurgeProducts operation has finished - for that ProductSet. + If the plan is to purge all of the Products from a ProductSet + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) .. code-block:: python @@ -3229,13 +3175,11 @@ def sample_purge_products(): Args: request (Union[google.cloud.vision_v1.types.PurgeProductsRequest, dict]): - The request object. Request message for the - ``PurgeProducts`` method. + The request object. Request message for the ``PurgeProducts`` method. parent (str): - Required. The project and location in - which the Products should be deleted. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project and location in which the Products + should be deleted. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3250,21 +3194,18 @@ def sample_purge_products(): Returns: google.api_core.operation.Operation: - An object representing a long-running - operation. - The result type for the operation will - be - :class:`google.protobuf.empty_pb2.Empty` - A generic empty message that you can - re-use to avoid defining duplicated - empty messages in your APIs. A typical - example is to use it as the request or - the response type of an API method. For - instance: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.protobuf.empty_pb2.Empty` A generic empty + message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to use + it as the request or the response type of an API method. + For instance: service Foo { - rpc Bar(google.protobuf.Empty) - returns (google.protobuf.Empty); } + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py index c8b78badefba..b526bf61a709 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py @@ -117,8 +117,8 @@ class ProductSearchGrpcTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, @@ -126,9 +126,9 @@ class ProductSearchGrpcTransport(ProductSearchTransport): `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -370,8 +370,8 @@ def create_product_set( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing, - or is longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, or is + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -404,8 +404,8 @@ def list_product_sets( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100, or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100, or + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -471,10 +471,9 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer - than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -536,12 +535,11 @@ def create_product( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing or - longer than 4096 characters. - - * Returns INVALID_ARGUMENT if description is longer than - 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + * Returns INVALID_ARGUMENT if display_name is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is + missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -574,8 +572,8 @@ def list_products( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. Returns: Callable[[~.ListProductsRequest], @@ -636,24 +634,21 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated right now. - If labels are updated, the change will not be reflected - in queries until the next index time. + If labels are updated, the change will not be reflected in + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer - than 4096 characters. - - * Returns INVALID_ARGUMENT if description is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. - - * Returns INVALID_ARGUMENT if product_category is - present in update_mask. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -715,29 +710,25 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If - ``bounding_poly`` is not specified, the system will try - to detect regions of interest in the image that are - compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, the system will try to detect regions of interest + in the image that are compatible with the product_category on + the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the - image resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the image + resolution is too large to process (above 50MP). Possible errors: - * Returns INVALID_ARGUMENT if the image_uri is missing - or longer than 4096 characters. - - * Returns INVALID_ARGUMENT if the product does not - exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent - product's product_category is detected. - - * Returns INVALID_ARGUMENT if bounding_poly contains - more than 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. * + Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -805,9 +796,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not - exist. * Returns INVALID_ARGUMENT if the page_size is - greater than 100, or less than 1. + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -840,8 +831,7 @@ def get_reference_image( Possible errors: - * Returns NOT_FOUND if the specified image does not - exist. + * Returns NOT_FOUND if the specified image does not exist. Returns: Callable[[~.GetReferenceImageRequest], @@ -869,15 +859,15 @@ def add_product_to_product_set( ]: r"""Return a callable for the add product to product set method over gRPC. - Adds a Product to the specified ProductSet. If the - Product is already present, no change is made. + Adds a Product to the specified ProductSet. If the Product is + already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - * Returns NOT_FOUND if the Product or the ProductSet - doesn't exist. + * Returns NOT_FOUND if the Product or the ProductSet doesn't + exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -939,14 +929,14 @@ def list_products_in_product_set( ]: r"""Return a callable for the list products in product set method over gRPC. - Lists the Products in a ProductSet, in an unspecified - order. If the ProductSet does not exist, the products - field of the response will be empty. + Lists the Products in a ProductSet, in an unspecified order. If + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -976,20 +966,18 @@ def import_product_sets( ]: r"""Return a callable for the import product sets method over gRPC. - Asynchronous API that imports a list of reference images - to specified product sets based on a list of image - information. + Asynchronous API that imports a list of reference images to + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google - Cloud Storage. For the format of the csv file please see + The input source of this method is a csv file on Google Cloud + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -1019,37 +1007,34 @@ def purge_products( ]: r"""Return a callable for the purge products method over gRPC. - Asynchronous API to delete all Products in a ProductSet - or all Products that are in no ProductSet. + Asynchronous API to delete all Products in a ProductSet or all + Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in - addition to other ProductSets, the Product will still be - deleted. + If a Product is a member of the specified ProductSet in addition + to other ProductSets, the Product will still be deleted. - It is recommended to not delete the specified ProductSet - until after this operation has completed. It is also - recommended to not add any of the Products involved in - the batch delete to a new ProductSet while this - operation is running because those Products may still - end up deleted. + It is recommended to not delete the specified ProductSet until + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used - in ImportProductSets (if that was how you originally - built the Product Set) before starting PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. - If the plan is to purge all of the Products from a - ProductSet and then re-use the empty ProductSet to - re-import new Products into the empty ProductSet, you - must wait until the PurgeProducts operation has finished - for that ProductSet. + If the plan is to purge all of the Products from a ProductSet + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) Returns: Callable[[~.PurgeProductsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py index 376d4aacbecd..3af8c215b7fb 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py @@ -123,8 +123,8 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, @@ -132,9 +132,9 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -378,8 +378,8 @@ def create_product_set( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing, - or is longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, or is + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -412,8 +412,8 @@ def list_product_sets( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100, or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100, or + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -480,10 +480,9 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer - than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -548,12 +547,11 @@ def create_product( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing or - longer than 4096 characters. - - * Returns INVALID_ARGUMENT if description is longer than - 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + * Returns INVALID_ARGUMENT if display_name is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is + missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -586,8 +584,8 @@ def list_products( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. Returns: Callable[[~.ListProductsRequest], @@ -650,24 +648,21 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated right now. - If labels are updated, the change will not be reflected - in queries until the next index time. + If labels are updated, the change will not be reflected in + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer - than 4096 characters. - - * Returns INVALID_ARGUMENT if description is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. - - * Returns INVALID_ARGUMENT if product_category is - present in update_mask. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -731,29 +726,25 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If - ``bounding_poly`` is not specified, the system will try - to detect regions of interest in the image that are - compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, the system will try to detect regions of interest + in the image that are compatible with the product_category on + the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the - image resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the image + resolution is too large to process (above 50MP). Possible errors: - * Returns INVALID_ARGUMENT if the image_uri is missing - or longer than 4096 characters. - - * Returns INVALID_ARGUMENT if the product does not - exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent - product's product_category is detected. - - * Returns INVALID_ARGUMENT if bounding_poly contains - more than 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. * + Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -821,9 +812,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not - exist. * Returns INVALID_ARGUMENT if the page_size is - greater than 100, or less than 1. + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -856,8 +847,7 @@ def get_reference_image( Possible errors: - * Returns NOT_FOUND if the specified image does not - exist. + * Returns NOT_FOUND if the specified image does not exist. Returns: Callable[[~.GetReferenceImageRequest], @@ -886,15 +876,15 @@ def add_product_to_product_set( ]: r"""Return a callable for the add product to product set method over gRPC. - Adds a Product to the specified ProductSet. If the - Product is already present, no change is made. + Adds a Product to the specified ProductSet. If the Product is + already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - * Returns NOT_FOUND if the Product or the ProductSet - doesn't exist. + * Returns NOT_FOUND if the Product or the ProductSet doesn't + exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -957,14 +947,14 @@ def list_products_in_product_set( ]: r"""Return a callable for the list products in product set method over gRPC. - Lists the Products in a ProductSet, in an unspecified - order. If the ProductSet does not exist, the products - field of the response will be empty. + Lists the Products in a ProductSet, in an unspecified order. If + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -995,20 +985,18 @@ def import_product_sets( ]: r"""Return a callable for the import product sets method over gRPC. - Asynchronous API that imports a list of reference images - to specified product sets based on a list of image - information. + Asynchronous API that imports a list of reference images to + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google - Cloud Storage. For the format of the csv file please see + The input source of this method is a csv file on Google Cloud + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -1039,37 +1027,34 @@ def purge_products( ]: r"""Return a callable for the purge products method over gRPC. - Asynchronous API to delete all Products in a ProductSet - or all Products that are in no ProductSet. + Asynchronous API to delete all Products in a ProductSet or all + Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in - addition to other ProductSets, the Product will still be - deleted. + If a Product is a member of the specified ProductSet in addition + to other ProductSets, the Product will still be deleted. - It is recommended to not delete the specified ProductSet - until after this operation has completed. It is also - recommended to not add any of the Products involved in - the batch delete to a new ProductSet while this - operation is running because those Products may still - end up deleted. + It is recommended to not delete the specified ProductSet until + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used - in ImportProductSets (if that was how you originally - built the Product Set) before starting PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. - If the plan is to purge all of the Products from a - ProductSet and then re-use the empty ProductSet to - re-import new Products into the empty ProductSet, you - must wait until the PurgeProducts operation has finished - for that ProductSet. + If the plan is to purge all of the Products from a ProductSet + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) Returns: Callable[[~.PurgeProductsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py index 3de8c00ebefe..21809bf4cb6a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py @@ -1036,8 +1036,8 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, @@ -1045,9 +1045,9 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -1215,8 +1215,8 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the - ``AddProductToProductSet`` method. + The request object. Request message for the ``AddProductToProductSet`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1330,8 +1330,7 @@ def __call__( Args: request (~.product_search_service.CreateProductRequest): - The request object. Request message for the - ``CreateProduct`` method. + The request object. Request message for the ``CreateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1481,8 +1480,7 @@ def __call__( Args: request (~.product_search_service.CreateProductSetRequest): - The request object. Request message for the - ``CreateProductSet`` method. + The request object. Request message for the ``CreateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1641,8 +1639,7 @@ def __call__( Args: request (~.product_search_service.CreateReferenceImageRequest): - The request object. Request message for the - ``CreateReferenceImage`` method. + The request object. Request message for the ``CreateReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1653,9 +1650,8 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ @@ -1798,8 +1794,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductRequest): - The request object. Request message for the - ``DeleteProduct`` method. + The request object. Request message for the ``DeleteProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1905,8 +1900,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductSetRequest): - The request object. Request message for the - ``DeleteProductSet`` method. + The request object. Request message for the ``DeleteProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2014,8 +2008,7 @@ def __call__( Args: request (~.product_search_service.DeleteReferenceImageRequest): - The request object. Request message for the - ``DeleteReferenceImage`` method. + The request object. Request message for the ``DeleteReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2123,8 +2116,7 @@ def __call__( Args: request (~.product_search_service.GetProductRequest): - The request object. Request message for the ``GetProduct`` - method. + The request object. Request message for the ``GetProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2272,8 +2264,7 @@ def __call__( Args: request (~.product_search_service.GetProductSetRequest): - The request object. Request message for the - ``GetProductSet`` method. + The request object. Request message for the ``GetProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2424,8 +2415,7 @@ def __call__( Args: request (~.product_search_service.GetReferenceImageRequest): - The request object. Request message for the - ``GetReferenceImage`` method. + The request object. Request message for the ``GetReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2436,9 +2426,8 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ @@ -2577,8 +2566,7 @@ def __call__( Args: request (~.product_search_service.ImportProductSetsRequest): - The request object. Request message for the - ``ImportProductSets`` method. + The request object. Request message for the ``ImportProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2730,8 +2718,7 @@ def __call__( Args: request (~.product_search_service.ListProductsRequest): - The request object. Request message for the ``ListProducts`` - method. + The request object. Request message for the ``ListProducts`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2742,9 +2729,7 @@ def __call__( Returns: ~.product_search_service.ListProductsResponse: - Response message for the - ``ListProducts`` method. - + Response message for the ``ListProducts`` method. """ http_options = ( @@ -2879,8 +2864,7 @@ def __call__( Args: request (~.product_search_service.ListProductSetsRequest): - The request object. Request message for the - ``ListProductSets`` method. + The request object. Request message for the ``ListProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2891,9 +2875,7 @@ def __call__( Returns: ~.product_search_service.ListProductSetsResponse: - Response message for the - ``ListProductSets`` method. - + Response message for the ``ListProductSets`` method. """ http_options = ( @@ -3032,8 +3014,8 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the - ``ListProductsInProductSet`` method. + The request object. Request message for the ``ListProductsInProductSet`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3044,8 +3026,8 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the - ``ListProductsInProductSet`` method. + Response message for the ``ListProductsInProductSet`` + method. """ @@ -3187,8 +3169,7 @@ def __call__( Args: request (~.product_search_service.ListReferenceImagesRequest): - The request object. Request message for the - ``ListReferenceImages`` method. + The request object. Request message for the ``ListReferenceImages`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3199,9 +3180,7 @@ def __call__( Returns: ~.product_search_service.ListReferenceImagesResponse: - Response message for the - ``ListReferenceImages`` method. - + Response message for the ``ListReferenceImages`` method. """ http_options = ( @@ -3341,8 +3320,7 @@ def __call__( Args: request (~.product_search_service.PurgeProductsRequest): - The request object. Request message for the - ``PurgeProducts`` method. + The request object. Request message for the ``PurgeProducts`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3495,8 +3473,8 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the - ``RemoveProductFromProductSet`` method. + The request object. Request message for the ``RemoveProductFromProductSet`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3612,8 +3590,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductRequest): - The request object. Request message for the - ``UpdateProduct`` method. + The request object. Request message for the ``UpdateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3763,8 +3740,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductSetRequest): - The request object. Request message for the - ``UpdateProductSet`` method. + The request object. Request message for the ``UpdateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py index 90840a1d4c0c..cd3a78020c14 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py @@ -100,24 +100,23 @@ class Likelihood(proto.Enum): class Feature(proto.Message): - r"""The type of Google Cloud Vision API detection to perform, and - the maximum number of results to return for that type. Multiple + r"""The type of Google Cloud Vision API detection to perform, and the + maximum number of results to return for that type. Multiple ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1.types.Feature.Type): The feature type. max_results (int): - Maximum number of results of this type. Does not - apply to ``TEXT_DETECTION``, - ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. + Maximum number of results of this type. Does not apply to + ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or + ``CROP_HINTS``. model (str): Model to use for the feature. - Supported values: "builtin/stable" (the default - if unset) and "builtin/latest". - ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" - for the bleeding edge release updated weekly. + Supported values: "builtin/stable" (the default if unset) + and "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also support "builtin/weekly" for the + bleeding edge release updated weekly. """ class Type(proto.Enum): @@ -135,15 +134,14 @@ class Type(proto.Enum): LABEL_DETECTION (4): Run label detection. TEXT_DETECTION (5): - Run text detection / optical character - recognition (OCR). Text detection is optimized - for areas of text within a larger image; if the - image is a document, use + Run text detection / optical character recognition (OCR). + Text detection is optimized for areas of text within a + larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): - Run dense text document OCR. Takes precedence - when both ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` are present. + Run dense text document OCR. Takes precedence when both + ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are + present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -197,9 +195,8 @@ class ImageSource(proto.Message): **Use ``image_uri`` instead.** The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud - Storage Request + ``gs://bucket_name/object_name``. Object versioning is not + supported. See `Google Cloud Storage Request URIs `__ for more info. @@ -207,27 +204,23 @@ class ImageSource(proto.Message): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google - Cloud Storage Request + ``gs://bucket_name/object_name``. Object versioning is + not supported. See `Google Cloud Storage Request URIs `__ for more info. - 2. A publicly-accessible image HTTP/HTTPS URL. - When fetching images from HTTP/HTTPS - URLs, Google cannot guarantee that the - request will be completed. Your request - may fail if the specified host denies the - request (e.g. due to request throttling or - DOS prevention), or if Google throttles - requests to the site for abuse prevention. - You should not depend on - externally-hosted images for production - applications. - - When both ``gcs_image_uri`` and ``image_uri`` - are specified, ``image_uri`` takes precedence. + 2. A publicly-accessible image HTTP/HTTPS URL. When fetching + images from HTTP/HTTPS URLs, Google cannot guarantee + that the request will be completed. Your request may + fail if the specified host denies the request (e.g. + due to request throttling or DOS prevention), or if + Google throttles requests to the site for abuse + prevention. You should not depend on + externally-hosted images for production applications. + + When both ``gcs_image_uri`` and ``image_uri`` are specified, + ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -246,19 +239,18 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers - use a pure binary representation, whereas JSON - representations use base64. + Note: As with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. - Currently, this field only works for - BatchAnnotateImages requests. It does not work - for AsyncBatchAnnotateImages requests. + Currently, this field only works for BatchAnnotateImages + requests. It does not work for AsyncBatchAnnotateImages + requests. source (google.cloud.vision_v1.types.ImageSource): - Google Cloud Storage image location, or - publicly-accessible image URL. If both - ``content`` and ``source`` are provided for an - image, ``content`` takes precedence and is used - to perform the image annotation request. + Google Cloud Storage image location, or publicly-accessible + image URL. If both ``content`` and ``source`` are provided + for an image, ``content`` takes precedence and is used to + perform the image annotation request. """ content: bytes = proto.Field( @@ -278,42 +270,35 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1.types.BoundingPoly): - The bounding polygon around the face. The - coordinates of the bounding box are in the - original image's scale. The bounding box is - computed to "frame" the face in accordance with - human expectations. It is based on the - landmarker results. Note that one or more x - and/or y coordinates may not be generated in the - ``BoundingPoly`` (the polygon will be unbounded) - if only a partial face appears in the image to - be annotated. + The bounding polygon around the face. The coordinates of the + bounding box are in the original image's scale. The bounding + box is computed to "frame" the face in accordance with human + expectations. It is based on the landmarker results. Note + that one or more x and/or y coordinates may not be generated + in the ``BoundingPoly`` (the polygon will be unbounded) if + only a partial face appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is - tighter than the ``boundingPoly``, and encloses - only the skin part of the face. Typically, it is - used to eliminate the face from any image - analysis that detects the "amount of skin" - visible in an image. It is not based on the - landmarker results, only on the initial face - detection, hence the fd (face + The ``fd_bounding_poly`` bounding polygon is tighter than + the ``boundingPoly``, and encloses only the skin part of the + face. Typically, it is used to eliminate the face from any + image analysis that detects the "amount of skin" visible in + an image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face - relative to the image vertical about the axis - perpendicular to the face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the face. + Range [-180,180]. pan_angle (float): - Yaw angle, which indicates the - leftward/rightward angle that the face is - pointing relative to the vertical plane + Yaw angle, which indicates the leftward/rightward angle that + the face is pointing relative to the vertical plane perpendicular to the image. Range [-180,180]. tilt_angle (float): - Pitch angle, which indicates the - upwards/downwards angle that the face is - pointing relative to the image's horizontal + Pitch angle, which indicates the upwards/downwards angle + that the face is pointing relative to the image's horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. @@ -348,8 +333,8 @@ class Landmark(proto.Message): class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the - image without considering mirror projections typical of photos. - So, ``LEFT_EYE``, typically, is the person's right eye. + image without considering mirror projections typical of photos. So, + ``LEFT_EYE``, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -597,47 +582,42 @@ class EntityAnnotation(proto.Message): mid (str): Opaque entity ID. Some IDs may be available in `Google Knowledge Graph Search - API - `__. + API `__. locale (str): - The language code for the locale in which the - entity textual ``description`` is expressed. + The language code for the locale in which the entity textual + ``description`` is expressed. description (str): - Entity textual description, expressed in its - ``locale`` language. + Entity textual description, expressed in its ``locale`` + language. score (float): Overall score of the result. Range [0, 1]. confidence (float): **Deprecated. Use ``score`` instead.** - The accuracy of the entity detection in an - image. For example, for an image in which the - "Eiffel Tower" entity is detected, this field - represents the confidence that there is a tower - in the query image. Range [0, 1]. + The accuracy of the entity detection in an image. For + example, for an image in which the "Eiffel Tower" entity is + detected, this field represents the confidence that there is + a tower in the query image. Range [0, 1]. topicality (float): - The relevancy of the ICA (Image Content - Annotation) label to the image. For example, the - relevancy of "tower" is likely higher to an - image containing the detected "Eiffel Tower" - than to an image containing a detected distant - towering building, even though the confidence - that there is a tower in each image may be the - same. Range [0, 1]. + The relevancy of the ICA (Image Content Annotation) label to + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower + in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1.types.BoundingPoly): - Image region to which this entity belongs. Not - produced for ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not produced + for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1.types.LocationInfo]): - The location information for the detected - entity. Multiple ``LocationInfo`` elements can - be present because one location may indicate the - location of the scene in the image, and another - location may indicate the location of the place - where the image was taken. Location information - is usually present for landmarks. + The location information for the detected entity. Multiple + ``LocationInfo`` elements can be present because one + location may indicate the location of the scene in the + image, and another location may indicate the location of the + place where the image was taken. Location information is + usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1.types.Property]): - Some entities may have optional user-supplied - ``Property`` (name/value) fields, such a score - or string that qualifies the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) fields, such a score or string that qualifies + the entity. """ mid: str = proto.Field( @@ -689,12 +669,11 @@ class LocalizedObjectAnnotation(proto.Message): Object ID that should align with EntityAnnotation mid. language_code (str): - The BCP-47 language code, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code, such as "en-US" or "sr-Latn". For + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` - language. + Object name, expressed in its ``language_code`` language. score (float): Score of the result. Range [0, 1]. bounding_poly (google.cloud.vision_v1.types.BoundingPoly): @@ -813,11 +792,10 @@ class ColorInfo(proto.Message): color (google.type.color_pb2.Color): RGB components of the color. score (float): - Image-specific score for this color. Value in - range [0, 1]. + Image-specific score for this color. Value in range [0, 1]. pixel_fraction (float): - The fraction of pixels the color occupies in the - image. Value in range [0, 1]. + The fraction of pixels the color occupies in the image. + Value in range [0, 1]. """ color: color_pb2.Color = proto.Field( @@ -877,8 +855,7 @@ class CropHint(proto.Message): coordinates of the bounding box are in the original image's scale. confidence (float): - Confidence of this being a salient region. - Range [0, 1]. + Confidence of this being a salient region. Range [0, 1]. importance_fraction (float): Fraction of importance of this salient region with respect to the original image. @@ -956,20 +933,17 @@ class TextDetectionParams(proto.Message): Attributes: enable_text_detection_confidence_score (bool): - By default, Cloud Vision API only includes - confidence score for DOCUMENT_TEXT_DETECTION - result. Set the flag to true to include - confidence score for TEXT_DETECTION as well. + By default, Cloud Vision API only includes confidence score + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): - A list of advanced OCR options to further - fine-tune OCR behavior. Current valid values - are: - - - ``legacy_layout``: a heuristics layout - detection algorithm, which serves as an - alternative to the current ML-based layout - detection algorithm. Customers can choose the - best suitable layout algorithm based on their + A list of advanced OCR options to further fine-tune OCR + behavior. Current valid values are: + + - ``legacy_layout``: a heuristics layout detection + algorithm, which serves as an alternative to the current + ML-based layout detection algorithm. Customers can choose + the best suitable layout algorithm based on their situation. """ @@ -990,18 +964,15 @@ class ImageContext(proto.Message): lat_long_rect (google.cloud.vision_v1.types.LatLongRect): Not used. language_hints (MutableSequence[str]): - List of languages to use for TEXT_DETECTION. In - most cases, an empty value yields the best - results since it enables automatic language - detection. For languages based on the Latin - alphabet, setting ``language_hints`` is not - needed. In rare cases, when the language of the - text in the image is known, setting a hint will - help get better results (although it will be a - significant hindrance if the hint is wrong). - Text detection returns an error if one or more - of the specified languages is not one of the - `supported languages + List of languages to use for TEXT_DETECTION. In most cases, + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In + rare cases, when the language of the text in the image is + known, setting a hint will help get better results (although + it will be a significant hindrance if the hint is wrong). + Text detection returns an error if one or more of the + specified languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1.types.CropHintsParams): Parameters for crop hints annotation request. @@ -1145,10 +1116,9 @@ class AnnotateImageResponse(proto.Message): If present, product search has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the - operation. Note that filled-in image annotations - are guaranteed to be correct, even when - ``error`` is set. + If set, represents the error message for the operation. + Note that filled-in image annotations are guaranteed to be + correct, even when ``error`` is set. context (google.cloud.vision_v1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1237,19 +1207,18 @@ class BatchAnnotateImagesRequest(proto.Message): Required. Individual image annotation requests for this batch. parent (str): - Optional. Target project and location to make a - call. - Format: - ``projects/{project-id}/locations/{location-id}``. + Optional. Target project and location to make a call. + + Format: ``projects/{project-id}/locations/{location-id}``. - If no parent is specified, a region will be - chosen automatically. + If no parent is specified, a region will be chosen + automatically. Supported location-ids: ``us``: USA country only, - ``asia``: East asia areas, like Japan, - Taiwan, ``eu``: The European Union. + ``asia``: East asia areas, like Japan, Taiwan, + ``eu``: The European Union. Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): @@ -1358,16 +1327,14 @@ class AnnotateFileResponse(proto.Message): Information about the file for which this response is generated. responses (MutableSequence[google.cloud.vision_v1.types.AnnotateImageResponse]): - Individual responses to images found within the - file. This field will be empty if the ``error`` - field is set. + Individual responses to images found within the file. This + field will be empty if the ``error`` field is set. total_pages (int): This field gives the total number of pages in the file. error (google.rpc.status_pb2.Status): - If set, represents the error message for the - failed request. The ``responses`` field will not - be set in this case. + If set, represents the error message for the failed request. + The ``responses`` field will not be set in this case. """ input_config: "InputConfig" = proto.Field( @@ -1402,19 +1369,18 @@ class BatchAnnotateFilesRequest(proto.Message): AnnotateFileRequest in BatchAnnotateFilesRequest. parent (str): - Optional. Target project and location to make a - call. - Format: - ``projects/{project-id}/locations/{location-id}``. + Optional. Target project and location to make a call. - If no parent is specified, a region will be - chosen automatically. + Format: ``projects/{project-id}/locations/{location-id}``. + + If no parent is specified, a region will be chosen + automatically. Supported location-ids: ``us``: USA country only, - ``asia``: East asia areas, like Japan, - Taiwan, ``eu``: The European Union. + ``asia``: East asia areas, like Japan, Taiwan, + ``eu``: The European Union. Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): @@ -1527,19 +1493,18 @@ class AsyncBatchAnnotateImagesRequest(proto.Message): Required. The desired output location and metadata (e.g. format). parent (str): - Optional. Target project and location to make a - call. - Format: - ``projects/{project-id}/locations/{location-id}``. + Optional. Target project and location to make a call. + + Format: ``projects/{project-id}/locations/{location-id}``. - If no parent is specified, a region will be - chosen automatically. + If no parent is specified, a region will be chosen + automatically. Supported location-ids: ``us``: USA country only, - ``asia``: East asia areas, like Japan, - Taiwan, ``eu``: The European Union. + ``asia``: East asia areas, like Japan, Taiwan, + ``eu``: The European Union. Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): @@ -1599,19 +1564,18 @@ class AsyncBatchAnnotateFilesRequest(proto.Message): Required. Individual async file annotation requests for this batch. parent (str): - Optional. Target project and location to make a - call. - Format: - ``projects/{project-id}/locations/{location-id}``. + Optional. Target project and location to make a call. + + Format: ``projects/{project-id}/locations/{location-id}``. - If no parent is specified, a region will be - chosen automatically. + If no parent is specified, a region will be chosen + automatically. Supported location-ids: ``us``: USA country only, - ``asia``: East asia areas, like Japan, - Taiwan, ``eu``: The European Union. + ``asia``: East asia areas, like Japan, Taiwan, + ``eu``: The European Union. Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): @@ -1667,13 +1631,13 @@ class InputConfig(proto.Message): input from. content (bytes): File content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers - use a pure binary representation, whereas JSON - representations use base64. + Note: As with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. - Currently, this field only works for - BatchAnnotateFiles requests. It does not work - for AsyncBatchAnnotateFiles requests. + Currently, this field only works for BatchAnnotateFiles + requests. It does not work for AsyncBatchAnnotateFiles + requests. mime_type (str): The type of the file. Currently only "application/pdf", "image/tiff" and "image/gif" @@ -1703,20 +1667,18 @@ class OutputConfig(proto.Message): The Google Cloud Storage location to write the output(s) to. batch_size (int): - The max number of response protos to put into - each output JSON file on Google Cloud Storage. - The valid range is [1, 100]. If not specified, - the default value is 20. - - For example, for one pdf file with 100 pages, - 100 response protos will be generated. If - ``batch_size`` = 20, then 5 json files each - containing 20 response protos will be written - under the prefix ``gcs_destination``.``uri``. - - Currently, batch_size only applies to - GcsDestination, with potential future support - for other output configurations. + The max number of response protos to put into each output + JSON file on Google Cloud Storage. + The valid range is [1, 100]. If not specified, the default + value is 20. + + For example, for one pdf file with 100 pages, 100 response + protos will be generated. If ``batch_size`` = 20, then 5 + json files each containing 20 response protos will be + written under the prefix ``gcs_destination``.``uri``. + + Currently, batch_size only applies to GcsDestination, with + potential future support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1753,37 +1715,32 @@ class GcsDestination(proto.Message): Attributes: uri (str): - Google Cloud Storage URI prefix where the - results will be stored. Results will be in JSON - format and preceded by its corresponding input - URI prefix. This field can either represent a - gcs file prefix or gcs directory. In either - case, the uri should be unique because in order - to get all of the output files, you will need to - do a wildcard gcs search on the uri prefix you - provide. + Google Cloud Storage URI prefix where the results will be + stored. Results will be in JSON format and preceded by its + corresponding input URI prefix. This field can either + represent a gcs file prefix or gcs directory. In either + case, the uri should be unique because in order to get all + of the output files, you will need to do a wildcard gcs + search on the uri prefix you provide. Examples: - * File Prefix: - gs://bucket-name/here/filenameprefix The - output files will be created in - gs://bucket-name/here/ and the names of the - output files will begin with "filenameprefix". + * File Prefix: gs://bucket-name/here/filenameprefix The + output files will be created in gs://bucket-name/here/ and + the names of the output files will begin with + "filenameprefix". - * Directory Prefix: - gs://bucket-name/some/location/ The output - files will be created in - gs://bucket-name/some/location/ and the names of - the output files could be anything because there - was no filename prefix specified. + * Directory Prefix: gs://bucket-name/some/location/ The + output files will be created in + gs://bucket-name/some/location/ and the names of the output + files could be anything because there was no filename prefix + specified. If multiple outputs, each response is still - AnnotateFileResponse, each of which contains - some subset of the full list of - AnnotateImageResponse. Multiple outputs can - happen if, for example, the output JSON is too - large and overflows into multiple sharded files. + AnnotateFileResponse, each of which contains some subset of + the full list of AnnotateImageResponse. Multiple outputs can + happen if, for example, the output JSON is too large and + overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py index 7bed9cc147f9..d4687c24e25d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py @@ -41,8 +41,8 @@ class ProductSearchParams(proto.Message): system discretion will be applied. product_set (str): The resource name of a `ProductSet - `__ to be - searched for similar images. + `__ to be searched for + similar images. Format is: @@ -149,12 +149,11 @@ class ObjectAnnotation(proto.Message): Object ID that should align with EntityAnnotation mid. language_code (str): - The BCP-47 language code, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code, such as "en-US" or "sr-Latn". For + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` - language. + Object name, expressed in its ``language_code`` language. score (float): Score of the result. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py index f2d74b474b14..0cdf00e46b82 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py @@ -90,23 +90,21 @@ class Product(proto.Message): and "toys" are still supported, but these should not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1.types.Product.KeyValue]): - Key-value pairs that can be attached to a - product. At query time, constraints can be - specified based on the product_labels. - - Note that integer values can be provided as - strings, e.g. "1199". Only strings with integer - values can match a range-based restriction which - is to be supported soon. - - Multiple values can be assigned to the same key. - One product may have up to 500 product_labels. - - Notice that the total number of distinct - product_labels over all products in one - ProductSet cannot exceed 1M, otherwise the - product search pipeline will refuse to work for - that ProductSet. + Key-value pairs that can be attached to a product. At query + time, constraints can be specified based on the + product_labels. + + Note that integer values can be provided as strings, e.g. + "1199". Only strings with integer values can match a + range-based restriction which is to be supported soon. + + Multiple values can be assigned to the same key. One product + may have up to 500 product_labels. + + Notice that the total number of distinct product_labels over + all products in one ProductSet cannot exceed 1M, otherwise + the product search pipeline will refuse to work for that + ProductSet. """ class KeyValue(proto.Message): @@ -167,8 +165,7 @@ class ProductSet(proto.Message): ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. - This field is ignored when creating a - ProductSet. + This field is ignored when creating a ProductSet. display_name (str): The user-provided name for this ProductSet. Must not be empty. Must be at most 4096 @@ -224,11 +221,10 @@ class ReferenceImage(proto.Message): ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. - This field is ignored when creating a reference - image. + This field is ignored when creating a reference image. uri (str): - Required. The Google Cloud Storage URI of the - reference image. + Required. The Google Cloud Storage URI of the reference + image. The URI must start with ``gs://``. bounding_polys (MutableSequence[google.cloud.vision_v1.types.BoundingPoly]): Optional. Bounding polygons around the areas @@ -264,19 +260,18 @@ class CreateProductRequest(proto.Message): Attributes: parent (str): - Required. The project in which the Product - should be created. + Required. The project in which the Product should be + created. Format is ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1.types.Product): Required. The product to create. product_id (str): - A user-supplied resource id for this Product. If - set, the server will attempt to use this value - as the resource id. If it is already in use, an - error is returned with code ALREADY_EXISTS. Must - be at most 128 characters long. It cannot - contain the character ``/``. + A user-supplied resource id for this Product. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -299,8 +294,8 @@ class ListProductsRequest(proto.Message): Attributes: parent (str): - Required. The project OR ProductSet from which - Products should be listed. + Required. The project OR ProductSet from which Products + should be listed. Format: ``projects/PROJECT_ID/locations/LOC_ID`` @@ -308,8 +303,8 @@ class ListProductsRequest(proto.Message): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous - List request, if any. + The next_page_token returned from a previous List request, + if any. """ parent: str = proto.Field( @@ -380,12 +375,12 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ - that specifies which fields to update. - If update_mask isn't specified, all mutable - fields are to be updated. Valid mask paths - include ``product_labels``, ``display_name``, - and ``description``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include + ``product_labels``, ``display_name``, and + ``description``. """ product: "Product" = proto.Field( @@ -423,19 +418,17 @@ class CreateProductSetRequest(proto.Message): Attributes: parent (str): - Required. The project in which the ProductSet - should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSet should be + created. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. product_set (google.cloud.vision_v1.types.ProductSet): Required. The ProductSet to create. product_set_id (str): - A user-supplied resource id for this ProductSet. - If set, the server will attempt to use this - value as the resource id. If it is already in - use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 characters - long. It cannot contain the character ``/``. + A user-supplied resource id for this ProductSet. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -458,16 +451,15 @@ class ListProductSetsRequest(proto.Message): Attributes: parent (str): - Required. The project from which ProductSets - should be listed. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which ProductSets should be + listed. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous - List request, if any. + The next_page_token returned from a previous List request, + if any. """ parent: str = proto.Field( @@ -516,8 +508,8 @@ class GetProductSetRequest(proto.Message): Attributes: name (str): - Required. Resource name of the ProductSet to - get. + Required. Resource name of the ProductSet to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -537,11 +529,10 @@ class UpdateProductSetRequest(proto.Message): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ - that specifies which fields to update. - If update_mask isn't specified, all mutable - fields are to be updated. Valid mask path is - ``display_name``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. """ product_set: "ProductSet" = proto.Field( @@ -561,8 +552,8 @@ class DeleteProductSetRequest(proto.Message): Attributes: name (str): - Required. Resource name of the ProductSet to - delete. + Required. Resource name of the ProductSet to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -579,8 +570,8 @@ class CreateReferenceImageRequest(proto.Message): Attributes: parent (str): - Required. Resource name of the product in which - to create the reference image. + Required. Resource name of the product in which to + create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -588,13 +579,11 @@ class CreateReferenceImageRequest(proto.Message): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): - A user-supplied resource id for the - ReferenceImage to be added. If set, the server - will attempt to use this value as the resource - id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at - most 128 characters long. It cannot contain the - character ``/``. + A user-supplied resource id for the ReferenceImage to be + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -617,18 +606,17 @@ class ListReferenceImagesRequest(proto.Message): Attributes: parent (str): - Required. Resource name of the product - containing the reference images. + Required. Resource name of the product containing the + reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - A token identifying a page of results to be - returned. This is the value of ``nextPageToken`` - returned in a previous reference image list - request. + A token identifying a page of results to be returned. This + is the value of ``nextPageToken`` returned in a previous + reference image list request. Defaults to the first page if not specified. """ @@ -657,8 +645,8 @@ class ListReferenceImagesResponse(proto.Message): The maximum number of items to return. Default 10, maximum 100. next_page_token (str): - The next_page_token returned from a previous - List request, if any. + The next_page_token returned from a previous List request, + if any. """ @property @@ -685,8 +673,8 @@ class GetReferenceImageRequest(proto.Message): Attributes: name (str): - Required. The resource name of the - ReferenceImage to get. + Required. The resource name of the ReferenceImage to + get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -703,8 +691,8 @@ class DeleteReferenceImageRequest(proto.Message): Attributes: name (str): - Required. The resource name of the reference - image to delete. + Required. The resource name of the reference image to + delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -717,18 +705,19 @@ class DeleteReferenceImageRequest(proto.Message): class AddProductToProductSetRequest(proto.Message): - r"""Request message for the ``AddProductToProductSet`` method. + r"""Request message for the ``AddProductToProductSet`` + method. Attributes: name (str): - Required. The resource name for the ProductSet - to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): - Required. The resource name for the Product to - be added to this ProductSet. + Required. The resource name for the Product to be added + to this ProductSet. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -745,18 +734,19 @@ class AddProductToProductSetRequest(proto.Message): class RemoveProductFromProductSetRequest(proto.Message): - r"""Request message for the ``RemoveProductFromProductSet`` method. + r"""Request message for the ``RemoveProductFromProductSet`` + method. Attributes: name (str): - Required. The resource name for the ProductSet - to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): - Required. The resource name for the Product to - be removed from this ProductSet. + Required. The resource name for the Product to be + removed from this ProductSet. Format is: @@ -774,12 +764,13 @@ class RemoveProductFromProductSetRequest(proto.Message): class ListProductsInProductSetRequest(proto.Message): - r"""Request message for the ``ListProductsInProductSet`` method. + r"""Request message for the ``ListProductsInProductSet`` + method. Attributes: name (str): - Required. The ProductSet resource for which to - retrieve Products. + Required. The ProductSet resource for which to retrieve + Products. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -787,8 +778,8 @@ class ListProductsInProductSetRequest(proto.Message): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous - List request, if any. + The next_page_token returned from a previous List request, + if any. """ name: str = proto.Field( @@ -806,7 +797,8 @@ class ListProductsInProductSetRequest(proto.Message): class ListProductsInProductSetResponse(proto.Message): - r"""Response message for the ``ListProductsInProductSet`` method. + r"""Response message for the ``ListProductsInProductSet`` + method. Attributes: products (MutableSequence[google.cloud.vision_v1.types.Product]): @@ -838,13 +830,12 @@ class ImportProductSetsGcsSource(proto.Message): Attributes: csv_file_uri (str): - The Google Cloud Storage URI of the input csv - file. + The Google Cloud Storage URI of the input csv file. + The URI must start with ``gs://``. - The format of the input csv file should be one - image per line. In each line, there are 8 - columns. + The format of the input csv file should be one image per + line. In each line, there are 8 columns. 1. image-uri 2. image-id @@ -855,73 +846,64 @@ class ImportProductSetsGcsSource(proto.Message): 7. labels 8. bounding-poly - The ``image-uri``, ``product-set-id``, - ``product-id``, and ``product-category`` columns - are required. All other columns are optional. + The ``image-uri``, ``product-set-id``, ``product-id``, and + ``product-category`` columns are required. All other columns + are optional. - If the ``ProductSet`` or ``Product`` specified - by the ``product-set-id`` and ``product-id`` - values does not exist, then the system will - create a new ``ProductSet`` or ``Product`` for - the image. In this case, the + If the ``ProductSet`` or ``Product`` specified by the + ``product-set-id`` and ``product-id`` values does not exist, + then the system will create a new ``ProductSet`` or + ``Product`` for the image. In this case, the ``product-display-name`` column refers to `display_name - `__, - the ``product-category`` column refers to + `__, the + ``product-category`` column refers to `product_category - `__, - and the ``labels`` column refers to + `__, and + the ``labels`` column refers to `product_labels `__. - The ``image-id`` column is optional but must be - unique if provided. If it is empty, the system - will automatically assign a unique id to the - image. + The ``image-id`` column is optional but must be unique if + provided. If it is empty, the system will automatically + assign a unique id to the image. - The ``product-display-name`` column is optional. - If it is empty, the system sets the - `display_name - `__ - field for the product to a space (" "). You can - update the ``display_name`` later by using the - API. - - If a ``Product`` with the specified - ``product-id`` already exists, then the system - ignores the ``product-display-name``, - ``product-category``, and ``labels`` columns. - - The ``labels`` column (optional) is a line - containing a list of comma-separated key-value - pairs, in the following format: - - "key_1=value_1,key_2=value_2,...,key_n=value_n" - - The ``bounding-poly`` column (optional) - identifies one region of interest from the image - in the same manner as ``CreateReferenceImage``. - If you do not specify the ``bounding-poly`` - column, then the system will try to detect + The ``product-display-name`` column is optional. If it is + empty, the system sets the `display_name + `__ field for + the product to a space (" "). You can update the + ``display_name`` later by using the API. + + If a ``Product`` with the specified ``product-id`` already + exists, then the system ignores the + ``product-display-name``, ``product-category``, and + ``labels`` columns. + + The ``labels`` column (optional) is a line containing a list + of comma-separated key-value pairs, in the following format: + + "key_1=value_1,key_2=value_2,...,key_n=value_n" + + The ``bounding-poly`` column (optional) identifies one + region of interest from the image in the same manner as + ``CreateReferenceImage``. If you do not specify the + ``bounding-poly`` column, then the system will try to detect regions of interest automatically. - At most one ``bounding-poly`` column is allowed - per line. If the image contains multiple regions - of interest, add a line to the CSV file that - includes the same product information, and the - ``bounding-poly`` values for each region of + At most one ``bounding-poly`` column is allowed per line. If + the image contains multiple regions of interest, add a line + to the CSV file that includes the same product information, + and the ``bounding-poly`` values for each region of interest. - The ``bounding-poly`` column must contain an - even number of comma-separated numbers, in the - format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use - non-negative integers for absolute bounding - polygons, and float values in [0, 1] for - normalized bounding polygons. + The ``bounding-poly`` column must contain an even number of + comma-separated numbers, in the format + "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative + integers for absolute bounding polygons, and float values in + [0, 1] for normalized bounding polygons. - The system will resize the image if the image - resolution is too large to process (larger than - 20MP). + The system will resize the image if the image resolution is + too large to process (larger than 20MP). """ csv_file_uri: str = proto.Field( @@ -957,10 +939,9 @@ class ImportProductSetsRequest(proto.Message): Attributes: parent (str): - Required. The project in which the ProductSets - should be imported. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSets should be + imported. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. input_config (google.cloud.vision_v1.types.ImportProductSetsInputConfig): Required. The input content for the list of requests. @@ -989,16 +970,15 @@ class ImportProductSetsResponse(proto.Message): Attributes: reference_images (MutableSequence[google.cloud.vision_v1.types.ReferenceImage]): - The list of reference_images that are imported - successfully. + The list of reference_images that are imported successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): - The rpc status for each ImportProductSet - request, including both successes and errors. + The rpc status for each ImportProductSet request, including + both successes and errors. - The number of statuses here matches the number - of lines in the csv file, and statuses[i] stores - the success or failure status of processing the - i-th line of the csv, starting from line 0. + The number of statuses here matches the number of lines in + the csv file, and statuses[i] stores the success or failure + status of processing the i-th line of the csv, starting from + line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -1016,8 +996,9 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` returned by the - ``GetOperation`` call of the ``google::longrunning::Operations`` service. + This is included in the ``metadata`` field of the ``Operation`` + returned by the ``GetOperation`` call of the + ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1.types.BatchOperationMetadata.State): @@ -1028,8 +1009,7 @@ class BatchOperationMetadata(proto.Message): end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and `google.longrunning.Operation.done - `__ is set to - true. + `__ is set to true. """ class State(proto.Enum): @@ -1083,10 +1063,9 @@ class ProductSetPurgeConfig(proto.Message): Attributes: product_set_id (str): - The ProductSet that contains the Products to - delete. If a Product is a member of - product_set_id in addition to other ProductSets, - the Product will still be deleted. + The ProductSet that contains the Products to delete. If a + Product is a member of product_set_id in addition to other + ProductSets, the Product will still be deleted. """ product_set_id: str = proto.Field( @@ -1112,15 +1091,14 @@ class PurgeProductsRequest(proto.Message): This field is a member of `oneof`_ ``target``. delete_orphan_products (bool): - If delete_orphan_products is true, all Products - that are not in any ProductSet will be deleted. + If delete_orphan_products is true, all Products that are not + in any ProductSet will be deleted. This field is a member of `oneof`_ ``target``. parent (str): - Required. The project and location in which the - Products should be deleted. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project and location in which the Products + should be deleted. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. force (bool): The default value is false. Override this value to true to actually perform the purge. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py index bb1a5408580b..9c2caf90d262 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py @@ -35,14 +35,13 @@ class TextAnnotation(proto.Message): - r"""TextAnnotation contains a structured representation of OCR - extracted text. The hierarchy of an OCR extracted text structure - is like this: - - TextAnnotation -> Page -> Block -> Paragraph -> Word -> - Symbol Each structural component, starting from Page, may - further have their own properties. Properties describe detected - languages, breaks etc.. Please refer to the + r"""TextAnnotation contains a structured representation of OCR extracted + text. The hierarchy of an OCR extracted text structure is like this: + + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + Each structural component, starting from Page, may further have + their own properties. Properties describe detected languages, breaks + etc.. Please refer to the `TextAnnotation.TextProperty `__ message definition below for more detail. @@ -59,8 +58,8 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): - The BCP-47 language code, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code, such as "en-US" or "sr-Latn". For + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -98,9 +97,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; - does not co-occur with ``SPACE``, - ``LEADER_SPACE``, or ``LINE_BREAK``. + End-line hyphen that is not present in text; does not + co-occur with ``SPACE``, ``LEADER_SPACE``, or + ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -172,8 +171,7 @@ class Page(proto.Message): List of blocks of text, images etc on this page. confidence (float): - Confidence of the OCR results on the page. Range - [0, 1]. + Confidence of the OCR results on the page. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -239,8 +237,7 @@ class Block(proto.Message): Detected block type (text, image etc) for this block. confidence (float): - Confidence of the OCR results on the block. - Range [0, 1]. + Confidence of the OCR results on the block. Range [0, 1]. """ class BlockType(proto.Enum): @@ -302,25 +299,22 @@ class Paragraph(proto.Message): Additional information detected for the paragraph. bounding_box (google.cloud.vision_v1.types.BoundingPoly): - The bounding box for the paragraph. The vertices - are in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertex order will still be - (0, 1, 2, 3). + The bounding box for the paragraph. The vertices are in the + order of top-left, top-right, bottom-right, bottom-left. + When a rotation of the bounding box is detected the rotation + is represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertex order will + still be (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1.types.Word]): List of all words in this paragraph. confidence (float): - Confidence of the OCR results for the paragraph. - Range [0, 1]. + Confidence of the OCR results for the paragraph. Range [0, + 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -351,27 +345,23 @@ class Word(proto.Message): property (google.cloud.vision_v1.types.TextAnnotation.TextProperty): Additional information detected for the word. bounding_box (google.cloud.vision_v1.types.BoundingPoly): - The bounding box for the word. The vertices are - in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertex order will still be - (0, 1, 2, 3). + The bounding box for the word. The vertices are in the order + of top-left, top-right, bottom-right, bottom-left. When a + rotation of the bounding box is detected the rotation is + represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertex order will + still be (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural reading order. confidence (float): - Confidence of the OCR results for the word. - Range [0, 1]. + Confidence of the OCR results for the word. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -403,26 +393,22 @@ class Symbol(proto.Message): Additional information detected for the symbol. bounding_box (google.cloud.vision_v1.types.BoundingPoly): - The bounding box for the symbol. The vertices - are in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertex order will still be - (0, 1, 2, 3). + The bounding box for the symbol. The vertices are in the + order of top-left, top-right, bottom-right, bottom-left. + When a rotation of the bounding box is detected the rotation + is represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertex order will + still be (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. confidence (float): - Confidence of the OCR results for the symbol. - Range [0, 1]. + Confidence of the OCR results for the symbol. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py index 4254abe6daf0..11ce1af125ac 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py @@ -159,8 +159,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as - "en-US" or "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/__init__.py index ebd5bcd9a09f..097c67e1b303 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/__init__.py @@ -28,7 +28,11 @@ # this code path once we drop support for Python 3.7 import importlib_metadata as metadata -from .services.image_annotator import ImageAnnotatorAsyncClient, ImageAnnotatorClient +from google.cloud.vision_helpers import VisionHelpers +from google.cloud.vision_helpers.decorators import add_single_feature_methods + +from .services.image_annotator import ImageAnnotatorAsyncClient +from .services.image_annotator import ImageAnnotatorClient as IacImageAnnotatorClient from .types.geometry import BoundingPoly, Position, Vertex from .types.image_annotator import ( AnnotateImageRequest, @@ -152,6 +156,13 @@ def _get_version(dependency_name): + "https://devguide.python.org/versions/" ) + +@add_single_feature_methods +class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient): + __doc__ = IacImageAnnotatorClient.__doc__ + Feature = Feature + + __all__ = ( "ImageAnnotatorAsyncClient", "AnnotateImageRequest", diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py index fd562aa94f18..828f4a586ea4 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py @@ -87,11 +87,11 @@ class Likelihood(proto.Enum): class Feature(proto.Message): - r"""Users describe the type of Google Cloud Vision API tasks to - perform over images by using *Feature*s. Each Feature indicates - a type of image detection task to perform. Features encode the - Cloud Vision API vertical to operate on and the number of - top-scoring results to return. + r"""Users describe the type of Google Cloud Vision API tasks to perform + over images by using *Feature*s. Each Feature indicates a type of + image detection task to perform. Features encode the Cloud Vision + API vertical to operate on and the number of top-scoring results to + return. Attributes: type_ (google.cloud.vision_v1p1beta1.types.Feature.Type): @@ -100,11 +100,10 @@ class Feature(proto.Message): Maximum number of results of this type. model (str): Model to use for the feature. - Supported values: "builtin/stable" (the default - if unset) and "builtin/latest". - ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" - for the bleeding edge release updated weekly. + Supported values: "builtin/stable" (the default if unset) + and "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also support "builtin/weekly" for the + bleeding edge release updated weekly. """ class Type(proto.Enum): @@ -124,9 +123,8 @@ class Type(proto.Enum): TEXT_DETECTION (5): Run OCR. DOCUMENT_TEXT_DETECTION (11): - Run dense text document OCR. Takes precedence - when both DOCUMENT_TEXT_DETECTION and - TEXT_DETECTION are present. + Run dense text document OCR. Takes precedence when both + DOCUMENT_TEXT_DETECTION and TEXT_DETECTION are present. SAFE_SEARCH_DETECTION (6): Run computer vision models to compute image safe-search properties. @@ -170,33 +168,30 @@ class ImageSource(proto.Message): Attributes: gcs_image_uri (str): - NOTE: For new code ``image_uri`` below is - preferred. Google Cloud Storage image URI, which - must be in the following form: + NOTE: For new code ``image_uri`` below is preferred. + Google Cloud Storage image URI, which must be in the + following form: - ``gs://bucket_name/object_name`` (for details, - see `Google Cloud Storage Request + ``gs://bucket_name/object_name`` (for details, see `Google + Cloud Storage Request URIs `__). - NOTE: Cloud Storage object versioning is not - supported. + NOTE: Cloud Storage object versioning is not supported. image_uri (str): Image URI which supports: - 1) Google Cloud Storage image URI, which must be - in the following form: + 1) Google Cloud Storage image URI, which must be in the + following form: - ``gs://bucket_name/object_name`` (for details, - see `Google Cloud Storage Request + ``gs://bucket_name/object_name`` (for details, see `Google + Cloud Storage Request URIs `__). - NOTE: Cloud Storage object versioning is not - supported. 2) Publicly accessible image - HTTP/HTTPS URL. - This is preferred over the legacy - ``gcs_image_uri`` above. When both - ``gcs_image_uri`` and ``image_uri`` are - specified, ``image_uri`` takes precedence. + NOTE: Cloud Storage object versioning is not supported. 2) + Publicly accessible image HTTP/HTTPS URL. + This is preferred over the legacy ``gcs_image_uri`` above. + When both ``gcs_image_uri`` and ``image_uri`` are specified, + ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -215,14 +210,14 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: as with all ``bytes`` fields, protobuffers - use a pure binary representation, whereas JSON - representations use base64. + Note: as with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. source (google.cloud.vision_v1p1beta1.types.ImageSource): - Google Cloud Storage image location. If both - ``content`` and ``source`` are provided for an - image, ``content`` takes precedence and is used - to perform the image annotation request. + Google Cloud Storage image location. If both ``content`` and + ``source`` are provided for an image, ``content`` takes + precedence and is used to perform the image annotation + request. """ content: bytes = proto.Field( @@ -242,43 +237,36 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The bounding polygon around the face. The - coordinates of the bounding box are in the - original image's scale, as returned in - ``ImageParams``. The bounding box is computed to - "frame" the face in accordance with human - expectations. It is based on the landmarker - results. Note that one or more x and/or y - coordinates may not be generated in the - ``BoundingPoly`` (the polygon will be unbounded) - if only a partial face appears in the image to - be annotated. + The bounding polygon around the face. The coordinates of the + bounding box are in the original image's scale, as returned + in ``ImageParams``. The bounding box is computed to "frame" + the face in accordance with human expectations. It is based + on the landmarker results. Note that one or more x and/or y + coordinates may not be generated in the ``BoundingPoly`` + (the polygon will be unbounded) if only a partial face + appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is - tighter than the ``boundingPoly``, and encloses - only the skin part of the face. Typically, it is - used to eliminate the face from any image - analysis that detects the "amount of skin" - visible in an image. It is not based on the - landmarker results, only on the initial face - detection, hence the fd (face + The ``fd_bounding_poly`` bounding polygon is tighter than + the ``boundingPoly``, and encloses only the skin part of the + face. Typically, it is used to eliminate the face from any + image analysis that detects the "amount of skin" visible in + an image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p1beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face - relative to the image vertical about the axis - perpendicular to the face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the face. + Range [-180,180]. pan_angle (float): - Yaw angle, which indicates the - leftward/rightward angle that the face is - pointing relative to the vertical plane + Yaw angle, which indicates the leftward/rightward angle that + the face is pointing relative to the vertical plane perpendicular to the image. Range [-180,180]. tilt_angle (float): - Pitch angle, which indicates the - upwards/downwards angle that the face is - pointing relative to the image's horizontal + Pitch angle, which indicates the upwards/downwards angle + that the face is pointing relative to the image's horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. @@ -313,8 +301,8 @@ class Landmark(proto.Message): class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the - image without considering mirror projections typical of photos. - So, ``LEFT_EYE``, typically, is the person's right eye. + image without considering mirror projections typical of photos. So, + ``LEFT_EYE``, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -556,46 +544,41 @@ class EntityAnnotation(proto.Message): mid (str): Opaque entity ID. Some IDs may be available in `Google Knowledge Graph Search - API - `__. + API `__. locale (str): - The language code for the locale in which the - entity textual ``description`` is expressed. + The language code for the locale in which the entity textual + ``description`` is expressed. description (str): - Entity textual description, expressed in its - ``locale`` language. + Entity textual description, expressed in its ``locale`` + language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - The accuracy of the entity detection in an - image. For example, for an image in which the - "Eiffel Tower" entity is detected, this field - represents the confidence that there is a tower - in the query image. Range [0, 1]. + The accuracy of the entity detection in an image. + For example, for an image in which the "Eiffel Tower" entity + is detected, this field represents the confidence that there + is a tower in the query image. Range [0, 1]. topicality (float): - The relevancy of the ICA (Image Content - Annotation) label to the image. For example, the - relevancy of "tower" is likely higher to an - image containing the detected "Eiffel Tower" - than to an image containing a detected distant - towering building, even though the confidence - that there is a tower in each image may be the - same. Range [0, 1]. + The relevancy of the ICA (Image Content Annotation) label to + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower + in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): - Image region to which this entity belongs. Not - produced for ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not produced + for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p1beta1.types.LocationInfo]): - The location information for the detected - entity. Multiple ``LocationInfo`` elements can - be present because one location may indicate the - location of the scene in the image, and another - location may indicate the location of the place - where the image was taken. Location information - is usually present for landmarks. + The location information for the detected entity. Multiple + ``LocationInfo`` elements can be present because one + location may indicate the location of the scene in the + image, and another location may indicate the location of the + place where the image was taken. Location information is + usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p1beta1.types.Property]): - Some entities may have optional user-supplied - ``Property`` (name/value) fields, such a score - or string that qualifies the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) fields, such a score or string that qualifies + the entity. """ mid: str = proto.Field( @@ -725,11 +708,10 @@ class ColorInfo(proto.Message): color (google.type.color_pb2.Color): RGB components of the color. score (float): - Image-specific score for this color. Value in - range [0, 1]. + Image-specific score for this color. Value in range [0, 1]. pixel_fraction (float): - The fraction of pixels the color occupies in the - image. Value in range [0, 1]. + The fraction of pixels the color occupies in the image. + Value in range [0, 1]. """ color: color_pb2.Color = proto.Field( @@ -785,13 +767,11 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The bounding polygon for the crop region. The - coordinates of the bounding box are in the - original image's scale, as returned in - ``ImageParams``. + The bounding polygon for the crop region. The coordinates of + the bounding box are in the original image's scale, as + returned in ``ImageParams``. confidence (float): - Confidence of this being a salient region. - Range [0, 1]. + Confidence of this being a salient region. Range [0, 1]. importance_fraction (float): Fraction of importance of this salient region with respect to the original image. @@ -870,10 +850,9 @@ class TextDetectionParams(proto.Message): Attributes: enable_text_detection_confidence_score (bool): - By default, Cloud Vision API only includes - confidence score for DOCUMENT_TEXT_DETECTION - result. Set the flag to true to include - confidence score for TEXT_DETECTION as well. + By default, Cloud Vision API only includes confidence score + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -897,18 +876,15 @@ class ImageContext(proto.Message): lat/long rectangle that specifies the location of the image. language_hints (MutableSequence[str]): - List of languages to use for TEXT_DETECTION. In - most cases, an empty value yields the best - results since it enables automatic language - detection. For languages based on the Latin - alphabet, setting ``language_hints`` is not - needed. In rare cases, when the language of the - text in the image is known, setting a hint will - help get better results (although it will be a - significant hindrance if the hint is wrong). - Text detection returns an error if one or more - of the specified languages is not one of the - `supported languages + List of languages to use for TEXT_DETECTION. In most cases, + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In + rare cases, when the language of the text in the image is + known, setting a hint will help get better results (although + it will be a significant hindrance if the hint is wrong). + Text detection returns an error if one or more of the + specified languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p1beta1.types.CropHintsParams): Parameters for crop hints annotation request. @@ -1013,10 +989,9 @@ class AnnotateImageResponse(proto.Message): If present, web detection has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the - operation. Note that filled-in image annotations - are guaranteed to be correct, even when - ``error`` is set. + If set, represents the error message for the operation. + Note that filled-in image annotations are guaranteed to be + correct, even when ``error`` is set. """ face_annotations: MutableSequence["FaceAnnotation"] = proto.RepeatedField( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py index 6c898df4278d..133b3c347c3d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py @@ -35,14 +35,13 @@ class TextAnnotation(proto.Message): - r"""TextAnnotation contains a structured representation of OCR - extracted text. The hierarchy of an OCR extracted text structure - is like this: - - TextAnnotation -> Page -> Block -> Paragraph -> Word -> - Symbol Each structural component, starting from Page, may - further have their own properties. Properties describe detected - languages, breaks etc.. Please refer to the + r"""TextAnnotation contains a structured representation of OCR extracted + text. The hierarchy of an OCR extracted text structure is like this: + + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + Each structural component, starting from Page, may further have + their own properties. Properties describe detected languages, breaks + etc.. Please refer to the `TextAnnotation.TextProperty `__ message definition below for more detail. @@ -59,8 +58,8 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): - The BCP-47 language code, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code, such as "en-US" or "sr-Latn". For + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -98,9 +97,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; - does not co-occur with ``SPACE``, - ``LEADER_SPACE``, or ``LINE_BREAK``. + End-line hyphen that is not present in text; does not + co-occur with ``SPACE``, ``LEADER_SPACE``, or + ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -170,8 +169,7 @@ class Page(proto.Message): List of blocks of text, images etc on this page. confidence (float): - Confidence of the OCR results on the page. Range - [0, 1]. + Confidence of the OCR results on the page. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -206,20 +204,17 @@ class Block(proto.Message): Additional information detected for the block. bounding_box (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The bounding box for the block. The vertices are - in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertice order will still be - (0, 1, 2, 3). + The bounding box for the block. The vertices are in the + order of top-left, top-right, bottom-right, bottom-left. + When a rotation of the bounding box is detected the rotation + is represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertice order + will still be (0, 1, 2, 3). paragraphs (MutableSequence[google.cloud.vision_v1p1beta1.types.Paragraph]): List of paragraphs in this block (if this blocks is of type text). @@ -227,8 +222,7 @@ class Block(proto.Message): Detected block type (text, image etc) for this block. confidence (float): - Confidence of the OCR results on the block. - Range [0, 1]. + Confidence of the OCR results on the block. Range [0, 1]. """ class BlockType(proto.Enum): @@ -290,25 +284,22 @@ class Paragraph(proto.Message): Additional information detected for the paragraph. bounding_box (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The bounding box for the paragraph. The vertices - are in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertice order will still be - (0, 1, 2, 3). + The bounding box for the paragraph. The vertices are in the + order of top-left, top-right, bottom-right, bottom-left. + When a rotation of the bounding box is detected the rotation + is represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertice order + will still be (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1p1beta1.types.Word]): List of words in this paragraph. confidence (float): - Confidence of the OCR results for the paragraph. - Range [0, 1]. + Confidence of the OCR results for the paragraph. Range [0, + 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -339,27 +330,23 @@ class Word(proto.Message): property (google.cloud.vision_v1p1beta1.types.TextAnnotation.TextProperty): Additional information detected for the word. bounding_box (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The bounding box for the word. The vertices are - in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertice order will still be - (0, 1, 2, 3). + The bounding box for the word. The vertices are in the order + of top-left, top-right, bottom-right, bottom-left. When a + rotation of the bounding box is detected the rotation is + represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertice order + will still be (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1p1beta1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural reading order. confidence (float): - Confidence of the OCR results for the word. - Range [0, 1]. + Confidence of the OCR results for the word. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -391,26 +378,22 @@ class Symbol(proto.Message): Additional information detected for the symbol. bounding_box (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The bounding box for the symbol. The vertices - are in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertice order will still be - (0, 1, 2, 3). + The bounding box for the symbol. The vertices are in the + order of top-left, top-right, bottom-right, bottom-left. + When a rotation of the bounding box is detected the rotation + is represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertice order + will still be (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. confidence (float): - Confidence of the OCR results for the symbol. - Range [0, 1]. + Confidence of the OCR results for the symbol. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py index 1192622d2304..bdfaf20fc558 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py @@ -157,8 +157,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as - "en-US" or "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/__init__.py index 807ec4dc6be4..38b15b5dabec 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/__init__.py @@ -28,7 +28,11 @@ # this code path once we drop support for Python 3.7 import importlib_metadata as metadata -from .services.image_annotator import ImageAnnotatorAsyncClient, ImageAnnotatorClient +from google.cloud.vision_helpers import VisionHelpers +from google.cloud.vision_helpers.decorators import add_single_feature_methods + +from .services.image_annotator import ImageAnnotatorAsyncClient +from .services.image_annotator import ImageAnnotatorClient as IacImageAnnotatorClient from .types.geometry import BoundingPoly, NormalizedVertex, Position, Vertex from .types.image_annotator import ( AnnotateFileResponse, @@ -163,6 +167,13 @@ def _get_version(dependency_name): + "https://devguide.python.org/versions/" ) + +@add_single_feature_methods +class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient): + __doc__ = IacImageAnnotatorClient.__doc__ + Feature = Feature + + __all__ = ( "ImageAnnotatorAsyncClient", "AnnotateFileResponse", diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py index ab1d33436766..fb5632ad071d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py @@ -414,11 +414,10 @@ async def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Run async image detection and annotation for a list of - generic files (e.g. PDF) which may contain multiple - pages and multiple images per page. Progress and results - can be retrieved through the - ``google.longrunning.Operations`` interface. + r"""Run async image detection and annotation for a list of generic + files (e.g. PDF) which may contain multiple pages and multiple + images per page. Progress and results can be retrieved through + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -474,13 +473,11 @@ async def sample_async_batch_annotate_files(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file - annotation request. + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py index d2ee85b89581..aa9125703821 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py @@ -832,11 +832,10 @@ def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Run async image detection and annotation for a list of - generic files (e.g. PDF) which may contain multiple - pages and multiple images per page. Progress and results - can be retrieved through the - ``google.longrunning.Operations`` interface. + r"""Run async image detection and annotation for a list of generic + files (e.g. PDF) which may contain multiple pages and multiple + images per page. Progress and results can be retrieved through + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -892,13 +891,11 @@ def sample_async_batch_annotate_files(): Returns: google.api_core.operation.Operation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file - annotation request. + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py index 2e8fd4f7a8d8..7fe5866362e2 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py @@ -380,11 +380,10 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run async image detection and annotation for a list of - generic files (e.g. PDF) which may contain multiple - pages and multiple images per page. Progress and results - can be retrieved through the - ``google.longrunning.Operations`` interface. + Run async image detection and annotation for a list of generic + files (e.g. PDF) which may contain multiple pages and multiple + images per page. Progress and results can be retrieved through + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py index 295569347d12..41879c4326a0 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py @@ -389,11 +389,10 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run async image detection and annotation for a list of - generic files (e.g. PDF) which may contain multiple - pages and multiple images per page. Progress and results - can be retrieved through the - ``google.longrunning.Operations`` interface. + Run async image detection and annotation for a list of generic + files (e.g. PDF) which may contain multiple pages and multiple + images per page. Progress and results can be retrieved through + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py index 9b30dbbb8f4e..38a1541d002d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py @@ -99,24 +99,23 @@ class Likelihood(proto.Enum): class Feature(proto.Message): - r"""The type of Google Cloud Vision API detection to perform, and - the maximum number of results to return for that type. Multiple + r"""The type of Google Cloud Vision API detection to perform, and the + maximum number of results to return for that type. Multiple ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p2beta1.types.Feature.Type): The feature type. max_results (int): - Maximum number of results of this type. Does not - apply to ``TEXT_DETECTION``, - ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. + Maximum number of results of this type. Does not apply to + ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or + ``CROP_HINTS``. model (str): Model to use for the feature. - Supported values: "builtin/stable" (the default - if unset) and "builtin/latest". - ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" - for the bleeding edge release updated weekly. + Supported values: "builtin/stable" (the default if unset) + and "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also support "builtin/weekly" for the + bleeding edge release updated weekly. """ class Type(proto.Enum): @@ -134,15 +133,14 @@ class Type(proto.Enum): LABEL_DETECTION (4): Run label detection. TEXT_DETECTION (5): - Run text detection / optical character - recognition (OCR). Text detection is optimized - for areas of text within a larger image; if the - image is a document, use + Run text detection / optical character recognition (OCR). + Text detection is optimized for areas of text within a + larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): - Run dense text document OCR. Takes precedence - when both ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` are present. + Run dense text document OCR. Takes precedence when both + ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are + present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -190,9 +188,8 @@ class ImageSource(proto.Message): **Use ``image_uri`` instead.** The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud - Storage Request + ``gs://bucket_name/object_name``. Object versioning is not + supported. See `Google Cloud Storage Request URIs `__ for more info. @@ -200,27 +197,23 @@ class ImageSource(proto.Message): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google - Cloud Storage Request + ``gs://bucket_name/object_name``. Object versioning is + not supported. See `Google Cloud Storage Request URIs `__ for more info. - 2. A publicly-accessible image HTTP/HTTPS URL. - When fetching images from HTTP/HTTPS - URLs, Google cannot guarantee that the - request will be completed. Your request - may fail if the specified host denies the - request (e.g. due to request throttling or - DOS prevention), or if Google throttles - requests to the site for abuse prevention. - You should not depend on - externally-hosted images for production - applications. - - When both ``gcs_image_uri`` and ``image_uri`` - are specified, ``image_uri`` takes precedence. + 2. A publicly-accessible image HTTP/HTTPS URL. When fetching + images from HTTP/HTTPS URLs, Google cannot guarantee + that the request will be completed. Your request may + fail if the specified host denies the request (e.g. + due to request throttling or DOS prevention), or if + Google throttles requests to the site for abuse + prevention. You should not depend on + externally-hosted images for production applications. + + When both ``gcs_image_uri`` and ``image_uri`` are specified, + ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -239,15 +232,14 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers - use a pure binary representation, whereas JSON - representations use base64. + Note: As with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. source (google.cloud.vision_v1p2beta1.types.ImageSource): - Google Cloud Storage image location, or - publicly-accessible image URL. If both - ``content`` and ``source`` are provided for an - image, ``content`` takes precedence and is used - to perform the image annotation request. + Google Cloud Storage image location, or publicly-accessible + image URL. If both ``content`` and ``source`` are provided + for an image, ``content`` takes precedence and is used to + perform the image annotation request. """ content: bytes = proto.Field( @@ -267,43 +259,36 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The bounding polygon around the face. The - coordinates of the bounding box are in the - original image's scale, as returned in - ``ImageParams``. The bounding box is computed to - "frame" the face in accordance with human - expectations. It is based on the landmarker - results. Note that one or more x and/or y - coordinates may not be generated in the - ``BoundingPoly`` (the polygon will be unbounded) - if only a partial face appears in the image to - be annotated. + The bounding polygon around the face. The coordinates of the + bounding box are in the original image's scale, as returned + in ``ImageParams``. The bounding box is computed to "frame" + the face in accordance with human expectations. It is based + on the landmarker results. Note that one or more x and/or y + coordinates may not be generated in the ``BoundingPoly`` + (the polygon will be unbounded) if only a partial face + appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is - tighter than the ``boundingPoly``, and encloses - only the skin part of the face. Typically, it is - used to eliminate the face from any image - analysis that detects the "amount of skin" - visible in an image. It is not based on the - landmarker results, only on the initial face - detection, hence the fd (face + The ``fd_bounding_poly`` bounding polygon is tighter than + the ``boundingPoly``, and encloses only the skin part of the + face. Typically, it is used to eliminate the face from any + image analysis that detects the "amount of skin" visible in + an image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p2beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face - relative to the image vertical about the axis - perpendicular to the face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the face. + Range [-180,180]. pan_angle (float): - Yaw angle, which indicates the - leftward/rightward angle that the face is - pointing relative to the vertical plane + Yaw angle, which indicates the leftward/rightward angle that + the face is pointing relative to the vertical plane perpendicular to the image. Range [-180,180]. tilt_angle (float): - Pitch angle, which indicates the - upwards/downwards angle that the face is - pointing relative to the image's horizontal + Pitch angle, which indicates the upwards/downwards angle + that the face is pointing relative to the image's horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. @@ -338,8 +323,8 @@ class Landmark(proto.Message): class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the - image without considering mirror projections typical of photos. - So, ``LEFT_EYE``, typically, is the person's right eye. + image without considering mirror projections typical of photos. So, + ``LEFT_EYE``, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -581,47 +566,42 @@ class EntityAnnotation(proto.Message): mid (str): Opaque entity ID. Some IDs may be available in `Google Knowledge Graph Search - API - `__. + API `__. locale (str): - The language code for the locale in which the - entity textual ``description`` is expressed. + The language code for the locale in which the entity textual + ``description`` is expressed. description (str): - Entity textual description, expressed in its - ``locale`` language. + Entity textual description, expressed in its ``locale`` + language. score (float): Overall score of the result. Range [0, 1]. confidence (float): **Deprecated. Use ``score`` instead.** - The accuracy of the entity detection in an - image. For example, for an image in which the - "Eiffel Tower" entity is detected, this field - represents the confidence that there is a tower - in the query image. Range [0, 1]. + The accuracy of the entity detection in an image. For + example, for an image in which the "Eiffel Tower" entity is + detected, this field represents the confidence that there is + a tower in the query image. Range [0, 1]. topicality (float): - The relevancy of the ICA (Image Content - Annotation) label to the image. For example, the - relevancy of "tower" is likely higher to an - image containing the detected "Eiffel Tower" - than to an image containing a detected distant - towering building, even though the confidence - that there is a tower in each image may be the - same. Range [0, 1]. + The relevancy of the ICA (Image Content Annotation) label to + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower + in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): - Image region to which this entity belongs. Not - produced for ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not produced + for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p2beta1.types.LocationInfo]): - The location information for the detected - entity. Multiple ``LocationInfo`` elements can - be present because one location may indicate the - location of the scene in the image, and another - location may indicate the location of the place - where the image was taken. Location information - is usually present for landmarks. + The location information for the detected entity. Multiple + ``LocationInfo`` elements can be present because one + location may indicate the location of the scene in the + image, and another location may indicate the location of the + place where the image was taken. Location information is + usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p2beta1.types.Property]): - Some entities may have optional user-supplied - ``Property`` (name/value) fields, such a score - or string that qualifies the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) fields, such a score or string that qualifies + the entity. """ mid: str = proto.Field( @@ -751,11 +731,10 @@ class ColorInfo(proto.Message): color (google.type.color_pb2.Color): RGB components of the color. score (float): - Image-specific score for this color. Value in - range [0, 1]. + Image-specific score for this color. Value in range [0, 1]. pixel_fraction (float): - The fraction of pixels the color occupies in the - image. Value in range [0, 1]. + The fraction of pixels the color occupies in the image. + Value in range [0, 1]. """ color: color_pb2.Color = proto.Field( @@ -811,13 +790,11 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The bounding polygon for the crop region. The - coordinates of the bounding box are in the - original image's scale, as returned in - ``ImageParams``. + The bounding polygon for the crop region. The coordinates of + the bounding box are in the original image's scale, as + returned in ``ImageParams``. confidence (float): - Confidence of this being a salient region. - Range [0, 1]. + Confidence of this being a salient region. Range [0, 1]. importance_fraction (float): Fraction of importance of this salient region with respect to the original image. @@ -896,10 +873,9 @@ class TextDetectionParams(proto.Message): Attributes: enable_text_detection_confidence_score (bool): - By default, Cloud Vision API only includes - confidence score for DOCUMENT_TEXT_DETECTION - result. Set the flag to true to include - confidence score for TEXT_DETECTION as well. + By default, Cloud Vision API only includes confidence score + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -922,18 +898,15 @@ class ImageContext(proto.Message): lat_long_rect (google.cloud.vision_v1p2beta1.types.LatLongRect): Not used. language_hints (MutableSequence[str]): - List of languages to use for TEXT_DETECTION. In - most cases, an empty value yields the best - results since it enables automatic language - detection. For languages based on the Latin - alphabet, setting ``language_hints`` is not - needed. In rare cases, when the language of the - text in the image is known, setting a hint will - help get better results (although it will be a - significant hindrance if the hint is wrong). - Text detection returns an error if one or more - of the specified languages is not one of the - `supported languages + List of languages to use for TEXT_DETECTION. In most cases, + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In + rare cases, when the language of the text in the image is + known, setting a hint will help get better results (although + it will be a significant hindrance if the hint is wrong). + Text detection returns an error if one or more of the + specified languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p2beta1.types.CropHintsParams): Parameters for crop hints annotation request. @@ -1062,10 +1035,9 @@ class AnnotateImageResponse(proto.Message): If present, web detection has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the - operation. Note that filled-in image annotations - are guaranteed to be correct, even when - ``error`` is set. + If set, represents the error message for the operation. + Note that filled-in image annotations are guaranteed to be + correct, even when ``error`` is set. context (google.cloud.vision_v1p2beta1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1312,20 +1284,17 @@ class OutputConfig(proto.Message): The Google Cloud Storage location to write the output(s) to. batch_size (int): - The max number of response protos to put into - each output JSON file on GCS. The valid range is - [1, 100]. If not specified, the default value is - 20. - - For example, for one pdf file with 100 pages, - 100 response protos will be generated. If - ``batch_size`` = 20, then 5 json files each - containing 20 response protos will be written - under the prefix ``gcs_destination``.``uri``. - - Currently, batch_size only applies to - GcsDestination, with potential future support - for other output configurations. + The max number of response protos to put into each output + JSON file on GCS. The valid range is [1, 100]. If not + specified, the default value is 20. + + For example, for one pdf file with 100 pages, 100 response + protos will be generated. If ``batch_size`` = 20, then 5 + json files each containing 20 response protos will be + written under the prefix ``gcs_destination``.``uri``. + + Currently, batch_size only applies to GcsDestination, with + potential future support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1362,26 +1331,23 @@ class GcsDestination(proto.Message): Attributes: uri (str): - Google Cloud Storage URI where the results will - be stored. Results will be in JSON format and - preceded by its corresponding input URI. This - field can either represent a single file, or a - prefix for multiple outputs. Prefixes must end - in a ``/``. + Google Cloud Storage URI where the results will be stored. + Results will be in JSON format and preceded by its + corresponding input URI. This field can either represent a + single file, or a prefix for multiple outputs. Prefixes must + end in a ``/``. Examples: * File: gs://bucket-name/filename.json * Prefix: gs://bucket-name/prefix/here/ - * File: gs://bucket-name/prefix/here If multiple outputs, each response is still - AnnotateFileResponse, each of which contains - some subset of the full list of - AnnotateImageResponse. Multiple outputs can - happen if, for example, the output JSON is too - large and overflows into multiple sharded files. + AnnotateFileResponse, each of which contains some subset of + the full list of AnnotateImageResponse. Multiple outputs can + happen if, for example, the output JSON is too large and + overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py index 7cec33c2adaa..00f174ddcb9b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py @@ -35,14 +35,13 @@ class TextAnnotation(proto.Message): - r"""TextAnnotation contains a structured representation of OCR - extracted text. The hierarchy of an OCR extracted text structure - is like this: - - TextAnnotation -> Page -> Block -> Paragraph -> Word -> - Symbol Each structural component, starting from Page, may - further have their own properties. Properties describe detected - languages, breaks etc.. Please refer to the + r"""TextAnnotation contains a structured representation of OCR extracted + text. The hierarchy of an OCR extracted text structure is like this: + + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + Each structural component, starting from Page, may further have + their own properties. Properties describe detected languages, breaks + etc.. Please refer to the `TextAnnotation.TextProperty `__ message definition below for more detail. @@ -59,8 +58,8 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): - The BCP-47 language code, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code, such as "en-US" or "sr-Latn". For + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -98,9 +97,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; - does not co-occur with ``SPACE``, - ``LEADER_SPACE``, or ``LINE_BREAK``. + End-line hyphen that is not present in text; does not + co-occur with ``SPACE``, ``LEADER_SPACE``, or + ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -172,8 +171,7 @@ class Page(proto.Message): List of blocks of text, images etc on this page. confidence (float): - Confidence of the OCR results on the page. Range - [0, 1]. + Confidence of the OCR results on the page. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -239,8 +237,7 @@ class Block(proto.Message): Detected block type (text, image etc) for this block. confidence (float): - Confidence of the OCR results on the block. - Range [0, 1]. + Confidence of the OCR results on the block. Range [0, 1]. """ class BlockType(proto.Enum): @@ -302,25 +299,22 @@ class Paragraph(proto.Message): Additional information detected for the paragraph. bounding_box (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The bounding box for the paragraph. The vertices - are in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertice order will still be - (0, 1, 2, 3). + The bounding box for the paragraph. The vertices are in the + order of top-left, top-right, bottom-right, bottom-left. + When a rotation of the bounding box is detected the rotation + is represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertice order + will still be (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1p2beta1.types.Word]): List of words in this paragraph. confidence (float): - Confidence of the OCR results for the paragraph. - Range [0, 1]. + Confidence of the OCR results for the paragraph. Range [0, + 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -351,27 +345,23 @@ class Word(proto.Message): property (google.cloud.vision_v1p2beta1.types.TextAnnotation.TextProperty): Additional information detected for the word. bounding_box (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The bounding box for the word. The vertices are - in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertice order will still be - (0, 1, 2, 3). + The bounding box for the word. The vertices are in the order + of top-left, top-right, bottom-right, bottom-left. When a + rotation of the bounding box is detected the rotation is + represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertice order + will still be (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1p2beta1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural reading order. confidence (float): - Confidence of the OCR results for the word. - Range [0, 1]. + Confidence of the OCR results for the word. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -403,26 +393,22 @@ class Symbol(proto.Message): Additional information detected for the symbol. bounding_box (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The bounding box for the symbol. The vertices - are in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertice order will still be - (0, 1, 2, 3). + The bounding box for the symbol. The vertices are in the + order of top-left, top-right, bottom-right, bottom-left. + When a rotation of the bounding box is detected the rotation + is represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertice order + will still be (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. confidence (float): - Confidence of the OCR results for the symbol. - Range [0, 1]. + Confidence of the OCR results for the symbol. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py index 623e17fe8c2b..648d4e415953 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py @@ -157,8 +157,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as - "en-US" or "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/__init__.py index 43d6ef217f8b..a2e768f2a3da 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/__init__.py @@ -28,7 +28,11 @@ # this code path once we drop support for Python 3.7 import importlib_metadata as metadata -from .services.image_annotator import ImageAnnotatorAsyncClient, ImageAnnotatorClient +from google.cloud.vision_helpers import VisionHelpers +from google.cloud.vision_helpers.decorators import add_single_feature_methods + +from .services.image_annotator import ImageAnnotatorAsyncClient +from .services.image_annotator import ImageAnnotatorClient as IacImageAnnotatorClient from .services.product_search import ProductSearchAsyncClient, ProductSearchClient from .types.geometry import BoundingPoly, NormalizedVertex, Position, Vertex from .types.image_annotator import ( @@ -197,6 +201,13 @@ def _get_version(dependency_name): + "https://devguide.python.org/versions/" ) + +@add_single_feature_methods +class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient): + __doc__ = IacImageAnnotatorClient.__doc__ + Feature = Feature + + __all__ = ( "ImageAnnotatorAsyncClient", "ProductSearchAsyncClient", diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py index e79170f58f1e..f98a15cd4b38 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py @@ -417,11 +417,11 @@ async def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Run asynchronous image detection and annotation for a - list of generic files, such as PDF files, which may - contain multiple pages and multiple images per page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. + r"""Run asynchronous image detection and annotation for a list of + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -477,13 +477,11 @@ async def sample_async_batch_annotate_files(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file - annotation request. + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py index 278cd080d435..98fb5c01b0e5 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py @@ -877,11 +877,11 @@ def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Run asynchronous image detection and annotation for a - list of generic files, such as PDF files, which may - contain multiple pages and multiple images per page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. + r"""Run asynchronous image detection and annotation for a list of + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -937,13 +937,11 @@ def sample_async_batch_annotate_files(): Returns: google.api_core.operation.Operation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file - annotation request. + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py index e178a7b0dc99..26fb39e8be19 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py @@ -380,11 +380,11 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run asynchronous image detection and annotation for a - list of generic files, such as PDF files, which may - contain multiple pages and multiple images per page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. + Run asynchronous image detection and annotation for a list of + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py index 47db7b5889dd..f767c75aa187 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py @@ -389,11 +389,11 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run asynchronous image detection and annotation for a - list of generic files, such as PDF files, which may - contain multiple pages and multiple images per page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. + Run asynchronous image detection and annotation for a list of + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py index ea2c5328e154..4dcc9b15353e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py @@ -73,8 +73,8 @@ class ProductSearchAsyncClient: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, @@ -84,8 +84,7 @@ class ProductSearchAsyncClient: - Each `Product `__ has a collection of `ReferenceImage - `__ resources, - named + `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ @@ -335,8 +334,8 @@ async def create_product_set( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing, - or is longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, or is + longer than 4096 characters. .. code-block:: python @@ -366,13 +365,11 @@ async def sample_create_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.CreateProductSetRequest, dict]]): - The request object. Request message for the - ``CreateProductSet`` method. + The request object. Request message for the ``CreateProductSet`` method. parent (:class:`str`): - Required. The project in which the - ProductSet should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSet should be + created. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -383,14 +380,11 @@ async def sample_create_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_set_id (:class:`str`): - A user-supplied resource id for this - ProductSet. If set, the server will - attempt to use this value as the - resource id. If it is already in use, an - error is returned with code - ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the - character ``/``. + A user-supplied resource id for this ProductSet. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -480,8 +474,8 @@ async def list_product_sets( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100, or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100, or + less than 1. .. code-block:: python @@ -512,13 +506,11 @@ async def sample_list_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListProductSetsRequest, dict]]): - The request object. Request message for the - ``ListProductSets`` method. + The request object. Request message for the ``ListProductSets`` method. parent (:class:`str`): - Required. The project from which - ProductSets should be listed. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which ProductSets should be + listed. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -533,11 +525,10 @@ async def sample_list_product_sets(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductSetsAsyncPager: - Response message for the - ``ListProductSets`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProductSets`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -645,11 +636,10 @@ async def sample_get_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.GetProductSetRequest, dict]]): - The request object. Request message for the - ``GetProductSet`` method. + The request object. Request message for the ``GetProductSet`` method. name (:class:`str`): - Required. Resource name of the - ProductSet to get. + Required. Resource name of the ProductSet to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -740,10 +730,9 @@ async def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer - than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. .. code-block:: python @@ -772,8 +761,7 @@ async def sample_update_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.UpdateProductSetRequest, dict]]): - The request object. Request message for the - ``UpdateProductSet`` method. + The request object. Request message for the ``UpdateProductSet`` method. product_set (:class:`google.cloud.vision_v1p3beta1.types.ProductSet`): Required. The ProductSet resource which replaces the one on the server. @@ -782,12 +770,10 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask - `__ that - specifies which fields to update. If - update_mask isn't specified, all mutable - fields are to be updated. Valid mask - path is ``display_name``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -908,11 +894,10 @@ async def sample_delete_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.DeleteProductSetRequest, dict]]): - The request object. Request message for the - ``DeleteProductSet`` method. + The request object. Request message for the ``DeleteProductSet`` method. name (:class:`str`): - Required. Resource name of the - ProductSet to delete. + Required. Resource name of the ProductSet to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -991,12 +976,11 @@ async def create_product( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing or - longer than 4096 characters. - - * Returns INVALID_ARGUMENT if description is longer than - 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + * Returns INVALID_ARGUMENT if display_name is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is + missing or invalid. .. code-block:: python @@ -1026,11 +1010,10 @@ async def sample_create_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.CreateProductRequest, dict]]): - The request object. Request message for the - ``CreateProduct`` method. + The request object. Request message for the ``CreateProduct`` method. parent (:class:`str`): - Required. The project in which the - Product should be created. + Required. The project in which the Product should be + created. Format is ``projects/PROJECT_ID/locations/LOC_ID``. @@ -1043,13 +1026,11 @@ async def sample_create_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_id (:class:`str`): - A user-supplied resource id for this - Product. If set, the server will attempt - to use this value as the resource id. If - it is already in use, an error is - returned with code ALREADY_EXISTS. Must - be at most 128 characters long. It - cannot contain the character ``/``. + A user-supplied resource id for this Product. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1134,8 +1115,8 @@ async def list_products( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. .. code-block:: python @@ -1166,11 +1147,10 @@ async def sample_list_products(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListProductsRequest, dict]]): - The request object. Request message for the ``ListProducts`` - method. + The request object. Request message for the ``ListProducts`` method. parent (:class:`str`): - Required. The project OR ProductSet from - which Products should be listed. + Required. The project OR ProductSet from which Products + should be listed. Format: ``projects/PROJECT_ID/locations/LOC_ID`` @@ -1188,11 +1168,10 @@ async def sample_list_products(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsAsyncPager: - Response message for the - ``ListProducts`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProducts`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -1298,11 +1277,10 @@ async def sample_get_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.GetProductRequest, dict]]): - The request object. Request message for the ``GetProduct`` - method. + The request object. Request message for the ``GetProduct`` method. name (:class:`str`): - Required. Resource name of the Product - to get. + Required. Resource name of the Product to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -1384,24 +1362,21 @@ async def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only display_name, description and labels can be updated - right now. + Only display_name, description and labels can be updated right + now. - If labels are updated, the change will not be reflected - in queries until the next index time. + If labels are updated, the change will not be reflected in + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer - than 4096 characters. - - * Returns INVALID_ARGUMENT if description is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. - - * Returns INVALID_ARGUMENT if product_category is - present in update_mask. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. .. code-block:: python @@ -1430,8 +1405,7 @@ async def sample_update_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.UpdateProductRequest, dict]]): - The request object. Request message for the - ``UpdateProduct`` method. + The request object. Request message for the ``UpdateProduct`` method. product (:class:`google.cloud.vision_v1p3beta1.types.Product`): Required. The Product resource which replaces the one on the server. @@ -1441,13 +1415,12 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask - `__ that - specifies which fields to update. If - update_mask isn't specified, all mutable - fields are to be updated. Valid mask - paths include ``product_labels``, - ``display_name``, and ``description``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include + ``product_labels``, ``display_name``, and + ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1530,10 +1503,9 @@ async def delete_product( ) -> None: r"""Permanently deletes a product and its reference images. - Metadata of the product and all its images will be - deleted right away, but search queries against - ProductSets containing the product may still work until - all related caches are refreshed. + Metadata of the product and all its images will be deleted right + away, but search queries against ProductSets containing the + product may still work until all related caches are refreshed. Possible errors: @@ -1564,11 +1536,10 @@ async def sample_delete_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.DeleteProductRequest, dict]]): - The request object. Request message for the - ``DeleteProduct`` method. + The request object. Request message for the ``DeleteProduct`` method. name (:class:`str`): - Required. Resource name of product to - delete. + Required. Resource name of product to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -1645,29 +1616,25 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If - ``bounding_poly`` is not specified, the system will try - to detect regions of interest in the image that are - compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, the system will try to detect regions of interest + in the image that are compatible with the product_category on + the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the - image resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the image + resolution is too large to process (above 50MP). Possible errors: - * Returns INVALID_ARGUMENT if the image_uri is missing - or longer than 4096 characters. - - * Returns INVALID_ARGUMENT if the product does not - exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent - product's product_category is detected. - - * Returns INVALID_ARGUMENT if bounding_poly contains - more than 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. * + Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. .. code-block:: python @@ -1701,11 +1668,10 @@ async def sample_create_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.CreateReferenceImageRequest, dict]]): - The request object. Request message for the - ``CreateReferenceImage`` method. + The request object. Request message for the ``CreateReferenceImage`` method. parent (:class:`str`): - Required. Resource name of the product - in which to create the reference image. + Required. Resource name of the product in which to + create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -1721,14 +1687,11 @@ async def sample_create_reference_image(): on the ``request`` instance; if ``request`` is provided, this should not be set. reference_image_id (:class:`str`): - A user-supplied resource id for the - ReferenceImage to be added. If set, the - server will attempt to use this value as - the resource id. If it is already in - use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the - character ``/``. + A user-supplied resource id for the ReferenceImage to be + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1743,9 +1706,8 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1814,17 +1776,16 @@ async def delete_reference_image( ) -> None: r"""Permanently deletes a reference image. - The image metadata will be deleted right away, but - search queries against ProductSets containing the image - may still work until all related caches are refreshed. + The image metadata will be deleted right away, but search + queries against ProductSets containing the image may still work + until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. Possible errors: - * Returns NOT_FOUND if the reference image does not - exist. + * Returns NOT_FOUND if the reference image does not exist. .. code-block:: python @@ -1851,11 +1812,10 @@ async def sample_delete_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.DeleteReferenceImageRequest, dict]]): - The request object. Request message for the - ``DeleteReferenceImage`` method. + The request object. Request message for the ``DeleteReferenceImage`` method. name (:class:`str`): - Required. The resource name of the - reference image to delete. + Required. The resource name of the reference image to + delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -1932,9 +1892,9 @@ async def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not - exist. * Returns INVALID_ARGUMENT if the page_size is - greater than 100, or less than 1. + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. .. code-block:: python @@ -1965,11 +1925,10 @@ async def sample_list_reference_images(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListReferenceImagesRequest, dict]]): - The request object. Request message for the - ``ListReferenceImages`` method. + The request object. Request message for the ``ListReferenceImages`` method. parent (:class:`str`): - Required. Resource name of the product - containing the reference images. + Required. Resource name of the product containing the + reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -1986,11 +1945,10 @@ async def sample_list_reference_images(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListReferenceImagesAsyncPager: - Response message for the - ``ListReferenceImages`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListReferenceImages`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -2068,8 +2026,7 @@ async def get_reference_image( Possible errors: - * Returns NOT_FOUND if the specified image does not - exist. + * Returns NOT_FOUND if the specified image does not exist. .. code-block:: python @@ -2099,11 +2056,10 @@ async def sample_get_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.GetReferenceImageRequest, dict]]): - The request object. Request message for the - ``GetReferenceImage`` method. + The request object. Request message for the ``GetReferenceImage`` method. name (:class:`str`): - Required. The resource name of the - ReferenceImage to get. + Required. The resource name of the ReferenceImage to + get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -2121,9 +2077,8 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2187,15 +2142,15 @@ async def add_product_to_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: - r"""Adds a Product to the specified ProductSet. If the - Product is already present, no change is made. + r"""Adds a Product to the specified ProductSet. If the Product is + already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - * Returns NOT_FOUND if the Product or the ProductSet - doesn't exist. + * Returns NOT_FOUND if the Product or the ProductSet doesn't + exist. .. code-block:: python @@ -2223,11 +2178,11 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the - ``AddProductToProductSet`` method. + The request object. Request message for the ``AddProductToProductSet`` + method. name (:class:`str`): - Required. The resource name for the - ProductSet to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2236,8 +2191,8 @@ async def sample_add_product_to_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): - Required. The resource name for the - Product to be added to this ProductSet. + Required. The resource name for the Product to be added + to this ProductSet. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -2319,8 +2274,8 @@ async def remove_product_from_product_set( Possible errors: - * Returns NOT_FOUND If the Product is not found under - the ProductSet. + * Returns NOT_FOUND If the Product is not found under the + ProductSet. .. code-block:: python @@ -2348,11 +2303,11 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the - ``RemoveProductFromProductSet`` method. + The request object. Request message for the ``RemoveProductFromProductSet`` + method. name (:class:`str`): - Required. The resource name for the - ProductSet to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2361,9 +2316,9 @@ async def sample_remove_product_from_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): - Required. The resource name for the - Product to be removed from this - ProductSet. Format is: + Required. The resource name for the Product to be + removed from this ProductSet. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -2439,14 +2394,14 @@ async def list_products_in_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: - r"""Lists the Products in a ProductSet, in an unspecified - order. If the ProductSet does not exist, the products - field of the response will be empty. + r"""Lists the Products in a ProductSet, in an unspecified order. If + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. .. code-block:: python @@ -2477,11 +2432,11 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the - ``ListProductsInProductSet`` method. + The request object. Request message for the ``ListProductsInProductSet`` + method. name (:class:`str`): - Required. The ProductSet resource for - which to retrieve Products. + Required. The ProductSet resource for which to retrieve + Products. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2499,11 +2454,10 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the - ``ListProductsInProductSet`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProductsInProductSet`` + method. + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -2582,20 +2536,18 @@ async def import_product_sets( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Asynchronous API that imports a list of reference images - to specified product sets based on a list of image - information. + r"""Asynchronous API that imports a list of reference images to + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google - Cloud Storage. For the format of the csv file please see + The input source of this method is a csv file on Google Cloud + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -2631,13 +2583,11 @@ async def sample_import_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ImportProductSetsRequest, dict]]): - The request object. Request message for the - ``ImportProductSets`` method. + The request object. Request message for the ``ImportProductSets`` method. parent (:class:`str`): - Required. The project in which the - ProductSets should be imported. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSets should be + imported. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2659,21 +2609,18 @@ async def sample_import_product_sets(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` - Response message for the - ``ImportProductSets` method. + Response message for the ``ImportProductSets` method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned + `__ method + in the returned `google.longrunning.Operation.response - `__ - field. + `__ field. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py index 3ce442d0f680..b89bf1ed0d74 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py @@ -117,8 +117,8 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, @@ -128,8 +128,7 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): - Each `Product `__ has a collection of `ReferenceImage - `__ resources, - named + `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ @@ -816,8 +815,8 @@ def create_product_set( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing, - or is longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, or is + longer than 4096 characters. .. code-block:: python @@ -847,13 +846,11 @@ def sample_create_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.CreateProductSetRequest, dict]): - The request object. Request message for the - ``CreateProductSet`` method. + The request object. Request message for the ``CreateProductSet`` method. parent (str): - Required. The project in which the - ProductSet should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSet should be + created. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -864,14 +861,11 @@ def sample_create_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_set_id (str): - A user-supplied resource id for this - ProductSet. If set, the server will - attempt to use this value as the - resource id. If it is already in use, an - error is returned with code - ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the - character ``/``. + A user-supplied resource id for this ProductSet. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -958,8 +952,8 @@ def list_product_sets( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100, or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100, or + less than 1. .. code-block:: python @@ -990,13 +984,11 @@ def sample_list_product_sets(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListProductSetsRequest, dict]): - The request object. Request message for the - ``ListProductSets`` method. + The request object. Request message for the ``ListProductSets`` method. parent (str): - Required. The project from which - ProductSets should be listed. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which ProductSets should be + listed. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1011,11 +1003,10 @@ def sample_list_product_sets(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductSetsPager: - Response message for the - ``ListProductSets`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProductSets`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -1120,11 +1111,10 @@ def sample_get_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.GetProductSetRequest, dict]): - The request object. Request message for the - ``GetProductSet`` method. + The request object. Request message for the ``GetProductSet`` method. name (str): - Required. Resource name of the - ProductSet to get. + Required. Resource name of the ProductSet to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -1212,10 +1202,9 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer - than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. .. code-block:: python @@ -1244,8 +1233,7 @@ def sample_update_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.UpdateProductSetRequest, dict]): - The request object. Request message for the - ``UpdateProductSet`` method. + The request object. Request message for the ``UpdateProductSet`` method. product_set (google.cloud.vision_v1p3beta1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. @@ -1254,12 +1242,10 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask - `__ that - specifies which fields to update. If - update_mask isn't specified, all mutable - fields are to be updated. Valid mask - path is ``display_name``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1377,11 +1363,10 @@ def sample_delete_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.DeleteProductSetRequest, dict]): - The request object. Request message for the - ``DeleteProductSet`` method. + The request object. Request message for the ``DeleteProductSet`` method. name (str): - Required. Resource name of the - ProductSet to delete. + Required. Resource name of the ProductSet to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -1457,12 +1442,11 @@ def create_product( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing or - longer than 4096 characters. - - * Returns INVALID_ARGUMENT if description is longer than - 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + * Returns INVALID_ARGUMENT if display_name is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is + missing or invalid. .. code-block:: python @@ -1492,11 +1476,10 @@ def sample_create_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.CreateProductRequest, dict]): - The request object. Request message for the - ``CreateProduct`` method. + The request object. Request message for the ``CreateProduct`` method. parent (str): - Required. The project in which the - Product should be created. + Required. The project in which the Product should be + created. Format is ``projects/PROJECT_ID/locations/LOC_ID``. @@ -1509,13 +1492,11 @@ def sample_create_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_id (str): - A user-supplied resource id for this - Product. If set, the server will attempt - to use this value as the resource id. If - it is already in use, an error is - returned with code ALREADY_EXISTS. Must - be at most 128 characters long. It - cannot contain the character ``/``. + A user-supplied resource id for this Product. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1597,8 +1578,8 @@ def list_products( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. .. code-block:: python @@ -1629,11 +1610,10 @@ def sample_list_products(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListProductsRequest, dict]): - The request object. Request message for the ``ListProducts`` - method. + The request object. Request message for the ``ListProducts`` method. parent (str): - Required. The project OR ProductSet from - which Products should be listed. + Required. The project OR ProductSet from which Products + should be listed. Format: ``projects/PROJECT_ID/locations/LOC_ID`` @@ -1651,11 +1631,10 @@ def sample_list_products(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsPager: - Response message for the - ``ListProducts`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProducts`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -1758,11 +1737,10 @@ def sample_get_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.GetProductRequest, dict]): - The request object. Request message for the ``GetProduct`` - method. + The request object. Request message for the ``GetProduct`` method. name (str): - Required. Resource name of the Product - to get. + Required. Resource name of the Product to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -1841,24 +1819,21 @@ def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only display_name, description and labels can be updated - right now. + Only display_name, description and labels can be updated right + now. - If labels are updated, the change will not be reflected - in queries until the next index time. + If labels are updated, the change will not be reflected in + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer - than 4096 characters. - - * Returns INVALID_ARGUMENT if description is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. - - * Returns INVALID_ARGUMENT if product_category is - present in update_mask. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. .. code-block:: python @@ -1887,8 +1862,7 @@ def sample_update_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.UpdateProductRequest, dict]): - The request object. Request message for the - ``UpdateProduct`` method. + The request object. Request message for the ``UpdateProduct`` method. product (google.cloud.vision_v1p3beta1.types.Product): Required. The Product resource which replaces the one on the server. @@ -1898,13 +1872,12 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask - `__ that - specifies which fields to update. If - update_mask isn't specified, all mutable - fields are to be updated. Valid mask - paths include ``product_labels``, - ``display_name``, and ``description``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include + ``product_labels``, ``display_name``, and + ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1984,10 +1957,9 @@ def delete_product( ) -> None: r"""Permanently deletes a product and its reference images. - Metadata of the product and all its images will be - deleted right away, but search queries against - ProductSets containing the product may still work until - all related caches are refreshed. + Metadata of the product and all its images will be deleted right + away, but search queries against ProductSets containing the + product may still work until all related caches are refreshed. Possible errors: @@ -2018,11 +1990,10 @@ def sample_delete_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.DeleteProductRequest, dict]): - The request object. Request message for the - ``DeleteProduct`` method. + The request object. Request message for the ``DeleteProduct`` method. name (str): - Required. Resource name of product to - delete. + Required. Resource name of product to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -2096,29 +2067,25 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If - ``bounding_poly`` is not specified, the system will try - to detect regions of interest in the image that are - compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, the system will try to detect regions of interest + in the image that are compatible with the product_category on + the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the - image resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the image + resolution is too large to process (above 50MP). Possible errors: - * Returns INVALID_ARGUMENT if the image_uri is missing - or longer than 4096 characters. - - * Returns INVALID_ARGUMENT if the product does not - exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent - product's product_category is detected. - - * Returns INVALID_ARGUMENT if bounding_poly contains - more than 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. * + Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. .. code-block:: python @@ -2152,11 +2119,10 @@ def sample_create_reference_image(): Args: request (Union[google.cloud.vision_v1p3beta1.types.CreateReferenceImageRequest, dict]): - The request object. Request message for the - ``CreateReferenceImage`` method. + The request object. Request message for the ``CreateReferenceImage`` method. parent (str): - Required. Resource name of the product - in which to create the reference image. + Required. Resource name of the product in which to + create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -2172,14 +2138,11 @@ def sample_create_reference_image(): on the ``request`` instance; if ``request`` is provided, this should not be set. reference_image_id (str): - A user-supplied resource id for the - ReferenceImage to be added. If set, the - server will attempt to use this value as - the resource id. If it is already in - use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the - character ``/``. + A user-supplied resource id for the ReferenceImage to be + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2194,9 +2157,8 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2262,17 +2224,16 @@ def delete_reference_image( ) -> None: r"""Permanently deletes a reference image. - The image metadata will be deleted right away, but - search queries against ProductSets containing the image - may still work until all related caches are refreshed. + The image metadata will be deleted right away, but search + queries against ProductSets containing the image may still work + until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. Possible errors: - * Returns NOT_FOUND if the reference image does not - exist. + * Returns NOT_FOUND if the reference image does not exist. .. code-block:: python @@ -2299,11 +2260,10 @@ def sample_delete_reference_image(): Args: request (Union[google.cloud.vision_v1p3beta1.types.DeleteReferenceImageRequest, dict]): - The request object. Request message for the - ``DeleteReferenceImage`` method. + The request object. Request message for the ``DeleteReferenceImage`` method. name (str): - Required. The resource name of the - reference image to delete. + Required. The resource name of the reference image to + delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -2377,9 +2337,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not - exist. * Returns INVALID_ARGUMENT if the page_size is - greater than 100, or less than 1. + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. .. code-block:: python @@ -2410,11 +2370,10 @@ def sample_list_reference_images(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListReferenceImagesRequest, dict]): - The request object. Request message for the - ``ListReferenceImages`` method. + The request object. Request message for the ``ListReferenceImages`` method. parent (str): - Required. Resource name of the product - containing the reference images. + Required. Resource name of the product containing the + reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -2431,11 +2390,10 @@ def sample_list_reference_images(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListReferenceImagesPager: - Response message for the - ``ListReferenceImages`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListReferenceImages`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -2510,8 +2468,7 @@ def get_reference_image( Possible errors: - * Returns NOT_FOUND if the specified image does not - exist. + * Returns NOT_FOUND if the specified image does not exist. .. code-block:: python @@ -2541,11 +2498,10 @@ def sample_get_reference_image(): Args: request (Union[google.cloud.vision_v1p3beta1.types.GetReferenceImageRequest, dict]): - The request object. Request message for the - ``GetReferenceImage`` method. + The request object. Request message for the ``GetReferenceImage`` method. name (str): - Required. The resource name of the - ReferenceImage to get. + Required. The resource name of the ReferenceImage to + get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -2563,9 +2519,8 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2626,15 +2581,15 @@ def add_product_to_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: - r"""Adds a Product to the specified ProductSet. If the - Product is already present, no change is made. + r"""Adds a Product to the specified ProductSet. If the Product is + already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - * Returns NOT_FOUND if the Product or the ProductSet - doesn't exist. + * Returns NOT_FOUND if the Product or the ProductSet doesn't + exist. .. code-block:: python @@ -2662,11 +2617,11 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the - ``AddProductToProductSet`` method. + The request object. Request message for the ``AddProductToProductSet`` + method. name (str): - Required. The resource name for the - ProductSet to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2675,8 +2630,8 @@ def sample_add_product_to_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): - Required. The resource name for the - Product to be added to this ProductSet. + Required. The resource name for the Product to be added + to this ProductSet. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -2757,8 +2712,8 @@ def remove_product_from_product_set( Possible errors: - * Returns NOT_FOUND If the Product is not found under - the ProductSet. + * Returns NOT_FOUND If the Product is not found under the + ProductSet. .. code-block:: python @@ -2786,11 +2741,11 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the - ``RemoveProductFromProductSet`` method. + The request object. Request message for the ``RemoveProductFromProductSet`` + method. name (str): - Required. The resource name for the - ProductSet to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2799,9 +2754,9 @@ def sample_remove_product_from_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): - Required. The resource name for the - Product to be removed from this - ProductSet. Format is: + Required. The resource name for the Product to be + removed from this ProductSet. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -2876,14 +2831,14 @@ def list_products_in_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: - r"""Lists the Products in a ProductSet, in an unspecified - order. If the ProductSet does not exist, the products - field of the response will be empty. + r"""Lists the Products in a ProductSet, in an unspecified order. If + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. .. code-block:: python @@ -2914,11 +2869,11 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the - ``ListProductsInProductSet`` method. + The request object. Request message for the ``ListProductsInProductSet`` + method. name (str): - Required. The ProductSet resource for - which to retrieve Products. + Required. The ProductSet resource for which to retrieve + Products. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2936,11 +2891,10 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the - ``ListProductsInProductSet`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProductsInProductSet`` + method. + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -3018,20 +2972,18 @@ def import_product_sets( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Asynchronous API that imports a list of reference images - to specified product sets based on a list of image - information. + r"""Asynchronous API that imports a list of reference images to + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google - Cloud Storage. For the format of the csv file please see + The input source of this method is a csv file on Google Cloud + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -3067,13 +3019,11 @@ def sample_import_product_sets(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ImportProductSetsRequest, dict]): - The request object. Request message for the - ``ImportProductSets`` method. + The request object. Request message for the ``ImportProductSets`` method. parent (str): - Required. The project in which the - ProductSets should be imported. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSets should be + imported. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3095,21 +3045,18 @@ def sample_import_product_sets(): Returns: google.api_core.operation.Operation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` - Response message for the - ``ImportProductSets` method. + Response message for the ``ImportProductSets` method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned + `__ method + in the returned `google.longrunning.Operation.response - `__ - field. + `__ field. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py index 86b8cde1528e..08aa87b0806e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py @@ -117,8 +117,8 @@ class ProductSearchGrpcTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, @@ -128,8 +128,7 @@ class ProductSearchGrpcTransport(ProductSearchTransport): - Each `Product `__ has a collection of `ReferenceImage - `__ resources, - named + `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -371,8 +370,8 @@ def create_product_set( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing, - or is longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, or is + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -405,8 +404,8 @@ def list_product_sets( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100, or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100, or + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -472,10 +471,9 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer - than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -541,12 +539,11 @@ def create_product( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing or - longer than 4096 characters. - - * Returns INVALID_ARGUMENT if description is longer than - 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + * Returns INVALID_ARGUMENT if display_name is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is + missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -579,8 +576,8 @@ def list_products( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. Returns: Callable[[~.ListProductsRequest], @@ -641,24 +638,21 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only display_name, description and labels can be updated - right now. + Only display_name, description and labels can be updated right + now. - If labels are updated, the change will not be reflected - in queries until the next index time. + If labels are updated, the change will not be reflected in + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer - than 4096 characters. - - * Returns INVALID_ARGUMENT if description is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. - - * Returns INVALID_ARGUMENT if product_category is - present in update_mask. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -686,10 +680,9 @@ def delete_product( Permanently deletes a product and its reference images. - Metadata of the product and all its images will be - deleted right away, but search queries against - ProductSets containing the product may still work until - all related caches are refreshed. + Metadata of the product and all its images will be deleted right + away, but search queries against ProductSets containing the + product may still work until all related caches are refreshed. Possible errors: @@ -724,29 +717,25 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If - ``bounding_poly`` is not specified, the system will try - to detect regions of interest in the image that are - compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, the system will try to detect regions of interest + in the image that are compatible with the product_category on + the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the - image resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the image + resolution is too large to process (above 50MP). Possible errors: - * Returns INVALID_ARGUMENT if the image_uri is missing - or longer than 4096 characters. - - * Returns INVALID_ARGUMENT if the product does not - exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent - product's product_category is detected. - - * Returns INVALID_ARGUMENT if bounding_poly contains - more than 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. * + Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -776,17 +765,16 @@ def delete_reference_image( Permanently deletes a reference image. - The image metadata will be deleted right away, but - search queries against ProductSets containing the image - may still work until all related caches are refreshed. + The image metadata will be deleted right away, but search + queries against ProductSets containing the image may still work + until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. Possible errors: - * Returns NOT_FOUND if the reference image does not - exist. + * Returns NOT_FOUND if the reference image does not exist. Returns: Callable[[~.DeleteReferenceImageRequest], @@ -819,9 +807,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not - exist. * Returns INVALID_ARGUMENT if the page_size is - greater than 100, or less than 1. + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -854,8 +842,7 @@ def get_reference_image( Possible errors: - * Returns NOT_FOUND if the specified image does not - exist. + * Returns NOT_FOUND if the specified image does not exist. Returns: Callable[[~.GetReferenceImageRequest], @@ -883,15 +870,15 @@ def add_product_to_product_set( ]: r"""Return a callable for the add product to product set method over gRPC. - Adds a Product to the specified ProductSet. If the - Product is already present, no change is made. + Adds a Product to the specified ProductSet. If the Product is + already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - * Returns NOT_FOUND if the Product or the ProductSet - doesn't exist. + * Returns NOT_FOUND if the Product or the ProductSet doesn't + exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -926,8 +913,8 @@ def remove_product_from_product_set( Possible errors: - * Returns NOT_FOUND If the Product is not found under - the ProductSet. + * Returns NOT_FOUND If the Product is not found under the + ProductSet. Returns: Callable[[~.RemoveProductFromProductSetRequest], @@ -958,14 +945,14 @@ def list_products_in_product_set( ]: r"""Return a callable for the list products in product set method over gRPC. - Lists the Products in a ProductSet, in an unspecified - order. If the ProductSet does not exist, the products - field of the response will be empty. + Lists the Products in a ProductSet, in an unspecified order. If + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -995,20 +982,18 @@ def import_product_sets( ]: r"""Return a callable for the import product sets method over gRPC. - Asynchronous API that imports a list of reference images - to specified product sets based on a list of image - information. + Asynchronous API that imports a list of reference images to + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google - Cloud Storage. For the format of the csv file please see + The input source of this method is a csv file on Google Cloud + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py index 584c87639584..31846fe371ca 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py @@ -123,8 +123,8 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, @@ -134,8 +134,7 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): - Each `Product `__ has a collection of `ReferenceImage - `__ resources, - named + `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -379,8 +378,8 @@ def create_product_set( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing, - or is longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, or is + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -413,8 +412,8 @@ def list_product_sets( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100, or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100, or + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -481,10 +480,9 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer - than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -553,12 +551,11 @@ def create_product( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing or - longer than 4096 characters. - - * Returns INVALID_ARGUMENT if description is longer than - 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + * Returns INVALID_ARGUMENT if display_name is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is + missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -591,8 +588,8 @@ def list_products( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. Returns: Callable[[~.ListProductsRequest], @@ -655,24 +652,21 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only display_name, description and labels can be updated - right now. + Only display_name, description and labels can be updated right + now. - If labels are updated, the change will not be reflected - in queries until the next index time. + If labels are updated, the change will not be reflected in + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer - than 4096 characters. - - * Returns INVALID_ARGUMENT if description is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. - - * Returns INVALID_ARGUMENT if product_category is - present in update_mask. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -702,10 +696,9 @@ def delete_product( Permanently deletes a product and its reference images. - Metadata of the product and all its images will be - deleted right away, but search queries against - ProductSets containing the product may still work until - all related caches are refreshed. + Metadata of the product and all its images will be deleted right + away, but search queries against ProductSets containing the + product may still work until all related caches are refreshed. Possible errors: @@ -740,29 +733,25 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If - ``bounding_poly`` is not specified, the system will try - to detect regions of interest in the image that are - compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, the system will try to detect regions of interest + in the image that are compatible with the product_category on + the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the - image resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the image + resolution is too large to process (above 50MP). Possible errors: - * Returns INVALID_ARGUMENT if the image_uri is missing - or longer than 4096 characters. - - * Returns INVALID_ARGUMENT if the product does not - exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent - product's product_category is detected. - - * Returns INVALID_ARGUMENT if bounding_poly contains - more than 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. * + Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -792,17 +781,16 @@ def delete_reference_image( Permanently deletes a reference image. - The image metadata will be deleted right away, but - search queries against ProductSets containing the image - may still work until all related caches are refreshed. + The image metadata will be deleted right away, but search + queries against ProductSets containing the image may still work + until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. Possible errors: - * Returns NOT_FOUND if the reference image does not - exist. + * Returns NOT_FOUND if the reference image does not exist. Returns: Callable[[~.DeleteReferenceImageRequest], @@ -835,9 +823,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not - exist. * Returns INVALID_ARGUMENT if the page_size is - greater than 100, or less than 1. + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -870,8 +858,7 @@ def get_reference_image( Possible errors: - * Returns NOT_FOUND if the specified image does not - exist. + * Returns NOT_FOUND if the specified image does not exist. Returns: Callable[[~.GetReferenceImageRequest], @@ -900,15 +887,15 @@ def add_product_to_product_set( ]: r"""Return a callable for the add product to product set method over gRPC. - Adds a Product to the specified ProductSet. If the - Product is already present, no change is made. + Adds a Product to the specified ProductSet. If the Product is + already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - * Returns NOT_FOUND if the Product or the ProductSet - doesn't exist. + * Returns NOT_FOUND if the Product or the ProductSet doesn't + exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -944,8 +931,8 @@ def remove_product_from_product_set( Possible errors: - * Returns NOT_FOUND If the Product is not found under - the ProductSet. + * Returns NOT_FOUND If the Product is not found under the + ProductSet. Returns: Callable[[~.RemoveProductFromProductSetRequest], @@ -976,14 +963,14 @@ def list_products_in_product_set( ]: r"""Return a callable for the list products in product set method over gRPC. - Lists the Products in a ProductSet, in an unspecified - order. If the ProductSet does not exist, the products - field of the response will be empty. + Lists the Products in a ProductSet, in an unspecified order. If + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -1014,20 +1001,18 @@ def import_product_sets( ]: r"""Return a callable for the import product sets method over gRPC. - Asynchronous API that imports a list of reference images - to specified product sets based on a list of image - information. + Asynchronous API that imports a list of reference images to + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google - Cloud Storage. For the format of the csv file please see + The input source of this method is a csv file on Google Cloud + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py index 51a2a6c55fef..351b2e0a11ad 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py @@ -954,8 +954,8 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, @@ -965,8 +965,7 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): - Each `Product `__ has a collection of `ReferenceImage - `__ resources, - named + `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -1115,8 +1114,8 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the - ``AddProductToProductSet`` method. + The request object. Request message for the ``AddProductToProductSet`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1230,8 +1229,7 @@ def __call__( Args: request (~.product_search_service.CreateProductRequest): - The request object. Request message for the - ``CreateProduct`` method. + The request object. Request message for the ``CreateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1381,8 +1379,7 @@ def __call__( Args: request (~.product_search_service.CreateProductSetRequest): - The request object. Request message for the - ``CreateProductSet`` method. + The request object. Request message for the ``CreateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1541,8 +1538,7 @@ def __call__( Args: request (~.product_search_service.CreateReferenceImageRequest): - The request object. Request message for the - ``CreateReferenceImage`` method. + The request object. Request message for the ``CreateReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1553,9 +1549,8 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ @@ -1698,8 +1693,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductRequest): - The request object. Request message for the - ``DeleteProduct`` method. + The request object. Request message for the ``DeleteProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1805,8 +1799,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductSetRequest): - The request object. Request message for the - ``DeleteProductSet`` method. + The request object. Request message for the ``DeleteProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1914,8 +1907,7 @@ def __call__( Args: request (~.product_search_service.DeleteReferenceImageRequest): - The request object. Request message for the - ``DeleteReferenceImage`` method. + The request object. Request message for the ``DeleteReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2023,8 +2015,7 @@ def __call__( Args: request (~.product_search_service.GetProductRequest): - The request object. Request message for the ``GetProduct`` - method. + The request object. Request message for the ``GetProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2172,8 +2163,7 @@ def __call__( Args: request (~.product_search_service.GetProductSetRequest): - The request object. Request message for the - ``GetProductSet`` method. + The request object. Request message for the ``GetProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2324,8 +2314,7 @@ def __call__( Args: request (~.product_search_service.GetReferenceImageRequest): - The request object. Request message for the - ``GetReferenceImage`` method. + The request object. Request message for the ``GetReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2336,9 +2325,8 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ @@ -2477,8 +2465,7 @@ def __call__( Args: request (~.product_search_service.ImportProductSetsRequest): - The request object. Request message for the - ``ImportProductSets`` method. + The request object. Request message for the ``ImportProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2630,8 +2617,7 @@ def __call__( Args: request (~.product_search_service.ListProductsRequest): - The request object. Request message for the ``ListProducts`` - method. + The request object. Request message for the ``ListProducts`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2642,9 +2628,7 @@ def __call__( Returns: ~.product_search_service.ListProductsResponse: - Response message for the - ``ListProducts`` method. - + Response message for the ``ListProducts`` method. """ http_options = ( @@ -2779,8 +2763,7 @@ def __call__( Args: request (~.product_search_service.ListProductSetsRequest): - The request object. Request message for the - ``ListProductSets`` method. + The request object. Request message for the ``ListProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2791,9 +2774,7 @@ def __call__( Returns: ~.product_search_service.ListProductSetsResponse: - Response message for the - ``ListProductSets`` method. - + Response message for the ``ListProductSets`` method. """ http_options = ( @@ -2932,8 +2913,8 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the - ``ListProductsInProductSet`` method. + The request object. Request message for the ``ListProductsInProductSet`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2944,8 +2925,8 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the - ``ListProductsInProductSet`` method. + Response message for the ``ListProductsInProductSet`` + method. """ @@ -3087,8 +3068,7 @@ def __call__( Args: request (~.product_search_service.ListReferenceImagesRequest): - The request object. Request message for the - ``ListReferenceImages`` method. + The request object. Request message for the ``ListReferenceImages`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3099,9 +3079,7 @@ def __call__( Returns: ~.product_search_service.ListReferenceImagesResponse: - Response message for the - ``ListReferenceImages`` method. - + Response message for the ``ListReferenceImages`` method. """ http_options = ( @@ -3243,8 +3221,8 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the - ``RemoveProductFromProductSet`` method. + The request object. Request message for the ``RemoveProductFromProductSet`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3360,8 +3338,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductRequest): - The request object. Request message for the - ``UpdateProduct`` method. + The request object. Request message for the ``UpdateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3511,8 +3488,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductSetRequest): - The request object. Request message for the - ``UpdateProductSet`` method. + The request object. Request message for the ``UpdateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py index bdf360dbaa90..898164827790 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py @@ -104,24 +104,23 @@ class Likelihood(proto.Enum): class Feature(proto.Message): - r"""The type of Google Cloud Vision API detection to perform, and - the maximum number of results to return for that type. Multiple + r"""The type of Google Cloud Vision API detection to perform, and the + maximum number of results to return for that type. Multiple ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p3beta1.types.Feature.Type): The feature type. max_results (int): - Maximum number of results of this type. Does not - apply to ``TEXT_DETECTION``, - ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. + Maximum number of results of this type. Does not apply to + ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or + ``CROP_HINTS``. model (str): Model to use for the feature. - Supported values: "builtin/stable" (the default - if unset) and "builtin/latest". - ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" - for the bleeding edge release updated weekly. + Supported values: "builtin/stable" (the default if unset) + and "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also support "builtin/weekly" for the + bleeding edge release updated weekly. """ class Type(proto.Enum): @@ -139,15 +138,14 @@ class Type(proto.Enum): LABEL_DETECTION (4): Run label detection. TEXT_DETECTION (5): - Run text detection / optical character - recognition (OCR). Text detection is optimized - for areas of text within a larger image; if the - image is a document, use + Run text detection / optical character recognition (OCR). + Text detection is optimized for areas of text within a + larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): - Run dense text document OCR. Takes precedence - when both ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` are present. + Run dense text document OCR. Takes precedence when both + ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are + present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -201,9 +199,8 @@ class ImageSource(proto.Message): **Use ``image_uri`` instead.** The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud - Storage Request + ``gs://bucket_name/object_name``. Object versioning is not + supported. See `Google Cloud Storage Request URIs `__ for more info. @@ -211,27 +208,23 @@ class ImageSource(proto.Message): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google - Cloud Storage Request + ``gs://bucket_name/object_name``. Object versioning is + not supported. See `Google Cloud Storage Request URIs `__ for more info. - 2. A publicly-accessible image HTTP/HTTPS URL. - When fetching images from HTTP/HTTPS - URLs, Google cannot guarantee that the - request will be completed. Your request - may fail if the specified host denies the - request (e.g. due to request throttling or - DOS prevention), or if Google throttles - requests to the site for abuse prevention. - You should not depend on - externally-hosted images for production - applications. - - When both ``gcs_image_uri`` and ``image_uri`` - are specified, ``image_uri`` takes precedence. + 2. A publicly-accessible image HTTP/HTTPS URL. When fetching + images from HTTP/HTTPS URLs, Google cannot guarantee + that the request will be completed. Your request may + fail if the specified host denies the request (e.g. + due to request throttling or DOS prevention), or if + Google throttles requests to the site for abuse + prevention. You should not depend on + externally-hosted images for production applications. + + When both ``gcs_image_uri`` and ``image_uri`` are specified, + ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -250,15 +243,14 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers - use a pure binary representation, whereas JSON - representations use base64. + Note: As with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. source (google.cloud.vision_v1p3beta1.types.ImageSource): - Google Cloud Storage image location, or - publicly-accessible image URL. If both - ``content`` and ``source`` are provided for an - image, ``content`` takes precedence and is used - to perform the image annotation request. + Google Cloud Storage image location, or publicly-accessible + image URL. If both ``content`` and ``source`` are provided + for an image, ``content`` takes precedence and is used to + perform the image annotation request. """ content: bytes = proto.Field( @@ -278,43 +270,36 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The bounding polygon around the face. The - coordinates of the bounding box are in the - original image's scale, as returned in - ``ImageParams``. The bounding box is computed to - "frame" the face in accordance with human - expectations. It is based on the landmarker - results. Note that one or more x and/or y - coordinates may not be generated in the - ``BoundingPoly`` (the polygon will be unbounded) - if only a partial face appears in the image to - be annotated. + The bounding polygon around the face. The coordinates of the + bounding box are in the original image's scale, as returned + in ``ImageParams``. The bounding box is computed to "frame" + the face in accordance with human expectations. It is based + on the landmarker results. Note that one or more x and/or y + coordinates may not be generated in the ``BoundingPoly`` + (the polygon will be unbounded) if only a partial face + appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is - tighter than the ``boundingPoly``, and encloses - only the skin part of the face. Typically, it is - used to eliminate the face from any image - analysis that detects the "amount of skin" - visible in an image. It is not based on the - landmarker results, only on the initial face - detection, hence the fd (face + The ``fd_bounding_poly`` bounding polygon is tighter than + the ``boundingPoly``, and encloses only the skin part of the + face. Typically, it is used to eliminate the face from any + image analysis that detects the "amount of skin" visible in + an image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p3beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face - relative to the image vertical about the axis - perpendicular to the face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the face. + Range [-180,180]. pan_angle (float): - Yaw angle, which indicates the - leftward/rightward angle that the face is - pointing relative to the vertical plane + Yaw angle, which indicates the leftward/rightward angle that + the face is pointing relative to the vertical plane perpendicular to the image. Range [-180,180]. tilt_angle (float): - Pitch angle, which indicates the - upwards/downwards angle that the face is - pointing relative to the image's horizontal + Pitch angle, which indicates the upwards/downwards angle + that the face is pointing relative to the image's horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. @@ -349,8 +334,8 @@ class Landmark(proto.Message): class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the - image without considering mirror projections typical of photos. - So, ``LEFT_EYE``, typically, is the person's right eye. + image without considering mirror projections typical of photos. So, + ``LEFT_EYE``, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -592,47 +577,42 @@ class EntityAnnotation(proto.Message): mid (str): Opaque entity ID. Some IDs may be available in `Google Knowledge Graph Search - API - `__. + API `__. locale (str): - The language code for the locale in which the - entity textual ``description`` is expressed. + The language code for the locale in which the entity textual + ``description`` is expressed. description (str): - Entity textual description, expressed in its - ``locale`` language. + Entity textual description, expressed in its ``locale`` + language. score (float): Overall score of the result. Range [0, 1]. confidence (float): **Deprecated. Use ``score`` instead.** - The accuracy of the entity detection in an - image. For example, for an image in which the - "Eiffel Tower" entity is detected, this field - represents the confidence that there is a tower - in the query image. Range [0, 1]. + The accuracy of the entity detection in an image. For + example, for an image in which the "Eiffel Tower" entity is + detected, this field represents the confidence that there is + a tower in the query image. Range [0, 1]. topicality (float): - The relevancy of the ICA (Image Content - Annotation) label to the image. For example, the - relevancy of "tower" is likely higher to an - image containing the detected "Eiffel Tower" - than to an image containing a detected distant - towering building, even though the confidence - that there is a tower in each image may be the - same. Range [0, 1]. + The relevancy of the ICA (Image Content Annotation) label to + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower + in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): - Image region to which this entity belongs. Not - produced for ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not produced + for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p3beta1.types.LocationInfo]): - The location information for the detected - entity. Multiple ``LocationInfo`` elements can - be present because one location may indicate the - location of the scene in the image, and another - location may indicate the location of the place - where the image was taken. Location information - is usually present for landmarks. + The location information for the detected entity. Multiple + ``LocationInfo`` elements can be present because one + location may indicate the location of the scene in the + image, and another location may indicate the location of the + place where the image was taken. Location information is + usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p3beta1.types.Property]): - Some entities may have optional user-supplied - ``Property`` (name/value) fields, such a score - or string that qualifies the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) fields, such a score or string that qualifies + the entity. """ mid: str = proto.Field( @@ -684,12 +664,11 @@ class LocalizedObjectAnnotation(proto.Message): Object ID that should align with EntityAnnotation mid. language_code (str): - The BCP-47 language code, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code, such as "en-US" or "sr-Latn". For + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` - language. + Object name, expressed in its ``language_code`` language. score (float): Score of the result. Range [0, 1]. bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): @@ -806,11 +785,10 @@ class ColorInfo(proto.Message): color (google.type.color_pb2.Color): RGB components of the color. score (float): - Image-specific score for this color. Value in - range [0, 1]. + Image-specific score for this color. Value in range [0, 1]. pixel_fraction (float): - The fraction of pixels the color occupies in the - image. Value in range [0, 1]. + The fraction of pixels the color occupies in the image. + Value in range [0, 1]. """ color: color_pb2.Color = proto.Field( @@ -866,13 +844,11 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The bounding polygon for the crop region. The - coordinates of the bounding box are in the - original image's scale, as returned in - ``ImageParams``. + The bounding polygon for the crop region. The coordinates of + the bounding box are in the original image's scale, as + returned in ``ImageParams``. confidence (float): - Confidence of this being a salient region. - Range [0, 1]. + Confidence of this being a salient region. Range [0, 1]. importance_fraction (float): Fraction of importance of this salient region with respect to the original image. @@ -951,10 +927,9 @@ class TextDetectionParams(proto.Message): Attributes: enable_text_detection_confidence_score (bool): - By default, Cloud Vision API only includes - confidence score for DOCUMENT_TEXT_DETECTION - result. Set the flag to true to include - confidence score for TEXT_DETECTION as well. + By default, Cloud Vision API only includes confidence score + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -977,18 +952,15 @@ class ImageContext(proto.Message): lat_long_rect (google.cloud.vision_v1p3beta1.types.LatLongRect): Not used. language_hints (MutableSequence[str]): - List of languages to use for TEXT_DETECTION. In - most cases, an empty value yields the best - results since it enables automatic language - detection. For languages based on the Latin - alphabet, setting ``language_hints`` is not - needed. In rare cases, when the language of the - text in the image is known, setting a hint will - help get better results (although it will be a - significant hindrance if the hint is wrong). - Text detection returns an error if one or more - of the specified languages is not one of the - `supported languages + List of languages to use for TEXT_DETECTION. In most cases, + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In + rare cases, when the language of the text in the image is + known, setting a hint will help get better results (although + it will be a significant hindrance if the hint is wrong). + Text detection returns an error if one or more of the + specified languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p3beta1.types.CropHintsParams): Parameters for crop hints annotation request. @@ -1131,10 +1103,9 @@ class AnnotateImageResponse(proto.Message): If present, product search has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the - operation. Note that filled-in image annotations - are guaranteed to be correct, even when - ``error`` is set. + If set, represents the error message for the operation. + Note that filled-in image annotations are guaranteed to be + correct, even when ``error`` is set. context (google.cloud.vision_v1p3beta1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1393,20 +1364,18 @@ class OutputConfig(proto.Message): The Google Cloud Storage location to write the output(s) to. batch_size (int): - The max number of response protos to put into - each output JSON file on Google Cloud Storage. - The valid range is [1, 100]. If not specified, - the default value is 20. - - For example, for one pdf file with 100 pages, - 100 response protos will be generated. If - ``batch_size`` = 20, then 5 json files each - containing 20 response protos will be written - under the prefix ``gcs_destination``.``uri``. - - Currently, batch_size only applies to - GcsDestination, with potential future support - for other output configurations. + The max number of response protos to put into each output + JSON file on Google Cloud Storage. + The valid range is [1, 100]. If not specified, the default + value is 20. + + For example, for one pdf file with 100 pages, 100 response + protos will be generated. If ``batch_size`` = 20, then 5 + json files each containing 20 response protos will be + written under the prefix ``gcs_destination``.``uri``. + + Currently, batch_size only applies to GcsDestination, with + potential future support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1443,26 +1412,23 @@ class GcsDestination(proto.Message): Attributes: uri (str): - Google Cloud Storage URI where the results will - be stored. Results will be in JSON format and - preceded by its corresponding input URI. This - field can either represent a single file, or a - prefix for multiple outputs. Prefixes must end - in a ``/``. + Google Cloud Storage URI where the results will be stored. + Results will be in JSON format and preceded by its + corresponding input URI. This field can either represent a + single file, or a prefix for multiple outputs. Prefixes must + end in a ``/``. Examples: * File: gs://bucket-name/filename.json * Prefix: gs://bucket-name/prefix/here/ - * File: gs://bucket-name/prefix/here If multiple outputs, each response is still - AnnotateFileResponse, each of which contains - some subset of the full list of - AnnotateImageResponse. Multiple outputs can - happen if, for example, the output JSON is too - large and overflows into multiple sharded files. + AnnotateFileResponse, each of which contains some subset of + the full list of AnnotateImageResponse. Multiple outputs can + happen if, for example, the output JSON is too large and + overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py index 71b9b9e5541d..2c06f26aaefa 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py @@ -41,8 +41,8 @@ class ProductSearchParams(proto.Message): system discretion will be applied. product_set (str): The resource name of a `ProductSet - `__ to - be searched for similar images. Format is: + `__ to be searched + for similar images. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): @@ -147,12 +147,11 @@ class ObjectAnnotation(proto.Message): Object ID that should align with EntityAnnotation mid. language_code (str): - The BCP-47 language code, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code, such as "en-US" or "sr-Latn". For + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` - language. + Object name, expressed in its ``language_code`` language. score (float): Score of the result. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py index bbf40f7baa1c..1bb49d4bdf2a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py @@ -87,17 +87,16 @@ class Product(proto.Message): "apparel", and "toys" are still supported, but these should not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1p3beta1.types.Product.KeyValue]): - Key-value pairs that can be attached to a - product. At query time, constraints can be - specified based on the product_labels. + Key-value pairs that can be attached to a product. At query + time, constraints can be specified based on the + product_labels. - Note that integer values can be provided as - strings, e.g. "1199". Only strings with integer - values can match a range-based restriction which - is to be supported soon. + Note that integer values can be provided as strings, e.g. + "1199". Only strings with integer values can match a + range-based restriction which is to be supported soon. - Multiple values can be assigned to the same key. - One product may have up to 100 product_labels. + Multiple values can be assigned to the same key. One product + may have up to 100 product_labels. """ class KeyValue(proto.Message): @@ -158,8 +157,7 @@ class ProductSet(proto.Message): ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. - This field is ignored when creating a - ProductSet. + This field is ignored when creating a ProductSet. display_name (str): The user-provided name for this ProductSet. Must not be empty. Must be at most 4096 @@ -214,11 +212,10 @@ class ReferenceImage(proto.Message): ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. - This field is ignored when creating a reference - image. + This field is ignored when creating a reference image. uri (str): - Required. The Google Cloud Storage URI of the - reference image. + Required. The Google Cloud Storage URI of the reference + image. The URI must start with ``gs://``. bounding_polys (MutableSequence[google.cloud.vision_v1p3beta1.types.BoundingPoly]): Optional. Bounding polygons around the areas @@ -254,19 +251,18 @@ class CreateProductRequest(proto.Message): Attributes: parent (str): - Required. The project in which the Product - should be created. + Required. The project in which the Product should be + created. Format is ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1p3beta1.types.Product): Required. The product to create. product_id (str): - A user-supplied resource id for this Product. If - set, the server will attempt to use this value - as the resource id. If it is already in use, an - error is returned with code ALREADY_EXISTS. Must - be at most 128 characters long. It cannot - contain the character ``/``. + A user-supplied resource id for this Product. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -289,8 +285,8 @@ class ListProductsRequest(proto.Message): Attributes: parent (str): - Required. The project OR ProductSet from which - Products should be listed. + Required. The project OR ProductSet from which Products + should be listed. Format: ``projects/PROJECT_ID/locations/LOC_ID`` @@ -298,8 +294,8 @@ class ListProductsRequest(proto.Message): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous - List request, if any. + The next_page_token returned from a previous List request, + if any. """ parent: str = proto.Field( @@ -370,12 +366,12 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ - that specifies which fields to update. - If update_mask isn't specified, all mutable - fields are to be updated. Valid mask paths - include ``product_labels``, ``display_name``, - and ``description``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include + ``product_labels``, ``display_name``, and + ``description``. """ product: "Product" = proto.Field( @@ -413,19 +409,17 @@ class CreateProductSetRequest(proto.Message): Attributes: parent (str): - Required. The project in which the ProductSet - should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSet should be + created. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. product_set (google.cloud.vision_v1p3beta1.types.ProductSet): Required. The ProductSet to create. product_set_id (str): - A user-supplied resource id for this ProductSet. - If set, the server will attempt to use this - value as the resource id. If it is already in - use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 characters - long. It cannot contain the character ``/``. + A user-supplied resource id for this ProductSet. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -448,16 +442,15 @@ class ListProductSetsRequest(proto.Message): Attributes: parent (str): - Required. The project from which ProductSets - should be listed. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which ProductSets should be + listed. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous - List request, if any. + The next_page_token returned from a previous List request, + if any. """ parent: str = proto.Field( @@ -506,8 +499,8 @@ class GetProductSetRequest(proto.Message): Attributes: name (str): - Required. Resource name of the ProductSet to - get. + Required. Resource name of the ProductSet to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -527,11 +520,10 @@ class UpdateProductSetRequest(proto.Message): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ - that specifies which fields to update. - If update_mask isn't specified, all mutable - fields are to be updated. Valid mask path is - ``display_name``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. """ product_set: "ProductSet" = proto.Field( @@ -551,8 +543,8 @@ class DeleteProductSetRequest(proto.Message): Attributes: name (str): - Required. Resource name of the ProductSet to - delete. + Required. Resource name of the ProductSet to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -569,21 +561,19 @@ class CreateReferenceImageRequest(proto.Message): Attributes: parent (str): - Required. Resource name of the product in which - to create the reference image. + Required. Resource name of the product in which to + create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. reference_image (google.cloud.vision_v1p3beta1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): - A user-supplied resource id for the - ReferenceImage to be added. If set, the server - will attempt to use this value as the resource - id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at - most 128 characters long. It cannot contain the - character ``/``. + A user-supplied resource id for the ReferenceImage to be + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -606,18 +596,17 @@ class ListReferenceImagesRequest(proto.Message): Attributes: parent (str): - Required. Resource name of the product - containing the reference images. + Required. Resource name of the product containing the + reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - A token identifying a page of results to be - returned. This is the value of ``nextPageToken`` - returned in a previous reference image list - request. + A token identifying a page of results to be returned. This + is the value of ``nextPageToken`` returned in a previous + reference image list request. Defaults to the first page if not specified. """ @@ -646,8 +635,8 @@ class ListReferenceImagesResponse(proto.Message): The maximum number of items to return. Default 10, maximum 100. next_page_token (str): - The next_page_token returned from a previous - List request, if any. + The next_page_token returned from a previous List request, + if any. """ @property @@ -674,8 +663,8 @@ class GetReferenceImageRequest(proto.Message): Attributes: name (str): - Required. The resource name of the - ReferenceImage to get. + Required. The resource name of the ReferenceImage to + get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -692,8 +681,8 @@ class DeleteReferenceImageRequest(proto.Message): Attributes: name (str): - Required. The resource name of the reference - image to delete. + Required. The resource name of the reference image to + delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -706,18 +695,19 @@ class DeleteReferenceImageRequest(proto.Message): class AddProductToProductSetRequest(proto.Message): - r"""Request message for the ``AddProductToProductSet`` method. + r"""Request message for the ``AddProductToProductSet`` + method. Attributes: name (str): - Required. The resource name for the ProductSet - to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): - Required. The resource name for the Product to - be added to this ProductSet. + Required. The resource name for the Product to be added + to this ProductSet. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -734,18 +724,19 @@ class AddProductToProductSetRequest(proto.Message): class RemoveProductFromProductSetRequest(proto.Message): - r"""Request message for the ``RemoveProductFromProductSet`` method. + r"""Request message for the ``RemoveProductFromProductSet`` + method. Attributes: name (str): - Required. The resource name for the ProductSet - to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): - Required. The resource name for the Product to - be removed from this ProductSet. + Required. The resource name for the Product to be + removed from this ProductSet. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -762,12 +753,13 @@ class RemoveProductFromProductSetRequest(proto.Message): class ListProductsInProductSetRequest(proto.Message): - r"""Request message for the ``ListProductsInProductSet`` method. + r"""Request message for the ``ListProductsInProductSet`` + method. Attributes: name (str): - Required. The ProductSet resource for which to - retrieve Products. + Required. The ProductSet resource for which to retrieve + Products. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -775,8 +767,8 @@ class ListProductsInProductSetRequest(proto.Message): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous - List request, if any. + The next_page_token returned from a previous List request, + if any. """ name: str = proto.Field( @@ -794,7 +786,8 @@ class ListProductsInProductSetRequest(proto.Message): class ListProductsInProductSetResponse(proto.Message): - r"""Response message for the ``ListProductsInProductSet`` method. + r"""Response message for the ``ListProductsInProductSet`` + method. Attributes: products (MutableSequence[google.cloud.vision_v1p3beta1.types.Product]): @@ -826,13 +819,12 @@ class ImportProductSetsGcsSource(proto.Message): Attributes: csv_file_uri (str): - The Google Cloud Storage URI of the input csv - file. + The Google Cloud Storage URI of the input csv file. + The URI must start with ``gs://``. - The format of the input csv file should be one - image per line. In each line, there are 6 - columns. + The format of the input csv file should be one image per + line. In each line, there are 6 columns. 1. image_uri 2, image_id 3. product_set_id @@ -842,62 +834,55 @@ class ImportProductSetsGcsSource(proto.Message): 7, labels 8. bounding_poly - Columns 1, 3, 4, and 5 are required, other - columns are optional. A new ProductSet/Product - with the same id will be created on the fly if - the ProductSet/Product specified by + Columns 1, 3, 4, and 5 are required, other columns are + optional. A new ProductSet/Product with the same id will be + created on the fly if the ProductSet/Product specified by product_set_id/product_id does not exist. - The image_id field is optional but has to be - unique if provided. If it is empty, we will - automatically assign an unique id to the image. + The image_id field is optional but has to be unique if + provided. If it is empty, we will automatically assign an + unique id to the image. - The product_display_name field is optional. If - it is empty, a space (" ") is used as the place - holder for the product display_name, which can - be updated later through the realtime API. + The product_display_name field is optional. If it is empty, + a space (" ") is used as the place holder for the product + display_name, which can be updated later through the + realtime API. - If the Product with product_id already exists, - the fields product_display_name, - product_category and labels are ignored. + If the Product with product_id already exists, the fields + product_display_name, product_category and labels are + ignored. - If a Product doesn't exist and needs to be - created on the fly, the product_display_name - field refers to + If a Product doesn't exist and needs to be created on the + fly, the product_display_name field refers to `Product.display_name - `__, - the product_category field refers to + `__, the + product_category field refers to `Product.product_category `__, - and the labels field refers to - [Product.labels][]. - - Labels (optional) should be a line containing a - list of comma-separated key-value pairs, with - the format - "key_1=value_1,key_2=value_2,...,key_n=value_n". - - The bounding_poly (optional) field is used to - identify one region of interest from the image - in the same manner as CreateReferenceImage. If - no bounding_poly is specified, the system will - try to detect regions of interest automatically. - - Note that the pipeline will resize the image if - the image resolution is too large to process - (above 20MP). - - Also note that at most one bounding_poly is - allowed per line. If the image contains multiple - regions of interest, the csv should contain one - line per region of interest. - - The bounding_poly column should contain an even - number of comma-separated numbers, with the - format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". - Nonnegative integers should be used for absolute - bounding polygons, and float values in [0, 1] - should be used for normalized bounding polygons. + and the labels field refers to [Product.labels][]. + + Labels (optional) should be a line containing a list of + comma-separated key-value pairs, with the format + "key_1=value_1,key_2=value_2,...,key_n=value_n". + + The bounding_poly (optional) field is used to identify one + region of interest from the image in the same manner as + CreateReferenceImage. If no bounding_poly is specified, the + system will try to detect regions of interest automatically. + + Note that the pipeline will resize the image if the image + resolution is too large to process (above 20MP). + + Also note that at most one bounding_poly is allowed per + line. If the image contains multiple regions of interest, + the csv should contain one line per region of interest. + + The bounding_poly column should contain an even number of + comma-separated numbers, with the format + "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative integers + should be used for absolute bounding polygons, and float + values in [0, 1] should be used for normalized bounding + polygons. """ csv_file_uri: str = proto.Field( @@ -933,10 +918,9 @@ class ImportProductSetsRequest(proto.Message): Attributes: parent (str): - Required. The project in which the ProductSets - should be imported. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSets should be + imported. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. input_config (google.cloud.vision_v1p3beta1.types.ImportProductSetsInputConfig): Required. The input content for the list of requests. @@ -965,16 +949,15 @@ class ImportProductSetsResponse(proto.Message): Attributes: reference_images (MutableSequence[google.cloud.vision_v1p3beta1.types.ReferenceImage]): - The list of reference_images that are imported - successfully. + The list of reference_images that are imported successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): - The rpc status for each ImportProductSet - request, including both successes and errors. + The rpc status for each ImportProductSet request, including + both successes and errors. - The number of statuses here matches the number - of lines in the csv file, and statuses[i] stores - the success or failure status of processing the - i-th line of the csv, starting from line 0. + The number of statuses here matches the number of lines in + the csv file, and statuses[i] stores the success or failure + status of processing the i-th line of the csv, starting from + line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -992,8 +975,9 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` returned by the - ``GetOperation`` call of the ``google::longrunning::Operations`` service. + This is included in the ``metadata`` field of the ``Operation`` + returned by the ``GetOperation`` call of the + ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1p3beta1.types.BatchOperationMetadata.State): @@ -1004,8 +988,7 @@ class BatchOperationMetadata(proto.Message): end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and `google.longrunning.Operation.done - `__ is set to - true. + `__ is set to true. """ class State(proto.Enum): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py index 199a91679ae7..3d38f81ca6b6 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py @@ -35,14 +35,13 @@ class TextAnnotation(proto.Message): - r"""TextAnnotation contains a structured representation of OCR - extracted text. The hierarchy of an OCR extracted text structure - is like this: - - TextAnnotation -> Page -> Block -> Paragraph -> Word -> - Symbol Each structural component, starting from Page, may - further have their own properties. Properties describe detected - languages, breaks etc.. Please refer to the + r"""TextAnnotation contains a structured representation of OCR extracted + text. The hierarchy of an OCR extracted text structure is like this: + + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + Each structural component, starting from Page, may further have + their own properties. Properties describe detected languages, breaks + etc.. Please refer to the `TextAnnotation.TextProperty `__ message definition below for more detail. @@ -59,8 +58,8 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): - The BCP-47 language code, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code, such as "en-US" or "sr-Latn". For + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -98,9 +97,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; - does not co-occur with ``SPACE``, - ``LEADER_SPACE``, or ``LINE_BREAK``. + End-line hyphen that is not present in text; does not + co-occur with ``SPACE``, ``LEADER_SPACE``, or + ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -172,8 +171,7 @@ class Page(proto.Message): List of blocks of text, images etc on this page. confidence (float): - Confidence of the OCR results on the page. Range - [0, 1]. + Confidence of the OCR results on the page. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -239,8 +237,7 @@ class Block(proto.Message): Detected block type (text, image etc) for this block. confidence (float): - Confidence of the OCR results on the block. - Range [0, 1]. + Confidence of the OCR results on the block. Range [0, 1]. """ class BlockType(proto.Enum): @@ -302,25 +299,22 @@ class Paragraph(proto.Message): Additional information detected for the paragraph. bounding_box (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The bounding box for the paragraph. The vertices - are in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertice order will still be - (0, 1, 2, 3). + The bounding box for the paragraph. The vertices are in the + order of top-left, top-right, bottom-right, bottom-left. + When a rotation of the bounding box is detected the rotation + is represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertice order + will still be (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1p3beta1.types.Word]): List of words in this paragraph. confidence (float): - Confidence of the OCR results for the paragraph. - Range [0, 1]. + Confidence of the OCR results for the paragraph. Range [0, + 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -351,27 +345,23 @@ class Word(proto.Message): property (google.cloud.vision_v1p3beta1.types.TextAnnotation.TextProperty): Additional information detected for the word. bounding_box (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The bounding box for the word. The vertices are - in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertice order will still be - (0, 1, 2, 3). + The bounding box for the word. The vertices are in the order + of top-left, top-right, bottom-right, bottom-left. When a + rotation of the bounding box is detected the rotation is + represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertice order + will still be (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1p3beta1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural reading order. confidence (float): - Confidence of the OCR results for the word. - Range [0, 1]. + Confidence of the OCR results for the word. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -403,26 +393,22 @@ class Symbol(proto.Message): Additional information detected for the symbol. bounding_box (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The bounding box for the symbol. The vertices - are in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertice order will still be - (0, 1, 2, 3). + The bounding box for the symbol. The vertices are in the + order of top-left, top-right, bottom-right, bottom-left. + When a rotation of the bounding box is detected the rotation + is represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertice order + will still be (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. confidence (float): - Confidence of the OCR results for the symbol. - Range [0, 1]. + Confidence of the OCR results for the symbol. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py index b3e48f9a1373..887e53444d05 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py @@ -157,8 +157,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as - "en-US" or "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/__init__.py index b44f88b0ef8e..f921e4ab9124 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/__init__.py @@ -28,7 +28,11 @@ # this code path once we drop support for Python 3.7 import importlib_metadata as metadata -from .services.image_annotator import ImageAnnotatorAsyncClient, ImageAnnotatorClient +from google.cloud.vision_helpers import VisionHelpers +from google.cloud.vision_helpers.decorators import add_single_feature_methods + +from .services.image_annotator import ImageAnnotatorAsyncClient +from .services.image_annotator import ImageAnnotatorClient as IacImageAnnotatorClient from .services.product_search import ProductSearchAsyncClient, ProductSearchClient from .types.face import Celebrity, FaceRecognitionParams, FaceRecognitionResult from .types.geometry import BoundingPoly, NormalizedVertex, Position, Vertex @@ -205,6 +209,13 @@ def _get_version(dependency_name): + "https://devguide.python.org/versions/" ) + +@add_single_feature_methods +class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient): + __doc__ = IacImageAnnotatorClient.__doc__ + Feature = Feature + + __all__ = ( "ImageAnnotatorAsyncClient", "ProductSearchAsyncClient", diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py index b7ff809c3582..4e89aa363161 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py @@ -532,16 +532,16 @@ async def async_batch_annotate_images( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Run asynchronous image detection and annotation for a - list of images. + r"""Run asynchronous image detection and annotation for a list of + images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json - files in customer GCS bucket, each json file containing + This service will write image annotation outputs to json files + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -601,13 +601,11 @@ async def sample_async_batch_annotate_images(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse` - Response to an async batch image - annotation request. + Response to an async batch image annotation request. """ # Create or coerce a protobuf request object. @@ -676,11 +674,11 @@ async def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Run asynchronous image detection and annotation for a - list of generic files, such as PDF files, which may - contain multiple pages and multiple images per page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. + r"""Run asynchronous image detection and annotation for a list of + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -736,13 +734,11 @@ async def sample_async_batch_annotate_files(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file - annotation request. + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py index 326f8a7945db..2d969ba638e4 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py @@ -989,16 +989,16 @@ def async_batch_annotate_images( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Run asynchronous image detection and annotation for a - list of images. + r"""Run asynchronous image detection and annotation for a list of + images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json - files in customer GCS bucket, each json file containing + This service will write image annotation outputs to json files + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -1058,13 +1058,11 @@ def sample_async_batch_annotate_images(): Returns: google.api_core.operation.Operation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse` - Response to an async batch image - annotation request. + Response to an async batch image annotation request. """ # Create or coerce a protobuf request object. @@ -1132,11 +1130,11 @@ def async_batch_annotate_files( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Run asynchronous image detection and annotation for a - list of generic files, such as PDF files, which may - contain multiple pages and multiple images per page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. + r"""Run asynchronous image detection and annotation for a list of + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). @@ -1192,13 +1190,11 @@ def sample_async_batch_annotate_files(): Returns: google.api_core.operation.Operation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file - annotation request. + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py index 5f8203609a18..4790cb67d154 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py @@ -417,16 +417,16 @@ def async_batch_annotate_images( ]: r"""Return a callable for the async batch annotate images method over gRPC. - Run asynchronous image detection and annotation for a - list of images. + Run asynchronous image detection and annotation for a list of + images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json - files in customer GCS bucket, each json file containing + This service will write image annotation outputs to json files + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -457,11 +457,11 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run asynchronous image detection and annotation for a - list of generic files, such as PDF files, which may - contain multiple pages and multiple images per page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. + Run asynchronous image detection and annotation for a list of + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py index c220c12390a5..2ced1bc0948c 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py @@ -426,16 +426,16 @@ def async_batch_annotate_images( ]: r"""Return a callable for the async batch annotate images method over gRPC. - Run asynchronous image detection and annotation for a - list of images. + Run asynchronous image detection and annotation for a list of + images. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). - This service will write image annotation outputs to json - files in customer GCS bucket, each json file containing + This service will write image annotation outputs to json files + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -467,11 +467,11 @@ def async_batch_annotate_files( ]: r"""Return a callable for the async batch annotate files method over gRPC. - Run asynchronous image detection and annotation for a - list of generic files, such as PDF files, which may - contain multiple pages and multiple images per page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. + Run asynchronous image detection and annotation for a list of + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py index 311c7f8ae063..373e510ecf5c 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py @@ -73,21 +73,19 @@ class ProductSearchAsyncClient: product search. It uses the following resource model: - The API has a collection of - `ProductSet `__ - resources, named ``projects/*/locations/*/productSets/*``, which - acts as a way to put different products into groups to limit - identification. + `ProductSet `__ resources, + named ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - The API has a collection of - `Product `__ resources, - named ``projects/*/locations/*/products/*`` + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has a collection of `ReferenceImage - `__ resources, - named + `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ @@ -337,8 +335,8 @@ async def create_product_set( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing, - or is longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, or is + longer than 4096 characters. .. code-block:: python @@ -368,13 +366,11 @@ async def sample_create_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.CreateProductSetRequest, dict]]): - The request object. Request message for the - ``CreateProductSet`` method. + The request object. Request message for the ``CreateProductSet`` method. parent (:class:`str`): - Required. The project in which the - ProductSet should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSet should be + created. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -385,14 +381,11 @@ async def sample_create_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_set_id (:class:`str`): - A user-supplied resource id for this - ProductSet. If set, the server will - attempt to use this value as the - resource id. If it is already in use, an - error is returned with code - ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the - character ``/``. + A user-supplied resource id for this ProductSet. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -482,8 +475,8 @@ async def list_product_sets( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100, or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100, or + less than 1. .. code-block:: python @@ -514,13 +507,11 @@ async def sample_list_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListProductSetsRequest, dict]]): - The request object. Request message for the - ``ListProductSets`` method. + The request object. Request message for the ``ListProductSets`` method. parent (:class:`str`): - Required. The project from which - ProductSets should be listed. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which ProductSets should be + listed. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -535,11 +526,10 @@ async def sample_list_product_sets(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductSetsAsyncPager: - Response message for the - ``ListProductSets`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProductSets`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -647,11 +637,10 @@ async def sample_get_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.GetProductSetRequest, dict]]): - The request object. Request message for the - ``GetProductSet`` method. + The request object. Request message for the ``GetProductSet`` method. name (:class:`str`): - Required. Resource name of the - ProductSet to get. + Required. Resource name of the ProductSet to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -742,10 +731,9 @@ async def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer - than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. .. code-block:: python @@ -774,8 +762,7 @@ async def sample_update_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.UpdateProductSetRequest, dict]]): - The request object. Request message for the - ``UpdateProductSet`` method. + The request object. Request message for the ``UpdateProductSet`` method. product_set (:class:`google.cloud.vision_v1p4beta1.types.ProductSet`): Required. The ProductSet resource which replaces the one on the server. @@ -784,12 +771,10 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask - `__ that - specifies which fields to update. If - update_mask isn't specified, all mutable - fields are to be updated. Valid mask - path is ``display_name``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -906,11 +891,10 @@ async def sample_delete_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.DeleteProductSetRequest, dict]]): - The request object. Request message for the - ``DeleteProductSet`` method. + The request object. Request message for the ``DeleteProductSet`` method. name (:class:`str`): - Required. Resource name of the - ProductSet to delete. + Required. Resource name of the ProductSet to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -989,12 +973,11 @@ async def create_product( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing or - longer than 4096 characters. - - * Returns INVALID_ARGUMENT if description is longer than - 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + * Returns INVALID_ARGUMENT if display_name is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is + missing or invalid. .. code-block:: python @@ -1024,11 +1007,10 @@ async def sample_create_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.CreateProductRequest, dict]]): - The request object. Request message for the - ``CreateProduct`` method. + The request object. Request message for the ``CreateProduct`` method. parent (:class:`str`): - Required. The project in which the - Product should be created. + Required. The project in which the Product should be + created. Format is ``projects/PROJECT_ID/locations/LOC_ID``. @@ -1041,13 +1023,11 @@ async def sample_create_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_id (:class:`str`): - A user-supplied resource id for this - Product. If set, the server will attempt - to use this value as the resource id. If - it is already in use, an error is - returned with code ALREADY_EXISTS. Must - be at most 128 characters long. It - cannot contain the character ``/``. + A user-supplied resource id for this Product. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1132,8 +1112,8 @@ async def list_products( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. .. code-block:: python @@ -1164,11 +1144,10 @@ async def sample_list_products(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListProductsRequest, dict]]): - The request object. Request message for the ``ListProducts`` - method. + The request object. Request message for the ``ListProducts`` method. parent (:class:`str`): - Required. The project OR ProductSet from - which Products should be listed. + Required. The project OR ProductSet from which Products + should be listed. Format: ``projects/PROJECT_ID/locations/LOC_ID`` @@ -1186,11 +1165,10 @@ async def sample_list_products(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsAsyncPager: - Response message for the - ``ListProducts`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProducts`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -1296,11 +1274,10 @@ async def sample_get_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.GetProductRequest, dict]]): - The request object. Request message for the ``GetProduct`` - method. + The request object. Request message for the ``GetProduct`` method. name (:class:`str`): - Required. Resource name of the Product - to get. + Required. Resource name of the Product to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -1382,24 +1359,21 @@ async def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated right now. - If labels are updated, the change will not be reflected - in queries until the next index time. + If labels are updated, the change will not be reflected in + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer - than 4096 characters. - - * Returns INVALID_ARGUMENT if description is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. - - * Returns INVALID_ARGUMENT if product_category is - present in update_mask. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. .. code-block:: python @@ -1428,8 +1402,7 @@ async def sample_update_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.UpdateProductRequest, dict]]): - The request object. Request message for the - ``UpdateProduct`` method. + The request object. Request message for the ``UpdateProduct`` method. product (:class:`google.cloud.vision_v1p4beta1.types.Product`): Required. The Product resource which replaces the one on the server. @@ -1439,13 +1412,12 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask - `__ that - specifies which fields to update. If - update_mask isn't specified, all mutable - fields are to be updated. Valid mask - paths include ``product_labels``, - ``display_name``, and ``description``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include + ``product_labels``, ``display_name``, and + ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1558,11 +1530,10 @@ async def sample_delete_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.DeleteProductRequest, dict]]): - The request object. Request message for the - ``DeleteProduct`` method. + The request object. Request message for the ``DeleteProduct`` method. name (:class:`str`): - Required. Resource name of product to - delete. + Required. Resource name of product to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -1639,29 +1610,25 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If - ``bounding_poly`` is not specified, the system will try - to detect regions of interest in the image that are - compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, the system will try to detect regions of interest + in the image that are compatible with the product_category on + the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the - image resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the image + resolution is too large to process (above 50MP). Possible errors: - * Returns INVALID_ARGUMENT if the image_uri is missing - or longer than 4096 characters. - - * Returns INVALID_ARGUMENT if the product does not - exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent - product's product_category is detected. - - * Returns INVALID_ARGUMENT if bounding_poly contains - more than 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. * + Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. .. code-block:: python @@ -1695,11 +1662,10 @@ async def sample_create_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.CreateReferenceImageRequest, dict]]): - The request object. Request message for the - ``CreateReferenceImage`` method. + The request object. Request message for the ``CreateReferenceImage`` method. parent (:class:`str`): - Required. Resource name of the product - in which to create the reference image. + Required. Resource name of the product in which to + create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -1716,14 +1682,11 @@ async def sample_create_reference_image(): on the ``request`` instance; if ``request`` is provided, this should not be set. reference_image_id (:class:`str`): - A user-supplied resource id for the - ReferenceImage to be added. If set, the - server will attempt to use this value as - the resource id. If it is already in - use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the - character ``/``. + A user-supplied resource id for the ReferenceImage to be + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1738,9 +1701,8 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1841,11 +1803,10 @@ async def sample_delete_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.DeleteReferenceImageRequest, dict]]): - The request object. Request message for the - ``DeleteReferenceImage`` method. + The request object. Request message for the ``DeleteReferenceImage`` method. name (:class:`str`): - Required. The resource name of the - reference image to delete. + Required. The resource name of the reference image to + delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -1922,9 +1883,9 @@ async def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not - exist. * Returns INVALID_ARGUMENT if the page_size is - greater than 100, or less than 1. + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. .. code-block:: python @@ -1955,11 +1916,10 @@ async def sample_list_reference_images(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListReferenceImagesRequest, dict]]): - The request object. Request message for the - ``ListReferenceImages`` method. + The request object. Request message for the ``ListReferenceImages`` method. parent (:class:`str`): - Required. Resource name of the product - containing the reference images. + Required. Resource name of the product containing the + reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -1976,11 +1936,10 @@ async def sample_list_reference_images(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListReferenceImagesAsyncPager: - Response message for the - ``ListReferenceImages`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListReferenceImages`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -2058,8 +2017,7 @@ async def get_reference_image( Possible errors: - * Returns NOT_FOUND if the specified image does not - exist. + * Returns NOT_FOUND if the specified image does not exist. .. code-block:: python @@ -2089,11 +2047,10 @@ async def sample_get_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.GetReferenceImageRequest, dict]]): - The request object. Request message for the - ``GetReferenceImage`` method. + The request object. Request message for the ``GetReferenceImage`` method. name (:class:`str`): - Required. The resource name of the - ReferenceImage to get. + Required. The resource name of the ReferenceImage to + get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -2111,9 +2068,8 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2177,15 +2133,15 @@ async def add_product_to_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: - r"""Adds a Product to the specified ProductSet. If the - Product is already present, no change is made. + r"""Adds a Product to the specified ProductSet. If the Product is + already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - * Returns NOT_FOUND if the Product or the ProductSet - doesn't exist. + * Returns NOT_FOUND if the Product or the ProductSet doesn't + exist. .. code-block:: python @@ -2213,11 +2169,11 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the - ``AddProductToProductSet`` method. + The request object. Request message for the ``AddProductToProductSet`` + method. name (:class:`str`): - Required. The resource name for the - ProductSet to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2226,8 +2182,8 @@ async def sample_add_product_to_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): - Required. The resource name for the - Product to be added to this ProductSet. + Required. The resource name for the Product to be added + to this ProductSet. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -2333,11 +2289,11 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the - ``RemoveProductFromProductSet`` method. + The request object. Request message for the ``RemoveProductFromProductSet`` + method. name (:class:`str`): - Required. The resource name for the - ProductSet to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2346,9 +2302,8 @@ async def sample_remove_product_from_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): - Required. The resource name for the - Product to be removed from this - ProductSet. + Required. The resource name for the Product to be + removed from this ProductSet. Format is: @@ -2426,14 +2381,14 @@ async def list_products_in_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: - r"""Lists the Products in a ProductSet, in an unspecified - order. If the ProductSet does not exist, the products - field of the response will be empty. + r"""Lists the Products in a ProductSet, in an unspecified order. If + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. .. code-block:: python @@ -2464,11 +2419,11 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the - ``ListProductsInProductSet`` method. + The request object. Request message for the ``ListProductsInProductSet`` + method. name (:class:`str`): - Required. The ProductSet resource for - which to retrieve Products. + Required. The ProductSet resource for which to retrieve + Products. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2486,11 +2441,10 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the - ``ListProductsInProductSet`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProductsInProductSet`` + method. + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -2569,20 +2523,18 @@ async def import_product_sets( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Asynchronous API that imports a list of reference images - to specified product sets based on a list of image - information. + r"""Asynchronous API that imports a list of reference images to + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google - Cloud Storage. For the format of the csv file please see + The input source of this method is a csv file on Google Cloud + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -2618,13 +2570,11 @@ async def sample_import_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ImportProductSetsRequest, dict]]): - The request object. Request message for the - ``ImportProductSets`` method. + The request object. Request message for the ``ImportProductSets`` method. parent (:class:`str`): - Required. The project in which the - ProductSets should be imported. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSets should be + imported. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2646,21 +2596,18 @@ async def sample_import_product_sets(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` - Response message for the - ``ImportProductSets` method. + Response message for the ``ImportProductSets` method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned + `__ method + in the returned `google.longrunning.Operation.response - `__ - field. + `__ field. """ # Create or coerce a protobuf request object. @@ -2733,37 +2680,34 @@ async def purge_products( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: - r"""Asynchronous API to delete all Products in a ProductSet - or all Products that are in no ProductSet. + r"""Asynchronous API to delete all Products in a ProductSet or all + Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in - addition to other ProductSets, the Product will still be - deleted. + If a Product is a member of the specified ProductSet in addition + to other ProductSets, the Product will still be deleted. - It is recommended to not delete the specified ProductSet - until after this operation has completed. It is also - recommended to not add any of the Products involved in - the batch delete to a new ProductSet while this - operation is running because those Products may still - end up deleted. + It is recommended to not delete the specified ProductSet until + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used - in ImportProductSets (if that was how you originally - built the Product Set) before starting PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. - If the plan is to purge all of the Products from a - ProductSet and then re-use the empty ProductSet to - re-import new Products into the empty ProductSet, you - must wait until the PurgeProducts operation has finished - for that ProductSet. + If the plan is to purge all of the Products from a ProductSet + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) .. code-block:: python @@ -2797,13 +2741,11 @@ async def sample_purge_products(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.PurgeProductsRequest, dict]]): - The request object. Request message for the - ``PurgeProducts`` method. + The request object. Request message for the ``PurgeProducts`` method. parent (:class:`str`): - Required. The project and location in - which the Products should be deleted. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project and location in which the Products + should be deleted. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2818,21 +2760,18 @@ async def sample_purge_products(): Returns: google.api_core.operation_async.AsyncOperation: - An object representing a long-running - operation. - The result type for the operation will - be - :class:`google.protobuf.empty_pb2.Empty` - A generic empty message that you can - re-use to avoid defining duplicated - empty messages in your APIs. A typical - example is to use it as the request or - the response type of an API method. For - instance: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.protobuf.empty_pb2.Empty` A generic empty + message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to use + it as the request or the response type of an API method. + For instance: service Foo { - rpc Bar(google.protobuf.Empty) - returns (google.protobuf.Empty); } + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py index b609dab086ea..06a858596f86 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py @@ -117,21 +117,19 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): product search. It uses the following resource model: - The API has a collection of - `ProductSet `__ - resources, named ``projects/*/locations/*/productSets/*``, which - acts as a way to put different products into groups to limit - identification. + `ProductSet `__ resources, + named ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - The API has a collection of - `Product `__ resources, - named ``projects/*/locations/*/products/*`` + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has a collection of `ReferenceImage - `__ resources, - named + `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ @@ -818,8 +816,8 @@ def create_product_set( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing, - or is longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, or is + longer than 4096 characters. .. code-block:: python @@ -849,13 +847,11 @@ def sample_create_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.CreateProductSetRequest, dict]): - The request object. Request message for the - ``CreateProductSet`` method. + The request object. Request message for the ``CreateProductSet`` method. parent (str): - Required. The project in which the - ProductSet should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSet should be + created. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -866,14 +862,11 @@ def sample_create_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_set_id (str): - A user-supplied resource id for this - ProductSet. If set, the server will - attempt to use this value as the - resource id. If it is already in use, an - error is returned with code - ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the - character ``/``. + A user-supplied resource id for this ProductSet. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -960,8 +953,8 @@ def list_product_sets( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100, or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100, or + less than 1. .. code-block:: python @@ -992,13 +985,11 @@ def sample_list_product_sets(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListProductSetsRequest, dict]): - The request object. Request message for the - ``ListProductSets`` method. + The request object. Request message for the ``ListProductSets`` method. parent (str): - Required. The project from which - ProductSets should be listed. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which ProductSets should be + listed. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1013,11 +1004,10 @@ def sample_list_product_sets(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductSetsPager: - Response message for the - ``ListProductSets`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProductSets`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -1122,11 +1112,10 @@ def sample_get_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.GetProductSetRequest, dict]): - The request object. Request message for the - ``GetProductSet`` method. + The request object. Request message for the ``GetProductSet`` method. name (str): - Required. Resource name of the - ProductSet to get. + Required. Resource name of the ProductSet to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -1214,10 +1203,9 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer - than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. .. code-block:: python @@ -1246,8 +1234,7 @@ def sample_update_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.UpdateProductSetRequest, dict]): - The request object. Request message for the - ``UpdateProductSet`` method. + The request object. Request message for the ``UpdateProductSet`` method. product_set (google.cloud.vision_v1p4beta1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. @@ -1256,12 +1243,10 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask - `__ that - specifies which fields to update. If - update_mask isn't specified, all mutable - fields are to be updated. Valid mask - path is ``display_name``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1375,11 +1360,10 @@ def sample_delete_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.DeleteProductSetRequest, dict]): - The request object. Request message for the - ``DeleteProductSet`` method. + The request object. Request message for the ``DeleteProductSet`` method. name (str): - Required. Resource name of the - ProductSet to delete. + Required. Resource name of the ProductSet to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -1455,12 +1439,11 @@ def create_product( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing or - longer than 4096 characters. - - * Returns INVALID_ARGUMENT if description is longer than - 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + * Returns INVALID_ARGUMENT if display_name is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is + missing or invalid. .. code-block:: python @@ -1490,11 +1473,10 @@ def sample_create_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.CreateProductRequest, dict]): - The request object. Request message for the - ``CreateProduct`` method. + The request object. Request message for the ``CreateProduct`` method. parent (str): - Required. The project in which the - Product should be created. + Required. The project in which the Product should be + created. Format is ``projects/PROJECT_ID/locations/LOC_ID``. @@ -1507,13 +1489,11 @@ def sample_create_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. product_id (str): - A user-supplied resource id for this - Product. If set, the server will attempt - to use this value as the resource id. If - it is already in use, an error is - returned with code ALREADY_EXISTS. Must - be at most 128 characters long. It - cannot contain the character ``/``. + A user-supplied resource id for this Product. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1595,8 +1575,8 @@ def list_products( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. .. code-block:: python @@ -1627,11 +1607,10 @@ def sample_list_products(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListProductsRequest, dict]): - The request object. Request message for the ``ListProducts`` - method. + The request object. Request message for the ``ListProducts`` method. parent (str): - Required. The project OR ProductSet from - which Products should be listed. + Required. The project OR ProductSet from which Products + should be listed. Format: ``projects/PROJECT_ID/locations/LOC_ID`` @@ -1649,11 +1628,10 @@ def sample_list_products(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsPager: - Response message for the - ``ListProducts`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProducts`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -1756,11 +1734,10 @@ def sample_get_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.GetProductRequest, dict]): - The request object. Request message for the ``GetProduct`` - method. + The request object. Request message for the ``GetProduct`` method. name (str): - Required. Resource name of the Product - to get. + Required. Resource name of the Product to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -1839,24 +1816,21 @@ def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated right now. - If labels are updated, the change will not be reflected - in queries until the next index time. + If labels are updated, the change will not be reflected in + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer - than 4096 characters. - - * Returns INVALID_ARGUMENT if description is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. - - * Returns INVALID_ARGUMENT if product_category is - present in update_mask. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. .. code-block:: python @@ -1885,8 +1859,7 @@ def sample_update_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.UpdateProductRequest, dict]): - The request object. Request message for the - ``UpdateProduct`` method. + The request object. Request message for the ``UpdateProduct`` method. product (google.cloud.vision_v1p4beta1.types.Product): Required. The Product resource which replaces the one on the server. @@ -1896,13 +1869,12 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask - `__ that - specifies which fields to update. If - update_mask isn't specified, all mutable - fields are to be updated. Valid mask - paths include ``product_labels``, - ``display_name``, and ``description``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include + ``product_labels``, ``display_name``, and + ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -2012,11 +1984,10 @@ def sample_delete_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.DeleteProductRequest, dict]): - The request object. Request message for the - ``DeleteProduct`` method. + The request object. Request message for the ``DeleteProduct`` method. name (str): - Required. Resource name of product to - delete. + Required. Resource name of product to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -2090,29 +2061,25 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If - ``bounding_poly`` is not specified, the system will try - to detect regions of interest in the image that are - compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, the system will try to detect regions of interest + in the image that are compatible with the product_category on + the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the - image resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the image + resolution is too large to process (above 50MP). Possible errors: - * Returns INVALID_ARGUMENT if the image_uri is missing - or longer than 4096 characters. - - * Returns INVALID_ARGUMENT if the product does not - exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent - product's product_category is detected. - - * Returns INVALID_ARGUMENT if bounding_poly contains - more than 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. * + Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. .. code-block:: python @@ -2146,11 +2113,10 @@ def sample_create_reference_image(): Args: request (Union[google.cloud.vision_v1p4beta1.types.CreateReferenceImageRequest, dict]): - The request object. Request message for the - ``CreateReferenceImage`` method. + The request object. Request message for the ``CreateReferenceImage`` method. parent (str): - Required. Resource name of the product - in which to create the reference image. + Required. Resource name of the product in which to + create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -2167,14 +2133,11 @@ def sample_create_reference_image(): on the ``request`` instance; if ``request`` is provided, this should not be set. reference_image_id (str): - A user-supplied resource id for the - ReferenceImage to be added. If set, the - server will attempt to use this value as - the resource id. If it is already in - use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the - character ``/``. + A user-supplied resource id for the ReferenceImage to be + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2189,9 +2152,8 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2289,11 +2251,10 @@ def sample_delete_reference_image(): Args: request (Union[google.cloud.vision_v1p4beta1.types.DeleteReferenceImageRequest, dict]): - The request object. Request message for the - ``DeleteReferenceImage`` method. + The request object. Request message for the ``DeleteReferenceImage`` method. name (str): - Required. The resource name of the - reference image to delete. + Required. The resource name of the reference image to + delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -2367,9 +2328,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not - exist. * Returns INVALID_ARGUMENT if the page_size is - greater than 100, or less than 1. + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. .. code-block:: python @@ -2400,11 +2361,10 @@ def sample_list_reference_images(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListReferenceImagesRequest, dict]): - The request object. Request message for the - ``ListReferenceImages`` method. + The request object. Request message for the ``ListReferenceImages`` method. parent (str): - Required. Resource name of the product - containing the reference images. + Required. Resource name of the product containing the + reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -2421,11 +2381,10 @@ def sample_list_reference_images(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListReferenceImagesPager: - Response message for the - ``ListReferenceImages`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListReferenceImages`` method. + + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -2500,8 +2459,7 @@ def get_reference_image( Possible errors: - * Returns NOT_FOUND if the specified image does not - exist. + * Returns NOT_FOUND if the specified image does not exist. .. code-block:: python @@ -2531,11 +2489,10 @@ def sample_get_reference_image(): Args: request (Union[google.cloud.vision_v1p4beta1.types.GetReferenceImageRequest, dict]): - The request object. Request message for the - ``GetReferenceImage`` method. + The request object. Request message for the ``GetReferenceImage`` method. name (str): - Required. The resource name of the - ReferenceImage to get. + Required. The resource name of the ReferenceImage to + get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -2553,9 +2510,8 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2616,15 +2572,15 @@ def add_product_to_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: - r"""Adds a Product to the specified ProductSet. If the - Product is already present, no change is made. + r"""Adds a Product to the specified ProductSet. If the Product is + already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - * Returns NOT_FOUND if the Product or the ProductSet - doesn't exist. + * Returns NOT_FOUND if the Product or the ProductSet doesn't + exist. .. code-block:: python @@ -2652,11 +2608,11 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the - ``AddProductToProductSet`` method. + The request object. Request message for the ``AddProductToProductSet`` + method. name (str): - Required. The resource name for the - ProductSet to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2665,8 +2621,8 @@ def sample_add_product_to_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): - Required. The resource name for the - Product to be added to this ProductSet. + Required. The resource name for the Product to be added + to this ProductSet. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -2771,11 +2727,11 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the - ``RemoveProductFromProductSet`` method. + The request object. Request message for the ``RemoveProductFromProductSet`` + method. name (str): - Required. The resource name for the - ProductSet to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2784,9 +2740,8 @@ def sample_remove_product_from_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): - Required. The resource name for the - Product to be removed from this - ProductSet. + Required. The resource name for the Product to be + removed from this ProductSet. Format is: @@ -2863,14 +2818,14 @@ def list_products_in_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: - r"""Lists the Products in a ProductSet, in an unspecified - order. If the ProductSet does not exist, the products - field of the response will be empty. + r"""Lists the Products in a ProductSet, in an unspecified order. If + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. .. code-block:: python @@ -2901,11 +2856,11 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the - ``ListProductsInProductSet`` method. + The request object. Request message for the ``ListProductsInProductSet`` + method. name (str): - Required. The ProductSet resource for - which to retrieve Products. + Required. The ProductSet resource for which to retrieve + Products. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -2923,11 +2878,10 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the - ``ListProductsInProductSet`` method. - Iterating over this object will yield - results and resolve additional pages - automatically. + Response message for the ``ListProductsInProductSet`` + method. + Iterating over this object will yield results and + resolve additional pages automatically. """ # Create or coerce a protobuf request object. @@ -3005,20 +2959,18 @@ def import_product_sets( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Asynchronous API that imports a list of reference images - to specified product sets based on a list of image - information. + r"""Asynchronous API that imports a list of reference images to + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google - Cloud Storage. For the format of the csv file please see + The input source of this method is a csv file on Google Cloud + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -3054,13 +3006,11 @@ def sample_import_product_sets(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ImportProductSetsRequest, dict]): - The request object. Request message for the - ``ImportProductSets`` method. + The request object. Request message for the ``ImportProductSets`` method. parent (str): - Required. The project in which the - ProductSets should be imported. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSets should be + imported. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3082,21 +3032,18 @@ def sample_import_product_sets(): Returns: google.api_core.operation.Operation: - An object representing a long-running - operation. - The result type for the operation will - be + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` - Response message for the - ``ImportProductSets` method. + Response message for the ``ImportProductSets` method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned + `__ method + in the returned `google.longrunning.Operation.response - `__ - field. + `__ field. """ # Create or coerce a protobuf request object. @@ -3166,37 +3113,34 @@ def purge_products( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: - r"""Asynchronous API to delete all Products in a ProductSet - or all Products that are in no ProductSet. + r"""Asynchronous API to delete all Products in a ProductSet or all + Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in - addition to other ProductSets, the Product will still be - deleted. + If a Product is a member of the specified ProductSet in addition + to other ProductSets, the Product will still be deleted. - It is recommended to not delete the specified ProductSet - until after this operation has completed. It is also - recommended to not add any of the Products involved in - the batch delete to a new ProductSet while this - operation is running because those Products may still - end up deleted. + It is recommended to not delete the specified ProductSet until + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used - in ImportProductSets (if that was how you originally - built the Product Set) before starting PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. - If the plan is to purge all of the Products from a - ProductSet and then re-use the empty ProductSet to - re-import new Products into the empty ProductSet, you - must wait until the PurgeProducts operation has finished - for that ProductSet. + If the plan is to purge all of the Products from a ProductSet + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) .. code-block:: python @@ -3230,13 +3174,11 @@ def sample_purge_products(): Args: request (Union[google.cloud.vision_v1p4beta1.types.PurgeProductsRequest, dict]): - The request object. Request message for the - ``PurgeProducts`` method. + The request object. Request message for the ``PurgeProducts`` method. parent (str): - Required. The project and location in - which the Products should be deleted. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project and location in which the Products + should be deleted. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3251,21 +3193,18 @@ def sample_purge_products(): Returns: google.api_core.operation.Operation: - An object representing a long-running - operation. - The result type for the operation will - be - :class:`google.protobuf.empty_pb2.Empty` - A generic empty message that you can - re-use to avoid defining duplicated - empty messages in your APIs. A typical - example is to use it as the request or - the response type of an API method. For - instance: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.protobuf.empty_pb2.Empty` A generic empty + message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to use + it as the request or the response type of an API method. + For instance: service Foo { - rpc Bar(google.protobuf.Empty) - returns (google.protobuf.Empty); } + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py index 4095d72e6632..81fb89775963 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py @@ -116,21 +116,19 @@ class ProductSearchGrpcTransport(ProductSearchTransport): product search. It uses the following resource model: - The API has a collection of - `ProductSet `__ - resources, named ``projects/*/locations/*/productSets/*``, which - acts as a way to put different products into groups to limit - identification. + `ProductSet `__ resources, + named ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - The API has a collection of - `Product `__ resources, - named ``projects/*/locations/*/products/*`` + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has a collection of `ReferenceImage - `__ resources, - named + `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -372,8 +370,8 @@ def create_product_set( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing, - or is longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, or is + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -406,8 +404,8 @@ def list_product_sets( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100, or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100, or + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -473,10 +471,9 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer - than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -538,12 +535,11 @@ def create_product( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing or - longer than 4096 characters. - - * Returns INVALID_ARGUMENT if description is longer than - 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + * Returns INVALID_ARGUMENT if display_name is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is + missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -576,8 +572,8 @@ def list_products( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. Returns: Callable[[~.ListProductsRequest], @@ -638,24 +634,21 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated right now. - If labels are updated, the change will not be reflected - in queries until the next index time. + If labels are updated, the change will not be reflected in + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer - than 4096 characters. - - * Returns INVALID_ARGUMENT if description is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. - - * Returns INVALID_ARGUMENT if product_category is - present in update_mask. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -717,29 +710,25 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If - ``bounding_poly`` is not specified, the system will try - to detect regions of interest in the image that are - compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, the system will try to detect regions of interest + in the image that are compatible with the product_category on + the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the - image resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the image + resolution is too large to process (above 50MP). Possible errors: - * Returns INVALID_ARGUMENT if the image_uri is missing - or longer than 4096 characters. - - * Returns INVALID_ARGUMENT if the product does not - exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent - product's product_category is detected. - - * Returns INVALID_ARGUMENT if bounding_poly contains - more than 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. * + Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -807,9 +796,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not - exist. * Returns INVALID_ARGUMENT if the page_size is - greater than 100, or less than 1. + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -842,8 +831,7 @@ def get_reference_image( Possible errors: - * Returns NOT_FOUND if the specified image does not - exist. + * Returns NOT_FOUND if the specified image does not exist. Returns: Callable[[~.GetReferenceImageRequest], @@ -871,15 +859,15 @@ def add_product_to_product_set( ]: r"""Return a callable for the add product to product set method over gRPC. - Adds a Product to the specified ProductSet. If the - Product is already present, no change is made. + Adds a Product to the specified ProductSet. If the Product is + already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - * Returns NOT_FOUND if the Product or the ProductSet - doesn't exist. + * Returns NOT_FOUND if the Product or the ProductSet doesn't + exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -941,14 +929,14 @@ def list_products_in_product_set( ]: r"""Return a callable for the list products in product set method over gRPC. - Lists the Products in a ProductSet, in an unspecified - order. If the ProductSet does not exist, the products - field of the response will be empty. + Lists the Products in a ProductSet, in an unspecified order. If + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -978,20 +966,18 @@ def import_product_sets( ]: r"""Return a callable for the import product sets method over gRPC. - Asynchronous API that imports a list of reference images - to specified product sets based on a list of image - information. + Asynchronous API that imports a list of reference images to + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google - Cloud Storage. For the format of the csv file please see + The input source of this method is a csv file on Google Cloud + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -1021,37 +1007,34 @@ def purge_products( ]: r"""Return a callable for the purge products method over gRPC. - Asynchronous API to delete all Products in a ProductSet - or all Products that are in no ProductSet. + Asynchronous API to delete all Products in a ProductSet or all + Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in - addition to other ProductSets, the Product will still be - deleted. + If a Product is a member of the specified ProductSet in addition + to other ProductSets, the Product will still be deleted. - It is recommended to not delete the specified ProductSet - until after this operation has completed. It is also - recommended to not add any of the Products involved in - the batch delete to a new ProductSet while this - operation is running because those Products may still - end up deleted. + It is recommended to not delete the specified ProductSet until + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used - in ImportProductSets (if that was how you originally - built the Product Set) before starting PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. - If the plan is to purge all of the Products from a - ProductSet and then re-use the empty ProductSet to - re-import new Products into the empty ProductSet, you - must wait until the PurgeProducts operation has finished - for that ProductSet. + If the plan is to purge all of the Products from a ProductSet + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) Returns: Callable[[~.PurgeProductsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py index 4d4c061198e9..c9549a1a24fb 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py @@ -122,21 +122,19 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): product search. It uses the following resource model: - The API has a collection of - `ProductSet `__ - resources, named ``projects/*/locations/*/productSets/*``, which - acts as a way to put different products into groups to limit - identification. + `ProductSet `__ resources, + named ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - The API has a collection of - `Product `__ resources, - named ``projects/*/locations/*/products/*`` + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has a collection of `ReferenceImage - `__ resources, - named + `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -380,8 +378,8 @@ def create_product_set( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing, - or is longer than 4096 characters. + * Returns INVALID_ARGUMENT if display_name is missing, or is + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -414,8 +412,8 @@ def list_product_sets( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100, or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100, or + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -482,10 +480,9 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer - than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -550,12 +547,11 @@ def create_product( Possible errors: - * Returns INVALID_ARGUMENT if display_name is missing or - longer than 4096 characters. - - * Returns INVALID_ARGUMENT if description is longer than - 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + * Returns INVALID_ARGUMENT if display_name is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is + missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -588,8 +584,8 @@ def list_products( Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. Returns: Callable[[~.ListProductsRequest], @@ -652,24 +648,21 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated right now. - If labels are updated, the change will not be reflected - in queries until the next index time. + If labels are updated, the change will not be reflected in + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * - Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer - than 4096 characters. - - * Returns INVALID_ARGUMENT if description is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. - - * Returns INVALID_ARGUMENT if product_category is - present in update_mask. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -733,29 +726,25 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If - ``bounding_poly`` is not specified, the system will try - to detect regions of interest in the image that are - compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, the system will try to detect regions of interest + in the image that are compatible with the product_category on + the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. - Note that the pipeline will resize the image if the - image resolution is too large to process (above 50MP). + Note that the pipeline will resize the image if the image + resolution is too large to process (above 50MP). Possible errors: - * Returns INVALID_ARGUMENT if the image_uri is missing - or longer than 4096 characters. - - * Returns INVALID_ARGUMENT if the product does not - exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent - product's product_category is detected. - - * Returns INVALID_ARGUMENT if bounding_poly contains - more than 10 polygons. + * Returns INVALID_ARGUMENT if the image_uri is missing or longer + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. * + Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -823,9 +812,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not - exist. * Returns INVALID_ARGUMENT if the page_size is - greater than 100, or less than 1. + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -858,8 +847,7 @@ def get_reference_image( Possible errors: - * Returns NOT_FOUND if the specified image does not - exist. + * Returns NOT_FOUND if the specified image does not exist. Returns: Callable[[~.GetReferenceImageRequest], @@ -888,15 +876,15 @@ def add_product_to_product_set( ]: r"""Return a callable for the add product to product set method over gRPC. - Adds a Product to the specified ProductSet. If the - Product is already present, no change is made. + Adds a Product to the specified ProductSet. If the Product is + already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: - * Returns NOT_FOUND if the Product or the ProductSet - doesn't exist. + * Returns NOT_FOUND if the Product or the ProductSet doesn't + exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -959,14 +947,14 @@ def list_products_in_product_set( ]: r"""Return a callable for the list products in product set method over gRPC. - Lists the Products in a ProductSet, in an unspecified - order. If the ProductSet does not exist, the products - field of the response will be empty. + Lists the Products in a ProductSet, in an unspecified order. If + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: - * Returns INVALID_ARGUMENT if page_size is greater than - 100 or less than 1. + * Returns INVALID_ARGUMENT if page_size is greater than 100 or + less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -997,20 +985,18 @@ def import_product_sets( ]: r"""Return a callable for the import product sets method over gRPC. - Asynchronous API that imports a list of reference images - to specified product sets based on a list of image - information. + Asynchronous API that imports a list of reference images to + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) - The input source of this method is a csv file on Google - Cloud Storage. For the format of the csv file please see + The input source of this method is a csv file on Google Cloud + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -1041,37 +1027,34 @@ def purge_products( ]: r"""Return a callable for the purge products method over gRPC. - Asynchronous API to delete all Products in a ProductSet - or all Products that are in no ProductSet. + Asynchronous API to delete all Products in a ProductSet or all + Products that are in no ProductSet. - If a Product is a member of the specified ProductSet in - addition to other ProductSets, the Product will still be - deleted. + If a Product is a member of the specified ProductSet in addition + to other ProductSets, the Product will still be deleted. - It is recommended to not delete the specified ProductSet - until after this operation has completed. It is also - recommended to not add any of the Products involved in - the batch delete to a new ProductSet while this - operation is running because those Products may still - end up deleted. + It is recommended to not delete the specified ProductSet until + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used - in ImportProductSets (if that was how you originally - built the Product Set) before starting PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. - If the plan is to purge all of the Products from a - ProductSet and then re-use the empty ProductSet to - re-import new Products into the empty ProductSet, you - must wait until the PurgeProducts operation has finished - for that ProductSet. + If the plan is to purge all of the Products from a ProductSet + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to - keep track of the progress and results of the request. - ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) Returns: Callable[[~.PurgeProductsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py index 778acacac9fe..b8e8a7fc1495 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py @@ -1010,21 +1010,19 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): product search. It uses the following resource model: - The API has a collection of - `ProductSet `__ - resources, named ``projects/*/locations/*/productSets/*``, which - acts as a way to put different products into groups to limit - identification. + `ProductSet `__ resources, + named ``projects/*/locations/*/productSets/*``, which acts as a way + to put different products into groups to limit identification. In parallel, - The API has a collection of - `Product `__ resources, - named ``projects/*/locations/*/products/*`` + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has a collection of `ReferenceImage - `__ resources, - named + `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the @@ -1173,8 +1171,8 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the - ``AddProductToProductSet`` method. + The request object. Request message for the ``AddProductToProductSet`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1288,8 +1286,7 @@ def __call__( Args: request (~.product_search_service.CreateProductRequest): - The request object. Request message for the - ``CreateProduct`` method. + The request object. Request message for the ``CreateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1439,8 +1436,7 @@ def __call__( Args: request (~.product_search_service.CreateProductSetRequest): - The request object. Request message for the - ``CreateProductSet`` method. + The request object. Request message for the ``CreateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1599,8 +1595,7 @@ def __call__( Args: request (~.product_search_service.CreateReferenceImageRequest): - The request object. Request message for the - ``CreateReferenceImage`` method. + The request object. Request message for the ``CreateReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1611,9 +1606,8 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ @@ -1756,8 +1750,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductRequest): - The request object. Request message for the - ``DeleteProduct`` method. + The request object. Request message for the ``DeleteProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1863,8 +1856,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductSetRequest): - The request object. Request message for the - ``DeleteProductSet`` method. + The request object. Request message for the ``DeleteProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1972,8 +1964,7 @@ def __call__( Args: request (~.product_search_service.DeleteReferenceImageRequest): - The request object. Request message for the - ``DeleteReferenceImage`` method. + The request object. Request message for the ``DeleteReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2081,8 +2072,7 @@ def __call__( Args: request (~.product_search_service.GetProductRequest): - The request object. Request message for the ``GetProduct`` - method. + The request object. Request message for the ``GetProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2230,8 +2220,7 @@ def __call__( Args: request (~.product_search_service.GetProductSetRequest): - The request object. Request message for the - ``GetProductSet`` method. + The request object. Request message for the ``GetProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2382,8 +2371,7 @@ def __call__( Args: request (~.product_search_service.GetReferenceImageRequest): - The request object. Request message for the - ``GetReferenceImage`` method. + The request object. Request message for the ``GetReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2394,9 +2382,8 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a - product image and its associated - metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, such as bounding boxes. """ @@ -2535,8 +2522,7 @@ def __call__( Args: request (~.product_search_service.ImportProductSetsRequest): - The request object. Request message for the - ``ImportProductSets`` method. + The request object. Request message for the ``ImportProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2688,8 +2674,7 @@ def __call__( Args: request (~.product_search_service.ListProductsRequest): - The request object. Request message for the ``ListProducts`` - method. + The request object. Request message for the ``ListProducts`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2700,9 +2685,7 @@ def __call__( Returns: ~.product_search_service.ListProductsResponse: - Response message for the - ``ListProducts`` method. - + Response message for the ``ListProducts`` method. """ http_options = ( @@ -2837,8 +2820,7 @@ def __call__( Args: request (~.product_search_service.ListProductSetsRequest): - The request object. Request message for the - ``ListProductSets`` method. + The request object. Request message for the ``ListProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2849,9 +2831,7 @@ def __call__( Returns: ~.product_search_service.ListProductSetsResponse: - Response message for the - ``ListProductSets`` method. - + Response message for the ``ListProductSets`` method. """ http_options = ( @@ -2990,8 +2970,8 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the - ``ListProductsInProductSet`` method. + The request object. Request message for the ``ListProductsInProductSet`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3002,8 +2982,8 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the - ``ListProductsInProductSet`` method. + Response message for the ``ListProductsInProductSet`` + method. """ @@ -3145,8 +3125,7 @@ def __call__( Args: request (~.product_search_service.ListReferenceImagesRequest): - The request object. Request message for the - ``ListReferenceImages`` method. + The request object. Request message for the ``ListReferenceImages`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3157,9 +3136,7 @@ def __call__( Returns: ~.product_search_service.ListReferenceImagesResponse: - Response message for the - ``ListReferenceImages`` method. - + Response message for the ``ListReferenceImages`` method. """ http_options = ( @@ -3299,8 +3276,7 @@ def __call__( Args: request (~.product_search_service.PurgeProductsRequest): - The request object. Request message for the - ``PurgeProducts`` method. + The request object. Request message for the ``PurgeProducts`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3453,8 +3429,8 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the - ``RemoveProductFromProductSet`` method. + The request object. Request message for the ``RemoveProductFromProductSet`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3570,8 +3546,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductRequest): - The request object. Request message for the - ``UpdateProduct`` method. + The request object. Request message for the ``UpdateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3721,8 +3696,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductSetRequest): - The request object. Request message for the - ``UpdateProductSet`` method. + The request object. Request message for the ``UpdateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py index 2e2fbf8e667c..afb9200acc7d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py @@ -36,11 +36,10 @@ class FaceRecognitionParams(proto.Message): celebrity_set (MutableSequence[str]): The resource names for one or more `CelebritySet - `__s. - A celebrity set is preloaded and can be - specified as "builtin/default". If this is - specified, the algorithm will try to match the - faces detected in the input image to the + `__s. A + celebrity set is preloaded and can be specified as + "builtin/default". If this is specified, the algorithm will + try to match the faces detected in the input image to the Celebrities in the CelebritySets. """ @@ -55,8 +54,8 @@ class Celebrity(proto.Message): Attributes: name (str): - The resource name of the preloaded Celebrity. - Has the format ``builtin/{mid}``. + The resource name of the preloaded Celebrity. Has the format + ``builtin/{mid}``. display_name (str): The Celebrity's display name. description (str): @@ -82,8 +81,7 @@ class FaceRecognitionResult(proto.Message): Attributes: celebrity (google.cloud.vision_v1p4beta1.types.Celebrity): - The `Celebrity - `__ + The `Celebrity `__ that this face was matched to. confidence (float): Recognition confidence. Range [0, 1]. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py index 2e6dbc02e437..e3d94030edb0 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py @@ -105,24 +105,23 @@ class Likelihood(proto.Enum): class Feature(proto.Message): - r"""The type of Google Cloud Vision API detection to perform, and - the maximum number of results to return for that type. Multiple + r"""The type of Google Cloud Vision API detection to perform, and the + maximum number of results to return for that type. Multiple ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p4beta1.types.Feature.Type): The feature type. max_results (int): - Maximum number of results of this type. Does not - apply to ``TEXT_DETECTION``, - ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. + Maximum number of results of this type. Does not apply to + ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or + ``CROP_HINTS``. model (str): Model to use for the feature. - Supported values: "builtin/stable" (the default - if unset) and "builtin/latest". - ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" - for the bleeding edge release updated weekly. + Supported values: "builtin/stable" (the default if unset) + and "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also support "builtin/weekly" for the + bleeding edge release updated weekly. """ class Type(proto.Enum): @@ -140,15 +139,14 @@ class Type(proto.Enum): LABEL_DETECTION (4): Run label detection. TEXT_DETECTION (5): - Run text detection / optical character - recognition (OCR). Text detection is optimized - for areas of text within a larger image; if the - image is a document, use + Run text detection / optical character recognition (OCR). + Text detection is optimized for areas of text within a + larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): - Run dense text document OCR. Takes precedence - when both ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` are present. + Run dense text document OCR. Takes precedence when both + ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are + present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -202,9 +200,8 @@ class ImageSource(proto.Message): **Use ``image_uri`` instead.** The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud - Storage Request + ``gs://bucket_name/object_name``. Object versioning is not + supported. See `Google Cloud Storage Request URIs `__ for more info. @@ -212,27 +209,23 @@ class ImageSource(proto.Message): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google - Cloud Storage Request + ``gs://bucket_name/object_name``. Object versioning is + not supported. See `Google Cloud Storage Request URIs `__ for more info. - 2. A publicly-accessible image HTTP/HTTPS URL. - When fetching images from HTTP/HTTPS - URLs, Google cannot guarantee that the - request will be completed. Your request - may fail if the specified host denies the - request (e.g. due to request throttling or - DOS prevention), or if Google throttles - requests to the site for abuse prevention. - You should not depend on - externally-hosted images for production - applications. - - When both ``gcs_image_uri`` and ``image_uri`` - are specified, ``image_uri`` takes precedence. + 2. A publicly-accessible image HTTP/HTTPS URL. When fetching + images from HTTP/HTTPS URLs, Google cannot guarantee + that the request will be completed. Your request may + fail if the specified host denies the request (e.g. + due to request throttling or DOS prevention), or if + Google throttles requests to the site for abuse + prevention. You should not depend on + externally-hosted images for production applications. + + When both ``gcs_image_uri`` and ``image_uri`` are specified, + ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -251,15 +244,14 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers - use a pure binary representation, whereas JSON - representations use base64. + Note: As with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. source (google.cloud.vision_v1p4beta1.types.ImageSource): - Google Cloud Storage image location, or - publicly-accessible image URL. If both - ``content`` and ``source`` are provided for an - image, ``content`` takes precedence and is used - to perform the image annotation request. + Google Cloud Storage image location, or publicly-accessible + image URL. If both ``content`` and ``source`` are provided + for an image, ``content`` takes precedence and is used to + perform the image annotation request. """ content: bytes = proto.Field( @@ -279,42 +271,35 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): - The bounding polygon around the face. The - coordinates of the bounding box are in the - original image's scale. The bounding box is - computed to "frame" the face in accordance with - human expectations. It is based on the - landmarker results. Note that one or more x - and/or y coordinates may not be generated in the - ``BoundingPoly`` (the polygon will be unbounded) - if only a partial face appears in the image to - be annotated. + The bounding polygon around the face. The coordinates of the + bounding box are in the original image's scale. The bounding + box is computed to "frame" the face in accordance with human + expectations. It is based on the landmarker results. Note + that one or more x and/or y coordinates may not be generated + in the ``BoundingPoly`` (the polygon will be unbounded) if + only a partial face appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is - tighter than the ``boundingPoly``, and encloses - only the skin part of the face. Typically, it is - used to eliminate the face from any image - analysis that detects the "amount of skin" - visible in an image. It is not based on the - landmarker results, only on the initial face - detection, hence the fd (face + The ``fd_bounding_poly`` bounding polygon is tighter than + the ``boundingPoly``, and encloses only the skin part of the + face. Typically, it is used to eliminate the face from any + image analysis that detects the "amount of skin" visible in + an image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p4beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face - relative to the image vertical about the axis - perpendicular to the face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the face. + Range [-180,180]. pan_angle (float): - Yaw angle, which indicates the - leftward/rightward angle that the face is - pointing relative to the vertical plane + Yaw angle, which indicates the leftward/rightward angle that + the face is pointing relative to the vertical plane perpendicular to the image. Range [-180,180]. tilt_angle (float): - Pitch angle, which indicates the - upwards/downwards angle that the face is - pointing relative to the image's horizontal + Pitch angle, which indicates the upwards/downwards angle + that the face is pointing relative to the image's horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. @@ -335,16 +320,13 @@ class FaceAnnotation(proto.Message): headwear_likelihood (google.cloud.vision_v1p4beta1.types.Likelihood): Headwear likelihood. recognition_result (MutableSequence[google.cloud.vision_v1p4beta1.types.FaceRecognitionResult]): - Additional recognition information. Only - computed if - image_context.face_recognition_params is - provided, **and** a match is found to a - `Celebrity - `__ in - the input `CelebritySet - `__. - This field is sorted in order of decreasing - confidence values. + Additional recognition information. Only computed if + image_context.face_recognition_params is provided, **and** a + match is found to a `Celebrity + `__ in the input + `CelebritySet + `__. This field + is sorted in order of decreasing confidence values. """ class Landmark(proto.Message): @@ -360,8 +342,8 @@ class Landmark(proto.Message): class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the - image without considering mirror projections typical of photos. - So, ``LEFT_EYE``, typically, is the person's right eye. + image without considering mirror projections typical of photos. So, + ``LEFT_EYE``, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -610,47 +592,42 @@ class EntityAnnotation(proto.Message): mid (str): Opaque entity ID. Some IDs may be available in `Google Knowledge Graph Search - API - `__. + API `__. locale (str): - The language code for the locale in which the - entity textual ``description`` is expressed. + The language code for the locale in which the entity textual + ``description`` is expressed. description (str): - Entity textual description, expressed in its - ``locale`` language. + Entity textual description, expressed in its ``locale`` + language. score (float): Overall score of the result. Range [0, 1]. confidence (float): **Deprecated. Use ``score`` instead.** - The accuracy of the entity detection in an - image. For example, for an image in which the - "Eiffel Tower" entity is detected, this field - represents the confidence that there is a tower - in the query image. Range [0, 1]. + The accuracy of the entity detection in an image. For + example, for an image in which the "Eiffel Tower" entity is + detected, this field represents the confidence that there is + a tower in the query image. Range [0, 1]. topicality (float): - The relevancy of the ICA (Image Content - Annotation) label to the image. For example, the - relevancy of "tower" is likely higher to an - image containing the detected "Eiffel Tower" - than to an image containing a detected distant - towering building, even though the confidence - that there is a tower in each image may be the - same. Range [0, 1]. + The relevancy of the ICA (Image Content Annotation) label to + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower + in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): - Image region to which this entity belongs. Not - produced for ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not produced + for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p4beta1.types.LocationInfo]): - The location information for the detected - entity. Multiple ``LocationInfo`` elements can - be present because one location may indicate the - location of the scene in the image, and another - location may indicate the location of the place - where the image was taken. Location information - is usually present for landmarks. + The location information for the detected entity. Multiple + ``LocationInfo`` elements can be present because one + location may indicate the location of the scene in the + image, and another location may indicate the location of the + place where the image was taken. Location information is + usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p4beta1.types.Property]): - Some entities may have optional user-supplied - ``Property`` (name/value) fields, such a score - or string that qualifies the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) fields, such a score or string that qualifies + the entity. """ mid: str = proto.Field( @@ -702,12 +679,11 @@ class LocalizedObjectAnnotation(proto.Message): Object ID that should align with EntityAnnotation mid. language_code (str): - The BCP-47 language code, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code, such as "en-US" or "sr-Latn". For + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` - language. + Object name, expressed in its ``language_code`` language. score (float): Score of the result. Range [0, 1]. bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): @@ -824,11 +800,10 @@ class ColorInfo(proto.Message): color (google.type.color_pb2.Color): RGB components of the color. score (float): - Image-specific score for this color. Value in - range [0, 1]. + Image-specific score for this color. Value in range [0, 1]. pixel_fraction (float): - The fraction of pixels the color occupies in the - image. Value in range [0, 1]. + The fraction of pixels the color occupies in the image. + Value in range [0, 1]. """ color: color_pb2.Color = proto.Field( @@ -888,8 +863,7 @@ class CropHint(proto.Message): coordinates of the bounding box are in the original image's scale. confidence (float): - Confidence of this being a salient region. - Range [0, 1]. + Confidence of this being a salient region. Range [0, 1]. importance_fraction (float): Fraction of importance of this salient region with respect to the original image. @@ -968,10 +942,9 @@ class TextDetectionParams(proto.Message): Attributes: enable_text_detection_confidence_score (bool): - By default, Cloud Vision API only includes - confidence score for DOCUMENT_TEXT_DETECTION - result. Set the flag to true to include - confidence score for TEXT_DETECTION as well. + By default, Cloud Vision API only includes confidence score + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -994,18 +967,15 @@ class ImageContext(proto.Message): lat_long_rect (google.cloud.vision_v1p4beta1.types.LatLongRect): Not used. language_hints (MutableSequence[str]): - List of languages to use for TEXT_DETECTION. In - most cases, an empty value yields the best - results since it enables automatic language - detection. For languages based on the Latin - alphabet, setting ``language_hints`` is not - needed. In rare cases, when the language of the - text in the image is known, setting a hint will - help get better results (although it will be a - significant hindrance if the hint is wrong). - Text detection returns an error if one or more - of the specified languages is not one of the - `supported languages + List of languages to use for TEXT_DETECTION. In most cases, + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In + rare cases, when the language of the text in the image is + known, setting a hint will help get better results (although + it will be a significant hindrance if the hint is wrong). + Text detection returns an error if one or more of the + specified languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p4beta1.types.CropHintsParams): Parameters for crop hints annotation request. @@ -1156,10 +1126,9 @@ class AnnotateImageResponse(proto.Message): If present, product search has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the - operation. Note that filled-in image annotations - are guaranteed to be correct, even when - ``error`` is set. + If set, represents the error message for the operation. + Note that filled-in image annotations are guaranteed to be + correct, even when ``error`` is set. context (google.cloud.vision_v1p4beta1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1335,16 +1304,14 @@ class AnnotateFileResponse(proto.Message): Information about the file for which this response is generated. responses (MutableSequence[google.cloud.vision_v1p4beta1.types.AnnotateImageResponse]): - Individual responses to images found within the - file. This field will be empty if the ``error`` - field is set. + Individual responses to images found within the file. This + field will be empty if the ``error`` field is set. total_pages (int): This field gives the total number of pages in the file. error (google.rpc.status_pb2.Status): - If set, represents the error message for the - failed request. The ``responses`` field will not - be set in this case. + If set, represents the error message for the failed request. + The ``responses`` field will not be set in this case. """ input_config: "InputConfig" = proto.Field( @@ -1542,13 +1509,13 @@ class InputConfig(proto.Message): input from. content (bytes): File content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers - use a pure binary representation, whereas JSON - representations use base64. + Note: As with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. - Currently, this field only works for - BatchAnnotateFiles requests. It does not work - for AsyncBatchAnnotateFiles requests. + Currently, this field only works for BatchAnnotateFiles + requests. It does not work for AsyncBatchAnnotateFiles + requests. mime_type (str): The type of the file. Currently only "application/pdf", "image/tiff" and "image/gif" @@ -1578,20 +1545,18 @@ class OutputConfig(proto.Message): The Google Cloud Storage location to write the output(s) to. batch_size (int): - The max number of response protos to put into - each output JSON file on Google Cloud Storage. - The valid range is [1, 100]. If not specified, - the default value is 20. - - For example, for one pdf file with 100 pages, - 100 response protos will be generated. If - ``batch_size`` = 20, then 5 json files each - containing 20 response protos will be written - under the prefix ``gcs_destination``.``uri``. - - Currently, batch_size only applies to - GcsDestination, with potential future support - for other output configurations. + The max number of response protos to put into each output + JSON file on Google Cloud Storage. + The valid range is [1, 100]. If not specified, the default + value is 20. + + For example, for one pdf file with 100 pages, 100 response + protos will be generated. If ``batch_size`` = 20, then 5 + json files each containing 20 response protos will be + written under the prefix ``gcs_destination``.``uri``. + + Currently, batch_size only applies to GcsDestination, with + potential future support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1628,37 +1593,32 @@ class GcsDestination(proto.Message): Attributes: uri (str): - Google Cloud Storage URI prefix where the - results will be stored. Results will be in JSON - format and preceded by its corresponding input - URI prefix. This field can either represent a - gcs file prefix or gcs directory. In either - case, the uri should be unique because in order - to get all of the output files, you will need to - do a wildcard gcs search on the uri prefix you - provide. + Google Cloud Storage URI prefix where the results will be + stored. Results will be in JSON format and preceded by its + corresponding input URI prefix. This field can either + represent a gcs file prefix or gcs directory. In either + case, the uri should be unique because in order to get all + of the output files, you will need to do a wildcard gcs + search on the uri prefix you provide. Examples: - * File Prefix: - gs://bucket-name/here/filenameprefix The - output files will be created in - gs://bucket-name/here/ and the names of the - output files will begin with "filenameprefix". + * File Prefix: gs://bucket-name/here/filenameprefix The + output files will be created in gs://bucket-name/here/ and + the names of the output files will begin with + "filenameprefix". - * Directory Prefix: - gs://bucket-name/some/location/ The output - files will be created in - gs://bucket-name/some/location/ and the names of - the output files could be anything because there - was no filename prefix specified. + * Directory Prefix: gs://bucket-name/some/location/ The + output files will be created in + gs://bucket-name/some/location/ and the names of the output + files could be anything because there was no filename prefix + specified. If multiple outputs, each response is still - AnnotateFileResponse, each of which contains - some subset of the full list of - AnnotateImageResponse. Multiple outputs can - happen if, for example, the output JSON is too - large and overflows into multiple sharded files. + AnnotateFileResponse, each of which contains some subset of + the full list of AnnotateImageResponse. Multiple outputs can + happen if, for example, the output JSON is too large and + overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py index af4fafb8891c..c438f2cc0fc1 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py @@ -41,8 +41,7 @@ class ProductSearchParams(proto.Message): system discretion will be applied. product_set (str): The resource name of a - `ProductSet - `__ to + `ProductSet `__ to be searched for similar images. Format is: @@ -150,12 +149,11 @@ class ObjectAnnotation(proto.Message): Object ID that should align with EntityAnnotation mid. language_code (str): - The BCP-47 language code, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code, such as "en-US" or "sr-Latn". For + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` - language. + Object name, expressed in its ``language_code`` language. score (float): Score of the result. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py index b1a687b1152d..09fb49b729ff 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py @@ -89,23 +89,21 @@ class Product(proto.Message): "apparel", and "toys" are still supported, but these should not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1p4beta1.types.Product.KeyValue]): - Key-value pairs that can be attached to a - product. At query time, constraints can be - specified based on the product_labels. - - Note that integer values can be provided as - strings, e.g. "1199". Only strings with integer - values can match a range-based restriction which - is to be supported soon. - - Multiple values can be assigned to the same key. - One product may have up to 500 product_labels. - - Notice that the total number of distinct - product_labels over all products in one - ProductSet cannot exceed 1M, otherwise the - product search pipeline will refuse to work for - that ProductSet. + Key-value pairs that can be attached to a product. At query + time, constraints can be specified based on the + product_labels. + + Note that integer values can be provided as strings, e.g. + "1199". Only strings with integer values can match a + range-based restriction which is to be supported soon. + + Multiple values can be assigned to the same key. One product + may have up to 500 product_labels. + + Notice that the total number of distinct product_labels over + all products in one ProductSet cannot exceed 1M, otherwise + the product search pipeline will refuse to work for that + ProductSet. """ class KeyValue(proto.Message): @@ -166,8 +164,7 @@ class ProductSet(proto.Message): ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. - This field is ignored when creating a - ProductSet. + This field is ignored when creating a ProductSet. display_name (str): The user-provided name for this ProductSet. Must not be empty. Must be at most 4096 @@ -223,11 +220,10 @@ class ReferenceImage(proto.Message): ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. - This field is ignored when creating a reference - image. + This field is ignored when creating a reference image. uri (str): - Required. The Google Cloud Storage URI of the - reference image. + Required. The Google Cloud Storage URI of the reference + image. The URI must start with ``gs://``. bounding_polys (MutableSequence[google.cloud.vision_v1p4beta1.types.BoundingPoly]): Optional. Bounding polygons around the areas @@ -263,19 +259,18 @@ class CreateProductRequest(proto.Message): Attributes: parent (str): - Required. The project in which the Product - should be created. + Required. The project in which the Product should be + created. Format is ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1p4beta1.types.Product): Required. The product to create. product_id (str): - A user-supplied resource id for this Product. If - set, the server will attempt to use this value - as the resource id. If it is already in use, an - error is returned with code ALREADY_EXISTS. Must - be at most 128 characters long. It cannot - contain the character ``/``. + A user-supplied resource id for this Product. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -298,8 +293,8 @@ class ListProductsRequest(proto.Message): Attributes: parent (str): - Required. The project OR ProductSet from which - Products should be listed. + Required. The project OR ProductSet from which Products + should be listed. Format: ``projects/PROJECT_ID/locations/LOC_ID`` @@ -307,8 +302,8 @@ class ListProductsRequest(proto.Message): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous - List request, if any. + The next_page_token returned from a previous List request, + if any. """ parent: str = proto.Field( @@ -379,12 +374,12 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ - that specifies which fields to update. - If update_mask isn't specified, all mutable - fields are to be updated. Valid mask paths - include ``product_labels``, ``display_name``, - and ``description``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include + ``product_labels``, ``display_name``, and + ``description``. """ product: "Product" = proto.Field( @@ -422,19 +417,17 @@ class CreateProductSetRequest(proto.Message): Attributes: parent (str): - Required. The project in which the ProductSet - should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSet should be + created. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. product_set (google.cloud.vision_v1p4beta1.types.ProductSet): Required. The ProductSet to create. product_set_id (str): - A user-supplied resource id for this ProductSet. - If set, the server will attempt to use this - value as the resource id. If it is already in - use, an error is returned with code - ALREADY_EXISTS. Must be at most 128 characters - long. It cannot contain the character ``/``. + A user-supplied resource id for this ProductSet. If set, + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -457,16 +450,15 @@ class ListProductSetsRequest(proto.Message): Attributes: parent (str): - Required. The project from which ProductSets - should be listed. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project from which ProductSets should be + listed. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous - List request, if any. + The next_page_token returned from a previous List request, + if any. """ parent: str = proto.Field( @@ -515,8 +507,8 @@ class GetProductSetRequest(proto.Message): Attributes: name (str): - Required. Resource name of the ProductSet to - get. + Required. Resource name of the ProductSet to get. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -536,11 +528,10 @@ class UpdateProductSetRequest(proto.Message): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ - that specifies which fields to update. - If update_mask isn't specified, all mutable - fields are to be updated. Valid mask path is - ``display_name``. + The `FieldMask `__ that + specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. """ product_set: "ProductSet" = proto.Field( @@ -560,8 +551,8 @@ class DeleteProductSetRequest(proto.Message): Attributes: name (str): - Required. Resource name of the ProductSet to - delete. + Required. Resource name of the ProductSet to delete. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -578,8 +569,8 @@ class CreateReferenceImageRequest(proto.Message): Attributes: parent (str): - Required. Resource name of the product in which - to create the reference image. + Required. Resource name of the product in which to + create the reference image. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. @@ -587,13 +578,11 @@ class CreateReferenceImageRequest(proto.Message): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): - A user-supplied resource id for the - ReferenceImage to be added. If set, the server - will attempt to use this value as the resource - id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at - most 128 characters long. It cannot contain the - character ``/``. + A user-supplied resource id for the ReferenceImage to be + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -616,18 +605,17 @@ class ListReferenceImagesRequest(proto.Message): Attributes: parent (str): - Required. Resource name of the product - containing the reference images. + Required. Resource name of the product containing the + reference images. Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): - A token identifying a page of results to be - returned. This is the value of ``nextPageToken`` - returned in a previous reference image list - request. + A token identifying a page of results to be returned. This + is the value of ``nextPageToken`` returned in a previous + reference image list request. Defaults to the first page if not specified. """ @@ -656,8 +644,8 @@ class ListReferenceImagesResponse(proto.Message): The maximum number of items to return. Default 10, maximum 100. next_page_token (str): - The next_page_token returned from a previous - List request, if any. + The next_page_token returned from a previous List request, + if any. """ @property @@ -684,8 +672,8 @@ class GetReferenceImageRequest(proto.Message): Attributes: name (str): - Required. The resource name of the - ReferenceImage to get. + Required. The resource name of the ReferenceImage to + get. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. @@ -702,8 +690,8 @@ class DeleteReferenceImageRequest(proto.Message): Attributes: name (str): - Required. The resource name of the reference - image to delete. + Required. The resource name of the reference image to + delete. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` @@ -716,18 +704,19 @@ class DeleteReferenceImageRequest(proto.Message): class AddProductToProductSetRequest(proto.Message): - r"""Request message for the ``AddProductToProductSet`` method. + r"""Request message for the ``AddProductToProductSet`` + method. Attributes: name (str): - Required. The resource name for the ProductSet - to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): - Required. The resource name for the Product to - be added to this ProductSet. + Required. The resource name for the Product to be added + to this ProductSet. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` @@ -744,18 +733,19 @@ class AddProductToProductSetRequest(proto.Message): class RemoveProductFromProductSetRequest(proto.Message): - r"""Request message for the ``RemoveProductFromProductSet`` method. + r"""Request message for the ``RemoveProductFromProductSet`` + method. Attributes: name (str): - Required. The resource name for the ProductSet - to modify. + Required. The resource name for the ProductSet to + modify. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): - Required. The resource name for the Product to - be removed from this ProductSet. + Required. The resource name for the Product to be + removed from this ProductSet. Format is: @@ -773,12 +763,13 @@ class RemoveProductFromProductSetRequest(proto.Message): class ListProductsInProductSetRequest(proto.Message): - r"""Request message for the ``ListProductsInProductSet`` method. + r"""Request message for the ``ListProductsInProductSet`` + method. Attributes: name (str): - Required. The ProductSet resource for which to - retrieve Products. + Required. The ProductSet resource for which to retrieve + Products. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` @@ -786,8 +777,8 @@ class ListProductsInProductSetRequest(proto.Message): The maximum number of items to return. Default 10, maximum 100. page_token (str): - The next_page_token returned from a previous - List request, if any. + The next_page_token returned from a previous List request, + if any. """ name: str = proto.Field( @@ -805,7 +796,8 @@ class ListProductsInProductSetRequest(proto.Message): class ListProductsInProductSetResponse(proto.Message): - r"""Response message for the ``ListProductsInProductSet`` method. + r"""Response message for the ``ListProductsInProductSet`` + method. Attributes: products (MutableSequence[google.cloud.vision_v1p4beta1.types.Product]): @@ -837,13 +829,12 @@ class ImportProductSetsGcsSource(proto.Message): Attributes: csv_file_uri (str): - The Google Cloud Storage URI of the input csv - file. + The Google Cloud Storage URI of the input csv file. + The URI must start with ``gs://``. - The format of the input csv file should be one - image per line. In each line, there are 8 - columns. + The format of the input csv file should be one image per + line. In each line, there are 8 columns. 1. image-uri 2. image-id @@ -854,73 +845,64 @@ class ImportProductSetsGcsSource(proto.Message): 7. labels 8. bounding-poly - The ``image-uri``, ``product-set-id``, - ``product-id``, and ``product-category`` columns - are required. All other columns are optional. + The ``image-uri``, ``product-set-id``, ``product-id``, and + ``product-category`` columns are required. All other columns + are optional. - If the ``ProductSet`` or ``Product`` specified - by the ``product-set-id`` and ``product-id`` - values does not exist, then the system will - create a new ``ProductSet`` or ``Product`` for - the image. In this case, the + If the ``ProductSet`` or ``Product`` specified by the + ``product-set-id`` and ``product-id`` values does not exist, + then the system will create a new ``ProductSet`` or + ``Product`` for the image. In this case, the ``product-display-name`` column refers to `display_name - `__, - the ``product-category`` column refers to + `__, the + ``product-category`` column refers to `product_category `__, and the ``labels`` column refers to `product_labels `__. - The ``image-id`` column is optional but must be - unique if provided. If it is empty, the system - will automatically assign a unique id to the - image. + The ``image-id`` column is optional but must be unique if + provided. If it is empty, the system will automatically + assign a unique id to the image. - The ``product-display-name`` column is optional. - If it is empty, the system sets the - `display_name + The ``product-display-name`` column is optional. If it is + empty, the system sets the `display_name `__ - field for the product to a space (" "). You can - update the ``display_name`` later by using the - API. - - If a ``Product`` with the specified - ``product-id`` already exists, then the system - ignores the ``product-display-name``, - ``product-category``, and ``labels`` columns. - - The ``labels`` column (optional) is a line - containing a list of comma-separated key-value - pairs, in the following format: - - "key_1=value_1,key_2=value_2,...,key_n=value_n" - - The ``bounding-poly`` column (optional) - identifies one region of interest from the image - in the same manner as ``CreateReferenceImage``. - If you do not specify the ``bounding-poly`` - column, then the system will try to detect + field for the product to a space (" "). You can update the + ``display_name`` later by using the API. + + If a ``Product`` with the specified ``product-id`` already + exists, then the system ignores the + ``product-display-name``, ``product-category``, and + ``labels`` columns. + + The ``labels`` column (optional) is a line containing a list + of comma-separated key-value pairs, in the following format: + + "key_1=value_1,key_2=value_2,...,key_n=value_n" + + The ``bounding-poly`` column (optional) identifies one + region of interest from the image in the same manner as + ``CreateReferenceImage``. If you do not specify the + ``bounding-poly`` column, then the system will try to detect regions of interest automatically. - At most one ``bounding-poly`` column is allowed - per line. If the image contains multiple regions - of interest, add a line to the CSV file that - includes the same product information, and the - ``bounding-poly`` values for each region of + At most one ``bounding-poly`` column is allowed per line. If + the image contains multiple regions of interest, add a line + to the CSV file that includes the same product information, + and the ``bounding-poly`` values for each region of interest. - The ``bounding-poly`` column must contain an - even number of comma-separated numbers, in the - format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use - non-negative integers for absolute bounding - polygons, and float values in [0, 1] for - normalized bounding polygons. + The ``bounding-poly`` column must contain an even number of + comma-separated numbers, in the format + "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative + integers for absolute bounding polygons, and float values in + [0, 1] for normalized bounding polygons. - The system will resize the image if the image - resolution is too large to process (larger than - 20MP). + The system will resize the image if the image resolution is + too large to process (larger than 20MP). """ csv_file_uri: str = proto.Field( @@ -956,10 +938,9 @@ class ImportProductSetsRequest(proto.Message): Attributes: parent (str): - Required. The project in which the ProductSets - should be imported. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project in which the ProductSets should be + imported. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. input_config (google.cloud.vision_v1p4beta1.types.ImportProductSetsInputConfig): Required. The input content for the list of requests. @@ -988,16 +969,15 @@ class ImportProductSetsResponse(proto.Message): Attributes: reference_images (MutableSequence[google.cloud.vision_v1p4beta1.types.ReferenceImage]): - The list of reference_images that are imported - successfully. + The list of reference_images that are imported successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): - The rpc status for each ImportProductSet - request, including both successes and errors. + The rpc status for each ImportProductSet request, including + both successes and errors. - The number of statuses here matches the number - of lines in the csv file, and statuses[i] stores - the success or failure status of processing the - i-th line of the csv, starting from line 0. + The number of statuses here matches the number of lines in + the csv file, and statuses[i] stores the success or failure + status of processing the i-th line of the csv, starting from + line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -1015,8 +995,9 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` returned by the - ``GetOperation`` call of the ``google::longrunning::Operations`` service. + This is included in the ``metadata`` field of the ``Operation`` + returned by the ``GetOperation`` call of the + ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1p4beta1.types.BatchOperationMetadata.State): @@ -1027,8 +1008,7 @@ class BatchOperationMetadata(proto.Message): end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and `google.longrunning.Operation.done - `__ is set to - true. + `__ is set to true. """ class State(proto.Enum): @@ -1082,10 +1062,9 @@ class ProductSetPurgeConfig(proto.Message): Attributes: product_set_id (str): - The ProductSet that contains the Products to - delete. If a Product is a member of - product_set_id in addition to other ProductSets, - the Product will still be deleted. + The ProductSet that contains the Products to delete. If a + Product is a member of product_set_id in addition to other + ProductSets, the Product will still be deleted. """ product_set_id: str = proto.Field( @@ -1111,15 +1090,14 @@ class PurgeProductsRequest(proto.Message): This field is a member of `oneof`_ ``target``. delete_orphan_products (bool): - If delete_orphan_products is true, all Products - that are not in any ProductSet will be deleted. + If delete_orphan_products is true, all Products that are not + in any ProductSet will be deleted. This field is a member of `oneof`_ ``target``. parent (str): - Required. The project and location in which the - Products should be deleted. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Required. The project and location in which the Products + should be deleted. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. force (bool): The default value is false. Override this value to true to actually perform the purge. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py index 208832b1017b..72e783a672aa 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py @@ -35,14 +35,13 @@ class TextAnnotation(proto.Message): - r"""TextAnnotation contains a structured representation of OCR - extracted text. The hierarchy of an OCR extracted text structure - is like this: - - TextAnnotation -> Page -> Block -> Paragraph -> Word -> - Symbol Each structural component, starting from Page, may - further have their own properties. Properties describe detected - languages, breaks etc.. Please refer to the + r"""TextAnnotation contains a structured representation of OCR extracted + text. The hierarchy of an OCR extracted text structure is like this: + + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + Each structural component, starting from Page, may further have + their own properties. Properties describe detected languages, breaks + etc.. Please refer to the `TextAnnotation.TextProperty `__ message definition below for more detail. @@ -59,8 +58,8 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): - The BCP-47 language code, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code, such as "en-US" or "sr-Latn". For + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -98,9 +97,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; - does not co-occur with ``SPACE``, - ``LEADER_SPACE``, or ``LINE_BREAK``. + End-line hyphen that is not present in text; does not + co-occur with ``SPACE``, ``LEADER_SPACE``, or + ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -172,8 +171,7 @@ class Page(proto.Message): List of blocks of text, images etc on this page. confidence (float): - Confidence of the OCR results on the page. Range - [0, 1]. + Confidence of the OCR results on the page. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -239,8 +237,7 @@ class Block(proto.Message): Detected block type (text, image etc) for this block. confidence (float): - Confidence of the OCR results on the block. - Range [0, 1]. + Confidence of the OCR results on the block. Range [0, 1]. """ class BlockType(proto.Enum): @@ -302,25 +299,22 @@ class Paragraph(proto.Message): Additional information detected for the paragraph. bounding_box (google.cloud.vision_v1p4beta1.types.BoundingPoly): - The bounding box for the paragraph. The vertices - are in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertex order will still be - (0, 1, 2, 3). + The bounding box for the paragraph. The vertices are in the + order of top-left, top-right, bottom-right, bottom-left. + When a rotation of the bounding box is detected the rotation + is represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertex order will + still be (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1p4beta1.types.Word]): List of all words in this paragraph. confidence (float): - Confidence of the OCR results for the paragraph. - Range [0, 1]. + Confidence of the OCR results for the paragraph. Range [0, + 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -351,27 +345,23 @@ class Word(proto.Message): property (google.cloud.vision_v1p4beta1.types.TextAnnotation.TextProperty): Additional information detected for the word. bounding_box (google.cloud.vision_v1p4beta1.types.BoundingPoly): - The bounding box for the word. The vertices are - in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertex order will still be - (0, 1, 2, 3). + The bounding box for the word. The vertices are in the order + of top-left, top-right, bottom-right, bottom-left. When a + rotation of the bounding box is detected the rotation is + represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertex order will + still be (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1p4beta1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural reading order. confidence (float): - Confidence of the OCR results for the word. - Range [0, 1]. + Confidence of the OCR results for the word. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( @@ -403,26 +393,22 @@ class Symbol(proto.Message): Additional information detected for the symbol. bounding_box (google.cloud.vision_v1p4beta1.types.BoundingPoly): - The bounding box for the symbol. The vertices - are in the order of top-left, top-right, - bottom-right, bottom-left. When a rotation of - the bounding box is detected the rotation is - represented as around the top-left corner as - defined when the text is read in the 'natural' - orientation. For example: - - - when the text is horizontal it might look - like: 0----1 \| \| 3----2 - - when it's rotated 180 degrees around the - top-left corner it becomes: 2----3 \| \| - 1----0 and the vertex order will still be - (0, 1, 2, 3). + The bounding box for the symbol. The vertices are in the + order of top-left, top-right, bottom-right, bottom-left. + When a rotation of the bounding box is detected the rotation + is represented as around the top-left corner as defined when + the text is read in the 'natural' orientation. For example: + + - when the text is horizontal it might look like: 0----1 \| + \| 3----2 + - when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 \| \| 1----0 and the vertex order will + still be (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. confidence (float): - Confidence of the OCR results for the symbol. - Range [0, 1]. + Confidence of the OCR results for the symbol. Range [0, 1]. """ property: "TextAnnotation.TextProperty" = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py index ee8759fc039b..3bfadec02406 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py @@ -159,8 +159,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as - "en-US" or "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ From bf5a4769798654b73dbbb76afa2751b72b6e71bc Mon Sep 17 00:00:00 2001 From: ohmayr Date: Fri, 16 Jan 2026 23:06:57 +0000 Subject: [PATCH 3/9] version 3 --- .../services/image_annotator/async_client.py | 17 +- .../services/image_annotator/client.py | 17 +- .../image_annotator/transports/grpc.py | 17 +- .../transports/grpc_asyncio.py | 17 +- .../services/product_search/async_client.py | 212 +++++++++--------- .../services/product_search/client.py | 212 +++++++++--------- .../product_search/transports/grpc.py | 91 ++++---- .../product_search/transports/grpc_asyncio.py | 91 ++++---- .../product_search/transports/rest.py | 75 +++---- .../cloud/vision_v1/types/image_annotator.py | 160 +++++++------ .../cloud/vision_v1/types/product_search.py | 10 +- .../vision_v1/types/product_search_service.py | 202 ++++++++--------- .../cloud/vision_v1/types/text_annotation.py | 8 +- .../cloud/vision_v1/types/web_detection.py | 2 +- .../vision_v1p1beta1/types/image_annotator.py | 84 ++++--- .../vision_v1p1beta1/types/text_annotation.py | 6 +- .../vision_v1p1beta1/types/web_detection.py | 2 +- .../services/image_annotator/async_client.py | 8 +- .../services/image_annotator/client.py | 8 +- .../image_annotator/transports/grpc.py | 8 +- .../transports/grpc_asyncio.py | 8 +- .../vision_v1p2beta1/types/image_annotator.py | 122 +++++----- .../vision_v1p2beta1/types/text_annotation.py | 6 +- .../vision_v1p2beta1/types/web_detection.py | 2 +- .../services/image_annotator/async_client.py | 9 +- .../services/image_annotator/client.py | 9 +- .../image_annotator/transports/grpc.py | 9 +- .../transports/grpc_asyncio.py | 9 +- .../services/product_search/async_client.py | 199 ++++++++-------- .../services/product_search/client.py | 199 ++++++++-------- .../product_search/transports/grpc.py | 86 ++++--- .../product_search/transports/grpc_asyncio.py | 86 ++++--- .../product_search/transports/rest.py | 79 ++++--- .../vision_v1p3beta1/types/image_annotator.py | 124 +++++----- .../vision_v1p3beta1/types/product_search.py | 10 +- .../types/product_search_service.py | 141 ++++++------ .../vision_v1p3beta1/types/text_annotation.py | 6 +- .../vision_v1p3beta1/types/web_detection.py | 2 +- .../services/image_annotator/async_client.py | 17 +- .../services/image_annotator/client.py | 17 +- .../image_annotator/transports/grpc.py | 17 +- .../transports/grpc_asyncio.py | 17 +- .../services/product_search/async_client.py | 208 ++++++++--------- .../services/product_search/client.py | 208 ++++++++--------- .../product_search/transports/grpc.py | 89 ++++---- .../product_search/transports/grpc_asyncio.py | 89 ++++---- .../product_search/transports/rest.py | 73 +++--- .../cloud/vision_v1p4beta1/types/face.py | 9 +- .../vision_v1p4beta1/types/image_annotator.py | 122 +++++----- .../vision_v1p4beta1/types/product_search.py | 8 +- .../types/product_search_service.py | 200 ++++++++--------- .../vision_v1p4beta1/types/text_annotation.py | 6 +- .../vision_v1p4beta1/types/web_detection.py | 2 +- 53 files changed, 1630 insertions(+), 1805 deletions(-) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py index 3bc14b37d8c1..b4652c015d0a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py @@ -536,10 +536,10 @@ async def async_batch_annotate_images( r"""Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateImagesResponse` + (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -678,11 +678,10 @@ async def async_batch_annotate_files( r"""Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py index 75f5cae7a661..a865cf669ede 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py @@ -993,10 +993,10 @@ def async_batch_annotate_images( r"""Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateImagesResponse` + (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -1134,11 +1134,10 @@ def async_batch_annotate_files( r"""Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py index b620d322f9e8..73df3786fa52 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py @@ -420,10 +420,10 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateImagesResponse` + (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -460,11 +460,10 @@ def async_batch_annotate_files( Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py index e0191631f616..eee3632a6203 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py @@ -429,10 +429,10 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateImagesResponse` + (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -470,11 +470,10 @@ def async_batch_annotate_files( Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py index ca5663b048f6..bd7ad803a713 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py @@ -73,21 +73,19 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. - - In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - The API has a collection of + [ProductSet][google.cloud.vision.v1.ProductSet] resources, named + `projects/*/locations/*/productSets/*`, which acts as a way to put + different products into groups to limit identification. In + parallel, + + - The API has a collection of + [Product][google.cloud.vision.v1.Product] resources, named + `projects/*/locations/*/products/*` + + - Each [Product][google.cloud.vision.v1.Product] has a collection of + [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, + named `projects/*/locations/*/products/*/referenceImages/*` """ _client: ProductSearchClient @@ -337,7 +335,7 @@ async def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. .. code-block:: python @@ -367,11 +365,11 @@ async def sample_create_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.CreateProductSetRequest, dict]]): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the `CreateProductSet` method. parent (:class:`str`): Required. The project in which the ProductSet should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -386,7 +384,7 @@ async def sample_create_product_set(): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -477,7 +475,7 @@ async def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. .. code-block:: python @@ -508,11 +506,11 @@ async def sample_list_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListProductSetsRequest, dict]]): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the `ListProductSets` method. parent (:class:`str`): Required. The project from which ProductSets should be listed. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -527,7 +525,7 @@ async def sample_list_product_sets(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductSetsAsyncPager: - Response message for the ``ListProductSets`` method. + Response message for the `ListProductSets` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -638,13 +636,13 @@ async def sample_get_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.GetProductSetRequest, dict]]): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the `GetProductSet` method. name (:class:`str`): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -763,7 +761,7 @@ async def sample_update_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.UpdateProductSetRequest, dict]]): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the `UpdateProductSet` method. product_set (:class:`google.cloud.vision_v1.types.ProductSet`): Required. The ProductSet resource which replaces the one on the server. @@ -772,10 +770,10 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is ``display_name``. + to be updated. Valid mask path is `display_name`. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -892,13 +890,13 @@ async def sample_delete_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.DeleteProductSetRequest, dict]]): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the `DeleteProductSet` method. name (:class:`str`): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -975,10 +973,9 @@ async def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. * Returns INVALID_ARGUMENT if product_category is - missing or invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if description + is longer than 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. .. code-block:: python @@ -1008,12 +1005,12 @@ async def sample_create_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.CreateProductRequest, dict]]): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the `CreateProduct` method. parent (:class:`str`): Required. The project in which the Product should be created. Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1028,7 +1025,7 @@ async def sample_create_product(): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1145,13 +1142,13 @@ async def sample_list_products(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListProductsRequest, dict]]): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the `ListProducts` method. parent (:class:`str`): Required. The project OR ProductSet from which Products should be listed. Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + `projects/PROJECT_ID/locations/LOC_ID` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1166,7 +1163,7 @@ async def sample_list_products(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsAsyncPager: - Response message for the ``ListProducts`` method. + Response message for the `ListProducts` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1275,13 +1272,13 @@ async def sample_get_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.GetProductRequest, dict]]): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the `GetProduct` method. name (:class:`str`): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1360,8 +1357,8 @@ async def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated right now. + Only the `display_name`, `description`, and `labels` fields can + be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -1370,11 +1367,10 @@ async def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * + is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in - update_mask. + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1403,7 +1399,7 @@ async def sample_update_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.UpdateProductRequest, dict]]): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the `UpdateProduct` method. product (:class:`google.cloud.vision_v1.types.Product`): Required. The Product resource which replaces the one on the server. @@ -1413,12 +1409,11 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include - ``product_labels``, ``display_name``, and - ``description``. + `product_labels`, `display_name`, and `description`. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1531,13 +1526,13 @@ async def sample_delete_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.DeleteProductRequest, dict]]): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the `DeleteProduct` method. name (:class:`str`): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1611,12 +1606,11 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS - skipped. The system converts polygons into non-rotated - rectangles. + The `bounding_poly` field is optional. If `bounding_poly` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -1624,12 +1618,11 @@ async def create_reference_image( Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. * - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the product + does not exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent product's + product_category is detected. * Returns INVALID_ARGUMENT if + bounding_poly contains more than 10 polygons. .. code-block:: python @@ -1663,13 +1656,13 @@ async def sample_create_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1.types.CreateReferenceImageRequest, dict]]): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the `CreateReferenceImage` method. parent (:class:`str`): Required. Resource name of the product in which to create the reference image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1687,7 +1680,7 @@ async def sample_create_reference_image(): added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1702,7 +1695,7 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -1804,13 +1797,13 @@ async def sample_delete_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1.types.DeleteReferenceImageRequest, dict]]): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the `DeleteReferenceImage` method. name (:class:`str`): Required. The resource name of the reference image to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1886,7 +1879,7 @@ async def list_reference_images( * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + or less than 1. .. code-block:: python @@ -1917,12 +1910,12 @@ async def sample_list_reference_images(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListReferenceImagesRequest, dict]]): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the `ListReferenceImages` method. parent (:class:`str`): Required. Resource name of the product containing the reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1937,7 +1930,7 @@ async def sample_list_reference_images(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListReferenceImagesAsyncPager: - Response message for the ``ListReferenceImages`` method. + Response message for the `ListReferenceImages` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2048,13 +2041,13 @@ async def sample_get_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1.types.GetReferenceImageRequest, dict]]): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the `GetReferenceImage` method. name (:class:`str`): Required. The resource name of the ReferenceImage to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2069,7 +2062,7 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -2170,14 +2163,13 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the `AddProductToProductSet` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2187,7 +2179,7 @@ async def sample_add_product_to_product_set(): to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2290,14 +2282,14 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the ``RemoveProductFromProductSet`` + The request object. Request message for the `RemoveProductFromProductSet` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2308,7 +2300,7 @@ async def sample_remove_product_from_product_set(): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2420,14 +2412,14 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the ``ListProductsInProductSet`` + The request object. Request message for the `ListProductsInProductSet` method. name (:class:`str`): Required. The ProductSet resource for which to retrieve Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2442,7 +2434,7 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the ``ListProductsInProductSet`` + Response message for the `ListProductsInProductSet` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2527,17 +2519,15 @@ async def import_product_sets( r"""Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) ``Operation.response`` contains - ``ImportProductSetsResponse``. (results) + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. + (progress) `Operation.response` contains + `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. .. code-block:: python @@ -2571,11 +2561,11 @@ async def sample_import_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1.types.ImportProductSetsRequest, dict]]): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the `ImportProductSets` method. parent (:class:`str`): Required. The project in which the ProductSets should be imported. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2600,15 +2590,14 @@ async def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.vision_v1.types.ImportProductSetsResponse`` - Response message for the ``ImportProductSets` method. + :class:`google.cloud.vision_v1.types.ImportProductSetsResponse` + Response message for the `ImportProductSets` method. This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method - in the returned - `google.longrunning.Operation.response - `__ field. + [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + method in the returned + [google.longrunning.Operation.response][google.longrunning.Operation.response] + field. """ # Create or coerce a protobuf request object. @@ -2704,10 +2693,9 @@ async def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. (progress) .. code-block:: python @@ -2742,11 +2730,11 @@ async def sample_purge_products(): Args: request (Optional[Union[google.cloud.vision_v1.types.PurgeProductsRequest, dict]]): - The request object. Request message for the ``PurgeProducts`` method. + The request object. Request message for the `PurgeProducts` method. parent (:class:`str`): Required. The project and location in which the Products should be deleted. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py index 316e18371513..d8eb2977892c 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py @@ -117,21 +117,19 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. - - In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - The API has a collection of + [ProductSet][google.cloud.vision.v1.ProductSet] resources, named + `projects/*/locations/*/productSets/*`, which acts as a way to put + different products into groups to limit identification. In + parallel, + + - The API has a collection of + [Product][google.cloud.vision.v1.Product] resources, named + `projects/*/locations/*/products/*` + + - Each [Product][google.cloud.vision.v1.Product] has a collection of + [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, + named `projects/*/locations/*/products/*/referenceImages/*` """ @staticmethod @@ -818,7 +816,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. .. code-block:: python @@ -848,11 +846,11 @@ def sample_create_product_set(): Args: request (Union[google.cloud.vision_v1.types.CreateProductSetRequest, dict]): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the `CreateProductSet` method. parent (str): Required. The project in which the ProductSet should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -867,7 +865,7 @@ def sample_create_product_set(): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -955,7 +953,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. .. code-block:: python @@ -986,11 +984,11 @@ def sample_list_product_sets(): Args: request (Union[google.cloud.vision_v1.types.ListProductSetsRequest, dict]): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the `ListProductSets` method. parent (str): Required. The project from which ProductSets should be listed. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1005,7 +1003,7 @@ def sample_list_product_sets(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductSetsPager: - Response message for the ``ListProductSets`` method. + Response message for the `ListProductSets` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1113,13 +1111,13 @@ def sample_get_product_set(): Args: request (Union[google.cloud.vision_v1.types.GetProductSetRequest, dict]): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the `GetProductSet` method. name (str): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1235,7 +1233,7 @@ def sample_update_product_set(): Args: request (Union[google.cloud.vision_v1.types.UpdateProductSetRequest, dict]): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the `UpdateProductSet` method. product_set (google.cloud.vision_v1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. @@ -1244,10 +1242,10 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is ``display_name``. + to be updated. Valid mask path is `display_name`. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1361,13 +1359,13 @@ def sample_delete_product_set(): Args: request (Union[google.cloud.vision_v1.types.DeleteProductSetRequest, dict]): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the `DeleteProductSet` method. name (str): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1441,10 +1439,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. * Returns INVALID_ARGUMENT if product_category is - missing or invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if description + is longer than 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. .. code-block:: python @@ -1474,12 +1471,12 @@ def sample_create_product(): Args: request (Union[google.cloud.vision_v1.types.CreateProductRequest, dict]): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the `CreateProduct` method. parent (str): Required. The project in which the Product should be created. Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1494,7 +1491,7 @@ def sample_create_product(): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1608,13 +1605,13 @@ def sample_list_products(): Args: request (Union[google.cloud.vision_v1.types.ListProductsRequest, dict]): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the `ListProducts` method. parent (str): Required. The project OR ProductSet from which Products should be listed. Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + `projects/PROJECT_ID/locations/LOC_ID` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1629,7 +1626,7 @@ def sample_list_products(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsPager: - Response message for the ``ListProducts`` method. + Response message for the `ListProducts` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1735,13 +1732,13 @@ def sample_get_product(): Args: request (Union[google.cloud.vision_v1.types.GetProductRequest, dict]): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the `GetProduct` method. name (str): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1817,8 +1814,8 @@ def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated right now. + Only the `display_name`, `description`, and `labels` fields can + be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -1827,11 +1824,10 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * + is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in - update_mask. + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1860,7 +1856,7 @@ def sample_update_product(): Args: request (Union[google.cloud.vision_v1.types.UpdateProductRequest, dict]): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the `UpdateProduct` method. product (google.cloud.vision_v1.types.Product): Required. The Product resource which replaces the one on the server. @@ -1870,12 +1866,11 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include - ``product_labels``, ``display_name``, and - ``description``. + `product_labels`, `display_name`, and `description`. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1985,13 +1980,13 @@ def sample_delete_product(): Args: request (Union[google.cloud.vision_v1.types.DeleteProductRequest, dict]): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the `DeleteProduct` method. name (str): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2062,12 +2057,11 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS - skipped. The system converts polygons into non-rotated - rectangles. + The `bounding_poly` field is optional. If `bounding_poly` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -2075,12 +2069,11 @@ def create_reference_image( Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. * - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the product + does not exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent product's + product_category is detected. * Returns INVALID_ARGUMENT if + bounding_poly contains more than 10 polygons. .. code-block:: python @@ -2114,13 +2107,13 @@ def sample_create_reference_image(): Args: request (Union[google.cloud.vision_v1.types.CreateReferenceImageRequest, dict]): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the `CreateReferenceImage` method. parent (str): Required. Resource name of the product in which to create the reference image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2138,7 +2131,7 @@ def sample_create_reference_image(): added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2153,7 +2146,7 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -2252,13 +2245,13 @@ def sample_delete_reference_image(): Args: request (Union[google.cloud.vision_v1.types.DeleteReferenceImageRequest, dict]): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the `DeleteReferenceImage` method. name (str): Required. The resource name of the reference image to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2331,7 +2324,7 @@ def list_reference_images( * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + or less than 1. .. code-block:: python @@ -2362,12 +2355,12 @@ def sample_list_reference_images(): Args: request (Union[google.cloud.vision_v1.types.ListReferenceImagesRequest, dict]): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the `ListReferenceImages` method. parent (str): Required. Resource name of the product containing the reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2382,7 +2375,7 @@ def sample_list_reference_images(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListReferenceImagesPager: - Response message for the ``ListReferenceImages`` method. + Response message for the `ListReferenceImages` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2490,13 +2483,13 @@ def sample_get_reference_image(): Args: request (Union[google.cloud.vision_v1.types.GetReferenceImageRequest, dict]): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the `GetReferenceImage` method. name (str): Required. The resource name of the ReferenceImage to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2511,7 +2504,7 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -2609,14 +2602,13 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the `AddProductToProductSet` method. name (str): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2626,7 +2618,7 @@ def sample_add_product_to_product_set(): to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2728,14 +2720,14 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the ``RemoveProductFromProductSet`` + The request object. Request message for the `RemoveProductFromProductSet` method. name (str): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2746,7 +2738,7 @@ def sample_remove_product_from_product_set(): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2857,14 +2849,14 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the ``ListProductsInProductSet`` + The request object. Request message for the `ListProductsInProductSet` method. name (str): Required. The ProductSet resource for which to retrieve Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2879,7 +2871,7 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the ``ListProductsInProductSet`` + Response message for the `ListProductsInProductSet` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2963,17 +2955,15 @@ def import_product_sets( r"""Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) ``Operation.response`` contains - ``ImportProductSetsResponse``. (results) + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. + (progress) `Operation.response` contains + `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. .. code-block:: python @@ -3007,11 +2997,11 @@ def sample_import_product_sets(): Args: request (Union[google.cloud.vision_v1.types.ImportProductSetsRequest, dict]): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the `ImportProductSets` method. parent (str): Required. The project in which the ProductSets should be imported. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3036,15 +3026,14 @@ def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.vision_v1.types.ImportProductSetsResponse`` - Response message for the ``ImportProductSets` method. + :class:`google.cloud.vision_v1.types.ImportProductSetsResponse` + Response message for the `ImportProductSets` method. This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method - in the returned - `google.longrunning.Operation.response - `__ field. + [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + method in the returned + [google.longrunning.Operation.response][google.longrunning.Operation.response] + field. """ # Create or coerce a protobuf request object. @@ -3137,10 +3126,9 @@ def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. (progress) .. code-block:: python @@ -3175,11 +3163,11 @@ def sample_purge_products(): Args: request (Union[google.cloud.vision_v1.types.PurgeProductsRequest, dict]): - The request object. Request message for the ``PurgeProducts`` method. + The request object. Request message for the `PurgeProducts` method. parent (str): Required. The project and location in which the Products should be deleted. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py index b526bf61a709..77c99961531e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py @@ -115,21 +115,19 @@ class ProductSearchGrpcTransport(ProductSearchTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. + - The API has a collection of + [ProductSet][google.cloud.vision.v1.ProductSet] resources, named + `projects/*/locations/*/productSets/*`, which acts as a way to put + different products into groups to limit identification. In + parallel, - In parallel, + - The API has a collection of + [Product][google.cloud.vision.v1.Product] resources, named + `projects/*/locations/*/products/*` - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - Each [Product][google.cloud.vision.v1.Product] has a collection of + [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, + named `projects/*/locations/*/products/*/referenceImages/*` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -371,7 +369,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -405,7 +403,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -536,10 +534,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. * Returns INVALID_ARGUMENT if product_category is - missing or invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if description + is longer than 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -634,8 +631,8 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated right now. + Only the `display_name`, `description`, and `labels` fields can + be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -644,11 +641,10 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * + is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in - update_mask. + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -710,12 +706,11 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS - skipped. The system converts polygons into non-rotated - rectangles. + The `bounding_poly` field is optional. If `bounding_poly` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -723,12 +718,11 @@ def create_reference_image( Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. * - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the product + does not exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent product's + product_category is detected. * Returns INVALID_ARGUMENT if + bounding_poly contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -798,7 +792,7 @@ def list_reference_images( * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -969,17 +963,15 @@ def import_product_sets( Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) ``Operation.response`` contains - ``ImportProductSetsResponse``. (results) + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. + (progress) `Operation.response` contains + `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. Returns: Callable[[~.ImportProductSetsRequest], @@ -1030,10 +1022,9 @@ def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py index 3af8c215b7fb..4d53f1bd1574 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py @@ -121,21 +121,19 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. + - The API has a collection of + [ProductSet][google.cloud.vision.v1.ProductSet] resources, named + `projects/*/locations/*/productSets/*`, which acts as a way to put + different products into groups to limit identification. In + parallel, - In parallel, + - The API has a collection of + [Product][google.cloud.vision.v1.Product] resources, named + `projects/*/locations/*/products/*` - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - Each [Product][google.cloud.vision.v1.Product] has a collection of + [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, + named `projects/*/locations/*/products/*/referenceImages/*` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -379,7 +377,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -413,7 +411,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -548,10 +546,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. * Returns INVALID_ARGUMENT if product_category is - missing or invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if description + is longer than 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -648,8 +645,8 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated right now. + Only the `display_name`, `description`, and `labels` fields can + be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -658,11 +655,10 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * + is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in - update_mask. + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -726,12 +722,11 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS - skipped. The system converts polygons into non-rotated - rectangles. + The `bounding_poly` field is optional. If `bounding_poly` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -739,12 +734,11 @@ def create_reference_image( Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. * - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the product + does not exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent product's + product_category is detected. * Returns INVALID_ARGUMENT if + bounding_poly contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -814,7 +808,7 @@ def list_reference_images( * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -988,17 +982,15 @@ def import_product_sets( Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) ``Operation.response`` contains - ``ImportProductSetsResponse``. (results) + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. + (progress) `Operation.response` contains + `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. Returns: Callable[[~.ImportProductSetsRequest], @@ -1050,10 +1042,9 @@ def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py index 21809bf4cb6a..9c3c9b783448 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py @@ -1034,21 +1034,19 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. + - The API has a collection of + [ProductSet][google.cloud.vision.v1.ProductSet] resources, named + `projects/*/locations/*/productSets/*`, which acts as a way to put + different products into groups to limit identification. In + parallel, - In parallel, + - The API has a collection of + [Product][google.cloud.vision.v1.Product] resources, named + `projects/*/locations/*/products/*` - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - Each [Product][google.cloud.vision.v1.Product] has a collection of + [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, + named `projects/*/locations/*/products/*/referenceImages/*` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -1215,8 +1213,7 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the `AddProductToProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1330,7 +1327,7 @@ def __call__( Args: request (~.product_search_service.CreateProductRequest): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the `CreateProduct` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1480,7 +1477,7 @@ def __call__( Args: request (~.product_search_service.CreateProductSetRequest): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the `CreateProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1639,7 +1636,7 @@ def __call__( Args: request (~.product_search_service.CreateReferenceImageRequest): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the `CreateReferenceImage` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1650,7 +1647,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -1794,7 +1791,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductRequest): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the `DeleteProduct` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1900,7 +1897,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductSetRequest): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the `DeleteProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2008,7 +2005,7 @@ def __call__( Args: request (~.product_search_service.DeleteReferenceImageRequest): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the `DeleteReferenceImage` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2116,7 +2113,7 @@ def __call__( Args: request (~.product_search_service.GetProductRequest): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the `GetProduct` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2264,7 +2261,7 @@ def __call__( Args: request (~.product_search_service.GetProductSetRequest): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the `GetProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2415,7 +2412,7 @@ def __call__( Args: request (~.product_search_service.GetReferenceImageRequest): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the `GetReferenceImage` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2426,7 +2423,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -2566,7 +2563,7 @@ def __call__( Args: request (~.product_search_service.ImportProductSetsRequest): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the `ImportProductSets` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2718,7 +2715,7 @@ def __call__( Args: request (~.product_search_service.ListProductsRequest): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the `ListProducts` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2729,7 +2726,7 @@ def __call__( Returns: ~.product_search_service.ListProductsResponse: - Response message for the ``ListProducts`` method. + Response message for the `ListProducts` method. """ http_options = ( @@ -2864,7 +2861,7 @@ def __call__( Args: request (~.product_search_service.ListProductSetsRequest): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the `ListProductSets` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2875,7 +2872,7 @@ def __call__( Returns: ~.product_search_service.ListProductSetsResponse: - Response message for the ``ListProductSets`` method. + Response message for the `ListProductSets` method. """ http_options = ( @@ -3014,7 +3011,7 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the ``ListProductsInProductSet`` + The request object. Request message for the `ListProductsInProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -3026,7 +3023,7 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the ``ListProductsInProductSet`` + Response message for the `ListProductsInProductSet` method. """ @@ -3169,7 +3166,7 @@ def __call__( Args: request (~.product_search_service.ListReferenceImagesRequest): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the `ListReferenceImages` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3180,7 +3177,7 @@ def __call__( Returns: ~.product_search_service.ListReferenceImagesResponse: - Response message for the ``ListReferenceImages`` method. + Response message for the `ListReferenceImages` method. """ http_options = ( @@ -3320,7 +3317,7 @@ def __call__( Args: request (~.product_search_service.PurgeProductsRequest): - The request object. Request message for the ``PurgeProducts`` method. + The request object. Request message for the `PurgeProducts` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3473,7 +3470,7 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the ``RemoveProductFromProductSet`` + The request object. Request message for the `RemoveProductFromProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -3590,7 +3587,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductRequest): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the `UpdateProduct` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3740,7 +3737,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductSetRequest): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the `UpdateProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py index cd3a78020c14..7149b7a5292c 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py @@ -102,20 +102,20 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the maximum number of results to return for that type. Multiple - ``Feature`` objects can be specified in the ``features`` list. + `Feature` objects can be specified in the `features` list. Attributes: type_ (google.cloud.vision_v1.types.Feature.Type): The feature type. max_results (int): Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. + `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or + `CROP_HINTS`. model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) - and "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" for the + and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and + `TEXT_DETECTION` also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -137,11 +137,10 @@ class Type(proto.Enum): Run text detection / optical character recognition (OCR). Text detection is optimized for areas of text within a larger image; if the image is a document, use - ``DOCUMENT_TEXT_DETECTION`` instead. + `DOCUMENT_TEXT_DETECTION` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both - ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are - present. + `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -192,22 +191,20 @@ class ImageSource(proto.Message): Attributes: gcs_image_uri (str): - **Use ``image_uri`` instead.** + **Use `image_uri` instead.** The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See `Google Cloud Storage Request - URIs - `__ + `gs://bucket_name/object_name`. Object versioning is not + supported. See [Google Cloud Storage Request + URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is - not supported. See `Google Cloud Storage Request - URIs - `__ + `gs://bucket_name/object_name`. Object versioning is not + supported. See [Google Cloud Storage Request + URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching @@ -219,8 +216,8 @@ class ImageSource(proto.Message): prevention. You should not depend on externally-hosted images for production applications. - When both ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes precedence. + When both `gcs_image_uri` and `image_uri` are specified, + `image_uri` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -239,7 +236,7 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use a pure + Note: As with all `bytes` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. @@ -248,9 +245,9 @@ class Image(proto.Message): requests. source (google.cloud.vision_v1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided - for an image, ``content`` takes precedence and is used to - perform the image annotation request. + image URL. If both `content` and `source` are provided for + an image, `content` takes precedence and is used to perform + the image annotation request. """ content: bytes = proto.Field( @@ -275,14 +272,14 @@ class FaceAnnotation(proto.Message): box is computed to "frame" the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y coordinates may not be generated - in the ``BoundingPoly`` (the polygon will be unbounded) if + in the `BoundingPoly` (the polygon will be unbounded) if only a partial face appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the ``boundingPoly``, and encloses only the skin part of the - face. Typically, it is used to eliminate the face from any - image analysis that detects the "amount of skin" visible in - an image. It is not based on the landmarker results, only on + The `fd_bounding_poly` bounding polygon is tighter than the + `boundingPoly`, and encloses only the skin part of the face. + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1.types.FaceAnnotation.Landmark]): @@ -334,7 +331,7 @@ class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the image without considering mirror projections typical of photos. So, - ``LEFT_EYE``, typically, is the person's right eye. + `LEFT_EYE`, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -550,7 +547,7 @@ class LocationInfo(proto.Message): class Property(proto.Message): - r"""A ``Property`` consists of a user-supplied name/value pair. + r"""A `Property` consists of a user-supplied name/value pair. Attributes: name (str): @@ -581,18 +578,18 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): Opaque entity ID. Some IDs may be available in - `Google Knowledge Graph Search - API `__. + [Google Knowledge Graph Search + API](https://developers.google.com/knowledge-graph/). locale (str): The language code for the locale in which the entity textual - ``description`` is expressed. + `description` is expressed. description (str): - Entity textual description, expressed in its ``locale`` + Entity textual description, expressed in its `locale` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** + **Deprecated. Use `score` instead.** The accuracy of the entity detection in an image. For example, for an image in which the "Eiffel Tower" entity is detected, this field represents the confidence that there is @@ -606,16 +603,16 @@ class EntityAnnotation(proto.Message): in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1.types.BoundingPoly): Image region to which this entity belongs. Not produced - for ``LABEL_DETECTION`` features. + for `LABEL_DETECTION` features. locations (MutableSequence[google.cloud.vision_v1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may indicate the location of the scene in the - image, and another location may indicate the location of the - place where the image was taken. Location information is - usually present for landmarks. + `LocationInfo` elements can be present because one location + may indicate the location of the scene in the image, and + another location may indicate the location of the place + where the image was taken. Location information is usually + present for landmarks. properties (MutableSequence[google.cloud.vision_v1.types.Property]): - Some entities may have optional user-supplied ``Property`` + Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity. """ @@ -673,7 +670,7 @@ class LocalizedObjectAnnotation(proto.Message): more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` language. + Object name, expressed in its `language_code` language. score (float): Score of the result. Range [0, 1]. bounding_poly (google.cloud.vision_v1.types.BoundingPoly): @@ -763,7 +760,7 @@ class SafeSearchAnnotation(proto.Message): class LatLongRect(proto.Message): - r"""Rectangle determined by min and max ``LatLng`` pairs. + r"""Rectangle determined by min and max `LatLng` pairs. Attributes: min_lat_lng (google.type.latlng_pb2.LatLng): @@ -940,11 +937,10 @@ class TextDetectionParams(proto.Message): A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are: - - ``legacy_layout``: a heuristics layout detection - algorithm, which serves as an alternative to the current - ML-based layout detection algorithm. Customers can choose - the best suitable layout algorithm based on their - situation. + - `legacy_layout`: a heuristics layout detection algorithm, + which serves as an alternative to the current ML-based + layout detection algorithm. Customers can choose the best + suitable layout algorithm based on their situation. """ enable_text_detection_confidence_score: bool = proto.Field( @@ -967,13 +963,13 @@ class ImageContext(proto.Message): List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In + Latin alphabet, setting `language_hints` is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the - specified languages is not one of the `supported languages - `__. + specified languages is not one of the [supported + languages](https://cloud.google.com/vision/docs/languages). crop_hints_params (google.cloud.vision_v1.types.CropHintsParams): Parameters for crop hints annotation request. product_search_params (google.cloud.vision_v1.types.ProductSearchParams): @@ -1118,7 +1114,7 @@ class AnnotateImageResponse(proto.Message): error (google.rpc.status_pb2.Status): If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be - correct, even when ``error`` is set. + correct, even when `error` is set. context (google.cloud.vision_v1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1209,18 +1205,18 @@ class BatchAnnotateImagesRequest(proto.Message): parent (str): Optional. Target project and location to make a call. - Format: ``projects/{project-id}/locations/{location-id}``. + Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: - ``us``: USA country only, - ``asia``: East asia areas, like Japan, Taiwan, - ``eu``: The European Union. + `us`: USA country only, + `asia`: East asia areas, like Japan, Taiwan, `eu`: + The European Union. - Example: ``projects/project-A/locations/eu``. + Example: `projects/project-A/locations/eu`. labels (MutableMapping[str, str]): Optional. The labels with user-defined metadata for the request. @@ -1328,13 +1324,13 @@ class AnnotateFileResponse(proto.Message): response is generated. responses (MutableSequence[google.cloud.vision_v1.types.AnnotateImageResponse]): Individual responses to images found within the file. This - field will be empty if the ``error`` field is set. + field will be empty if the `error` field is set. total_pages (int): This field gives the total number of pages in the file. error (google.rpc.status_pb2.Status): If set, represents the error message for the failed request. - The ``responses`` field will not be set in this case. + The `responses` field will not be set in this case. """ input_config: "InputConfig" = proto.Field( @@ -1371,18 +1367,18 @@ class BatchAnnotateFilesRequest(proto.Message): parent (str): Optional. Target project and location to make a call. - Format: ``projects/{project-id}/locations/{location-id}``. + Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: - ``us``: USA country only, - ``asia``: East asia areas, like Japan, Taiwan, - ``eu``: The European Union. + `us`: USA country only, + `asia`: East asia areas, like Japan, Taiwan, `eu`: + The European Union. - Example: ``projects/project-A/locations/eu``. + Example: `projects/project-A/locations/eu`. labels (MutableMapping[str, str]): Optional. The labels with user-defined metadata for the request. @@ -1495,18 +1491,18 @@ class AsyncBatchAnnotateImagesRequest(proto.Message): parent (str): Optional. Target project and location to make a call. - Format: ``projects/{project-id}/locations/{location-id}``. + Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: - ``us``: USA country only, - ``asia``: East asia areas, like Japan, Taiwan, - ``eu``: The European Union. + `us`: USA country only, + `asia`: East asia areas, like Japan, Taiwan, `eu`: + The European Union. - Example: ``projects/project-A/locations/eu``. + Example: `projects/project-A/locations/eu`. labels (MutableMapping[str, str]): Optional. The labels with user-defined metadata for the request. @@ -1566,18 +1562,18 @@ class AsyncBatchAnnotateFilesRequest(proto.Message): parent (str): Optional. Target project and location to make a call. - Format: ``projects/{project-id}/locations/{location-id}``. + Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: - ``us``: USA country only, - ``asia``: East asia areas, like Japan, Taiwan, - ``eu``: The European Union. + `us`: USA country only, + `asia`: East asia areas, like Japan, Taiwan, `eu`: + The European Union. - Example: ``projects/project-A/locations/eu``. + Example: `projects/project-A/locations/eu`. labels (MutableMapping[str, str]): Optional. The labels with user-defined metadata for the request. @@ -1631,7 +1627,7 @@ class InputConfig(proto.Message): input from. content (bytes): File content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use a pure + Note: As with all `bytes` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. @@ -1673,9 +1669,9 @@ class OutputConfig(proto.Message): value is 20. For example, for one pdf file with 100 pages, 100 response - protos will be generated. If ``batch_size`` = 20, then 5 - json files each containing 20 response protos will be - written under the prefix ``gcs_destination``.``uri``. + protos will be generated. If `batch_size` = 20, then 5 json + files each containing 20 response protos will be written + under the prefix `gcs_destination`.`uri`. Currently, batch_size only applies to GcsDestination, with potential future support for other output configurations. @@ -1734,9 +1730,7 @@ class GcsDestination(proto.Message): output files will be created in gs://bucket-name/some/location/ and the names of the output files could be anything because there was no filename prefix - specified. - - If multiple outputs, each response is still + specified. If multiple outputs, each response is still AnnotateFileResponse, each of which contains some subset of the full list of AnnotateImageResponse. Multiple outputs can happen if, for example, the output JSON is too large and diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py index d4687c24e25d..180a03882578 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py @@ -40,13 +40,13 @@ class ProductSearchParams(proto.Message): interest in the image. If it is not specified, system discretion will be applied. product_set (str): - The resource name of a `ProductSet - `__ to be searched for - similar images. + The resource name of a + [ProductSet][google.cloud.vision.v1.ProductSet] to be + searched for similar images. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -153,7 +153,7 @@ class ObjectAnnotation(proto.Message): more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` language. + Object name, expressed in its `language_code` language. score (float): Score of the result. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py index 0cdf00e46b82..bf02791d41c9 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py @@ -71,7 +71,7 @@ class Product(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is ignored when creating a product. display_name (str): @@ -163,7 +163,7 @@ class ProductSet(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. This field is ignored when creating a ProductSet. display_name (str): @@ -210,7 +210,7 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): - r"""A ``ReferenceImage`` represents a product image and its + r"""A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. Attributes: @@ -219,13 +219,13 @@ class ReferenceImage(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. This field is ignored when creating a reference image. uri (str): Required. The Google Cloud Storage URI of the reference image. - The URI must start with ``gs://``. + The URI must start with `gs://`. bounding_polys (MutableSequence[google.cloud.vision_v1.types.BoundingPoly]): Optional. Bounding polygons around the areas of interest in the reference image. If this @@ -256,14 +256,14 @@ class ReferenceImage(proto.Message): class CreateProductRequest(proto.Message): - r"""Request message for the ``CreateProduct`` method. + r"""Request message for the `CreateProduct` method. Attributes: parent (str): Required. The project in which the Product should be created. Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + `projects/PROJECT_ID/locations/LOC_ID`. product (google.cloud.vision_v1.types.Product): Required. The product to create. product_id (str): @@ -271,7 +271,7 @@ class CreateProductRequest(proto.Message): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. """ parent: str = proto.Field( @@ -290,7 +290,7 @@ class CreateProductRequest(proto.Message): class ListProductsRequest(proto.Message): - r"""Request message for the ``ListProducts`` method. + r"""Request message for the `ListProducts` method. Attributes: parent (str): @@ -298,7 +298,7 @@ class ListProductsRequest(proto.Message): should be listed. Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + `projects/PROJECT_ID/locations/LOC_ID` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -322,7 +322,7 @@ class ListProductsRequest(proto.Message): class ListProductsResponse(proto.Message): - r"""Response message for the ``ListProducts`` method. + r"""Response message for the `ListProducts` method. Attributes: products (MutableSequence[google.cloud.vision_v1.types.Product]): @@ -349,7 +349,7 @@ def raw_page(self): class GetProductRequest(proto.Message): - r"""Request message for the ``GetProduct`` method. + r"""Request message for the `GetProduct` method. Attributes: name (str): @@ -357,7 +357,7 @@ class GetProductRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` """ name: str = proto.Field( @@ -367,7 +367,7 @@ class GetProductRequest(proto.Message): class UpdateProductRequest(proto.Message): - r"""Request message for the ``UpdateProduct`` method. + r"""Request message for the `UpdateProduct` method. Attributes: product (google.cloud.vision_v1.types.Product): @@ -375,12 +375,11 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include - ``product_labels``, ``display_name``, and - ``description``. + `product_labels`, `display_name`, and `description`. """ product: "Product" = proto.Field( @@ -396,7 +395,7 @@ class UpdateProductRequest(proto.Message): class DeleteProductRequest(proto.Message): - r"""Request message for the ``DeleteProduct`` method. + r"""Request message for the `DeleteProduct` method. Attributes: name (str): @@ -404,7 +403,7 @@ class DeleteProductRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` """ name: str = proto.Field( @@ -414,13 +413,13 @@ class DeleteProductRequest(proto.Message): class CreateProductSetRequest(proto.Message): - r"""Request message for the ``CreateProductSet`` method. + r"""Request message for the `CreateProductSet` method. Attributes: parent (str): Required. The project in which the ProductSet should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. product_set (google.cloud.vision_v1.types.ProductSet): Required. The ProductSet to create. product_set_id (str): @@ -428,7 +427,7 @@ class CreateProductSetRequest(proto.Message): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. """ parent: str = proto.Field( @@ -447,13 +446,13 @@ class CreateProductSetRequest(proto.Message): class ListProductSetsRequest(proto.Message): - r"""Request message for the ``ListProductSets`` method. + r"""Request message for the `ListProductSets` method. Attributes: parent (str): Required. The project from which ProductSets should be listed. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -477,7 +476,7 @@ class ListProductSetsRequest(proto.Message): class ListProductSetsResponse(proto.Message): - r"""Response message for the ``ListProductSets`` method. + r"""Response message for the `ListProductSets` method. Attributes: product_sets (MutableSequence[google.cloud.vision_v1.types.ProductSet]): @@ -504,7 +503,7 @@ def raw_page(self): class GetProductSetRequest(proto.Message): - r"""Request message for the ``GetProductSet`` method. + r"""Request message for the `GetProductSet` method. Attributes: name (str): @@ -512,7 +511,7 @@ class GetProductSetRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` """ name: str = proto.Field( @@ -522,17 +521,17 @@ class GetProductSetRequest(proto.Message): class UpdateProductSetRequest(proto.Message): - r"""Request message for the ``UpdateProductSet`` method. + r"""Request message for the `UpdateProductSet` method. Attributes: product_set (google.cloud.vision_v1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is ``display_name``. + to be updated. Valid mask path is `display_name`. """ product_set: "ProductSet" = proto.Field( @@ -548,7 +547,7 @@ class UpdateProductSetRequest(proto.Message): class DeleteProductSetRequest(proto.Message): - r"""Request message for the ``DeleteProductSet`` method. + r"""Request message for the `DeleteProductSet` method. Attributes: name (str): @@ -556,7 +555,7 @@ class DeleteProductSetRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` """ name: str = proto.Field( @@ -566,7 +565,7 @@ class DeleteProductSetRequest(proto.Message): class CreateReferenceImageRequest(proto.Message): - r"""Request message for the ``CreateReferenceImage`` method. + r"""Request message for the `CreateReferenceImage` method. Attributes: parent (str): @@ -574,7 +573,7 @@ class CreateReferenceImageRequest(proto.Message): create the reference image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. reference_image (google.cloud.vision_v1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. @@ -583,7 +582,7 @@ class CreateReferenceImageRequest(proto.Message): added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. """ parent: str = proto.Field( @@ -602,20 +601,20 @@ class CreateReferenceImageRequest(proto.Message): class ListReferenceImagesRequest(proto.Message): - r"""Request message for the ``ListReferenceImages`` method. + r"""Request message for the `ListReferenceImages` method. Attributes: parent (str): Required. Resource name of the product containing the reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value of ``nextPageToken`` returned in a previous + is the value of `nextPageToken` returned in a previous reference image list request. Defaults to the first page if not specified. @@ -636,7 +635,7 @@ class ListReferenceImagesRequest(proto.Message): class ListReferenceImagesResponse(proto.Message): - r"""Response message for the ``ListReferenceImages`` method. + r"""Response message for the `ListReferenceImages` method. Attributes: reference_images (MutableSequence[google.cloud.vision_v1.types.ReferenceImage]): @@ -669,7 +668,7 @@ def raw_page(self): class GetReferenceImageRequest(proto.Message): - r"""Request message for the ``GetReferenceImage`` method. + r"""Request message for the `GetReferenceImage` method. Attributes: name (str): @@ -677,7 +676,7 @@ class GetReferenceImageRequest(proto.Message): get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. """ name: str = proto.Field( @@ -687,7 +686,7 @@ class GetReferenceImageRequest(proto.Message): class DeleteReferenceImageRequest(proto.Message): - r"""Request message for the ``DeleteReferenceImage`` method. + r"""Request message for the `DeleteReferenceImage` method. Attributes: name (str): @@ -695,7 +694,7 @@ class DeleteReferenceImageRequest(proto.Message): delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` """ name: str = proto.Field( @@ -705,8 +704,7 @@ class DeleteReferenceImageRequest(proto.Message): class AddProductToProductSetRequest(proto.Message): - r"""Request message for the ``AddProductToProductSet`` - method. + r"""Request message for the `AddProductToProductSet` method. Attributes: name (str): @@ -714,13 +712,13 @@ class AddProductToProductSetRequest(proto.Message): modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` product (str): Required. The resource name for the Product to be added to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` """ name: str = proto.Field( @@ -734,7 +732,7 @@ class AddProductToProductSetRequest(proto.Message): class RemoveProductFromProductSetRequest(proto.Message): - r"""Request message for the ``RemoveProductFromProductSet`` + r"""Request message for the `RemoveProductFromProductSet` method. Attributes: @@ -743,14 +741,14 @@ class RemoveProductFromProductSetRequest(proto.Message): modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` product (str): Required. The resource name for the Product to be removed from this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` """ name: str = proto.Field( @@ -764,7 +762,7 @@ class RemoveProductFromProductSetRequest(proto.Message): class ListProductsInProductSetRequest(proto.Message): - r"""Request message for the ``ListProductsInProductSet`` + r"""Request message for the `ListProductsInProductSet` method. Attributes: @@ -773,7 +771,7 @@ class ListProductsInProductSetRequest(proto.Message): Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -797,7 +795,7 @@ class ListProductsInProductSetRequest(proto.Message): class ListProductsInProductSetResponse(proto.Message): - r"""Response message for the ``ListProductsInProductSet`` + r"""Response message for the `ListProductsInProductSet` method. Attributes: @@ -832,7 +830,7 @@ class ImportProductSetsGcsSource(proto.Message): csv_file_uri (str): The Google Cloud Storage URI of the input csv file. - The URI must start with ``gs://``. + The URI must start with `gs://`. The format of the input csv file should be one image per line. In each line, there are 8 columns. @@ -846,57 +844,52 @@ class ImportProductSetsGcsSource(proto.Message): 7. labels 8. bounding-poly - The ``image-uri``, ``product-set-id``, ``product-id``, and - ``product-category`` columns are required. All other columns + The `image-uri`, `product-set-id`, `product-id`, and + `product-category` columns are required. All other columns are optional. - If the ``ProductSet`` or ``Product`` specified by the - ``product-set-id`` and ``product-id`` values does not exist, - then the system will create a new ``ProductSet`` or - ``Product`` for the image. In this case, the - ``product-display-name`` column refers to - `display_name - `__, the - ``product-category`` column refers to - `product_category - `__, and - the ``labels`` column refers to - `product_labels - `__. - - The ``image-id`` column is optional but must be unique if + If the `ProductSet` or `Product` specified by the + `product-set-id` and `product-id` values does not exist, + then the system will create a new `ProductSet` or `Product` + for the image. In this case, the `product-display-name` + column refers to + [display_name][google.cloud.vision.v1.Product.display_name], + the `product-category` column refers to + [product_category][google.cloud.vision.v1.Product.product_category], + and the `labels` column refers to + [product_labels][google.cloud.vision.v1.Product.product_labels]. + + The `image-id` column is optional but must be unique if provided. If it is empty, the system will automatically assign a unique id to the image. - The ``product-display-name`` column is optional. If it is - empty, the system sets the `display_name - `__ field for - the product to a space (" "). You can update the - ``display_name`` later by using the API. + The `product-display-name` column is optional. If it is + empty, the system sets the + [display_name][google.cloud.vision.v1.Product.display_name] + field for the product to a space (" "). You can update the + `display_name` later by using the API. - If a ``Product`` with the specified ``product-id`` already - exists, then the system ignores the - ``product-display-name``, ``product-category``, and - ``labels`` columns. + If a `Product` with the specified `product-id` already + exists, then the system ignores the `product-display-name`, + `product-category`, and `labels` columns. - The ``labels`` column (optional) is a line containing a list + The `labels` column (optional) is a line containing a list of comma-separated key-value pairs, in the following format: "key_1=value_1,key_2=value_2,...,key_n=value_n" - The ``bounding-poly`` column (optional) identifies one - region of interest from the image in the same manner as - ``CreateReferenceImage``. If you do not specify the - ``bounding-poly`` column, then the system will try to detect + The `bounding-poly` column (optional) identifies one region + of interest from the image in the same manner as + `CreateReferenceImage`. If you do not specify the + `bounding-poly` column, then the system will try to detect regions of interest automatically. - At most one ``bounding-poly`` column is allowed per line. If + At most one `bounding-poly` column is allowed per line. If the image contains multiple regions of interest, add a line to the CSV file that includes the same product information, - and the ``bounding-poly`` values for each region of - interest. + and the `bounding-poly` values for each region of interest. - The ``bounding-poly`` column must contain an even number of + The `bounding-poly` column must contain an even number of comma-separated numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative integers for absolute bounding polygons, and float values in @@ -913,7 +906,7 @@ class ImportProductSetsGcsSource(proto.Message): class ImportProductSetsInputConfig(proto.Message): - r"""The input content for the ``ImportProductSets`` method. + r"""The input content for the `ImportProductSets` method. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -935,13 +928,13 @@ class ImportProductSetsInputConfig(proto.Message): class ImportProductSetsRequest(proto.Message): - r"""Request message for the ``ImportProductSets`` method. + r"""Request message for the `ImportProductSets` method. Attributes: parent (str): Required. The project in which the ProductSets should be imported. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. input_config (google.cloud.vision_v1.types.ImportProductSetsInputConfig): Required. The input content for the list of requests. @@ -959,14 +952,13 @@ class ImportProductSetsRequest(proto.Message): class ImportProductSetsResponse(proto.Message): - r"""Response message for the ``ImportProductSets`` method. + r"""Response message for the `ImportProductSets` method. This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method in the - returned - `google.longrunning.Operation.response - `__ field. + [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + method in the returned + [google.longrunning.Operation.response][google.longrunning.Operation.response] + field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1.types.ReferenceImage]): @@ -996,9 +988,9 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` - returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. + This is included in the `metadata` field of the `Operation` returned + by the `GetOperation` call of the `google::longrunning::Operations` + service. Attributes: state (google.cloud.vision_v1.types.BatchOperationMetadata.State): @@ -1008,8 +1000,8 @@ class BatchOperationMetadata(proto.Message): to the server. end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and - `google.longrunning.Operation.done - `__ is set to true. + [google.longrunning.Operation.done][google.longrunning.Operation.done] + is set to true. """ class State(proto.Enum): @@ -1075,7 +1067,7 @@ class ProductSetPurgeConfig(proto.Message): class PurgeProductsRequest(proto.Message): - r"""Request message for the ``PurgeProducts`` method. + r"""Request message for the `PurgeProducts` method. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -1098,7 +1090,7 @@ class PurgeProductsRequest(proto.Message): parent (str): Required. The project and location in which the Products should be deleted. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. force (bool): The default value is false. Override this value to true to actually perform the purge. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py index 9c2caf90d262..478c39fbfac3 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py @@ -42,9 +42,8 @@ class TextAnnotation(proto.Message): Each structural component, starting from Page, may further have their own properties. Properties describe detected languages, breaks etc.. Please refer to the - `TextAnnotation.TextProperty - `__ message - definition below for more detail. + [TextAnnotation.TextProperty][google.cloud.vision.v1.TextAnnotation.TextProperty] + message definition below for more detail. Attributes: pages (MutableSequence[google.cloud.vision_v1.types.Page]): @@ -98,8 +97,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or - ``LINE_BREAK``. + co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py index 11ce1af125ac..2222bf23b8bb 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py @@ -159,7 +159,7 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or + The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py index 828f4a586ea4..60e1498a7e83 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py @@ -101,8 +101,8 @@ class Feature(proto.Message): model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) - and "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" for the + and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and + `TEXT_DETECTION` also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -168,14 +168,13 @@ class ImageSource(proto.Message): Attributes: gcs_image_uri (str): - NOTE: For new code ``image_uri`` below is preferred. + NOTE: For new code `image_uri` below is preferred. Google Cloud Storage image URI, which must be in the following form: - ``gs://bucket_name/object_name`` (for details, see `Google + `gs://bucket_name/object_name` (for details, see [Google Cloud Storage Request - URIs - `__). + URIs](https://cloud.google.com/storage/docs/reference-uris)). NOTE: Cloud Storage object versioning is not supported. image_uri (str): Image URI which supports: @@ -183,15 +182,14 @@ class ImageSource(proto.Message): 1) Google Cloud Storage image URI, which must be in the following form: - ``gs://bucket_name/object_name`` (for details, see `Google + `gs://bucket_name/object_name` (for details, see [Google Cloud Storage Request - URIs - `__). + URIs](https://cloud.google.com/storage/docs/reference-uris)). NOTE: Cloud Storage object versioning is not supported. 2) Publicly accessible image HTTP/HTTPS URL. - This is preferred over the legacy ``gcs_image_uri`` above. - When both ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes precedence. + This is preferred over the legacy `gcs_image_uri` above. + When both `gcs_image_uri` and `image_uri` are specified, + `image_uri` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -210,12 +208,12 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: as with all ``bytes`` fields, protobuffers use a pure + Note: as with all `bytes` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p1beta1.types.ImageSource): - Google Cloud Storage image location. If both ``content`` and - ``source`` are provided for an image, ``content`` takes + Google Cloud Storage image location. If both `content` and + `source` are provided for an image, `content` takes precedence and is used to perform the image annotation request. """ @@ -239,18 +237,18 @@ class FaceAnnotation(proto.Message): bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale, as returned - in ``ImageParams``. The bounding box is computed to "frame" + in `ImageParams`. The bounding box is computed to "frame" the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y - coordinates may not be generated in the ``BoundingPoly`` - (the polygon will be unbounded) if only a partial face - appears in the image to be annotated. + coordinates may not be generated in the `BoundingPoly` (the + polygon will be unbounded) if only a partial face appears in + the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the ``boundingPoly``, and encloses only the skin part of the - face. Typically, it is used to eliminate the face from any - image analysis that detects the "amount of skin" visible in - an image. It is not based on the landmarker results, only on + The `fd_bounding_poly` bounding polygon is tighter than the + `boundingPoly`, and encloses only the skin part of the face. + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p1beta1.types.FaceAnnotation.Landmark]): @@ -302,7 +300,7 @@ class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the image without considering mirror projections typical of photos. So, - ``LEFT_EYE``, typically, is the person's right eye. + `LEFT_EYE`, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -512,7 +510,7 @@ class LocationInfo(proto.Message): class Property(proto.Message): - r"""A ``Property`` consists of a user-supplied name/value pair. + r"""A `Property` consists of a user-supplied name/value pair. Attributes: name (str): @@ -543,13 +541,13 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): Opaque entity ID. Some IDs may be available in - `Google Knowledge Graph Search - API `__. + [Google Knowledge Graph Search + API](https://developers.google.com/knowledge-graph/). locale (str): The language code for the locale in which the entity textual - ``description`` is expressed. + `description` is expressed. description (str): - Entity textual description, expressed in its ``locale`` + Entity textual description, expressed in its `locale` language. score (float): Overall score of the result. Range [0, 1]. @@ -567,16 +565,16 @@ class EntityAnnotation(proto.Message): in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): Image region to which this entity belongs. Not produced - for ``LABEL_DETECTION`` features. + for `LABEL_DETECTION` features. locations (MutableSequence[google.cloud.vision_v1p1beta1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may indicate the location of the scene in the - image, and another location may indicate the location of the - place where the image was taken. Location information is - usually present for landmarks. + `LocationInfo` elements can be present because one location + may indicate the location of the scene in the image, and + another location may indicate the location of the place + where the image was taken. Location information is usually + present for landmarks. properties (MutableSequence[google.cloud.vision_v1p1beta1.types.Property]): - Some entities may have optional user-supplied ``Property`` + Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity. """ @@ -679,7 +677,7 @@ class SafeSearchAnnotation(proto.Message): class LatLongRect(proto.Message): - r"""Rectangle determined by min and max ``LatLng`` pairs. + r"""Rectangle determined by min and max `LatLng` pairs. Attributes: min_lat_lng (google.type.latlng_pb2.LatLng): @@ -769,7 +767,7 @@ class CropHint(proto.Message): bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): The bounding polygon for the crop region. The coordinates of the bounding box are in the original image's scale, as - returned in ``ImageParams``. + returned in `ImageParams`. confidence (float): Confidence of this being a salient region. Range [0, 1]. importance_fraction (float): @@ -879,13 +877,13 @@ class ImageContext(proto.Message): List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In + Latin alphabet, setting `language_hints` is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the - specified languages is not one of the `supported languages - `__. + specified languages is not one of the [supported + languages](https://cloud.google.com/vision/docs/languages). crop_hints_params (google.cloud.vision_v1p1beta1.types.CropHintsParams): Parameters for crop hints annotation request. web_detection_params (google.cloud.vision_v1p1beta1.types.WebDetectionParams): @@ -991,7 +989,7 @@ class AnnotateImageResponse(proto.Message): error (google.rpc.status_pb2.Status): If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be - correct, even when ``error`` is set. + correct, even when `error` is set. """ face_annotations: MutableSequence["FaceAnnotation"] = proto.RepeatedField( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py index 133b3c347c3d..619bdbcc4ae3 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py @@ -42,8 +42,7 @@ class TextAnnotation(proto.Message): Each structural component, starting from Page, may further have their own properties. Properties describe detected languages, breaks etc.. Please refer to the - `TextAnnotation.TextProperty - `__ + [TextAnnotation.TextProperty][google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty] message definition below for more detail. Attributes: @@ -98,8 +97,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or - ``LINE_BREAK``. + co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py index bdfaf20fc558..3781c46da0a9 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py @@ -157,7 +157,7 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or + The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py index fb5632ad071d..b0412a4141ed 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py @@ -417,10 +417,10 @@ async def async_batch_annotate_files( r"""Run async image detection and annotation for a list of generic files (e.g. PDF) which may contain multiple pages and multiple images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py index aa9125703821..5c1bae11817a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py @@ -835,10 +835,10 @@ def async_batch_annotate_files( r"""Run async image detection and annotation for a list of generic files (e.g. PDF) which may contain multiple pages and multiple images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py index 7fe5866362e2..97f732ecbb93 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py @@ -383,10 +383,10 @@ def async_batch_annotate_files( Run async image detection and annotation for a list of generic files (e.g. PDF) which may contain multiple pages and multiple images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py index 41879c4326a0..877279aaceb8 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py @@ -392,10 +392,10 @@ def async_batch_annotate_files( Run async image detection and annotation for a list of generic files (e.g. PDF) which may contain multiple pages and multiple images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py index 38a1541d002d..def45e3dcf87 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py @@ -101,20 +101,20 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the maximum number of results to return for that type. Multiple - ``Feature`` objects can be specified in the ``features`` list. + `Feature` objects can be specified in the `features` list. Attributes: type_ (google.cloud.vision_v1p2beta1.types.Feature.Type): The feature type. max_results (int): Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. + `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or + `CROP_HINTS`. model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) - and "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" for the + and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and + `TEXT_DETECTION` also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -136,11 +136,10 @@ class Type(proto.Enum): Run text detection / optical character recognition (OCR). Text detection is optimized for areas of text within a larger image; if the image is a document, use - ``DOCUMENT_TEXT_DETECTION`` instead. + `DOCUMENT_TEXT_DETECTION` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both - ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are - present. + `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -185,22 +184,20 @@ class ImageSource(proto.Message): Attributes: gcs_image_uri (str): - **Use ``image_uri`` instead.** + **Use `image_uri` instead.** The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See `Google Cloud Storage Request - URIs - `__ + `gs://bucket_name/object_name`. Object versioning is not + supported. See [Google Cloud Storage Request + URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is - not supported. See `Google Cloud Storage Request - URIs - `__ + `gs://bucket_name/object_name`. Object versioning is not + supported. See [Google Cloud Storage Request + URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching @@ -212,8 +209,8 @@ class ImageSource(proto.Message): prevention. You should not depend on externally-hosted images for production applications. - When both ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes precedence. + When both `gcs_image_uri` and `image_uri` are specified, + `image_uri` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -232,14 +229,14 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use a pure + Note: As with all `bytes` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p2beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided - for an image, ``content`` takes precedence and is used to - perform the image annotation request. + image URL. If both `content` and `source` are provided for + an image, `content` takes precedence and is used to perform + the image annotation request. """ content: bytes = proto.Field( @@ -261,18 +258,18 @@ class FaceAnnotation(proto.Message): bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale, as returned - in ``ImageParams``. The bounding box is computed to "frame" + in `ImageParams`. The bounding box is computed to "frame" the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y - coordinates may not be generated in the ``BoundingPoly`` - (the polygon will be unbounded) if only a partial face - appears in the image to be annotated. + coordinates may not be generated in the `BoundingPoly` (the + polygon will be unbounded) if only a partial face appears in + the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the ``boundingPoly``, and encloses only the skin part of the - face. Typically, it is used to eliminate the face from any - image analysis that detects the "amount of skin" visible in - an image. It is not based on the landmarker results, only on + The `fd_bounding_poly` bounding polygon is tighter than the + `boundingPoly`, and encloses only the skin part of the face. + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p2beta1.types.FaceAnnotation.Landmark]): @@ -324,7 +321,7 @@ class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the image without considering mirror projections typical of photos. So, - ``LEFT_EYE``, typically, is the person's right eye. + `LEFT_EYE`, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -534,7 +531,7 @@ class LocationInfo(proto.Message): class Property(proto.Message): - r"""A ``Property`` consists of a user-supplied name/value pair. + r"""A `Property` consists of a user-supplied name/value pair. Attributes: name (str): @@ -565,18 +562,18 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): Opaque entity ID. Some IDs may be available in - `Google Knowledge Graph Search - API `__. + [Google Knowledge Graph Search + API](https://developers.google.com/knowledge-graph/). locale (str): The language code for the locale in which the entity textual - ``description`` is expressed. + `description` is expressed. description (str): - Entity textual description, expressed in its ``locale`` + Entity textual description, expressed in its `locale` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** + **Deprecated. Use `score` instead.** The accuracy of the entity detection in an image. For example, for an image in which the "Eiffel Tower" entity is detected, this field represents the confidence that there is @@ -590,16 +587,16 @@ class EntityAnnotation(proto.Message): in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): Image region to which this entity belongs. Not produced - for ``LABEL_DETECTION`` features. + for `LABEL_DETECTION` features. locations (MutableSequence[google.cloud.vision_v1p2beta1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may indicate the location of the scene in the - image, and another location may indicate the location of the - place where the image was taken. Location information is - usually present for landmarks. + `LocationInfo` elements can be present because one location + may indicate the location of the scene in the image, and + another location may indicate the location of the place + where the image was taken. Location information is usually + present for landmarks. properties (MutableSequence[google.cloud.vision_v1p2beta1.types.Property]): - Some entities may have optional user-supplied ``Property`` + Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity. """ @@ -702,7 +699,7 @@ class SafeSearchAnnotation(proto.Message): class LatLongRect(proto.Message): - r"""Rectangle determined by min and max ``LatLng`` pairs. + r"""Rectangle determined by min and max `LatLng` pairs. Attributes: min_lat_lng (google.type.latlng_pb2.LatLng): @@ -792,7 +789,7 @@ class CropHint(proto.Message): bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): The bounding polygon for the crop region. The coordinates of the bounding box are in the original image's scale, as - returned in ``ImageParams``. + returned in `ImageParams`. confidence (float): Confidence of this being a salient region. Range [0, 1]. importance_fraction (float): @@ -901,13 +898,13 @@ class ImageContext(proto.Message): List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In + Latin alphabet, setting `language_hints` is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the - specified languages is not one of the `supported languages - `__. + specified languages is not one of the [supported + languages](https://cloud.google.com/vision/docs/languages). crop_hints_params (google.cloud.vision_v1p2beta1.types.CropHintsParams): Parameters for crop hints annotation request. web_detection_params (google.cloud.vision_v1p2beta1.types.WebDetectionParams): @@ -1037,7 +1034,7 @@ class AnnotateImageResponse(proto.Message): error (google.rpc.status_pb2.Status): If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be - correct, even when ``error`` is set. + correct, even when `error` is set. context (google.cloud.vision_v1p2beta1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1289,9 +1286,9 @@ class OutputConfig(proto.Message): specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response - protos will be generated. If ``batch_size`` = 20, then 5 - json files each containing 20 response protos will be - written under the prefix ``gcs_destination``.``uri``. + protos will be generated. If `batch_size` = 20, then 5 json + files each containing 20 response protos will be written + under the prefix `gcs_destination`.`uri`. Currently, batch_size only applies to GcsDestination, with potential future support for other output configurations. @@ -1335,19 +1332,18 @@ class GcsDestination(proto.Message): Results will be in JSON format and preceded by its corresponding input URI. This field can either represent a single file, or a prefix for multiple outputs. Prefixes must - end in a ``/``. + end in a `/`. Examples: * File: gs://bucket-name/filename.json * Prefix: gs://bucket-name/prefix/here/ - * File: gs://bucket-name/prefix/here - - If multiple outputs, each response is still - AnnotateFileResponse, each of which contains some subset of - the full list of AnnotateImageResponse. Multiple outputs can - happen if, for example, the output JSON is too large and - overflows into multiple sharded files. + * File: gs://bucket-name/prefix/here If multiple outputs, + each response is still AnnotateFileResponse, each of which + contains some subset of the full list of + AnnotateImageResponse. Multiple outputs can happen if, for + example, the output JSON is too large and overflows into + multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py index 00f174ddcb9b..b296bb77d260 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py @@ -42,8 +42,7 @@ class TextAnnotation(proto.Message): Each structural component, starting from Page, may further have their own properties. Properties describe detected languages, breaks etc.. Please refer to the - `TextAnnotation.TextProperty - `__ + [TextAnnotation.TextProperty][google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty] message definition below for more detail. Attributes: @@ -98,8 +97,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or - ``LINE_BREAK``. + co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py index 648d4e415953..a9a668ce4c0e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py @@ -157,7 +157,7 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or + The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py index f98a15cd4b38..29494a610d27 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py @@ -420,11 +420,10 @@ async def async_batch_annotate_files( r"""Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py index 98fb5c01b0e5..0b22287aba8b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py @@ -880,11 +880,10 @@ def async_batch_annotate_files( r"""Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py index 26fb39e8be19..cf60e8833020 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py @@ -383,11 +383,10 @@ def async_batch_annotate_files( Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py index f767c75aa187..28944f7f6d79 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py @@ -392,11 +392,10 @@ def async_batch_annotate_files( Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py index 4dcc9b15353e..9426f40446e7 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py @@ -71,21 +71,21 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. - - In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - The API has a collection of + [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, + named `projects/*/locations/*/productSets/*`, which acts as a way + to put different products into groups to limit identification. In + parallel, + + - The API has a collection of + [Product][google.cloud.vision.v1p3beta1.Product] resources, named + `projects/*/locations/*/products/*` + + - Each [Product][google.cloud.vision.v1p3beta1.Product] has a + collection of + [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] + resources, named + `projects/*/locations/*/products/*/referenceImages/*` """ _client: ProductSearchClient @@ -335,7 +335,7 @@ async def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. .. code-block:: python @@ -365,11 +365,11 @@ async def sample_create_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.CreateProductSetRequest, dict]]): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the `CreateProductSet` method. parent (:class:`str`): Required. The project in which the ProductSet should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -384,7 +384,7 @@ async def sample_create_product_set(): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -475,7 +475,7 @@ async def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. .. code-block:: python @@ -506,11 +506,11 @@ async def sample_list_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListProductSetsRequest, dict]]): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the `ListProductSets` method. parent (:class:`str`): Required. The project from which ProductSets should be listed. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -525,7 +525,7 @@ async def sample_list_product_sets(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductSetsAsyncPager: - Response message for the ``ListProductSets`` method. + Response message for the `ListProductSets` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -636,13 +636,13 @@ async def sample_get_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.GetProductSetRequest, dict]]): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the `GetProductSet` method. name (:class:`str`): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -761,7 +761,7 @@ async def sample_update_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.UpdateProductSetRequest, dict]]): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the `UpdateProductSet` method. product_set (:class:`google.cloud.vision_v1p3beta1.types.ProductSet`): Required. The ProductSet resource which replaces the one on the server. @@ -770,10 +770,10 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is ``display_name``. + to be updated. Valid mask path is `display_name`. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -894,13 +894,13 @@ async def sample_delete_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.DeleteProductSetRequest, dict]]): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the `DeleteProductSet` method. name (:class:`str`): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -977,10 +977,9 @@ async def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. * Returns INVALID_ARGUMENT if product_category is - missing or invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if description + is longer than 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. .. code-block:: python @@ -1010,12 +1009,12 @@ async def sample_create_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.CreateProductRequest, dict]]): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the `CreateProduct` method. parent (:class:`str`): Required. The project in which the Product should be created. Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1030,7 +1029,7 @@ async def sample_create_product(): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1147,13 +1146,13 @@ async def sample_list_products(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListProductsRequest, dict]]): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the `ListProducts` method. parent (:class:`str`): Required. The project OR ProductSet from which Products should be listed. Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + `projects/PROJECT_ID/locations/LOC_ID` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1168,7 +1167,7 @@ async def sample_list_products(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsAsyncPager: - Response message for the ``ListProducts`` method. + Response message for the `ListProducts` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1277,13 +1276,13 @@ async def sample_get_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.GetProductRequest, dict]]): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the `GetProduct` method. name (:class:`str`): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1372,11 +1371,10 @@ async def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * + is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in - update_mask. + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1405,7 +1403,7 @@ async def sample_update_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.UpdateProductRequest, dict]]): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the `UpdateProduct` method. product (:class:`google.cloud.vision_v1p3beta1.types.Product`): Required. The Product resource which replaces the one on the server. @@ -1415,12 +1413,11 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include - ``product_labels``, ``display_name``, and - ``description``. + `product_labels`, `display_name`, and `description`. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1536,13 +1533,13 @@ async def sample_delete_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.DeleteProductRequest, dict]]): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the `DeleteProduct` method. name (:class:`str`): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1616,12 +1613,11 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS - skipped. The system converts polygons into non-rotated - rectangles. + The `bounding_poly` field is optional. If `bounding_poly` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -1629,12 +1625,11 @@ async def create_reference_image( Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. * - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the product + does not exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent product's + product_category is detected. * Returns INVALID_ARGUMENT if + bounding_poly contains more than 10 polygons. .. code-block:: python @@ -1668,12 +1663,12 @@ async def sample_create_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.CreateReferenceImageRequest, dict]]): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the `CreateReferenceImage` method. parent (:class:`str`): Required. Resource name of the product in which to create the reference image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1691,7 +1686,7 @@ async def sample_create_reference_image(): added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1706,7 +1701,7 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -1812,13 +1807,13 @@ async def sample_delete_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.DeleteReferenceImageRequest, dict]]): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the `DeleteReferenceImage` method. name (:class:`str`): Required. The resource name of the reference image to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1894,7 +1889,7 @@ async def list_reference_images( * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + or less than 1. .. code-block:: python @@ -1925,12 +1920,12 @@ async def sample_list_reference_images(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListReferenceImagesRequest, dict]]): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the `ListReferenceImages` method. parent (:class:`str`): Required. Resource name of the product containing the reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1945,7 +1940,7 @@ async def sample_list_reference_images(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListReferenceImagesAsyncPager: - Response message for the ``ListReferenceImages`` method. + Response message for the `ListReferenceImages` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2056,13 +2051,13 @@ async def sample_get_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.GetReferenceImageRequest, dict]]): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the `GetReferenceImage` method. name (:class:`str`): Required. The resource name of the ReferenceImage to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2077,7 +2072,7 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -2178,14 +2173,13 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the `AddProductToProductSet` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2195,7 +2189,7 @@ async def sample_add_product_to_product_set(): to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2303,14 +2297,14 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the ``RemoveProductFromProductSet`` + The request object. Request message for the `RemoveProductFromProductSet` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2320,7 +2314,7 @@ async def sample_remove_product_from_product_set(): removed from this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2432,14 +2426,14 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the ``ListProductsInProductSet`` + The request object. Request message for the `ListProductsInProductSet` method. name (:class:`str`): Required. The ProductSet resource for which to retrieve Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2454,7 +2448,7 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the ``ListProductsInProductSet`` + Response message for the `ListProductsInProductSet` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2539,17 +2533,15 @@ async def import_product_sets( r"""Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) ``Operation.response`` contains - ``ImportProductSetsResponse``. (results) + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. + (progress) `Operation.response` contains + `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. .. code-block:: python @@ -2583,11 +2575,11 @@ async def sample_import_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ImportProductSetsRequest, dict]]): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the `ImportProductSets` method. parent (:class:`str`): Required. The project in which the ProductSets should be imported. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2612,15 +2604,14 @@ async def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` - Response message for the ``ImportProductSets` method. + :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse` + Response message for the `ImportProductSets` method. This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method - in the returned - `google.longrunning.Operation.response - `__ field. + [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + method in the returned + [google.longrunning.Operation.response][google.longrunning.Operation.response] + field. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py index b89bf1ed0d74..3814405d8c91 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py @@ -115,21 +115,21 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. - - In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - The API has a collection of + [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, + named `projects/*/locations/*/productSets/*`, which acts as a way + to put different products into groups to limit identification. In + parallel, + + - The API has a collection of + [Product][google.cloud.vision.v1p3beta1.Product] resources, named + `projects/*/locations/*/products/*` + + - Each [Product][google.cloud.vision.v1p3beta1.Product] has a + collection of + [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] + resources, named + `projects/*/locations/*/products/*/referenceImages/*` """ @staticmethod @@ -816,7 +816,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. .. code-block:: python @@ -846,11 +846,11 @@ def sample_create_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.CreateProductSetRequest, dict]): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the `CreateProductSet` method. parent (str): Required. The project in which the ProductSet should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -865,7 +865,7 @@ def sample_create_product_set(): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -953,7 +953,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. .. code-block:: python @@ -984,11 +984,11 @@ def sample_list_product_sets(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListProductSetsRequest, dict]): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the `ListProductSets` method. parent (str): Required. The project from which ProductSets should be listed. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1003,7 +1003,7 @@ def sample_list_product_sets(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductSetsPager: - Response message for the ``ListProductSets`` method. + Response message for the `ListProductSets` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1111,13 +1111,13 @@ def sample_get_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.GetProductSetRequest, dict]): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the `GetProductSet` method. name (str): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1233,7 +1233,7 @@ def sample_update_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.UpdateProductSetRequest, dict]): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the `UpdateProductSet` method. product_set (google.cloud.vision_v1p3beta1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. @@ -1242,10 +1242,10 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is ``display_name``. + to be updated. Valid mask path is `display_name`. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1363,13 +1363,13 @@ def sample_delete_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.DeleteProductSetRequest, dict]): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the `DeleteProductSet` method. name (str): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1443,10 +1443,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. * Returns INVALID_ARGUMENT if product_category is - missing or invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if description + is longer than 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. .. code-block:: python @@ -1476,12 +1475,12 @@ def sample_create_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.CreateProductRequest, dict]): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the `CreateProduct` method. parent (str): Required. The project in which the Product should be created. Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1496,7 +1495,7 @@ def sample_create_product(): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1610,13 +1609,13 @@ def sample_list_products(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListProductsRequest, dict]): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the `ListProducts` method. parent (str): Required. The project OR ProductSet from which Products should be listed. Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + `projects/PROJECT_ID/locations/LOC_ID` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1631,7 +1630,7 @@ def sample_list_products(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsPager: - Response message for the ``ListProducts`` method. + Response message for the `ListProducts` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1737,13 +1736,13 @@ def sample_get_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.GetProductRequest, dict]): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the `GetProduct` method. name (str): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1829,11 +1828,10 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * + is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in - update_mask. + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1862,7 +1860,7 @@ def sample_update_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.UpdateProductRequest, dict]): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the `UpdateProduct` method. product (google.cloud.vision_v1p3beta1.types.Product): Required. The Product resource which replaces the one on the server. @@ -1872,12 +1870,11 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include - ``product_labels``, ``display_name``, and - ``description``. + `product_labels`, `display_name`, and `description`. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1990,13 +1987,13 @@ def sample_delete_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.DeleteProductRequest, dict]): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the `DeleteProduct` method. name (str): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2067,12 +2064,11 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS - skipped. The system converts polygons into non-rotated - rectangles. + The `bounding_poly` field is optional. If `bounding_poly` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -2080,12 +2076,11 @@ def create_reference_image( Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. * - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the product + does not exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent product's + product_category is detected. * Returns INVALID_ARGUMENT if + bounding_poly contains more than 10 polygons. .. code-block:: python @@ -2119,12 +2114,12 @@ def sample_create_reference_image(): Args: request (Union[google.cloud.vision_v1p3beta1.types.CreateReferenceImageRequest, dict]): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the `CreateReferenceImage` method. parent (str): Required. Resource name of the product in which to create the reference image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2142,7 +2137,7 @@ def sample_create_reference_image(): added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2157,7 +2152,7 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -2260,13 +2255,13 @@ def sample_delete_reference_image(): Args: request (Union[google.cloud.vision_v1p3beta1.types.DeleteReferenceImageRequest, dict]): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the `DeleteReferenceImage` method. name (str): Required. The resource name of the reference image to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2339,7 +2334,7 @@ def list_reference_images( * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + or less than 1. .. code-block:: python @@ -2370,12 +2365,12 @@ def sample_list_reference_images(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListReferenceImagesRequest, dict]): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the `ListReferenceImages` method. parent (str): Required. Resource name of the product containing the reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2390,7 +2385,7 @@ def sample_list_reference_images(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListReferenceImagesPager: - Response message for the ``ListReferenceImages`` method. + Response message for the `ListReferenceImages` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2498,13 +2493,13 @@ def sample_get_reference_image(): Args: request (Union[google.cloud.vision_v1p3beta1.types.GetReferenceImageRequest, dict]): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the `GetReferenceImage` method. name (str): Required. The resource name of the ReferenceImage to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2519,7 +2514,7 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -2617,14 +2612,13 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the `AddProductToProductSet` method. name (str): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2634,7 +2628,7 @@ def sample_add_product_to_product_set(): to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2741,14 +2735,14 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the ``RemoveProductFromProductSet`` + The request object. Request message for the `RemoveProductFromProductSet` method. name (str): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2758,7 +2752,7 @@ def sample_remove_product_from_product_set(): removed from this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2869,14 +2863,14 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the ``ListProductsInProductSet`` + The request object. Request message for the `ListProductsInProductSet` method. name (str): Required. The ProductSet resource for which to retrieve Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2891,7 +2885,7 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the ``ListProductsInProductSet`` + Response message for the `ListProductsInProductSet` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2975,17 +2969,15 @@ def import_product_sets( r"""Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) ``Operation.response`` contains - ``ImportProductSetsResponse``. (results) + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. + (progress) `Operation.response` contains + `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. .. code-block:: python @@ -3019,11 +3011,11 @@ def sample_import_product_sets(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ImportProductSetsRequest, dict]): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the `ImportProductSets` method. parent (str): Required. The project in which the ProductSets should be imported. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3048,15 +3040,14 @@ def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` - Response message for the ``ImportProductSets` method. + :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse` + Response message for the `ImportProductSets` method. This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method - in the returned - `google.longrunning.Operation.response - `__ field. + [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + method in the returned + [google.longrunning.Operation.response][google.longrunning.Operation.response] + field. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py index 08aa87b0806e..1ddfdd089913 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py @@ -115,21 +115,21 @@ class ProductSearchGrpcTransport(ProductSearchTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. - - In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - The API has a collection of + [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, + named `projects/*/locations/*/productSets/*`, which acts as a way + to put different products into groups to limit identification. In + parallel, + + - The API has a collection of + [Product][google.cloud.vision.v1p3beta1.Product] resources, named + `projects/*/locations/*/products/*` + + - Each [Product][google.cloud.vision.v1p3beta1.Product] has a + collection of + [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] + resources, named + `projects/*/locations/*/products/*/referenceImages/*` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -371,7 +371,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -405,7 +405,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -540,10 +540,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. * Returns INVALID_ARGUMENT if product_category is - missing or invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if description + is longer than 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -648,11 +647,10 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * + is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in - update_mask. + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -717,12 +715,11 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS - skipped. The system converts polygons into non-rotated - rectangles. + The `bounding_poly` field is optional. If `bounding_poly` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -730,12 +727,11 @@ def create_reference_image( Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. * - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the product + does not exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent product's + product_category is detected. * Returns INVALID_ARGUMENT if + bounding_poly contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -809,7 +805,7 @@ def list_reference_images( * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -985,17 +981,15 @@ def import_product_sets( Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) ``Operation.response`` contains - ``ImportProductSetsResponse``. (results) + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. + (progress) `Operation.response` contains + `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. Returns: Callable[[~.ImportProductSetsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py index 31846fe371ca..749b0c9412a2 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py @@ -121,21 +121,21 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. - - In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - The API has a collection of + [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, + named `projects/*/locations/*/productSets/*`, which acts as a way + to put different products into groups to limit identification. In + parallel, + + - The API has a collection of + [Product][google.cloud.vision.v1p3beta1.Product] resources, named + `projects/*/locations/*/products/*` + + - Each [Product][google.cloud.vision.v1p3beta1.Product] has a + collection of + [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] + resources, named + `projects/*/locations/*/products/*/referenceImages/*` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -379,7 +379,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -413,7 +413,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -552,10 +552,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. * Returns INVALID_ARGUMENT if product_category is - missing or invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if description + is longer than 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -662,11 +661,10 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * + is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in - update_mask. + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -733,12 +731,11 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS - skipped. The system converts polygons into non-rotated - rectangles. + The `bounding_poly` field is optional. If `bounding_poly` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -746,12 +743,11 @@ def create_reference_image( Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. * - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the product + does not exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent product's + product_category is detected. * Returns INVALID_ARGUMENT if + bounding_poly contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -825,7 +821,7 @@ def list_reference_images( * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -1004,17 +1000,15 @@ def import_product_sets( Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) ``Operation.response`` contains - ``ImportProductSetsResponse``. (results) + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. + (progress) `Operation.response` contains + `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. Returns: Callable[[~.ImportProductSetsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py index 351b2e0a11ad..58419d460e0d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py @@ -952,21 +952,21 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. - - In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - The API has a collection of + [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, + named `projects/*/locations/*/productSets/*`, which acts as a way + to put different products into groups to limit identification. In + parallel, + + - The API has a collection of + [Product][google.cloud.vision.v1p3beta1.Product] resources, named + `projects/*/locations/*/products/*` + + - Each [Product][google.cloud.vision.v1p3beta1.Product] has a + collection of + [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] + resources, named + `projects/*/locations/*/products/*/referenceImages/*` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -1114,8 +1114,7 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the `AddProductToProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1229,7 +1228,7 @@ def __call__( Args: request (~.product_search_service.CreateProductRequest): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the `CreateProduct` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1379,7 +1378,7 @@ def __call__( Args: request (~.product_search_service.CreateProductSetRequest): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the `CreateProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1538,7 +1537,7 @@ def __call__( Args: request (~.product_search_service.CreateReferenceImageRequest): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the `CreateReferenceImage` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1549,7 +1548,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -1693,7 +1692,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductRequest): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the `DeleteProduct` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1799,7 +1798,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductSetRequest): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the `DeleteProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1907,7 +1906,7 @@ def __call__( Args: request (~.product_search_service.DeleteReferenceImageRequest): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the `DeleteReferenceImage` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2015,7 +2014,7 @@ def __call__( Args: request (~.product_search_service.GetProductRequest): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the `GetProduct` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2163,7 +2162,7 @@ def __call__( Args: request (~.product_search_service.GetProductSetRequest): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the `GetProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2314,7 +2313,7 @@ def __call__( Args: request (~.product_search_service.GetReferenceImageRequest): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the `GetReferenceImage` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2325,7 +2324,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -2465,7 +2464,7 @@ def __call__( Args: request (~.product_search_service.ImportProductSetsRequest): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the `ImportProductSets` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2617,7 +2616,7 @@ def __call__( Args: request (~.product_search_service.ListProductsRequest): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the `ListProducts` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2628,7 +2627,7 @@ def __call__( Returns: ~.product_search_service.ListProductsResponse: - Response message for the ``ListProducts`` method. + Response message for the `ListProducts` method. """ http_options = ( @@ -2763,7 +2762,7 @@ def __call__( Args: request (~.product_search_service.ListProductSetsRequest): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the `ListProductSets` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2774,7 +2773,7 @@ def __call__( Returns: ~.product_search_service.ListProductSetsResponse: - Response message for the ``ListProductSets`` method. + Response message for the `ListProductSets` method. """ http_options = ( @@ -2913,7 +2912,7 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the ``ListProductsInProductSet`` + The request object. Request message for the `ListProductsInProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -2925,7 +2924,7 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the ``ListProductsInProductSet`` + Response message for the `ListProductsInProductSet` method. """ @@ -3068,7 +3067,7 @@ def __call__( Args: request (~.product_search_service.ListReferenceImagesRequest): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the `ListReferenceImages` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3079,7 +3078,7 @@ def __call__( Returns: ~.product_search_service.ListReferenceImagesResponse: - Response message for the ``ListReferenceImages`` method. + Response message for the `ListReferenceImages` method. """ http_options = ( @@ -3221,7 +3220,7 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the ``RemoveProductFromProductSet`` + The request object. Request message for the `RemoveProductFromProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -3338,7 +3337,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductRequest): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the `UpdateProduct` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3488,7 +3487,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductSetRequest): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the `UpdateProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py index 898164827790..606a60af3d9d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py @@ -106,20 +106,20 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the maximum number of results to return for that type. Multiple - ``Feature`` objects can be specified in the ``features`` list. + `Feature` objects can be specified in the `features` list. Attributes: type_ (google.cloud.vision_v1p3beta1.types.Feature.Type): The feature type. max_results (int): Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. + `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or + `CROP_HINTS`. model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) - and "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" for the + and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and + `TEXT_DETECTION` also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -141,11 +141,10 @@ class Type(proto.Enum): Run text detection / optical character recognition (OCR). Text detection is optimized for areas of text within a larger image; if the image is a document, use - ``DOCUMENT_TEXT_DETECTION`` instead. + `DOCUMENT_TEXT_DETECTION` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both - ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are - present. + `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -196,22 +195,20 @@ class ImageSource(proto.Message): Attributes: gcs_image_uri (str): - **Use ``image_uri`` instead.** + **Use `image_uri` instead.** The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See `Google Cloud Storage Request - URIs - `__ + `gs://bucket_name/object_name`. Object versioning is not + supported. See [Google Cloud Storage Request + URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is - not supported. See `Google Cloud Storage Request - URIs - `__ + `gs://bucket_name/object_name`. Object versioning is not + supported. See [Google Cloud Storage Request + URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching @@ -223,8 +220,8 @@ class ImageSource(proto.Message): prevention. You should not depend on externally-hosted images for production applications. - When both ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes precedence. + When both `gcs_image_uri` and `image_uri` are specified, + `image_uri` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -243,14 +240,14 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use a pure + Note: As with all `bytes` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p3beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided - for an image, ``content`` takes precedence and is used to - perform the image annotation request. + image URL. If both `content` and `source` are provided for + an image, `content` takes precedence and is used to perform + the image annotation request. """ content: bytes = proto.Field( @@ -272,18 +269,18 @@ class FaceAnnotation(proto.Message): bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale, as returned - in ``ImageParams``. The bounding box is computed to "frame" + in `ImageParams`. The bounding box is computed to "frame" the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y - coordinates may not be generated in the ``BoundingPoly`` - (the polygon will be unbounded) if only a partial face - appears in the image to be annotated. + coordinates may not be generated in the `BoundingPoly` (the + polygon will be unbounded) if only a partial face appears in + the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the ``boundingPoly``, and encloses only the skin part of the - face. Typically, it is used to eliminate the face from any - image analysis that detects the "amount of skin" visible in - an image. It is not based on the landmarker results, only on + The `fd_bounding_poly` bounding polygon is tighter than the + `boundingPoly`, and encloses only the skin part of the face. + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p3beta1.types.FaceAnnotation.Landmark]): @@ -335,7 +332,7 @@ class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the image without considering mirror projections typical of photos. So, - ``LEFT_EYE``, typically, is the person's right eye. + `LEFT_EYE`, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -545,7 +542,7 @@ class LocationInfo(proto.Message): class Property(proto.Message): - r"""A ``Property`` consists of a user-supplied name/value pair. + r"""A `Property` consists of a user-supplied name/value pair. Attributes: name (str): @@ -576,18 +573,18 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): Opaque entity ID. Some IDs may be available in - `Google Knowledge Graph Search - API `__. + [Google Knowledge Graph Search + API](https://developers.google.com/knowledge-graph/). locale (str): The language code for the locale in which the entity textual - ``description`` is expressed. + `description` is expressed. description (str): - Entity textual description, expressed in its ``locale`` + Entity textual description, expressed in its `locale` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** + **Deprecated. Use `score` instead.** The accuracy of the entity detection in an image. For example, for an image in which the "Eiffel Tower" entity is detected, this field represents the confidence that there is @@ -601,16 +598,16 @@ class EntityAnnotation(proto.Message): in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): Image region to which this entity belongs. Not produced - for ``LABEL_DETECTION`` features. + for `LABEL_DETECTION` features. locations (MutableSequence[google.cloud.vision_v1p3beta1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may indicate the location of the scene in the - image, and another location may indicate the location of the - place where the image was taken. Location information is - usually present for landmarks. + `LocationInfo` elements can be present because one location + may indicate the location of the scene in the image, and + another location may indicate the location of the place + where the image was taken. Location information is usually + present for landmarks. properties (MutableSequence[google.cloud.vision_v1p3beta1.types.Property]): - Some entities may have optional user-supplied ``Property`` + Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity. """ @@ -668,7 +665,7 @@ class LocalizedObjectAnnotation(proto.Message): more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` language. + Object name, expressed in its `language_code` language. score (float): Score of the result. Range [0, 1]. bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): @@ -756,7 +753,7 @@ class SafeSearchAnnotation(proto.Message): class LatLongRect(proto.Message): - r"""Rectangle determined by min and max ``LatLng`` pairs. + r"""Rectangle determined by min and max `LatLng` pairs. Attributes: min_lat_lng (google.type.latlng_pb2.LatLng): @@ -846,7 +843,7 @@ class CropHint(proto.Message): bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): The bounding polygon for the crop region. The coordinates of the bounding box are in the original image's scale, as - returned in ``ImageParams``. + returned in `ImageParams`. confidence (float): Confidence of this being a salient region. Range [0, 1]. importance_fraction (float): @@ -955,13 +952,13 @@ class ImageContext(proto.Message): List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In + Latin alphabet, setting `language_hints` is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the - specified languages is not one of the `supported languages - `__. + specified languages is not one of the [supported + languages](https://cloud.google.com/vision/docs/languages). crop_hints_params (google.cloud.vision_v1p3beta1.types.CropHintsParams): Parameters for crop hints annotation request. product_search_params (google.cloud.vision_v1p3beta1.types.ProductSearchParams): @@ -1105,7 +1102,7 @@ class AnnotateImageResponse(proto.Message): error (google.rpc.status_pb2.Status): If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be - correct, even when ``error`` is set. + correct, even when `error` is set. context (google.cloud.vision_v1p3beta1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1370,9 +1367,9 @@ class OutputConfig(proto.Message): value is 20. For example, for one pdf file with 100 pages, 100 response - protos will be generated. If ``batch_size`` = 20, then 5 - json files each containing 20 response protos will be - written under the prefix ``gcs_destination``.``uri``. + protos will be generated. If `batch_size` = 20, then 5 json + files each containing 20 response protos will be written + under the prefix `gcs_destination`.`uri`. Currently, batch_size only applies to GcsDestination, with potential future support for other output configurations. @@ -1416,19 +1413,18 @@ class GcsDestination(proto.Message): Results will be in JSON format and preceded by its corresponding input URI. This field can either represent a single file, or a prefix for multiple outputs. Prefixes must - end in a ``/``. + end in a `/`. Examples: * File: gs://bucket-name/filename.json * Prefix: gs://bucket-name/prefix/here/ - * File: gs://bucket-name/prefix/here - - If multiple outputs, each response is still - AnnotateFileResponse, each of which contains some subset of - the full list of AnnotateImageResponse. Multiple outputs can - happen if, for example, the output JSON is too large and - overflows into multiple sharded files. + * File: gs://bucket-name/prefix/here If multiple outputs, + each response is still AnnotateFileResponse, each of which + contains some subset of the full list of + AnnotateImageResponse. Multiple outputs can happen if, for + example, the output JSON is too large and overflows into + multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py index 2c06f26aaefa..583bf6353f57 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py @@ -40,11 +40,11 @@ class ProductSearchParams(proto.Message): interest in the image. If it is not specified, system discretion will be applied. product_set (str): - The resource name of a `ProductSet - `__ to be searched - for similar images. Format is: + The resource name of a + [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be + searched for similar images. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -151,7 +151,7 @@ class ObjectAnnotation(proto.Message): more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` language. + Object name, expressed in its `language_code` language. score (float): Score of the result. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py index 1bb49d4bdf2a..21bb56d1f87d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py @@ -69,7 +69,7 @@ class Product(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is ignored when creating a product. display_name (str): @@ -155,7 +155,7 @@ class ProductSet(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. This field is ignored when creating a ProductSet. display_name (str): @@ -201,7 +201,7 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): - r"""A ``ReferenceImage`` represents a product image and its + r"""A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. Attributes: @@ -210,13 +210,13 @@ class ReferenceImage(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. This field is ignored when creating a reference image. uri (str): Required. The Google Cloud Storage URI of the reference image. - The URI must start with ``gs://``. + The URI must start with `gs://`. bounding_polys (MutableSequence[google.cloud.vision_v1p3beta1.types.BoundingPoly]): Optional. Bounding polygons around the areas of interest in the reference image. If this @@ -247,14 +247,14 @@ class ReferenceImage(proto.Message): class CreateProductRequest(proto.Message): - r"""Request message for the ``CreateProduct`` method. + r"""Request message for the `CreateProduct` method. Attributes: parent (str): Required. The project in which the Product should be created. Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + `projects/PROJECT_ID/locations/LOC_ID`. product (google.cloud.vision_v1p3beta1.types.Product): Required. The product to create. product_id (str): @@ -262,7 +262,7 @@ class CreateProductRequest(proto.Message): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. """ parent: str = proto.Field( @@ -281,7 +281,7 @@ class CreateProductRequest(proto.Message): class ListProductsRequest(proto.Message): - r"""Request message for the ``ListProducts`` method. + r"""Request message for the `ListProducts` method. Attributes: parent (str): @@ -289,7 +289,7 @@ class ListProductsRequest(proto.Message): should be listed. Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + `projects/PROJECT_ID/locations/LOC_ID` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -313,7 +313,7 @@ class ListProductsRequest(proto.Message): class ListProductsResponse(proto.Message): - r"""Response message for the ``ListProducts`` method. + r"""Response message for the `ListProducts` method. Attributes: products (MutableSequence[google.cloud.vision_v1p3beta1.types.Product]): @@ -340,7 +340,7 @@ def raw_page(self): class GetProductRequest(proto.Message): - r"""Request message for the ``GetProduct`` method. + r"""Request message for the `GetProduct` method. Attributes: name (str): @@ -348,7 +348,7 @@ class GetProductRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` """ name: str = proto.Field( @@ -358,7 +358,7 @@ class GetProductRequest(proto.Message): class UpdateProductRequest(proto.Message): - r"""Request message for the ``UpdateProduct`` method. + r"""Request message for the `UpdateProduct` method. Attributes: product (google.cloud.vision_v1p3beta1.types.Product): @@ -366,12 +366,11 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include - ``product_labels``, ``display_name``, and - ``description``. + `product_labels`, `display_name`, and `description`. """ product: "Product" = proto.Field( @@ -387,7 +386,7 @@ class UpdateProductRequest(proto.Message): class DeleteProductRequest(proto.Message): - r"""Request message for the ``DeleteProduct`` method. + r"""Request message for the `DeleteProduct` method. Attributes: name (str): @@ -395,7 +394,7 @@ class DeleteProductRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` """ name: str = proto.Field( @@ -405,13 +404,13 @@ class DeleteProductRequest(proto.Message): class CreateProductSetRequest(proto.Message): - r"""Request message for the ``CreateProductSet`` method. + r"""Request message for the `CreateProductSet` method. Attributes: parent (str): Required. The project in which the ProductSet should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. product_set (google.cloud.vision_v1p3beta1.types.ProductSet): Required. The ProductSet to create. product_set_id (str): @@ -419,7 +418,7 @@ class CreateProductSetRequest(proto.Message): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. """ parent: str = proto.Field( @@ -438,13 +437,13 @@ class CreateProductSetRequest(proto.Message): class ListProductSetsRequest(proto.Message): - r"""Request message for the ``ListProductSets`` method. + r"""Request message for the `ListProductSets` method. Attributes: parent (str): Required. The project from which ProductSets should be listed. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -468,7 +467,7 @@ class ListProductSetsRequest(proto.Message): class ListProductSetsResponse(proto.Message): - r"""Response message for the ``ListProductSets`` method. + r"""Response message for the `ListProductSets` method. Attributes: product_sets (MutableSequence[google.cloud.vision_v1p3beta1.types.ProductSet]): @@ -495,7 +494,7 @@ def raw_page(self): class GetProductSetRequest(proto.Message): - r"""Request message for the ``GetProductSet`` method. + r"""Request message for the `GetProductSet` method. Attributes: name (str): @@ -503,7 +502,7 @@ class GetProductSetRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` """ name: str = proto.Field( @@ -513,17 +512,17 @@ class GetProductSetRequest(proto.Message): class UpdateProductSetRequest(proto.Message): - r"""Request message for the ``UpdateProductSet`` method. + r"""Request message for the `UpdateProductSet` method. Attributes: product_set (google.cloud.vision_v1p3beta1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is ``display_name``. + to be updated. Valid mask path is `display_name`. """ product_set: "ProductSet" = proto.Field( @@ -539,7 +538,7 @@ class UpdateProductSetRequest(proto.Message): class DeleteProductSetRequest(proto.Message): - r"""Request message for the ``DeleteProductSet`` method. + r"""Request message for the `DeleteProductSet` method. Attributes: name (str): @@ -547,7 +546,7 @@ class DeleteProductSetRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` """ name: str = proto.Field( @@ -557,14 +556,14 @@ class DeleteProductSetRequest(proto.Message): class CreateReferenceImageRequest(proto.Message): - r"""Request message for the ``CreateReferenceImage`` method. + r"""Request message for the `CreateReferenceImage` method. Attributes: parent (str): Required. Resource name of the product in which to create the reference image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. reference_image (google.cloud.vision_v1p3beta1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. @@ -573,7 +572,7 @@ class CreateReferenceImageRequest(proto.Message): added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. """ parent: str = proto.Field( @@ -592,20 +591,20 @@ class CreateReferenceImageRequest(proto.Message): class ListReferenceImagesRequest(proto.Message): - r"""Request message for the ``ListReferenceImages`` method. + r"""Request message for the `ListReferenceImages` method. Attributes: parent (str): Required. Resource name of the product containing the reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value of ``nextPageToken`` returned in a previous + is the value of `nextPageToken` returned in a previous reference image list request. Defaults to the first page if not specified. @@ -626,7 +625,7 @@ class ListReferenceImagesRequest(proto.Message): class ListReferenceImagesResponse(proto.Message): - r"""Response message for the ``ListReferenceImages`` method. + r"""Response message for the `ListReferenceImages` method. Attributes: reference_images (MutableSequence[google.cloud.vision_v1p3beta1.types.ReferenceImage]): @@ -659,7 +658,7 @@ def raw_page(self): class GetReferenceImageRequest(proto.Message): - r"""Request message for the ``GetReferenceImage`` method. + r"""Request message for the `GetReferenceImage` method. Attributes: name (str): @@ -667,7 +666,7 @@ class GetReferenceImageRequest(proto.Message): get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. """ name: str = proto.Field( @@ -677,7 +676,7 @@ class GetReferenceImageRequest(proto.Message): class DeleteReferenceImageRequest(proto.Message): - r"""Request message for the ``DeleteReferenceImage`` method. + r"""Request message for the `DeleteReferenceImage` method. Attributes: name (str): @@ -685,7 +684,7 @@ class DeleteReferenceImageRequest(proto.Message): delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` """ name: str = proto.Field( @@ -695,8 +694,7 @@ class DeleteReferenceImageRequest(proto.Message): class AddProductToProductSetRequest(proto.Message): - r"""Request message for the ``AddProductToProductSet`` - method. + r"""Request message for the `AddProductToProductSet` method. Attributes: name (str): @@ -704,13 +702,13 @@ class AddProductToProductSetRequest(proto.Message): modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` product (str): Required. The resource name for the Product to be added to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` """ name: str = proto.Field( @@ -724,7 +722,7 @@ class AddProductToProductSetRequest(proto.Message): class RemoveProductFromProductSetRequest(proto.Message): - r"""Request message for the ``RemoveProductFromProductSet`` + r"""Request message for the `RemoveProductFromProductSet` method. Attributes: @@ -733,13 +731,13 @@ class RemoveProductFromProductSetRequest(proto.Message): modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` product (str): Required. The resource name for the Product to be removed from this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` """ name: str = proto.Field( @@ -753,7 +751,7 @@ class RemoveProductFromProductSetRequest(proto.Message): class ListProductsInProductSetRequest(proto.Message): - r"""Request message for the ``ListProductsInProductSet`` + r"""Request message for the `ListProductsInProductSet` method. Attributes: @@ -762,7 +760,7 @@ class ListProductsInProductSetRequest(proto.Message): Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -786,7 +784,7 @@ class ListProductsInProductSetRequest(proto.Message): class ListProductsInProductSetResponse(proto.Message): - r"""Response message for the ``ListProductsInProductSet`` + r"""Response message for the `ListProductsInProductSet` method. Attributes: @@ -821,7 +819,7 @@ class ImportProductSetsGcsSource(proto.Message): csv_file_uri (str): The Google Cloud Storage URI of the input csv file. - The URI must start with ``gs://``. + The URI must start with `gs://`. The format of the input csv file should be one image per line. In each line, there are 6 columns. @@ -854,11 +852,9 @@ class ImportProductSetsGcsSource(proto.Message): If a Product doesn't exist and needs to be created on the fly, the product_display_name field refers to - `Product.display_name - `__, the - product_category field refers to - `Product.product_category - `__, + [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], + the product_category field refers to + [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], and the labels field refers to [Product.labels][]. Labels (optional) should be a line containing a list of @@ -892,7 +888,7 @@ class ImportProductSetsGcsSource(proto.Message): class ImportProductSetsInputConfig(proto.Message): - r"""The input content for the ``ImportProductSets`` method. + r"""The input content for the `ImportProductSets` method. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -914,13 +910,13 @@ class ImportProductSetsInputConfig(proto.Message): class ImportProductSetsRequest(proto.Message): - r"""Request message for the ``ImportProductSets`` method. + r"""Request message for the `ImportProductSets` method. Attributes: parent (str): Required. The project in which the ProductSets should be imported. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. input_config (google.cloud.vision_v1p3beta1.types.ImportProductSetsInputConfig): Required. The input content for the list of requests. @@ -938,14 +934,13 @@ class ImportProductSetsRequest(proto.Message): class ImportProductSetsResponse(proto.Message): - r"""Response message for the ``ImportProductSets`` method. + r"""Response message for the `ImportProductSets` method. This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method in the - returned - `google.longrunning.Operation.response - `__ field. + [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + method in the returned + [google.longrunning.Operation.response][google.longrunning.Operation.response] + field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1p3beta1.types.ReferenceImage]): @@ -975,9 +970,9 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` - returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. + This is included in the `metadata` field of the `Operation` returned + by the `GetOperation` call of the `google::longrunning::Operations` + service. Attributes: state (google.cloud.vision_v1p3beta1.types.BatchOperationMetadata.State): @@ -987,8 +982,8 @@ class BatchOperationMetadata(proto.Message): to the server. end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and - `google.longrunning.Operation.done - `__ is set to true. + [google.longrunning.Operation.done][google.longrunning.Operation.done] + is set to true. """ class State(proto.Enum): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py index 3d38f81ca6b6..83a9f47b70af 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py @@ -42,8 +42,7 @@ class TextAnnotation(proto.Message): Each structural component, starting from Page, may further have their own properties. Properties describe detected languages, breaks etc.. Please refer to the - `TextAnnotation.TextProperty - `__ + [TextAnnotation.TextProperty][google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty] message definition below for more detail. Attributes: @@ -98,8 +97,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or - ``LINE_BREAK``. + co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py index 887e53444d05..77beced50b26 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py @@ -157,7 +157,7 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or + The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py index 4e89aa363161..a231aa63afb2 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py @@ -535,10 +535,10 @@ async def async_batch_annotate_images( r"""Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateImagesResponse` + (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -677,11 +677,10 @@ async def async_batch_annotate_files( r"""Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py index 2d969ba638e4..f6a0b8b9873a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py @@ -992,10 +992,10 @@ def async_batch_annotate_images( r"""Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateImagesResponse` + (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -1133,11 +1133,10 @@ def async_batch_annotate_files( r"""Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py index 4790cb67d154..bbd1d83513a4 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py @@ -420,10 +420,10 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateImagesResponse` + (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -460,11 +460,10 @@ def async_batch_annotate_files( Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py index 2ced1bc0948c..ac24da43eea8 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py @@ -429,10 +429,10 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateImagesResponse` + (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -470,11 +470,10 @@ def async_batch_annotate_files( Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` - interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` + (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py index 373e510ecf5c..9feb2ec05f6d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py @@ -73,20 +73,20 @@ class ProductSearchAsyncClient: product search. It uses the following resource model: - The API has a collection of - `ProductSet `__ resources, - named ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. - - In parallel, + [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, + named `projects/*/locations/*/productSets/*`, which acts as a way + to put different products into groups to limit identification. In + parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + [Product][google.cloud.vision.v1p4beta1.Product] resources, named + `projects/*/locations/*/products/*` + + - Each [Product][google.cloud.vision.v1p4beta1.Product] has a + collection of + [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] + resources, named + `projects/*/locations/*/products/*/referenceImages/*` """ _client: ProductSearchClient @@ -336,7 +336,7 @@ async def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. .. code-block:: python @@ -366,11 +366,11 @@ async def sample_create_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.CreateProductSetRequest, dict]]): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the `CreateProductSet` method. parent (:class:`str`): Required. The project in which the ProductSet should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -385,7 +385,7 @@ async def sample_create_product_set(): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -476,7 +476,7 @@ async def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. .. code-block:: python @@ -507,11 +507,11 @@ async def sample_list_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListProductSetsRequest, dict]]): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the `ListProductSets` method. parent (:class:`str`): Required. The project from which ProductSets should be listed. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -526,7 +526,7 @@ async def sample_list_product_sets(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductSetsAsyncPager: - Response message for the ``ListProductSets`` method. + Response message for the `ListProductSets` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -637,13 +637,13 @@ async def sample_get_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.GetProductSetRequest, dict]]): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the `GetProductSet` method. name (:class:`str`): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -762,7 +762,7 @@ async def sample_update_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.UpdateProductSetRequest, dict]]): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the `UpdateProductSet` method. product_set (:class:`google.cloud.vision_v1p4beta1.types.ProductSet`): Required. The ProductSet resource which replaces the one on the server. @@ -771,10 +771,10 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is ``display_name``. + to be updated. Valid mask path is `display_name`. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -891,13 +891,13 @@ async def sample_delete_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.DeleteProductSetRequest, dict]]): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the `DeleteProductSet` method. name (:class:`str`): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -974,10 +974,9 @@ async def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. * Returns INVALID_ARGUMENT if product_category is - missing or invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if description + is longer than 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. .. code-block:: python @@ -1007,12 +1006,12 @@ async def sample_create_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.CreateProductRequest, dict]]): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the `CreateProduct` method. parent (:class:`str`): Required. The project in which the Product should be created. Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1027,7 +1026,7 @@ async def sample_create_product(): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1144,13 +1143,13 @@ async def sample_list_products(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListProductsRequest, dict]]): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the `ListProducts` method. parent (:class:`str`): Required. The project OR ProductSet from which Products should be listed. Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + `projects/PROJECT_ID/locations/LOC_ID` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1165,7 +1164,7 @@ async def sample_list_products(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsAsyncPager: - Response message for the ``ListProducts`` method. + Response message for the `ListProducts` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1274,13 +1273,13 @@ async def sample_get_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.GetProductRequest, dict]]): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the `GetProduct` method. name (:class:`str`): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1359,8 +1358,8 @@ async def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated right now. + Only the `display_name`, `description`, and `labels` fields can + be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -1369,11 +1368,10 @@ async def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * + is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in - update_mask. + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1402,7 +1400,7 @@ async def sample_update_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.UpdateProductRequest, dict]]): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the `UpdateProduct` method. product (:class:`google.cloud.vision_v1p4beta1.types.Product`): Required. The Product resource which replaces the one on the server. @@ -1412,12 +1410,11 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include - ``product_labels``, ``display_name``, and - ``description``. + `product_labels`, `display_name`, and `description`. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1530,13 +1527,13 @@ async def sample_delete_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.DeleteProductRequest, dict]]): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the `DeleteProduct` method. name (:class:`str`): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1610,12 +1607,11 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS - skipped. The system converts polygons into non-rotated - rectangles. + The `bounding_poly` field is optional. If `bounding_poly` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -1623,12 +1619,11 @@ async def create_reference_image( Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. * - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the product + does not exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent product's + product_category is detected. * Returns INVALID_ARGUMENT if + bounding_poly contains more than 10 polygons. .. code-block:: python @@ -1662,13 +1657,13 @@ async def sample_create_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.CreateReferenceImageRequest, dict]]): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the `CreateReferenceImage` method. parent (:class:`str`): Required. Resource name of the product in which to create the reference image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1686,7 +1681,7 @@ async def sample_create_reference_image(): added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1701,7 +1696,7 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -1803,13 +1798,13 @@ async def sample_delete_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.DeleteReferenceImageRequest, dict]]): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the `DeleteReferenceImage` method. name (:class:`str`): Required. The resource name of the reference image to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1885,7 +1880,7 @@ async def list_reference_images( * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + or less than 1. .. code-block:: python @@ -1916,12 +1911,12 @@ async def sample_list_reference_images(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListReferenceImagesRequest, dict]]): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the `ListReferenceImages` method. parent (:class:`str`): Required. Resource name of the product containing the reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1936,7 +1931,7 @@ async def sample_list_reference_images(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListReferenceImagesAsyncPager: - Response message for the ``ListReferenceImages`` method. + Response message for the `ListReferenceImages` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2047,13 +2042,13 @@ async def sample_get_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.GetReferenceImageRequest, dict]]): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the `GetReferenceImage` method. name (:class:`str`): Required. The resource name of the ReferenceImage to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2068,7 +2063,7 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -2169,14 +2164,13 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the `AddProductToProductSet` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2186,7 +2180,7 @@ async def sample_add_product_to_product_set(): to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2289,14 +2283,14 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the ``RemoveProductFromProductSet`` + The request object. Request message for the `RemoveProductFromProductSet` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2307,7 +2301,7 @@ async def sample_remove_product_from_product_set(): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2419,14 +2413,14 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the ``ListProductsInProductSet`` + The request object. Request message for the `ListProductsInProductSet` method. name (:class:`str`): Required. The ProductSet resource for which to retrieve Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2441,7 +2435,7 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the ``ListProductsInProductSet`` + Response message for the `ListProductsInProductSet` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2526,17 +2520,15 @@ async def import_product_sets( r"""Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) ``Operation.response`` contains - ``ImportProductSetsResponse``. (results) + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. + (progress) `Operation.response` contains + `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. .. code-block:: python @@ -2570,11 +2562,11 @@ async def sample_import_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ImportProductSetsRequest, dict]]): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the `ImportProductSets` method. parent (:class:`str`): Required. The project in which the ProductSets should be imported. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2599,15 +2591,14 @@ async def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` - Response message for the ``ImportProductSets` method. + :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse` + Response message for the `ImportProductSets` method. This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method - in the returned - `google.longrunning.Operation.response - `__ field. + [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + method in the returned + [google.longrunning.Operation.response][google.longrunning.Operation.response] + field. """ # Create or coerce a protobuf request object. @@ -2703,10 +2694,9 @@ async def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. (progress) .. code-block:: python @@ -2741,11 +2731,11 @@ async def sample_purge_products(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.PurgeProductsRequest, dict]]): - The request object. Request message for the ``PurgeProducts`` method. + The request object. Request message for the `PurgeProducts` method. parent (:class:`str`): Required. The project and location in which the Products should be deleted. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py index 06a858596f86..089fd5f68bd3 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py @@ -117,20 +117,20 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): product search. It uses the following resource model: - The API has a collection of - `ProductSet `__ resources, - named ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. - - In parallel, + [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, + named `projects/*/locations/*/productSets/*`, which acts as a way + to put different products into groups to limit identification. In + parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + [Product][google.cloud.vision.v1p4beta1.Product] resources, named + `projects/*/locations/*/products/*` + + - Each [Product][google.cloud.vision.v1p4beta1.Product] has a + collection of + [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] + resources, named + `projects/*/locations/*/products/*/referenceImages/*` """ @staticmethod @@ -817,7 +817,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. .. code-block:: python @@ -847,11 +847,11 @@ def sample_create_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.CreateProductSetRequest, dict]): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the `CreateProductSet` method. parent (str): Required. The project in which the ProductSet should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -866,7 +866,7 @@ def sample_create_product_set(): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -954,7 +954,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. .. code-block:: python @@ -985,11 +985,11 @@ def sample_list_product_sets(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListProductSetsRequest, dict]): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the `ListProductSets` method. parent (str): Required. The project from which ProductSets should be listed. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1004,7 +1004,7 @@ def sample_list_product_sets(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductSetsPager: - Response message for the ``ListProductSets`` method. + Response message for the `ListProductSets` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1112,13 +1112,13 @@ def sample_get_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.GetProductSetRequest, dict]): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the `GetProductSet` method. name (str): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1234,7 +1234,7 @@ def sample_update_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.UpdateProductSetRequest, dict]): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the `UpdateProductSet` method. product_set (google.cloud.vision_v1p4beta1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. @@ -1243,10 +1243,10 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is ``display_name``. + to be updated. Valid mask path is `display_name`. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1360,13 +1360,13 @@ def sample_delete_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.DeleteProductSetRequest, dict]): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the `DeleteProductSet` method. name (str): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1440,10 +1440,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. * Returns INVALID_ARGUMENT if product_category is - missing or invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if description + is longer than 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. .. code-block:: python @@ -1473,12 +1472,12 @@ def sample_create_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.CreateProductRequest, dict]): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the `CreateProduct` method. parent (str): Required. The project in which the Product should be created. Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1493,7 +1492,7 @@ def sample_create_product(): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1607,13 +1606,13 @@ def sample_list_products(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListProductsRequest, dict]): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the `ListProducts` method. parent (str): Required. The project OR ProductSet from which Products should be listed. Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + `projects/PROJECT_ID/locations/LOC_ID` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1628,7 +1627,7 @@ def sample_list_products(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsPager: - Response message for the ``ListProducts`` method. + Response message for the `ListProducts` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1734,13 +1733,13 @@ def sample_get_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.GetProductRequest, dict]): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the `GetProduct` method. name (str): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1816,8 +1815,8 @@ def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated right now. + Only the `display_name`, `description`, and `labels` fields can + be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -1826,11 +1825,10 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * + is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in - update_mask. + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1859,7 +1857,7 @@ def sample_update_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.UpdateProductRequest, dict]): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the `UpdateProduct` method. product (google.cloud.vision_v1p4beta1.types.Product): Required. The Product resource which replaces the one on the server. @@ -1869,12 +1867,11 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include - ``product_labels``, ``display_name``, and - ``description``. + `product_labels`, `display_name`, and `description`. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1984,13 +1981,13 @@ def sample_delete_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.DeleteProductRequest, dict]): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the `DeleteProduct` method. name (str): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2061,12 +2058,11 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS - skipped. The system converts polygons into non-rotated - rectangles. + The `bounding_poly` field is optional. If `bounding_poly` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -2074,12 +2070,11 @@ def create_reference_image( Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. * - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the product + does not exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent product's + product_category is detected. * Returns INVALID_ARGUMENT if + bounding_poly contains more than 10 polygons. .. code-block:: python @@ -2113,13 +2108,13 @@ def sample_create_reference_image(): Args: request (Union[google.cloud.vision_v1p4beta1.types.CreateReferenceImageRequest, dict]): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the `CreateReferenceImage` method. parent (str): Required. Resource name of the product in which to create the reference image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2137,7 +2132,7 @@ def sample_create_reference_image(): added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2152,7 +2147,7 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -2251,13 +2246,13 @@ def sample_delete_reference_image(): Args: request (Union[google.cloud.vision_v1p4beta1.types.DeleteReferenceImageRequest, dict]): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the `DeleteReferenceImage` method. name (str): Required. The resource name of the reference image to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2330,7 +2325,7 @@ def list_reference_images( * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + or less than 1. .. code-block:: python @@ -2361,12 +2356,12 @@ def sample_list_reference_images(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListReferenceImagesRequest, dict]): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the `ListReferenceImages` method. parent (str): Required. Resource name of the product containing the reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2381,7 +2376,7 @@ def sample_list_reference_images(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListReferenceImagesPager: - Response message for the ``ListReferenceImages`` method. + Response message for the `ListReferenceImages` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2489,13 +2484,13 @@ def sample_get_reference_image(): Args: request (Union[google.cloud.vision_v1p4beta1.types.GetReferenceImageRequest, dict]): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the `GetReferenceImage` method. name (str): Required. The resource name of the ReferenceImage to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2510,7 +2505,7 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -2608,14 +2603,13 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the `AddProductToProductSet` method. name (str): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2625,7 +2619,7 @@ def sample_add_product_to_product_set(): to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2727,14 +2721,14 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the ``RemoveProductFromProductSet`` + The request object. Request message for the `RemoveProductFromProductSet` method. name (str): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2745,7 +2739,7 @@ def sample_remove_product_from_product_set(): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2856,14 +2850,14 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the ``ListProductsInProductSet`` + The request object. Request message for the `ListProductsInProductSet` method. name (str): Required. The ProductSet resource for which to retrieve Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2878,7 +2872,7 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the ``ListProductsInProductSet`` + Response message for the `ListProductsInProductSet` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2962,17 +2956,15 @@ def import_product_sets( r"""Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) ``Operation.response`` contains - ``ImportProductSetsResponse``. (results) + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. + (progress) `Operation.response` contains + `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. .. code-block:: python @@ -3006,11 +2998,11 @@ def sample_import_product_sets(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ImportProductSetsRequest, dict]): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the `ImportProductSets` method. parent (str): Required. The project in which the ProductSets should be imported. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3035,15 +3027,14 @@ def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` - Response message for the ``ImportProductSets` method. + :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse` + Response message for the `ImportProductSets` method. This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method - in the returned - `google.longrunning.Operation.response - `__ field. + [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + method in the returned + [google.longrunning.Operation.response][google.longrunning.Operation.response] + field. """ # Create or coerce a protobuf request object. @@ -3136,10 +3127,9 @@ def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. (progress) .. code-block:: python @@ -3174,11 +3164,11 @@ def sample_purge_products(): Args: request (Union[google.cloud.vision_v1p4beta1.types.PurgeProductsRequest, dict]): - The request object. Request message for the ``PurgeProducts`` method. + The request object. Request message for the `PurgeProducts` method. parent (str): Required. The project and location in which the Products should be deleted. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py index 81fb89775963..b4f1954e6fb9 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py @@ -116,20 +116,20 @@ class ProductSearchGrpcTransport(ProductSearchTransport): product search. It uses the following resource model: - The API has a collection of - `ProductSet `__ resources, - named ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. - - In parallel, + [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, + named `projects/*/locations/*/productSets/*`, which acts as a way + to put different products into groups to limit identification. In + parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` + [Product][google.cloud.vision.v1p4beta1.Product] resources, named + `projects/*/locations/*/products/*` - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - Each [Product][google.cloud.vision.v1p4beta1.Product] has a + collection of + [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] + resources, named + `projects/*/locations/*/products/*/referenceImages/*` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -371,7 +371,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -405,7 +405,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -536,10 +536,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. * Returns INVALID_ARGUMENT if product_category is - missing or invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if description + is longer than 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -634,8 +633,8 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated right now. + Only the `display_name`, `description`, and `labels` fields can + be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -644,11 +643,10 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * + is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in - update_mask. + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -710,12 +708,11 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS - skipped. The system converts polygons into non-rotated - rectangles. + The `bounding_poly` field is optional. If `bounding_poly` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -723,12 +720,11 @@ def create_reference_image( Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. * - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the product + does not exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent product's + product_category is detected. * Returns INVALID_ARGUMENT if + bounding_poly contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -798,7 +794,7 @@ def list_reference_images( * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -969,17 +965,15 @@ def import_product_sets( Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) ``Operation.response`` contains - ``ImportProductSetsResponse``. (results) + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. + (progress) `Operation.response` contains + `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. Returns: Callable[[~.ImportProductSetsRequest], @@ -1030,10 +1024,9 @@ def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py index c9549a1a24fb..b16bebce24cb 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py @@ -122,20 +122,20 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): product search. It uses the following resource model: - The API has a collection of - `ProductSet `__ resources, - named ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. - - In parallel, + [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, + named `projects/*/locations/*/productSets/*`, which acts as a way + to put different products into groups to limit identification. In + parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` + [Product][google.cloud.vision.v1p4beta1.Product] resources, named + `projects/*/locations/*/products/*` - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - Each [Product][google.cloud.vision.v1p4beta1.Product] has a + collection of + [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] + resources, named + `projects/*/locations/*/products/*/referenceImages/*` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -379,7 +379,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -413,7 +413,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -548,10 +548,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. * Returns INVALID_ARGUMENT if product_category is - missing or invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if description + is longer than 4096 characters. * Returns INVALID_ARGUMENT if + product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -648,8 +647,8 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated right now. + Only the `display_name`, `description`, and `labels` fields can + be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -658,11 +657,10 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * + is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in - update_mask. + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -726,12 +724,11 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, the system will try to detect regions of interest - in the image that are compatible with the product_category on - the parent product. If it is specified, detection is ALWAYS - skipped. The system converts polygons into non-rotated - rectangles. + The `bounding_poly` field is optional. If `bounding_poly` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -739,12 +736,11 @@ def create_reference_image( Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. * - Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the product + does not exist. * Returns INVALID_ARGUMENT if bounding_poly is + not provided, and nothing compatible with the parent product's + product_category is detected. * Returns INVALID_ARGUMENT if + bounding_poly contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -814,7 +810,7 @@ def list_reference_images( * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -988,17 +984,15 @@ def import_product_sets( Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) ``Operation.response`` contains - ``ImportProductSetsResponse``. (results) + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. + (progress) `Operation.response` contains + `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. Returns: Callable[[~.ImportProductSetsRequest], @@ -1050,10 +1044,9 @@ def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. + The [google.longrunning.Operation][google.longrunning.Operation] + API can be used to keep track of the progress and results of the + request. `Operation.metadata` contains `BatchOperationMetadata`. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py index b8e8a7fc1495..bce1319cc59d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py @@ -1010,20 +1010,20 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): product search. It uses the following resource model: - The API has a collection of - `ProductSet `__ resources, - named ``projects/*/locations/*/productSets/*``, which acts as a way - to put different products into groups to limit identification. - - In parallel, + [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, + named `projects/*/locations/*/productSets/*`, which acts as a way + to put different products into groups to limit identification. In + parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` + [Product][google.cloud.vision.v1p4beta1.Product] resources, named + `projects/*/locations/*/products/*` - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - Each [Product][google.cloud.vision.v1p4beta1.Product] has a + collection of + [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] + resources, named + `projects/*/locations/*/products/*/referenceImages/*` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -1171,8 +1171,7 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the `AddProductToProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1286,7 +1285,7 @@ def __call__( Args: request (~.product_search_service.CreateProductRequest): - The request object. Request message for the ``CreateProduct`` method. + The request object. Request message for the `CreateProduct` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1436,7 +1435,7 @@ def __call__( Args: request (~.product_search_service.CreateProductSetRequest): - The request object. Request message for the ``CreateProductSet`` method. + The request object. Request message for the `CreateProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1595,7 +1594,7 @@ def __call__( Args: request (~.product_search_service.CreateReferenceImageRequest): - The request object. Request message for the ``CreateReferenceImage`` method. + The request object. Request message for the `CreateReferenceImage` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1606,7 +1605,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -1750,7 +1749,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductRequest): - The request object. Request message for the ``DeleteProduct`` method. + The request object. Request message for the `DeleteProduct` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1856,7 +1855,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductSetRequest): - The request object. Request message for the ``DeleteProductSet`` method. + The request object. Request message for the `DeleteProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1964,7 +1963,7 @@ def __call__( Args: request (~.product_search_service.DeleteReferenceImageRequest): - The request object. Request message for the ``DeleteReferenceImage`` method. + The request object. Request message for the `DeleteReferenceImage` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2072,7 +2071,7 @@ def __call__( Args: request (~.product_search_service.GetProductRequest): - The request object. Request message for the ``GetProduct`` method. + The request object. Request message for the `GetProduct` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2220,7 +2219,7 @@ def __call__( Args: request (~.product_search_service.GetProductSetRequest): - The request object. Request message for the ``GetProductSet`` method. + The request object. Request message for the `GetProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2371,7 +2370,7 @@ def __call__( Args: request (~.product_search_service.GetReferenceImageRequest): - The request object. Request message for the ``GetReferenceImage`` method. + The request object. Request message for the `GetReferenceImage` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2382,7 +2381,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A ``ReferenceImage`` represents a product image and its + A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. """ @@ -2522,7 +2521,7 @@ def __call__( Args: request (~.product_search_service.ImportProductSetsRequest): - The request object. Request message for the ``ImportProductSets`` method. + The request object. Request message for the `ImportProductSets` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2674,7 +2673,7 @@ def __call__( Args: request (~.product_search_service.ListProductsRequest): - The request object. Request message for the ``ListProducts`` method. + The request object. Request message for the `ListProducts` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2685,7 +2684,7 @@ def __call__( Returns: ~.product_search_service.ListProductsResponse: - Response message for the ``ListProducts`` method. + Response message for the `ListProducts` method. """ http_options = ( @@ -2820,7 +2819,7 @@ def __call__( Args: request (~.product_search_service.ListProductSetsRequest): - The request object. Request message for the ``ListProductSets`` method. + The request object. Request message for the `ListProductSets` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2831,7 +2830,7 @@ def __call__( Returns: ~.product_search_service.ListProductSetsResponse: - Response message for the ``ListProductSets`` method. + Response message for the `ListProductSets` method. """ http_options = ( @@ -2970,7 +2969,7 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the ``ListProductsInProductSet`` + The request object. Request message for the `ListProductsInProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -2982,7 +2981,7 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the ``ListProductsInProductSet`` + Response message for the `ListProductsInProductSet` method. """ @@ -3125,7 +3124,7 @@ def __call__( Args: request (~.product_search_service.ListReferenceImagesRequest): - The request object. Request message for the ``ListReferenceImages`` method. + The request object. Request message for the `ListReferenceImages` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3136,7 +3135,7 @@ def __call__( Returns: ~.product_search_service.ListReferenceImagesResponse: - Response message for the ``ListReferenceImages`` method. + Response message for the `ListReferenceImages` method. """ http_options = ( @@ -3276,7 +3275,7 @@ def __call__( Args: request (~.product_search_service.PurgeProductsRequest): - The request object. Request message for the ``PurgeProducts`` method. + The request object. Request message for the `PurgeProducts` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3429,7 +3428,7 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the ``RemoveProductFromProductSet`` + The request object. Request message for the `RemoveProductFromProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -3546,7 +3545,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductRequest): - The request object. Request message for the ``UpdateProduct`` method. + The request object. Request message for the `UpdateProduct` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3696,7 +3695,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductSetRequest): - The request object. Request message for the ``UpdateProductSet`` method. + The request object. Request message for the `UpdateProductSet` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py index afb9200acc7d..3be3bbed59d1 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py @@ -35,9 +35,8 @@ class FaceRecognitionParams(proto.Message): Attributes: celebrity_set (MutableSequence[str]): The resource names for one or more - `CelebritySet - `__s. A - celebrity set is preloaded and can be specified as + [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]s. + A celebrity set is preloaded and can be specified as "builtin/default". If this is specified, the algorithm will try to match the faces detected in the input image to the Celebrities in the CelebritySets. @@ -55,7 +54,7 @@ class Celebrity(proto.Message): Attributes: name (str): The resource name of the preloaded Celebrity. Has the format - ``builtin/{mid}``. + `builtin/{mid}`. display_name (str): The Celebrity's display name. description (str): @@ -81,7 +80,7 @@ class FaceRecognitionResult(proto.Message): Attributes: celebrity (google.cloud.vision_v1p4beta1.types.Celebrity): - The `Celebrity `__ + The [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] that this face was matched to. confidence (float): Recognition confidence. Range [0, 1]. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py index e3d94030edb0..4eafc04a4630 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py @@ -107,20 +107,20 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the maximum number of results to return for that type. Multiple - ``Feature`` objects can be specified in the ``features`` list. + `Feature` objects can be specified in the `features` list. Attributes: type_ (google.cloud.vision_v1p4beta1.types.Feature.Type): The feature type. max_results (int): Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. + `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or + `CROP_HINTS`. model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) - and "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also support "builtin/weekly" for the + and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and + `TEXT_DETECTION` also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -142,11 +142,10 @@ class Type(proto.Enum): Run text detection / optical character recognition (OCR). Text detection is optimized for areas of text within a larger image; if the image is a document, use - ``DOCUMENT_TEXT_DETECTION`` instead. + `DOCUMENT_TEXT_DETECTION` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both - ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are - present. + `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -197,22 +196,20 @@ class ImageSource(proto.Message): Attributes: gcs_image_uri (str): - **Use ``image_uri`` instead.** + **Use `image_uri` instead.** The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See `Google Cloud Storage Request - URIs - `__ + `gs://bucket_name/object_name`. Object versioning is not + supported. See [Google Cloud Storage Request + URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is - not supported. See `Google Cloud Storage Request - URIs - `__ + `gs://bucket_name/object_name`. Object versioning is not + supported. See [Google Cloud Storage Request + URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching @@ -224,8 +221,8 @@ class ImageSource(proto.Message): prevention. You should not depend on externally-hosted images for production applications. - When both ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes precedence. + When both `gcs_image_uri` and `image_uri` are specified, + `image_uri` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -244,14 +241,14 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use a pure + Note: As with all `bytes` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p4beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided - for an image, ``content`` takes precedence and is used to - perform the image annotation request. + image URL. If both `content` and `source` are provided for + an image, `content` takes precedence and is used to perform + the image annotation request. """ content: bytes = proto.Field( @@ -276,14 +273,14 @@ class FaceAnnotation(proto.Message): box is computed to "frame" the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y coordinates may not be generated - in the ``BoundingPoly`` (the polygon will be unbounded) if + in the `BoundingPoly` (the polygon will be unbounded) if only a partial face appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the ``boundingPoly``, and encloses only the skin part of the - face. Typically, it is used to eliminate the face from any - image analysis that detects the "amount of skin" visible in - an image. It is not based on the landmarker results, only on + The `fd_bounding_poly` bounding polygon is tighter than the + `boundingPoly`, and encloses only the skin part of the face. + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p4beta1.types.FaceAnnotation.Landmark]): @@ -322,11 +319,12 @@ class FaceAnnotation(proto.Message): recognition_result (MutableSequence[google.cloud.vision_v1p4beta1.types.FaceRecognitionResult]): Additional recognition information. Only computed if image_context.face_recognition_params is provided, **and** a - match is found to a `Celebrity - `__ in the input - `CelebritySet - `__. This field - is sorted in order of decreasing confidence values. + match is found to a + [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] in the + input + [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]. + This field is sorted in order of decreasing confidence + values. """ class Landmark(proto.Message): @@ -343,7 +341,7 @@ class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the image without considering mirror projections typical of photos. So, - ``LEFT_EYE``, typically, is the person's right eye. + `LEFT_EYE`, typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -560,7 +558,7 @@ class LocationInfo(proto.Message): class Property(proto.Message): - r"""A ``Property`` consists of a user-supplied name/value pair. + r"""A `Property` consists of a user-supplied name/value pair. Attributes: name (str): @@ -591,18 +589,18 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): Opaque entity ID. Some IDs may be available in - `Google Knowledge Graph Search - API `__. + [Google Knowledge Graph Search + API](https://developers.google.com/knowledge-graph/). locale (str): The language code for the locale in which the entity textual - ``description`` is expressed. + `description` is expressed. description (str): - Entity textual description, expressed in its ``locale`` + Entity textual description, expressed in its `locale` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** + **Deprecated. Use `score` instead.** The accuracy of the entity detection in an image. For example, for an image in which the "Eiffel Tower" entity is detected, this field represents the confidence that there is @@ -616,16 +614,16 @@ class EntityAnnotation(proto.Message): in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): Image region to which this entity belongs. Not produced - for ``LABEL_DETECTION`` features. + for `LABEL_DETECTION` features. locations (MutableSequence[google.cloud.vision_v1p4beta1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may indicate the location of the scene in the - image, and another location may indicate the location of the - place where the image was taken. Location information is - usually present for landmarks. + `LocationInfo` elements can be present because one location + may indicate the location of the scene in the image, and + another location may indicate the location of the place + where the image was taken. Location information is usually + present for landmarks. properties (MutableSequence[google.cloud.vision_v1p4beta1.types.Property]): - Some entities may have optional user-supplied ``Property`` + Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity. """ @@ -683,7 +681,7 @@ class LocalizedObjectAnnotation(proto.Message): more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` language. + Object name, expressed in its `language_code` language. score (float): Score of the result. Range [0, 1]. bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): @@ -771,7 +769,7 @@ class SafeSearchAnnotation(proto.Message): class LatLongRect(proto.Message): - r"""Rectangle determined by min and max ``LatLng`` pairs. + r"""Rectangle determined by min and max `LatLng` pairs. Attributes: min_lat_lng (google.type.latlng_pb2.LatLng): @@ -970,13 +968,13 @@ class ImageContext(proto.Message): List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In + Latin alphabet, setting `language_hints` is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the - specified languages is not one of the `supported languages - `__. + specified languages is not one of the [supported + languages](https://cloud.google.com/vision/docs/languages). crop_hints_params (google.cloud.vision_v1p4beta1.types.CropHintsParams): Parameters for crop hints annotation request. face_recognition_params (google.cloud.vision_v1p4beta1.types.FaceRecognitionParams): @@ -1128,7 +1126,7 @@ class AnnotateImageResponse(proto.Message): error (google.rpc.status_pb2.Status): If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be - correct, even when ``error`` is set. + correct, even when `error` is set. context (google.cloud.vision_v1p4beta1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1305,13 +1303,13 @@ class AnnotateFileResponse(proto.Message): response is generated. responses (MutableSequence[google.cloud.vision_v1p4beta1.types.AnnotateImageResponse]): Individual responses to images found within the file. This - field will be empty if the ``error`` field is set. + field will be empty if the `error` field is set. total_pages (int): This field gives the total number of pages in the file. error (google.rpc.status_pb2.Status): If set, represents the error message for the failed request. - The ``responses`` field will not be set in this case. + The `responses` field will not be set in this case. """ input_config: "InputConfig" = proto.Field( @@ -1509,7 +1507,7 @@ class InputConfig(proto.Message): input from. content (bytes): File content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use a pure + Note: As with all `bytes` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. @@ -1551,9 +1549,9 @@ class OutputConfig(proto.Message): value is 20. For example, for one pdf file with 100 pages, 100 response - protos will be generated. If ``batch_size`` = 20, then 5 - json files each containing 20 response protos will be - written under the prefix ``gcs_destination``.``uri``. + protos will be generated. If `batch_size` = 20, then 5 json + files each containing 20 response protos will be written + under the prefix `gcs_destination`.`uri`. Currently, batch_size only applies to GcsDestination, with potential future support for other output configurations. @@ -1612,9 +1610,7 @@ class GcsDestination(proto.Message): output files will be created in gs://bucket-name/some/location/ and the names of the output files could be anything because there was no filename prefix - specified. - - If multiple outputs, each response is still + specified. If multiple outputs, each response is still AnnotateFileResponse, each of which contains some subset of the full list of AnnotateImageResponse. Multiple outputs can happen if, for example, the output JSON is too large and diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py index c438f2cc0fc1..8dcd8d292f5d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py @@ -41,12 +41,12 @@ class ProductSearchParams(proto.Message): system discretion will be applied. product_set (str): The resource name of a - `ProductSet `__ to - be searched for similar images. + [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] to be + searched for similar images. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -153,7 +153,7 @@ class ObjectAnnotation(proto.Message): more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): - Object name, expressed in its ``language_code`` language. + Object name, expressed in its `language_code` language. score (float): Score of the result. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py index 09fb49b729ff..5e7b437c5294 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py @@ -71,7 +71,7 @@ class Product(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is ignored when creating a product. display_name (str): @@ -162,7 +162,7 @@ class ProductSet(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. This field is ignored when creating a ProductSet. display_name (str): @@ -209,7 +209,7 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): - r"""A ``ReferenceImage`` represents a product image and its + r"""A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes. Attributes: @@ -218,13 +218,13 @@ class ReferenceImage(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. This field is ignored when creating a reference image. uri (str): Required. The Google Cloud Storage URI of the reference image. - The URI must start with ``gs://``. + The URI must start with `gs://`. bounding_polys (MutableSequence[google.cloud.vision_v1p4beta1.types.BoundingPoly]): Optional. Bounding polygons around the areas of interest in the reference image. If this @@ -255,14 +255,14 @@ class ReferenceImage(proto.Message): class CreateProductRequest(proto.Message): - r"""Request message for the ``CreateProduct`` method. + r"""Request message for the `CreateProduct` method. Attributes: parent (str): Required. The project in which the Product should be created. Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + `projects/PROJECT_ID/locations/LOC_ID`. product (google.cloud.vision_v1p4beta1.types.Product): Required. The product to create. product_id (str): @@ -270,7 +270,7 @@ class CreateProductRequest(proto.Message): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. """ parent: str = proto.Field( @@ -289,7 +289,7 @@ class CreateProductRequest(proto.Message): class ListProductsRequest(proto.Message): - r"""Request message for the ``ListProducts`` method. + r"""Request message for the `ListProducts` method. Attributes: parent (str): @@ -297,7 +297,7 @@ class ListProductsRequest(proto.Message): should be listed. Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + `projects/PROJECT_ID/locations/LOC_ID` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -321,7 +321,7 @@ class ListProductsRequest(proto.Message): class ListProductsResponse(proto.Message): - r"""Response message for the ``ListProducts`` method. + r"""Response message for the `ListProducts` method. Attributes: products (MutableSequence[google.cloud.vision_v1p4beta1.types.Product]): @@ -348,7 +348,7 @@ def raw_page(self): class GetProductRequest(proto.Message): - r"""Request message for the ``GetProduct`` method. + r"""Request message for the `GetProduct` method. Attributes: name (str): @@ -356,7 +356,7 @@ class GetProductRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` """ name: str = proto.Field( @@ -366,7 +366,7 @@ class GetProductRequest(proto.Message): class UpdateProductRequest(proto.Message): - r"""Request message for the ``UpdateProduct`` method. + r"""Request message for the `UpdateProduct` method. Attributes: product (google.cloud.vision_v1p4beta1.types.Product): @@ -374,12 +374,11 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include - ``product_labels``, ``display_name``, and - ``description``. + `product_labels`, `display_name`, and `description`. """ product: "Product" = proto.Field( @@ -395,7 +394,7 @@ class UpdateProductRequest(proto.Message): class DeleteProductRequest(proto.Message): - r"""Request message for the ``DeleteProduct`` method. + r"""Request message for the `DeleteProduct` method. Attributes: name (str): @@ -403,7 +402,7 @@ class DeleteProductRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` """ name: str = proto.Field( @@ -413,13 +412,13 @@ class DeleteProductRequest(proto.Message): class CreateProductSetRequest(proto.Message): - r"""Request message for the ``CreateProductSet`` method. + r"""Request message for the `CreateProductSet` method. Attributes: parent (str): Required. The project in which the ProductSet should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. product_set (google.cloud.vision_v1p4beta1.types.ProductSet): Required. The ProductSet to create. product_set_id (str): @@ -427,7 +426,7 @@ class CreateProductSetRequest(proto.Message): the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. """ parent: str = proto.Field( @@ -446,13 +445,13 @@ class CreateProductSetRequest(proto.Message): class ListProductSetsRequest(proto.Message): - r"""Request message for the ``ListProductSets`` method. + r"""Request message for the `ListProductSets` method. Attributes: parent (str): Required. The project from which ProductSets should be listed. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -476,7 +475,7 @@ class ListProductSetsRequest(proto.Message): class ListProductSetsResponse(proto.Message): - r"""Response message for the ``ListProductSets`` method. + r"""Response message for the `ListProductSets` method. Attributes: product_sets (MutableSequence[google.cloud.vision_v1p4beta1.types.ProductSet]): @@ -503,7 +502,7 @@ def raw_page(self): class GetProductSetRequest(proto.Message): - r"""Request message for the ``GetProductSet`` method. + r"""Request message for the `GetProductSet` method. Attributes: name (str): @@ -511,7 +510,7 @@ class GetProductSetRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` """ name: str = proto.Field( @@ -521,17 +520,17 @@ class GetProductSetRequest(proto.Message): class UpdateProductSetRequest(proto.Message): - r"""Request message for the ``UpdateProductSet`` method. + r"""Request message for the `UpdateProductSet` method. Attributes: product_set (google.cloud.vision_v1p4beta1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that + The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is ``display_name``. + to be updated. Valid mask path is `display_name`. """ product_set: "ProductSet" = proto.Field( @@ -547,7 +546,7 @@ class UpdateProductSetRequest(proto.Message): class DeleteProductSetRequest(proto.Message): - r"""Request message for the ``DeleteProductSet`` method. + r"""Request message for the `DeleteProductSet` method. Attributes: name (str): @@ -555,7 +554,7 @@ class DeleteProductSetRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` """ name: str = proto.Field( @@ -565,7 +564,7 @@ class DeleteProductSetRequest(proto.Message): class CreateReferenceImageRequest(proto.Message): - r"""Request message for the ``CreateReferenceImage`` method. + r"""Request message for the `CreateReferenceImage` method. Attributes: parent (str): @@ -573,7 +572,7 @@ class CreateReferenceImageRequest(proto.Message): create the reference image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. reference_image (google.cloud.vision_v1p4beta1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. @@ -582,7 +581,7 @@ class CreateReferenceImageRequest(proto.Message): added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. + characters long. It cannot contain the character `/`. """ parent: str = proto.Field( @@ -601,20 +600,20 @@ class CreateReferenceImageRequest(proto.Message): class ListReferenceImagesRequest(proto.Message): - r"""Request message for the ``ListReferenceImages`` method. + r"""Request message for the `ListReferenceImages` method. Attributes: parent (str): Required. Resource name of the product containing the reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value of ``nextPageToken`` returned in a previous + is the value of `nextPageToken` returned in a previous reference image list request. Defaults to the first page if not specified. @@ -635,7 +634,7 @@ class ListReferenceImagesRequest(proto.Message): class ListReferenceImagesResponse(proto.Message): - r"""Response message for the ``ListReferenceImages`` method. + r"""Response message for the `ListReferenceImages` method. Attributes: reference_images (MutableSequence[google.cloud.vision_v1p4beta1.types.ReferenceImage]): @@ -668,7 +667,7 @@ def raw_page(self): class GetReferenceImageRequest(proto.Message): - r"""Request message for the ``GetReferenceImage`` method. + r"""Request message for the `GetReferenceImage` method. Attributes: name (str): @@ -676,7 +675,7 @@ class GetReferenceImageRequest(proto.Message): get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. """ name: str = proto.Field( @@ -686,7 +685,7 @@ class GetReferenceImageRequest(proto.Message): class DeleteReferenceImageRequest(proto.Message): - r"""Request message for the ``DeleteReferenceImage`` method. + r"""Request message for the `DeleteReferenceImage` method. Attributes: name (str): @@ -694,7 +693,7 @@ class DeleteReferenceImageRequest(proto.Message): delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` """ name: str = proto.Field( @@ -704,8 +703,7 @@ class DeleteReferenceImageRequest(proto.Message): class AddProductToProductSetRequest(proto.Message): - r"""Request message for the ``AddProductToProductSet`` - method. + r"""Request message for the `AddProductToProductSet` method. Attributes: name (str): @@ -713,13 +711,13 @@ class AddProductToProductSetRequest(proto.Message): modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` product (str): Required. The resource name for the Product to be added to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` """ name: str = proto.Field( @@ -733,7 +731,7 @@ class AddProductToProductSetRequest(proto.Message): class RemoveProductFromProductSetRequest(proto.Message): - r"""Request message for the ``RemoveProductFromProductSet`` + r"""Request message for the `RemoveProductFromProductSet` method. Attributes: @@ -742,14 +740,14 @@ class RemoveProductFromProductSetRequest(proto.Message): modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` product (str): Required. The resource name for the Product to be removed from this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` """ name: str = proto.Field( @@ -763,7 +761,7 @@ class RemoveProductFromProductSetRequest(proto.Message): class ListProductsInProductSetRequest(proto.Message): - r"""Request message for the ``ListProductsInProductSet`` + r"""Request message for the `ListProductsInProductSet` method. Attributes: @@ -772,7 +770,7 @@ class ListProductsInProductSetRequest(proto.Message): Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -796,7 +794,7 @@ class ListProductsInProductSetRequest(proto.Message): class ListProductsInProductSetResponse(proto.Message): - r"""Response message for the ``ListProductsInProductSet`` + r"""Response message for the `ListProductsInProductSet` method. Attributes: @@ -831,7 +829,7 @@ class ImportProductSetsGcsSource(proto.Message): csv_file_uri (str): The Google Cloud Storage URI of the input csv file. - The URI must start with ``gs://``. + The URI must start with `gs://`. The format of the input csv file should be one image per line. In each line, there are 8 columns. @@ -845,57 +843,52 @@ class ImportProductSetsGcsSource(proto.Message): 7. labels 8. bounding-poly - The ``image-uri``, ``product-set-id``, ``product-id``, and - ``product-category`` columns are required. All other columns + The `image-uri`, `product-set-id`, `product-id`, and + `product-category` columns are required. All other columns are optional. - If the ``ProductSet`` or ``Product`` specified by the - ``product-set-id`` and ``product-id`` values does not exist, - then the system will create a new ``ProductSet`` or - ``Product`` for the image. In this case, the - ``product-display-name`` column refers to - `display_name - `__, the - ``product-category`` column refers to - `product_category - `__, - and the ``labels`` column refers to - `product_labels - `__. - - The ``image-id`` column is optional but must be unique if + If the `ProductSet` or `Product` specified by the + `product-set-id` and `product-id` values does not exist, + then the system will create a new `ProductSet` or `Product` + for the image. In this case, the `product-display-name` + column refers to + [display_name][google.cloud.vision.v1p4beta1.Product.display_name], + the `product-category` column refers to + [product_category][google.cloud.vision.v1p4beta1.Product.product_category], + and the `labels` column refers to + [product_labels][google.cloud.vision.v1p4beta1.Product.product_labels]. + + The `image-id` column is optional but must be unique if provided. If it is empty, the system will automatically assign a unique id to the image. - The ``product-display-name`` column is optional. If it is - empty, the system sets the `display_name - `__ + The `product-display-name` column is optional. If it is + empty, the system sets the + [display_name][google.cloud.vision.v1p4beta1.Product.display_name] field for the product to a space (" "). You can update the - ``display_name`` later by using the API. + `display_name` later by using the API. - If a ``Product`` with the specified ``product-id`` already - exists, then the system ignores the - ``product-display-name``, ``product-category``, and - ``labels`` columns. + If a `Product` with the specified `product-id` already + exists, then the system ignores the `product-display-name`, + `product-category`, and `labels` columns. - The ``labels`` column (optional) is a line containing a list + The `labels` column (optional) is a line containing a list of comma-separated key-value pairs, in the following format: "key_1=value_1,key_2=value_2,...,key_n=value_n" - The ``bounding-poly`` column (optional) identifies one - region of interest from the image in the same manner as - ``CreateReferenceImage``. If you do not specify the - ``bounding-poly`` column, then the system will try to detect + The `bounding-poly` column (optional) identifies one region + of interest from the image in the same manner as + `CreateReferenceImage`. If you do not specify the + `bounding-poly` column, then the system will try to detect regions of interest automatically. - At most one ``bounding-poly`` column is allowed per line. If + At most one `bounding-poly` column is allowed per line. If the image contains multiple regions of interest, add a line to the CSV file that includes the same product information, - and the ``bounding-poly`` values for each region of - interest. + and the `bounding-poly` values for each region of interest. - The ``bounding-poly`` column must contain an even number of + The `bounding-poly` column must contain an even number of comma-separated numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative integers for absolute bounding polygons, and float values in @@ -912,7 +905,7 @@ class ImportProductSetsGcsSource(proto.Message): class ImportProductSetsInputConfig(proto.Message): - r"""The input content for the ``ImportProductSets`` method. + r"""The input content for the `ImportProductSets` method. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -934,13 +927,13 @@ class ImportProductSetsInputConfig(proto.Message): class ImportProductSetsRequest(proto.Message): - r"""Request message for the ``ImportProductSets`` method. + r"""Request message for the `ImportProductSets` method. Attributes: parent (str): Required. The project in which the ProductSets should be imported. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. input_config (google.cloud.vision_v1p4beta1.types.ImportProductSetsInputConfig): Required. The input content for the list of requests. @@ -958,14 +951,13 @@ class ImportProductSetsRequest(proto.Message): class ImportProductSetsResponse(proto.Message): - r"""Response message for the ``ImportProductSets`` method. + r"""Response message for the `ImportProductSets` method. This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method in the - returned - `google.longrunning.Operation.response - `__ field. + [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + method in the returned + [google.longrunning.Operation.response][google.longrunning.Operation.response] + field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1p4beta1.types.ReferenceImage]): @@ -995,9 +987,9 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` - returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. + This is included in the `metadata` field of the `Operation` returned + by the `GetOperation` call of the `google::longrunning::Operations` + service. Attributes: state (google.cloud.vision_v1p4beta1.types.BatchOperationMetadata.State): @@ -1007,8 +999,8 @@ class BatchOperationMetadata(proto.Message): to the server. end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and - `google.longrunning.Operation.done - `__ is set to true. + [google.longrunning.Operation.done][google.longrunning.Operation.done] + is set to true. """ class State(proto.Enum): @@ -1074,7 +1066,7 @@ class ProductSetPurgeConfig(proto.Message): class PurgeProductsRequest(proto.Message): - r"""Request message for the ``PurgeProducts`` method. + r"""Request message for the `PurgeProducts` method. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -1097,7 +1089,7 @@ class PurgeProductsRequest(proto.Message): parent (str): Required. The project and location in which the Products should be deleted. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is `projects/PROJECT_ID/locations/LOC_ID`. force (bool): The default value is false. Override this value to true to actually perform the purge. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py index 72e783a672aa..27bab8965fc4 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py @@ -42,8 +42,7 @@ class TextAnnotation(proto.Message): Each structural component, starting from Page, may further have their own properties. Properties describe detected languages, breaks etc.. Please refer to the - `TextAnnotation.TextProperty - `__ + [TextAnnotation.TextProperty][google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty] message definition below for more detail. Attributes: @@ -98,8 +97,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or - ``LINE_BREAK``. + co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py index 3bfadec02406..f655f0e91986 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py @@ -159,7 +159,7 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or + The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ From d8a5811b9cb5276096b8dc5df853861caa63bd4b Mon Sep 17 00:00:00 2001 From: ohmayr Date: Fri, 16 Jan 2026 23:24:35 +0000 Subject: [PATCH 4/9] version 4 --- .../services/image_annotator/async_client.py | 41 +- .../services/image_annotator/client.py | 41 +- .../image_annotator/transports/grpc.py | 29 +- .../transports/grpc_asyncio.py | 29 +- .../services/product_search/async_client.py | 399 ++++++++++------- .../services/product_search/client.py | 399 ++++++++++------- .../product_search/transports/grpc.py | 181 ++++---- .../product_search/transports/grpc_asyncio.py | 181 ++++---- .../product_search/transports/rest.py | 81 ++-- .../cloud/vision_v1/types/image_annotator.py | 380 ++++++++++------- .../cloud/vision_v1/types/product_search.py | 18 +- .../vision_v1/types/product_search_service.py | 389 ++++++++++------- .../cloud/vision_v1/types/text_annotation.py | 26 +- .../cloud/vision_v1/types/web_detection.py | 8 +- .../vision_v1p1beta1/types/image_annotator.py | 214 ++++++---- .../vision_v1p1beta1/types/text_annotation.py | 26 +- .../vision_v1p1beta1/types/web_detection.py | 8 +- .../services/image_annotator/async_client.py | 22 +- .../services/image_annotator/client.py | 22 +- .../image_annotator/transports/grpc.py | 15 +- .../transports/grpc_asyncio.py | 15 +- .../vision_v1p2beta1/types/image_annotator.py | 283 ++++++++----- .../vision_v1p2beta1/types/text_annotation.py | 26 +- .../vision_v1p2beta1/types/web_detection.py | 8 +- .../services/image_annotator/async_client.py | 23 +- .../services/image_annotator/client.py | 23 +- .../image_annotator/transports/grpc.py | 16 +- .../transports/grpc_asyncio.py | 16 +- .../services/product_search/async_client.py | 342 +++++++++------ .../services/product_search/client.py | 342 +++++++++------ .../product_search/transports/grpc.py | 150 ++++--- .../product_search/transports/grpc_asyncio.py | 150 ++++--- .../product_search/transports/rest.py | 81 ++-- .../vision_v1p3beta1/types/image_annotator.py | 289 ++++++++----- .../vision_v1p3beta1/types/product_search.py | 18 +- .../types/product_search_service.py | 304 +++++++------ .../vision_v1p3beta1/types/text_annotation.py | 26 +- .../vision_v1p3beta1/types/web_detection.py | 8 +- .../services/image_annotator/async_client.py | 43 +- .../services/image_annotator/client.py | 43 +- .../image_annotator/transports/grpc.py | 29 +- .../transports/grpc_asyncio.py | 29 +- .../services/product_search/async_client.py | 400 +++++++++++------- .../services/product_search/client.py | 400 +++++++++++------- .../product_search/transports/grpc.py | 183 ++++---- .../product_search/transports/grpc_asyncio.py | 183 ++++---- .../product_search/transports/rest.py | 83 ++-- .../cloud/vision_v1p4beta1/types/face.py | 20 +- .../vision_v1p4beta1/types/image_annotator.py | 331 +++++++++------ .../vision_v1p4beta1/types/product_search.py | 17 +- .../types/product_search_service.py | 384 ++++++++++------- .../vision_v1p4beta1/types/text_annotation.py | 26 +- .../vision_v1p4beta1/types/web_detection.py | 8 +- 53 files changed, 4009 insertions(+), 2799 deletions(-) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py index b4652c015d0a..c48fdb628811 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py @@ -535,14 +535,17 @@ async def async_batch_annotate_images( ) -> operation_async.AsyncOperation: r"""Run asynchronous image detection and annotation for a list of images. + Progress and results can be retrieved through the - `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateImagesResponse` - (results). + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer + GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -604,9 +607,9 @@ async def sample_async_batch_annotate_images(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse` - Response to an async batch image annotation request. + The result type for the operation will be :class:``googl + e.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse + `` Response to an async batch image annotation request. """ # Create or coerce a protobuf request object. @@ -676,12 +679,16 @@ async def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + generic + files, such as PDF files, which may contain multiple pages and + multiple + images per page. Progress and results can be retrieved through + the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -736,9 +743,9 @@ async def sample_async_batch_annotate_files(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + The result type for the operation will be :class:``googl + e.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse` + ` Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py index a865cf669ede..e5ad6b9aa31d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py @@ -992,14 +992,17 @@ def async_batch_annotate_images( ) -> operation.Operation: r"""Run asynchronous image detection and annotation for a list of images. + Progress and results can be retrieved through the - `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateImagesResponse` - (results). + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer + GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -1061,9 +1064,9 @@ def sample_async_batch_annotate_images(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse` - Response to an async batch image annotation request. + The result type for the operation will be :class:``googl + e.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse + `` Response to an async batch image annotation request. """ # Create or coerce a protobuf request object. @@ -1132,12 +1135,16 @@ def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + generic + files, such as PDF files, which may contain multiple pages and + multiple + images per page. Progress and results can be retrieved through + the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -1192,9 +1199,9 @@ def sample_async_batch_annotate_files(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + The result type for the operation will be :class:``googl + e.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse` + ` Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py index 73df3786fa52..3dfc108fe6d4 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py @@ -419,14 +419,17 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. + Progress and results can be retrieved through the - `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateImagesResponse` - (results). + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer + GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -458,12 +461,16 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + generic + files, such as PDF files, which may contain multiple pages and + multiple + images per page. Progress and results can be retrieved through + the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py index eee3632a6203..952c5eb0cabb 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py @@ -428,14 +428,17 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. + Progress and results can be retrieved through the - `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateImagesResponse` - (results). + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer + GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -468,12 +471,16 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + generic + files, such as PDF files, which may contain multiple pages and + multiple + images per page. Progress and results can be retrieved through + the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py index bd7ad803a713..067e75e1d217 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py @@ -71,21 +71,23 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1.ProductSet] resources, named - `projects/*/locations/*/productSets/*`, which acts as a way to put - different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1.Product] has a collection of - [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, - named `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -335,7 +337,7 @@ async def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. .. code-block:: python @@ -365,11 +367,12 @@ async def sample_create_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.CreateProductSetRequest, dict]]): - The request object. Request message for the `CreateProductSet` method. + The request object. Request message for the ``CreateProductSet`` method. parent (:class:`str`): Required. The project in which the ProductSet should be created. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -381,10 +384,12 @@ async def sample_create_product_set(): should not be set. product_set_id (:class:`str`): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -475,7 +480,7 @@ async def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. .. code-block:: python @@ -506,11 +511,12 @@ async def sample_list_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListProductSetsRequest, dict]]): - The request object. Request message for the `ListProductSets` method. + The request object. Request message for the ``ListProductSets`` method. parent (:class:`str`): Required. The project from which ProductSets should be listed. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -525,7 +531,7 @@ async def sample_list_product_sets(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductSetsAsyncPager: - Response message for the `ListProductSets` method. + Response message for the ``ListProductSets`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -636,13 +642,13 @@ async def sample_get_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.GetProductSetRequest, dict]]): - The request object. Request message for the `GetProductSet` method. + The request object. Request message for the ``GetProductSet`` method. name (:class:`str`): Required. Resource name of the ProductSet to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -730,9 +736,10 @@ async def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. .. code-block:: python @@ -761,7 +768,7 @@ async def sample_update_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.UpdateProductSetRequest, dict]]): - The request object. Request message for the `UpdateProductSet` method. + The request object. Request message for the ``UpdateProductSet`` method. product_set (:class:`google.cloud.vision_v1.types.ProductSet`): Required. The ProductSet resource which replaces the one on the server. @@ -770,10 +777,12 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields to + update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is `display_name`. + to be updated. + Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -890,13 +899,13 @@ async def sample_delete_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.DeleteProductSetRequest, dict]]): - The request object. Request message for the `DeleteProductSet` method. + The request object. Request message for the ``DeleteProductSet`` method. name (:class:`str`): Required. Resource name of the ProductSet to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -973,9 +982,11 @@ async def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if description - is longer than 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. .. code-block:: python @@ -1005,12 +1016,13 @@ async def sample_create_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.CreateProductRequest, dict]]): - The request object. Request message for the `CreateProduct` method. + The request object. Request message for the ``CreateProduct`` method. parent (:class:`str`): Required. The project in which the Product should be created. + Format is - `projects/PROJECT_ID/locations/LOC_ID`. + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1022,10 +1034,12 @@ async def sample_create_product(): should not be set. product_id (:class:`str`): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1111,7 +1125,7 @@ async def list_products( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. .. code-block:: python @@ -1142,13 +1156,13 @@ async def sample_list_products(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListProductsRequest, dict]]): - The request object. Request message for the `ListProducts` method. + The request object. Request message for the ``ListProducts`` method. parent (:class:`str`): Required. The project OR ProductSet from which Products should be listed. - Format: - `projects/PROJECT_ID/locations/LOC_ID` + Format: + ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1163,7 +1177,7 @@ async def sample_list_products(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsAsyncPager: - Response message for the `ListProducts` method. + Response message for the ``ListProducts`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1272,13 +1286,13 @@ async def sample_get_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.GetProductRequest, dict]]): - The request object. Request message for the `GetProduct` method. + The request object. Request message for the ``GetProduct`` method. name (:class:`str`): Required. Resource name of the Product to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1357,20 +1371,24 @@ async def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the `display_name`, `description`, and `labels` fields can - be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated + right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until + the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in update_mask. + * Returns NOT_FOUND if the Product does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. .. code-block:: python @@ -1399,7 +1417,7 @@ async def sample_update_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.UpdateProductRequest, dict]]): - The request object. Request message for the `UpdateProduct` method. + The request object. Request message for the ``UpdateProduct`` method. product (:class:`google.cloud.vision_v1.types.Product`): Required. The Product resource which replaces the one on the server. @@ -1409,11 +1427,14 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields + to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask paths include - `product_labels`, `display_name`, and `description`. + to be updated. + Valid mask paths include ``product_labels``, + ``display_name``, and + ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1526,13 +1547,13 @@ async def sample_delete_product(): Args: request (Optional[Union[google.cloud.vision_v1.types.DeleteProductRequest, dict]]): - The request object. Request message for the `DeleteProduct` method. + The request object. Request message for the ``DeleteProduct`` method. name (:class:`str`): Required. Resource name of product to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1606,23 +1627,30 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The `bounding_poly` field is optional. If `bounding_poly` is not - specified, the system will try to detect regions of interest in - the image that are compatible with the product_category on the - parent product. If it is specified, detection is ALWAYS skipped. - The system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, + the system will try to detect regions of interest in the image + that are + compatible with the product_category on the parent product. If + it is + specified, detection is ALWAYS skipped. The system converts + polygons into + non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too + large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the product - does not exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent product's - product_category is detected. * Returns INVALID_ARGUMENT if - bounding_poly contains more than 10 polygons. + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. .. code-block:: python @@ -1656,13 +1684,15 @@ async def sample_create_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1.types.CreateReferenceImageRequest, dict]]): - The request object. Request message for the `CreateReferenceImage` method. + The request object. Request message for the ``CreateReferenceImage`` method. parent (:class:`str`): Required. Resource name of the product in which to - create the reference image. + create the reference + image. Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1677,10 +1707,13 @@ async def sample_create_reference_image(): should not be set. reference_image_id (:class:`str`): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + added. If set, + the server will attempt to use this value as the + resource id. If it is + already in use, an error is returned with code + ALREADY_EXISTS. Must be at + most 128 characters long. It cannot contain the + character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1695,8 +1728,9 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1797,13 +1831,14 @@ async def sample_delete_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1.types.DeleteReferenceImageRequest, dict]]): - The request object. Request message for the `DeleteReferenceImage` method. + The request object. Request message for the ``DeleteReferenceImage`` method. name (:class:`str`): Required. The resource name of the reference image to delete. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1877,9 +1912,9 @@ async def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not exist. + * Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. .. code-block:: python @@ -1910,12 +1945,14 @@ async def sample_list_reference_images(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListReferenceImagesRequest, dict]]): - The request object. Request message for the `ListReferenceImages` method. + The request object. Request message for the ``ListReferenceImages`` method. parent (:class:`str`): Required. Resource name of the product containing the reference images. + Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1930,7 +1967,7 @@ async def sample_list_reference_images(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListReferenceImagesAsyncPager: - Response message for the `ListReferenceImages` method. + Response message for the ``ListReferenceImages`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2041,13 +2078,14 @@ async def sample_get_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1.types.GetReferenceImageRequest, dict]]): - The request object. Request message for the `GetReferenceImage` method. + The request object. Request message for the ``GetReferenceImage`` method. name (:class:`str`): Required. The resource name of the ReferenceImage to get. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2062,8 +2100,9 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2128,14 +2167,15 @@ async def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already + present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + exist. .. code-block:: python @@ -2163,13 +2203,15 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the `AddProductToProductSet` method. + The request object. Request message for the ``AddProductToProductSet`` + method. name (:class:`str`): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2177,9 +2219,10 @@ async def sample_add_product_to_product_set(): product (:class:`str`): Required. The resource name for the Product to be added to this ProductSet. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2282,25 +2325,27 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the `RemoveProductFromProductSet` + The request object. Request message for the ``RemoveProductFromProductSet`` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): Required. The resource name for the Product to be - removed from this ProductSet. + removed from this + ProductSet. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2375,13 +2420,15 @@ async def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the + ProductSet does not exist, the products field of the response + will be + empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. .. code-block:: python @@ -2412,14 +2459,15 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the `ListProductsInProductSet` + The request object. Request message for the ``ListProductsInProductSet`` method. name (:class:`str`): Required. The ProductSet resource for which to retrieve Products. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2434,8 +2482,9 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the `ListProductsInProductSet` + Response message for the ``ListProductsInProductSet`` method. + Iterating over this object will yield results and resolve additional pages automatically. @@ -2517,17 +2566,22 @@ async def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified + product sets based on a list of image information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. - (progress) `Operation.response` contains - `ImportProductSetsResponse`. (results) + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. + Storage. + For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri `__. .. code-block:: python @@ -2561,11 +2615,12 @@ async def sample_import_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1.types.ImportProductSetsRequest, dict]]): - The request object. Request message for the `ImportProductSets` method. + The request object. Request message for the ``ImportProductSets`` method. parent (:class:`str`): Required. The project in which the ProductSets should be imported. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2589,14 +2644,16 @@ async def sample_import_product_sets(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1.types.ImportProductSetsResponse` - Response message for the `ImportProductSets` method. + The result type for the operation will be :class:``googl + e.cloud.vision_v1.types.ImportProductSetsResponse`` + Response message for the ``ImportProductSets`` method. This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + `google.longrunning.Operations.GetOperation + `__ method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] + `google.longrunning.Operation.response + `__ field. """ @@ -2671,31 +2728,42 @@ async def purge_products( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products + that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other + ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + after this + operation has completed. It is also recommended to not add any + of the + Products involved in the batch delete to a new ProductSet while + this + operation is running because those Products may still end up + deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. + Therefore, it is + recommended to keep the csv files used in ImportProductSets (if + that was + how you originally built the Product Set) before starting + PurgeProducts, in + case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. + and then + re-use the empty ProductSet to re-import new Products into the + empty + ProductSet, you must wait until the PurgeProducts operation has + finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -2730,11 +2798,12 @@ async def sample_purge_products(): Args: request (Optional[Union[google.cloud.vision_v1.types.PurgeProductsRequest, dict]]): - The request object. Request message for the `PurgeProducts` method. + The request object. Request message for the ``PurgeProducts`` method. parent (:class:`str`): Required. The project and location in which the Products should be deleted. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2752,15 +2821,17 @@ async def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:`google.protobuf.empty_pb2.Empty` A generic empty - message that you can re-use to avoid defining duplicated + :class:``google.protobuf.empty_pb2.Empty`` A generic + empty message that you can re-use to avoid defining + duplicated empty messages in your APIs. A typical example is to use - it as the request or the response type of an API method. - For instance: + it as the request + or the response type of an API method. For instance: - service Foo { - rpc Bar(google.protobuf.Empty) returns - (google.protobuf.Empty); } + service Foo { + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); + } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py index d8eb2977892c..1e664080a779 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py @@ -115,21 +115,23 @@ def get_transport_class( class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1.ProductSet] resources, named - `projects/*/locations/*/productSets/*`, which acts as a way to put - different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1.Product] has a collection of - [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, - named `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -816,7 +818,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. .. code-block:: python @@ -846,11 +848,12 @@ def sample_create_product_set(): Args: request (Union[google.cloud.vision_v1.types.CreateProductSetRequest, dict]): - The request object. Request message for the `CreateProductSet` method. + The request object. Request message for the ``CreateProductSet`` method. parent (str): Required. The project in which the ProductSet should be created. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -862,10 +865,12 @@ def sample_create_product_set(): should not be set. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -953,7 +958,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. .. code-block:: python @@ -984,11 +989,12 @@ def sample_list_product_sets(): Args: request (Union[google.cloud.vision_v1.types.ListProductSetsRequest, dict]): - The request object. Request message for the `ListProductSets` method. + The request object. Request message for the ``ListProductSets`` method. parent (str): Required. The project from which ProductSets should be listed. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1003,7 +1009,7 @@ def sample_list_product_sets(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductSetsPager: - Response message for the `ListProductSets` method. + Response message for the ``ListProductSets`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1111,13 +1117,13 @@ def sample_get_product_set(): Args: request (Union[google.cloud.vision_v1.types.GetProductSetRequest, dict]): - The request object. Request message for the `GetProductSet` method. + The request object. Request message for the ``GetProductSet`` method. name (str): Required. Resource name of the ProductSet to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1202,9 +1208,10 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. .. code-block:: python @@ -1233,7 +1240,7 @@ def sample_update_product_set(): Args: request (Union[google.cloud.vision_v1.types.UpdateProductSetRequest, dict]): - The request object. Request message for the `UpdateProductSet` method. + The request object. Request message for the ``UpdateProductSet`` method. product_set (google.cloud.vision_v1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. @@ -1242,10 +1249,12 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields to + update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is `display_name`. + to be updated. + Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1359,13 +1368,13 @@ def sample_delete_product_set(): Args: request (Union[google.cloud.vision_v1.types.DeleteProductSetRequest, dict]): - The request object. Request message for the `DeleteProductSet` method. + The request object. Request message for the ``DeleteProductSet`` method. name (str): Required. Resource name of the ProductSet to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1439,9 +1448,11 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if description - is longer than 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. .. code-block:: python @@ -1471,12 +1482,13 @@ def sample_create_product(): Args: request (Union[google.cloud.vision_v1.types.CreateProductRequest, dict]): - The request object. Request message for the `CreateProduct` method. + The request object. Request message for the ``CreateProduct`` method. parent (str): Required. The project in which the Product should be created. + Format is - `projects/PROJECT_ID/locations/LOC_ID`. + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1488,10 +1500,12 @@ def sample_create_product(): should not be set. product_id (str): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1574,7 +1588,7 @@ def list_products( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. .. code-block:: python @@ -1605,13 +1619,13 @@ def sample_list_products(): Args: request (Union[google.cloud.vision_v1.types.ListProductsRequest, dict]): - The request object. Request message for the `ListProducts` method. + The request object. Request message for the ``ListProducts`` method. parent (str): Required. The project OR ProductSet from which Products should be listed. - Format: - `projects/PROJECT_ID/locations/LOC_ID` + Format: + ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1626,7 +1640,7 @@ def sample_list_products(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsPager: - Response message for the `ListProducts` method. + Response message for the ``ListProducts`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1732,13 +1746,13 @@ def sample_get_product(): Args: request (Union[google.cloud.vision_v1.types.GetProductRequest, dict]): - The request object. Request message for the `GetProduct` method. + The request object. Request message for the ``GetProduct`` method. name (str): Required. Resource name of the Product to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1814,20 +1828,24 @@ def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the `display_name`, `description`, and `labels` fields can - be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated + right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until + the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in update_mask. + * Returns NOT_FOUND if the Product does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. .. code-block:: python @@ -1856,7 +1874,7 @@ def sample_update_product(): Args: request (Union[google.cloud.vision_v1.types.UpdateProductRequest, dict]): - The request object. Request message for the `UpdateProduct` method. + The request object. Request message for the ``UpdateProduct`` method. product (google.cloud.vision_v1.types.Product): Required. The Product resource which replaces the one on the server. @@ -1866,11 +1884,14 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields + to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask paths include - `product_labels`, `display_name`, and `description`. + to be updated. + Valid mask paths include ``product_labels``, + ``display_name``, and + ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1980,13 +2001,13 @@ def sample_delete_product(): Args: request (Union[google.cloud.vision_v1.types.DeleteProductRequest, dict]): - The request object. Request message for the `DeleteProduct` method. + The request object. Request message for the ``DeleteProduct`` method. name (str): Required. Resource name of product to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2057,23 +2078,30 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The `bounding_poly` field is optional. If `bounding_poly` is not - specified, the system will try to detect regions of interest in - the image that are compatible with the product_category on the - parent product. If it is specified, detection is ALWAYS skipped. - The system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, + the system will try to detect regions of interest in the image + that are + compatible with the product_category on the parent product. If + it is + specified, detection is ALWAYS skipped. The system converts + polygons into + non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too + large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the product - does not exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent product's - product_category is detected. * Returns INVALID_ARGUMENT if - bounding_poly contains more than 10 polygons. + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. .. code-block:: python @@ -2107,13 +2135,15 @@ def sample_create_reference_image(): Args: request (Union[google.cloud.vision_v1.types.CreateReferenceImageRequest, dict]): - The request object. Request message for the `CreateReferenceImage` method. + The request object. Request message for the ``CreateReferenceImage`` method. parent (str): Required. Resource name of the product in which to - create the reference image. + create the reference + image. Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2128,10 +2158,13 @@ def sample_create_reference_image(): should not be set. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + added. If set, + the server will attempt to use this value as the + resource id. If it is + already in use, an error is returned with code + ALREADY_EXISTS. Must be at + most 128 characters long. It cannot contain the + character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2146,8 +2179,9 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2245,13 +2279,14 @@ def sample_delete_reference_image(): Args: request (Union[google.cloud.vision_v1.types.DeleteReferenceImageRequest, dict]): - The request object. Request message for the `DeleteReferenceImage` method. + The request object. Request message for the ``DeleteReferenceImage`` method. name (str): Required. The resource name of the reference image to delete. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2322,9 +2357,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not exist. + * Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. .. code-block:: python @@ -2355,12 +2390,14 @@ def sample_list_reference_images(): Args: request (Union[google.cloud.vision_v1.types.ListReferenceImagesRequest, dict]): - The request object. Request message for the `ListReferenceImages` method. + The request object. Request message for the ``ListReferenceImages`` method. parent (str): Required. Resource name of the product containing the reference images. + Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2375,7 +2412,7 @@ def sample_list_reference_images(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListReferenceImagesPager: - Response message for the `ListReferenceImages` method. + Response message for the ``ListReferenceImages`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2483,13 +2520,14 @@ def sample_get_reference_image(): Args: request (Union[google.cloud.vision_v1.types.GetReferenceImageRequest, dict]): - The request object. Request message for the `GetReferenceImage` method. + The request object. Request message for the ``GetReferenceImage`` method. name (str): Required. The resource name of the ReferenceImage to get. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2504,8 +2542,9 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2567,14 +2606,15 @@ def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already + present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + exist. .. code-block:: python @@ -2602,13 +2642,15 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the `AddProductToProductSet` method. + The request object. Request message for the ``AddProductToProductSet`` + method. name (str): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2616,9 +2658,10 @@ def sample_add_product_to_product_set(): product (str): Required. The resource name for the Product to be added to this ProductSet. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2720,25 +2763,27 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the `RemoveProductFromProductSet` + The request object. Request message for the ``RemoveProductFromProductSet`` method. name (str): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): Required. The resource name for the Product to be - removed from this ProductSet. + removed from this + ProductSet. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2812,13 +2857,15 @@ def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the + ProductSet does not exist, the products field of the response + will be + empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. .. code-block:: python @@ -2849,14 +2896,15 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the `ListProductsInProductSet` + The request object. Request message for the ``ListProductsInProductSet`` method. name (str): Required. The ProductSet resource for which to retrieve Products. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2871,8 +2919,9 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the `ListProductsInProductSet` + Response message for the ``ListProductsInProductSet`` method. + Iterating over this object will yield results and resolve additional pages automatically. @@ -2953,17 +3002,22 @@ def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified + product sets based on a list of image information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. - (progress) `Operation.response` contains - `ImportProductSetsResponse`. (results) + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. + Storage. + For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri `__. .. code-block:: python @@ -2997,11 +3051,12 @@ def sample_import_product_sets(): Args: request (Union[google.cloud.vision_v1.types.ImportProductSetsRequest, dict]): - The request object. Request message for the `ImportProductSets` method. + The request object. Request message for the ``ImportProductSets`` method. parent (str): Required. The project in which the ProductSets should be imported. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3025,14 +3080,16 @@ def sample_import_product_sets(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1.types.ImportProductSetsResponse` - Response message for the `ImportProductSets` method. + The result type for the operation will be :class:``googl + e.cloud.vision_v1.types.ImportProductSetsResponse`` + Response message for the ``ImportProductSets`` method. This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + `google.longrunning.Operations.GetOperation + `__ method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] + `google.longrunning.Operation.response + `__ field. """ @@ -3104,31 +3161,42 @@ def purge_products( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products + that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other + ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + after this + operation has completed. It is also recommended to not add any + of the + Products involved in the batch delete to a new ProductSet while + this + operation is running because those Products may still end up + deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. + Therefore, it is + recommended to keep the csv files used in ImportProductSets (if + that was + how you originally built the Product Set) before starting + PurgeProducts, in + case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. + and then + re-use the empty ProductSet to re-import new Products into the + empty + ProductSet, you must wait until the PurgeProducts operation has + finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -3163,11 +3231,12 @@ def sample_purge_products(): Args: request (Union[google.cloud.vision_v1.types.PurgeProductsRequest, dict]): - The request object. Request message for the `PurgeProducts` method. + The request object. Request message for the ``PurgeProducts`` method. parent (str): Required. The project and location in which the Products should be deleted. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3185,15 +3254,17 @@ def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:`google.protobuf.empty_pb2.Empty` A generic empty - message that you can re-use to avoid defining duplicated + :class:``google.protobuf.empty_pb2.Empty`` A generic + empty message that you can re-use to avoid defining + duplicated empty messages in your APIs. A typical example is to use - it as the request or the response type of an API method. - For instance: + it as the request + or the response type of an API method. For instance: - service Foo { - rpc Bar(google.protobuf.Empty) returns - (google.protobuf.Empty); } + service Foo { + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); + } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py index 77c99961531e..4932df073b02 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py @@ -113,21 +113,23 @@ class ProductSearchGrpcTransport(ProductSearchTransport): """gRPC backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1.ProductSet] resources, named - `projects/*/locations/*/productSets/*`, which acts as a way to put - different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1.Product] has a collection of - [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, - named `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -369,7 +371,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -403,7 +405,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -469,9 +471,10 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -534,9 +537,11 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if description - is longer than 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. Returns: Callable[[~.CreateProductRequest], @@ -570,7 +575,7 @@ def list_products( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. Returns: Callable[[~.ListProductsRequest], @@ -631,20 +636,24 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the `display_name`, `description`, and `labels` fields can - be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated + right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until + the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in update_mask. + * Returns NOT_FOUND if the Product does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -706,23 +715,30 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The `bounding_poly` field is optional. If `bounding_poly` is not - specified, the system will try to detect regions of interest in - the image that are compatible with the product_category on the - parent product. If it is specified, detection is ALWAYS skipped. - The system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, + the system will try to detect regions of interest in the image + that are + compatible with the product_category on the parent product. If + it is + specified, detection is ALWAYS skipped. The system converts + polygons into + non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too + large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the product - does not exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent product's - product_category is detected. * Returns INVALID_ARGUMENT if - bounding_poly contains more than 10 polygons. + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -790,9 +806,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not exist. + * Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -854,14 +870,15 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already + present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -924,13 +941,15 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the + ProductSet does not exist, the products field of the response + will be + empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -961,17 +980,22 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified + product sets based on a list of image information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. - (progress) `Operation.response` contains - `ImportProductSetsResponse`. (results) + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. + Storage. + For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1000,31 +1024,42 @@ def purge_products( r"""Return a callable for the purge products method over gRPC. Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products + that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other + ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + after this + operation has completed. It is also recommended to not add any + of the + Products involved in the batch delete to a new ProductSet while + this + operation is running because those Products may still end up + deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. + Therefore, it is + recommended to keep the csv files used in ImportProductSets (if + that was + how you originally built the Product Set) before starting + PurgeProducts, in + case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. + and then + re-use the empty ProductSet to re-import new Products into the + empty + ProductSet, you must wait until the PurgeProducts operation has + finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py index 4d53f1bd1574..9661af3e2b08 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py @@ -119,21 +119,23 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): """gRPC AsyncIO backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1.ProductSet] resources, named - `projects/*/locations/*/productSets/*`, which acts as a way to put - different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1.Product] has a collection of - [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, - named `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -377,7 +379,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -411,7 +413,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -478,9 +480,10 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -546,9 +549,11 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if description - is longer than 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. Returns: Callable[[~.CreateProductRequest], @@ -582,7 +587,7 @@ def list_products( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. Returns: Callable[[~.ListProductsRequest], @@ -645,20 +650,24 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the `display_name`, `description`, and `labels` fields can - be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated + right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until + the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in update_mask. + * Returns NOT_FOUND if the Product does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -722,23 +731,30 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The `bounding_poly` field is optional. If `bounding_poly` is not - specified, the system will try to detect regions of interest in - the image that are compatible with the product_category on the - parent product. If it is specified, detection is ALWAYS skipped. - The system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, + the system will try to detect regions of interest in the image + that are + compatible with the product_category on the parent product. If + it is + specified, detection is ALWAYS skipped. The system converts + polygons into + non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too + large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the product - does not exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent product's - product_category is detected. * Returns INVALID_ARGUMENT if - bounding_poly contains more than 10 polygons. + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -806,9 +822,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not exist. + * Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -871,14 +887,15 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already + present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -942,13 +959,15 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the + ProductSet does not exist, the products field of the response + will be + empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -980,17 +999,22 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified + product sets based on a list of image information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. - (progress) `Operation.response` contains - `ImportProductSetsResponse`. (results) + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. + Storage. + For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1020,31 +1044,42 @@ def purge_products( r"""Return a callable for the purge products method over gRPC. Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products + that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other + ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + after this + operation has completed. It is also recommended to not add any + of the + Products involved in the batch delete to a new ProductSet while + this + operation is running because those Products may still end up + deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. + Therefore, it is + recommended to keep the csv files used in ImportProductSets (if + that was + how you originally built the Product Set) before starting + PurgeProducts, in + case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. + and then + re-use the empty ProductSet to re-import new Products into the + empty + ProductSet, you must wait until the PurgeProducts operation has + finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py index 9c3c9b783448..79d8b4f6ff62 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py @@ -1032,21 +1032,23 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): """REST backend synchronous transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1.ProductSet] resources, named - `projects/*/locations/*/productSets/*`, which acts as a way to put - different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1.Product] has a collection of - [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, - named `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -1213,7 +1215,8 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the `AddProductToProductSet` method. + The request object. Request message for the ``AddProductToProductSet`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1327,7 +1330,7 @@ def __call__( Args: request (~.product_search_service.CreateProductRequest): - The request object. Request message for the `CreateProduct` method. + The request object. Request message for the ``CreateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1477,7 +1480,7 @@ def __call__( Args: request (~.product_search_service.CreateProductSetRequest): - The request object. Request message for the `CreateProductSet` method. + The request object. Request message for the ``CreateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1636,7 +1639,7 @@ def __call__( Args: request (~.product_search_service.CreateReferenceImageRequest): - The request object. Request message for the `CreateReferenceImage` method. + The request object. Request message for the ``CreateReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1647,8 +1650,9 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ @@ -1791,7 +1795,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductRequest): - The request object. Request message for the `DeleteProduct` method. + The request object. Request message for the ``DeleteProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1897,7 +1901,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductSetRequest): - The request object. Request message for the `DeleteProductSet` method. + The request object. Request message for the ``DeleteProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2005,7 +2009,7 @@ def __call__( Args: request (~.product_search_service.DeleteReferenceImageRequest): - The request object. Request message for the `DeleteReferenceImage` method. + The request object. Request message for the ``DeleteReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2113,7 +2117,7 @@ def __call__( Args: request (~.product_search_service.GetProductRequest): - The request object. Request message for the `GetProduct` method. + The request object. Request message for the ``GetProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2261,7 +2265,7 @@ def __call__( Args: request (~.product_search_service.GetProductSetRequest): - The request object. Request message for the `GetProductSet` method. + The request object. Request message for the ``GetProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2412,7 +2416,7 @@ def __call__( Args: request (~.product_search_service.GetReferenceImageRequest): - The request object. Request message for the `GetReferenceImage` method. + The request object. Request message for the ``GetReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2423,8 +2427,9 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ @@ -2563,7 +2568,7 @@ def __call__( Args: request (~.product_search_service.ImportProductSetsRequest): - The request object. Request message for the `ImportProductSets` method. + The request object. Request message for the ``ImportProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2715,7 +2720,7 @@ def __call__( Args: request (~.product_search_service.ListProductsRequest): - The request object. Request message for the `ListProducts` method. + The request object. Request message for the ``ListProducts`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2726,7 +2731,7 @@ def __call__( Returns: ~.product_search_service.ListProductsResponse: - Response message for the `ListProducts` method. + Response message for the ``ListProducts`` method. """ http_options = ( @@ -2861,7 +2866,7 @@ def __call__( Args: request (~.product_search_service.ListProductSetsRequest): - The request object. Request message for the `ListProductSets` method. + The request object. Request message for the ``ListProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2872,7 +2877,7 @@ def __call__( Returns: ~.product_search_service.ListProductSetsResponse: - Response message for the `ListProductSets` method. + Response message for the ``ListProductSets`` method. """ http_options = ( @@ -3011,7 +3016,7 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the `ListProductsInProductSet` + The request object. Request message for the ``ListProductsInProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -3023,7 +3028,7 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the `ListProductsInProductSet` + Response message for the ``ListProductsInProductSet`` method. """ @@ -3166,7 +3171,7 @@ def __call__( Args: request (~.product_search_service.ListReferenceImagesRequest): - The request object. Request message for the `ListReferenceImages` method. + The request object. Request message for the ``ListReferenceImages`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3177,7 +3182,7 @@ def __call__( Returns: ~.product_search_service.ListReferenceImagesResponse: - Response message for the `ListReferenceImages` method. + Response message for the ``ListReferenceImages`` method. """ http_options = ( @@ -3317,7 +3322,7 @@ def __call__( Args: request (~.product_search_service.PurgeProductsRequest): - The request object. Request message for the `PurgeProducts` method. + The request object. Request message for the ``PurgeProducts`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3470,7 +3475,7 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the `RemoveProductFromProductSet` + The request object. Request message for the ``RemoveProductFromProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -3587,7 +3592,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductRequest): - The request object. Request message for the `UpdateProduct` method. + The request object. Request message for the ``UpdateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3737,7 +3742,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductSetRequest): - The request object. Request message for the `UpdateProductSet` method. + The request object. Request message for the ``UpdateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py index 7149b7a5292c..41eaf0847c9b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py @@ -101,22 +101,26 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the - maximum number of results to return for that type. Multiple - `Feature` objects can be specified in the `features` list. + maximum + number of results to return for that type. Multiple ``Feature`` + objects can + be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1.types.Feature.Type): The feature type. max_results (int): Maximum number of results of this type. Does not apply to - `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or - `CROP_HINTS`. + ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or + ``CROP_HINTS``. model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) - and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and - `TEXT_DETECTION` also support "builtin/weekly" for the - bleeding edge release updated weekly. + and + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also + support "builtin/weekly" for the bleeding edge release + updated weekly. """ class Type(proto.Enum): @@ -135,12 +139,14 @@ class Type(proto.Enum): Run label detection. TEXT_DETECTION (5): Run text detection / optical character recognition (OCR). - Text detection is optimized for areas of text within a - larger image; if the image is a document, use - `DOCUMENT_TEXT_DETECTION` instead. + Text detection + is optimized for areas of text within a larger image; if the + image is + a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both - `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. + ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are + present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -191,33 +197,41 @@ class ImageSource(proto.Message): Attributes: gcs_image_uri (str): - **Use `image_uri` instead.** + **Use ``image_uri`` instead.** The Google Cloud Storage URI of the form - `gs://bucket_name/object_name`. Object versioning is not - supported. See [Google Cloud Storage Request - URIs](https://cloud.google.com/storage/docs/reference-uris) - for more info. + ``gs://bucket_name/object_name``. Object versioning is not + supported. See + `Google Cloud Storage Request + URIs `__ for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - `gs://bucket_name/object_name`. Object versioning is not - supported. See [Google Cloud Storage Request - URIs](https://cloud.google.com/storage/docs/reference-uris) - for more info. + ``gs://bucket_name/object_name``. Object versioning is not + supported. See + `Google Cloud Storage Request + URIs `__ for more + info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from HTTP/HTTPS URLs, Google cannot guarantee - that the request will be completed. Your request may - fail if the specified host denies the request (e.g. - due to request throttling or DOS prevention), or if - Google throttles requests to the site for abuse - prevention. You should not depend on - externally-hosted images for production applications. - - When both `gcs_image_uri` and `image_uri` are specified, - `image_uri` takes precedence. + images from + HTTP/HTTPS URLs, Google cannot guarantee that the request + will be + completed. Your request may fail if the specified host + denies the + request (e.g. due to request throttling or DOS prevention), + or if Google + throttles requests to the site for abuse prevention. You + should not + depend on externally-hosted images for production + applications. + + When both ``gcs_image_uri`` and ``image_uri`` are specified, + ``image_uri`` takes + precedence. """ gcs_image_uri: str = proto.Field( @@ -236,18 +250,20 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all `bytes` fields, protobuffers use a pure - binary representation, whereas JSON representations use - base64. + Note: As with all ``bytes`` fields, protobuffers use a pure + binary + representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateImages - requests. It does not work for AsyncBatchAnnotateImages - requests. + requests. It does + not work for AsyncBatchAnnotateImages requests. source (google.cloud.vision_v1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both `content` and `source` are provided for - an image, `content` takes precedence and is used to perform - the image annotation request. + image + URL. If both ``content`` and ``source`` are provided for an + image, ``content`` + takes precedence and is used to perform the image annotation + request. """ content: bytes = proto.Field( @@ -268,35 +284,46 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale. The bounding - box is computed to "frame" the face in accordance with human - expectations. It is based on the landmarker results. Note - that one or more x and/or y coordinates may not be generated - in the `BoundingPoly` (the polygon will be unbounded) if - only a partial face appears in the image to be annotated. + bounding box + are in the original image's scale. + The bounding box is computed to "frame" the face in + accordance with human + expectations. It is based on the landmarker results. + Note that one or more x and/or y coordinates may not be + generated in the + ``BoundingPoly`` (the polygon will be unbounded) if only a + partial face + appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1.types.BoundingPoly): - The `fd_bounding_poly` bounding polygon is tighter than the - `boundingPoly`, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face - detection) prefix. + The ``fd_bounding_poly`` bounding polygon is tighter than + the + ``boundingPoly``, and encloses only the skin part of the + face. Typically, it + is used to eliminate the face from any image analysis that + detects the + "amount of skin" visible in an image. It is not based on the + landmarker results, only on the initial face detection, + hence + the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): - Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the face. - Range [-180,180]. + Roll angle, which indicates the amount of clockwise/anti- + clockwise rotation + of the face relative to the image vertical about the axis + perpendicular to + the face. Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. + the face is + pointing relative to the vertical plane perpendicular to the + image. Range + [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's horizontal - plane. Range [-180,180]. + that the face is + pointing relative to the image's horizontal plane. Range + [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -330,8 +357,10 @@ class Landmark(proto.Message): class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the - image without considering mirror projections typical of photos. So, - `LEFT_EYE`, typically, is the person's right eye. + image + without considering mirror projections typical of photos. So, + ``LEFT_EYE``, + typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -547,7 +576,7 @@ class LocationInfo(proto.Message): class Property(proto.Message): - r"""A `Property` consists of a user-supplied name/value pair. + r"""A ``Property`` consists of a user-supplied name/value pair. Attributes: name (str): @@ -578,43 +607,51 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): Opaque entity ID. Some IDs may be available in - [Google Knowledge Graph Search - API](https://developers.google.com/knowledge-graph/). + `Google Knowledge Graph Search + API `__. locale (str): The language code for the locale in which the entity textual - `description` is expressed. + ``description`` is expressed. description (str): - Entity textual description, expressed in its `locale` + Entity textual description, expressed in its ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use `score` instead.** - The accuracy of the entity detection in an image. For - example, for an image in which the "Eiffel Tower" entity is - detected, this field represents the confidence that there is - a tower in the query image. Range [0, 1]. + **Deprecated. Use ``score`` instead.** + The accuracy of the entity detection in an image. + For example, for an image in which the "Eiffel Tower" entity + is detected, + this field represents the confidence that there is a tower + in the query + image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower - in each image may be the same. Range [0, 1]. + the + image. For example, the relevancy of "tower" is likely + higher to an image + containing the detected "Eiffel Tower" than to an image + containing a + detected distant towering building, even though the + confidence that + there is a tower in each image may be the same. Range [0, + 1]. bounding_poly (google.cloud.vision_v1.types.BoundingPoly): Image region to which this entity belongs. Not produced - for `LABEL_DETECTION` features. + for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1.types.LocationInfo]): The location information for the detected entity. Multiple - `LocationInfo` elements can be present because one location - may indicate the location of the scene in the image, and - another location may indicate the location of the place - where the image was taken. Location information is usually - present for landmarks. + ``LocationInfo`` elements can be present because one + location may + indicate the location of the scene in the image, and another + location + may indicate the location of the place where the image was + taken. + Location information is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1.types.Property]): - Some entities may have optional user-supplied `Property` - (name/value) fields, such a score or string that qualifies - the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) + fields, such a score or string that qualifies the entity. """ mid: str = proto.Field( @@ -667,10 +704,12 @@ class LocalizedObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + more + information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. name (str): - Object name, expressed in its `language_code` language. + Object name, expressed in its ``language_code`` language. score (float): Score of the result. Range [0, 1]. bounding_poly (google.cloud.vision_v1.types.BoundingPoly): @@ -760,7 +799,7 @@ class SafeSearchAnnotation(proto.Message): class LatLongRect(proto.Message): - r"""Rectangle determined by min and max `LatLng` pairs. + r"""Rectangle determined by min and max ``LatLng`` pairs. Attributes: min_lat_lng (google.type.latlng_pb2.LatLng): @@ -926,21 +965,26 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and + DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + for + DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence + score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to further fine-tune OCR - behavior. Current valid values are: - - - `legacy_layout`: a heuristics layout detection algorithm, - which serves as an alternative to the current ML-based - layout detection algorithm. Customers can choose the best - suitable layout algorithm based on their situation. + behavior. + Current valid values are: + + - ``legacy_layout``: a heuristics layout detection + algorithm, which serves as an alternative to the current + ML-based layout detection algorithm. Customers can choose + the best suitable layout algorithm based on their + situation. """ enable_text_detection_confidence_score: bool = proto.Field( @@ -961,15 +1005,21 @@ class ImageContext(proto.Message): Not used. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting `language_hints` is not needed. In - rare cases, when the language of the text in the image is - known, setting a hint will help get better results (although - it will be a significant hindrance if the hint is wrong). - Text detection returns an error if one or more of the - specified languages is not one of the [supported - languages](https://cloud.google.com/vision/docs/languages). + an empty value + yields the best results since it enables automatic language + detection. For + languages based on the Latin alphabet, setting + ``language_hints`` is not + needed. In rare cases, when the language of the text in the + image is known, + setting a hint will help get better results (although it + will be a + significant hindrance if the hint is wrong). Text detection + returns an + error if one or more of the specified languages is not one + of the + `supported languages + `__. crop_hints_params (google.cloud.vision_v1.types.CropHintsParams): Parameters for crop hints annotation request. product_search_params (google.cloud.vision_v1.types.ProductSearchParams): @@ -1114,7 +1164,7 @@ class AnnotateImageResponse(proto.Message): error (google.rpc.status_pb2.Status): If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be - correct, even when `error` is set. + correct, even when ``error`` is set. context (google.cloud.vision_v1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1205,18 +1255,17 @@ class BatchAnnotateImagesRequest(proto.Message): parent (str): Optional. Target project and location to make a call. - Format: `projects/{project-id}/locations/{location-id}`. + Format: ``projects/{project-id}/locations/{location-id}``. If no parent is specified, a region will be chosen automatically. Supported location-ids: + ``us``: USA country only, + ``asia``: East asia areas, like Japan, Taiwan, + ``eu``: The European Union. - `us`: USA country only, - `asia`: East asia areas, like Japan, Taiwan, `eu`: - The European Union. - - Example: `projects/project-A/locations/eu`. + Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): Optional. The labels with user-defined metadata for the request. @@ -1324,13 +1373,15 @@ class AnnotateFileResponse(proto.Message): response is generated. responses (MutableSequence[google.cloud.vision_v1.types.AnnotateImageResponse]): Individual responses to images found within the file. This - field will be empty if the `error` field is set. + field will be + empty if the ``error`` field is set. total_pages (int): This field gives the total number of pages in the file. error (google.rpc.status_pb2.Status): If set, represents the error message for the failed request. - The `responses` field will not be set in this case. + The + ``responses`` field will not be set in this case. """ input_config: "InputConfig" = proto.Field( @@ -1367,18 +1418,17 @@ class BatchAnnotateFilesRequest(proto.Message): parent (str): Optional. Target project and location to make a call. - Format: `projects/{project-id}/locations/{location-id}`. + Format: ``projects/{project-id}/locations/{location-id}``. If no parent is specified, a region will be chosen automatically. Supported location-ids: + ``us``: USA country only, + ``asia``: East asia areas, like Japan, Taiwan, + ``eu``: The European Union. - `us`: USA country only, - `asia`: East asia areas, like Japan, Taiwan, `eu`: - The European Union. - - Example: `projects/project-A/locations/eu`. + Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): Optional. The labels with user-defined metadata for the request. @@ -1491,18 +1541,17 @@ class AsyncBatchAnnotateImagesRequest(proto.Message): parent (str): Optional. Target project and location to make a call. - Format: `projects/{project-id}/locations/{location-id}`. + Format: ``projects/{project-id}/locations/{location-id}``. If no parent is specified, a region will be chosen automatically. Supported location-ids: + ``us``: USA country only, + ``asia``: East asia areas, like Japan, Taiwan, + ``eu``: The European Union. - `us`: USA country only, - `asia`: East asia areas, like Japan, Taiwan, `eu`: - The European Union. - - Example: `projects/project-A/locations/eu`. + Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): Optional. The labels with user-defined metadata for the request. @@ -1562,18 +1611,17 @@ class AsyncBatchAnnotateFilesRequest(proto.Message): parent (str): Optional. Target project and location to make a call. - Format: `projects/{project-id}/locations/{location-id}`. + Format: ``projects/{project-id}/locations/{location-id}``. If no parent is specified, a region will be chosen automatically. Supported location-ids: + ``us``: USA country only, + ``asia``: East asia areas, like Japan, Taiwan, + ``eu``: The European Union. - `us`: USA country only, - `asia`: East asia areas, like Japan, Taiwan, `eu`: - The European Union. - - Example: `projects/project-A/locations/eu`. + Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): Optional. The labels with user-defined metadata for the request. @@ -1627,13 +1675,13 @@ class InputConfig(proto.Message): input from. content (bytes): File content, represented as a stream of bytes. - Note: As with all `bytes` fields, protobuffers use a pure - binary representation, whereas JSON representations use - base64. + Note: As with all ``bytes`` fields, protobuffers use a pure + binary + representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateFiles - requests. It does not work for AsyncBatchAnnotateFiles - requests. + requests. It does + not work for AsyncBatchAnnotateFiles requests. mime_type (str): The type of the file. Currently only "application/pdf", "image/tiff" and "image/gif" @@ -1664,17 +1712,21 @@ class OutputConfig(proto.Message): the output(s) to. batch_size (int): The max number of response protos to put into each output - JSON file on Google Cloud Storage. + JSON file on + Google Cloud Storage. The valid range is [1, 100]. If not specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response - protos will be generated. If `batch_size` = 20, then 5 json - files each containing 20 response protos will be written - under the prefix `gcs_destination`.`uri`. + protos will + be generated. If ``batch_size`` = 20, then 5 json files each + containing 20 response protos will be written under the + prefix + ``gcs_destination``.``uri``. Currently, batch_size only applies to GcsDestination, with - potential future support for other output configurations. + potential future + support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1712,29 +1764,35 @@ class GcsDestination(proto.Message): Attributes: uri (str): Google Cloud Storage URI prefix where the results will be - stored. Results will be in JSON format and preceded by its - corresponding input URI prefix. This field can either - represent a gcs file prefix or gcs directory. In either - case, the uri should be unique because in order to get all - of the output files, you will need to do a wildcard gcs - search on the uri prefix you provide. + stored. Results + will be in JSON format and preceded by its corresponding + input URI prefix. + This field can either represent a gcs file prefix or gcs + directory. In + either case, the uri should be unique because in order to + get all of the + output files, you will need to do a wildcard gcs search on + the uri prefix + you provide. Examples: * File Prefix: gs://bucket-name/here/filenameprefix The - output files will be created in gs://bucket-name/here/ and - the names of the output files will begin with - "filenameprefix". + output files will be created in gs://bucket-name/here/ and + the names of the output files will begin with + "filenameprefix". * Directory Prefix: gs://bucket-name/some/location/ The - output files will be created in - gs://bucket-name/some/location/ and the names of the output - files could be anything because there was no filename prefix - specified. If multiple outputs, each response is still - AnnotateFileResponse, each of which contains some subset of - the full list of AnnotateImageResponse. Multiple outputs can - happen if, for example, the output JSON is too large and - overflows into multiple sharded files. + output files will be created in gs://bucket- + name/some/location/ and the names of the output files + could be anything because there was no filename prefix + specified. If multiple outputs, each response is still + AnnotateFileResponse, each of which contains some subset + of the full list of AnnotateImageResponse. + + Multiple outputs can happen if, for example, the output JSON + is too large + and overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py index 180a03882578..5b41b74ea516 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py @@ -40,13 +40,13 @@ class ProductSearchParams(proto.Message): interest in the image. If it is not specified, system discretion will be applied. product_set (str): - The resource name of a - [ProductSet][google.cloud.vision.v1.ProductSet] to be - searched for similar images. + The resource name of a `ProductSet + `__ to + be searched for similar images. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_S + ET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -150,10 +150,12 @@ class ObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + more + information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. name (str): - Object name, expressed in its `language_code` language. + Object name, expressed in its ``language_code`` language. score (float): Score of the result. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py index bf02791d41c9..6049b4afe0a0 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py @@ -70,8 +70,8 @@ class Product(proto.Message): The resource name of the product. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + . This field is ignored when creating a product. display_name (str): @@ -91,20 +91,24 @@ class Product(proto.Message): not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1.types.Product.KeyValue]): Key-value pairs that can be attached to a product. At query - time, constraints can be specified based on the - product_labels. + time, + constraints can be specified based on the product_labels. Note that integer values can be provided as strings, e.g. - "1199". Only strings with integer values can match a - range-based restriction which is to be supported soon. + "1199". Only + strings with integer values can match a range-based + restriction which is + to be supported soon. Multiple values can be assigned to the same key. One product - may have up to 500 product_labels. + may have up to + 500 product_labels. Notice that the total number of distinct product_labels over - all products in one ProductSet cannot exceed 1M, otherwise - the product search pipeline will refuse to work for that - ProductSet. + all products + in one ProductSet cannot exceed 1M, otherwise the product + search pipeline + will refuse to work for that ProductSet. """ class KeyValue(proto.Message): @@ -162,8 +166,8 @@ class ProductSet(proto.Message): The resource name of the ProductSet. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_S + ET_ID``. This field is ignored when creating a ProductSet. display_name (str): @@ -210,22 +214,24 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): - r"""A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + r"""A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. Attributes: name (str): The resource name of the reference image. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/r + eferenceImages/IMAGE_ID``. This field is ignored when creating a reference image. uri (str): Required. The Google Cloud Storage URI of the reference image. - The URI must start with `gs://`. + + The URI must start with ``gs://``. bounding_polys (MutableSequence[google.cloud.vision_v1.types.BoundingPoly]): Optional. Bounding polygons around the areas of interest in the reference image. If this @@ -256,22 +262,25 @@ class ReferenceImage(proto.Message): class CreateProductRequest(proto.Message): - r"""Request message for the `CreateProduct` method. + r"""Request message for the ``CreateProduct`` method. Attributes: parent (str): Required. The project in which the Product should be created. + Format is - `projects/PROJECT_ID/locations/LOC_ID`. + ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1.types.Product): Required. The product to create. product_id (str): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -290,15 +299,15 @@ class CreateProductRequest(proto.Message): class ListProductsRequest(proto.Message): - r"""Request message for the `ListProducts` method. + r"""Request message for the ``ListProducts`` method. Attributes: parent (str): Required. The project OR ProductSet from which Products should be listed. - Format: - `projects/PROJECT_ID/locations/LOC_ID` + Format: + ``projects/PROJECT_ID/locations/LOC_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -322,7 +331,7 @@ class ListProductsRequest(proto.Message): class ListProductsResponse(proto.Message): - r"""Response message for the `ListProducts` method. + r"""Response message for the ``ListProducts`` method. Attributes: products (MutableSequence[google.cloud.vision_v1.types.Product]): @@ -349,15 +358,15 @@ def raw_page(self): class GetProductRequest(proto.Message): - r"""Request message for the `GetProduct` method. + r"""Request message for the ``GetProduct`` method. Attributes: name (str): Required. Resource name of the Product to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` """ name: str = proto.Field( @@ -367,7 +376,7 @@ class GetProductRequest(proto.Message): class UpdateProductRequest(proto.Message): - r"""Request message for the `UpdateProduct` method. + r"""Request message for the ``UpdateProduct`` method. Attributes: product (google.cloud.vision_v1.types.Product): @@ -375,11 +384,14 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields + to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask paths include - `product_labels`, `display_name`, and `description`. + to be updated. + Valid mask paths include ``product_labels``, + ``display_name``, and + ``description``. """ product: "Product" = proto.Field( @@ -395,15 +407,15 @@ class UpdateProductRequest(proto.Message): class DeleteProductRequest(proto.Message): - r"""Request message for the `DeleteProduct` method. + r"""Request message for the ``DeleteProduct`` method. Attributes: name (str): Required. Resource name of product to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` """ name: str = proto.Field( @@ -413,21 +425,24 @@ class DeleteProductRequest(proto.Message): class CreateProductSetRequest(proto.Message): - r"""Request message for the `CreateProductSet` method. + r"""Request message for the ``CreateProductSet`` method. Attributes: parent (str): Required. The project in which the ProductSet should be created. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. product_set (google.cloud.vision_v1.types.ProductSet): Required. The ProductSet to create. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -446,13 +461,14 @@ class CreateProductSetRequest(proto.Message): class ListProductSetsRequest(proto.Message): - r"""Request message for the `ListProductSets` method. + r"""Request message for the ``ListProductSets`` method. Attributes: parent (str): Required. The project from which ProductSets should be listed. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -476,7 +492,7 @@ class ListProductSetsRequest(proto.Message): class ListProductSetsResponse(proto.Message): - r"""Response message for the `ListProductSets` method. + r"""Response message for the ``ListProductSets`` method. Attributes: product_sets (MutableSequence[google.cloud.vision_v1.types.ProductSet]): @@ -503,15 +519,15 @@ def raw_page(self): class GetProductSetRequest(proto.Message): - r"""Request message for the `GetProductSet` method. + r"""Request message for the ``GetProductSet`` method. Attributes: name (str): Required. Resource name of the ProductSet to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` """ name: str = proto.Field( @@ -521,17 +537,19 @@ class GetProductSetRequest(proto.Message): class UpdateProductSetRequest(proto.Message): - r"""Request message for the `UpdateProductSet` method. + r"""Request message for the ``UpdateProductSet`` method. Attributes: product_set (google.cloud.vision_v1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields to + update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is `display_name`. + to be updated. + Valid mask path is ``display_name``. """ product_set: "ProductSet" = proto.Field( @@ -547,15 +565,15 @@ class UpdateProductSetRequest(proto.Message): class DeleteProductSetRequest(proto.Message): - r"""Request message for the `DeleteProductSet` method. + r"""Request message for the ``DeleteProductSet`` method. Attributes: name (str): Required. Resource name of the ProductSet to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` """ name: str = proto.Field( @@ -565,24 +583,29 @@ class DeleteProductSetRequest(proto.Message): class CreateReferenceImageRequest(proto.Message): - r"""Request message for the `CreateReferenceImage` method. + r"""Request message for the ``CreateReferenceImage`` method. Attributes: parent (str): Required. Resource name of the product in which to - create the reference image. + create the reference + image. Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. reference_image (google.cloud.vision_v1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + added. If set, + the server will attempt to use this value as the + resource id. If it is + already in use, an error is returned with code + ALREADY_EXISTS. Must be at + most 128 characters long. It cannot contain the + character ``/``. """ parent: str = proto.Field( @@ -601,21 +624,24 @@ class CreateReferenceImageRequest(proto.Message): class ListReferenceImagesRequest(proto.Message): - r"""Request message for the `ListReferenceImages` method. + r"""Request message for the ``ListReferenceImages`` method. Attributes: parent (str): Required. Resource name of the product containing the reference images. + Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value of `nextPageToken` returned in a previous - reference image list request. + is the value + of ``nextPageToken`` returned in a previous reference image + list request. Defaults to the first page if not specified. """ @@ -635,7 +661,7 @@ class ListReferenceImagesRequest(proto.Message): class ListReferenceImagesResponse(proto.Message): - r"""Response message for the `ListReferenceImages` method. + r"""Response message for the ``ListReferenceImages`` method. Attributes: reference_images (MutableSequence[google.cloud.vision_v1.types.ReferenceImage]): @@ -668,15 +694,16 @@ def raw_page(self): class GetReferenceImageRequest(proto.Message): - r"""Request message for the `GetReferenceImage` method. + r"""Request message for the ``GetReferenceImage`` method. Attributes: name (str): Required. The resource name of the ReferenceImage to get. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID``. """ name: str = proto.Field( @@ -686,15 +713,16 @@ class GetReferenceImageRequest(proto.Message): class DeleteReferenceImageRequest(proto.Message): - r"""Request message for the `DeleteReferenceImage` method. + r"""Request message for the ``DeleteReferenceImage`` method. Attributes: name (str): Required. The resource name of the reference image to delete. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID`` """ name: str = proto.Field( @@ -704,21 +732,24 @@ class DeleteReferenceImageRequest(proto.Message): class AddProductToProductSetRequest(proto.Message): - r"""Request message for the `AddProductToProductSet` method. + r"""Request message for the ``AddProductToProductSet`` + method. Attributes: name (str): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` product (str): Required. The resource name for the Product to be added to this ProductSet. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` """ name: str = proto.Field( @@ -732,23 +763,25 @@ class AddProductToProductSetRequest(proto.Message): class RemoveProductFromProductSetRequest(proto.Message): - r"""Request message for the `RemoveProductFromProductSet` + r"""Request message for the ``RemoveProductFromProductSet`` method. Attributes: name (str): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` product (str): Required. The resource name for the Product to be - removed from this ProductSet. + removed from this + ProductSet. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` """ name: str = proto.Field( @@ -762,16 +795,17 @@ class RemoveProductFromProductSetRequest(proto.Message): class ListProductsInProductSetRequest(proto.Message): - r"""Request message for the `ListProductsInProductSet` + r"""Request message for the ``ListProductsInProductSet`` method. Attributes: name (str): Required. The ProductSet resource for which to retrieve Products. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -795,7 +829,7 @@ class ListProductsInProductSetRequest(proto.Message): class ListProductsInProductSetResponse(proto.Message): - r"""Response message for the `ListProductsInProductSet` + r"""Response message for the ``ListProductsInProductSet`` method. Attributes: @@ -830,10 +864,11 @@ class ImportProductSetsGcsSource(proto.Message): csv_file_uri (str): The Google Cloud Storage URI of the input csv file. - The URI must start with `gs://`. + The URI must start with ``gs://``. The format of the input csv file should be one image per - line. In each line, there are 8 columns. + line. + In each line, there are 8 columns. 1. image-uri 2. image-id @@ -844,59 +879,78 @@ class ImportProductSetsGcsSource(proto.Message): 7. labels 8. bounding-poly - The `image-uri`, `product-set-id`, `product-id`, and - `product-category` columns are required. All other columns - are optional. - - If the `ProductSet` or `Product` specified by the - `product-set-id` and `product-id` values does not exist, - then the system will create a new `ProductSet` or `Product` - for the image. In this case, the `product-display-name` - column refers to - [display_name][google.cloud.vision.v1.Product.display_name], - the `product-category` column refers to - [product_category][google.cloud.vision.v1.Product.product_category], - and the `labels` column refers to - [product_labels][google.cloud.vision.v1.Product.product_labels]. - - The `image-id` column is optional but must be unique if - provided. If it is empty, the system will automatically - assign a unique id to the image. - - The `product-display-name` column is optional. If it is - empty, the system sets the - [display_name][google.cloud.vision.v1.Product.display_name] - field for the product to a space (" "). You can update the - `display_name` later by using the API. - - If a `Product` with the specified `product-id` already - exists, then the system ignores the `product-display-name`, - `product-category`, and `labels` columns. - - The `labels` column (optional) is a line containing a list - of comma-separated key-value pairs, in the following format: - - "key_1=value_1,key_2=value_2,...,key_n=value_n" - - The `bounding-poly` column (optional) identifies one region - of interest from the image in the same manner as - `CreateReferenceImage`. If you do not specify the - `bounding-poly` column, then the system will try to detect - regions of interest automatically. - - At most one `bounding-poly` column is allowed per line. If - the image contains multiple regions of interest, add a line - to the CSV file that includes the same product information, - and the `bounding-poly` values for each region of interest. - - The `bounding-poly` column must contain an even number of - comma-separated numbers, in the format - "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative - integers for absolute bounding polygons, and float values in - [0, 1] for normalized bounding polygons. + The ``image-uri``, ``product-set-id``, ``product-id``, and + ``product-category`` + columns are required. All other columns are optional. + + If the ``ProductSet`` or ``Product`` specified by the + ``product-set-id`` and + ``product-id`` values does not exist, then the system will + create a new + ``ProductSet`` or ``Product`` for the image. In this case, + the + ``product-display-name`` column refers to + `display_name + `__, the + ``product-category`` column refers to + `product_category + `__, and + the ``labels`` column refers to + `product_labels + `__. + + The ``image-id`` column is optional but must be unique if + provided. If it is + empty, the system will automatically assign a unique id to + the image. + + The ``product-display-name`` column is optional. If it is + empty, the system + sets the `display_name + `__ field + for the product to a space (" "). You can update the + ``display_name`` later + by using the API. + + If a ``Product`` with the specified ``product-id`` already + exists, then the + system ignores the ``product-display-name``, ``product- + category``, and ``labels`` + columns. + + The ``labels`` column (optional) is a line containing a list + of + comma-separated key-value pairs, in the following format: + + "key_1=value_1,key_2=value_2,...,key_n=value_n" + + The ``bounding-poly`` column (optional) identifies one + region of + interest from the image in the same manner as + ``CreateReferenceImage``. If + you do not specify the ``bounding-poly`` column, then the + system will try to + detect regions of interest automatically. + + At most one ``bounding-poly`` column is allowed per line. If + the image + contains multiple regions of interest, add a line to the CSV + file that + includes the same product information, and the ``bounding- + poly`` values for + each region of interest. + + The ``bounding-poly`` column must contain an even number of + comma-separated + numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". + Use + non-negative integers for absolute bounding polygons, and + float values + in [0, 1] for normalized bounding polygons. The system will resize the image if the image resolution is - too large to process (larger than 20MP). + too + large to process (larger than 20MP). """ csv_file_uri: str = proto.Field( @@ -906,7 +960,7 @@ class ImportProductSetsGcsSource(proto.Message): class ImportProductSetsInputConfig(proto.Message): - r"""The input content for the `ImportProductSets` method. + r"""The input content for the ``ImportProductSets`` method. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -928,13 +982,14 @@ class ImportProductSetsInputConfig(proto.Message): class ImportProductSetsRequest(proto.Message): - r"""Request message for the `ImportProductSets` method. + r"""Request message for the ``ImportProductSets`` method. Attributes: parent (str): Required. The project in which the ProductSets should be imported. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. input_config (google.cloud.vision_v1.types.ImportProductSetsInputConfig): Required. The input content for the list of requests. @@ -952,12 +1007,14 @@ class ImportProductSetsRequest(proto.Message): class ImportProductSetsResponse(proto.Message): - r"""Response message for the `ImportProductSets` method. + r"""Response message for the ``ImportProductSets`` method. This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + `google.longrunning.Operations.GetOperation + `__ method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] + `google.longrunning.Operation.response + `__ field. Attributes: @@ -965,12 +1022,14 @@ class ImportProductSetsResponse(proto.Message): The list of reference_images that are imported successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): The rpc status for each ImportProductSet request, including - both successes and errors. + both successes + and errors. The number of statuses here matches the number of lines in - the csv file, and statuses[i] stores the success or failure - status of processing the i-th line of the csv, starting from - line 0. + the csv file, + and statuses[i] stores the success or failure status of + processing the i-th + line of the csv, starting from line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -988,8 +1047,9 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the `metadata` field of the `Operation` returned - by the `GetOperation` call of the `google::longrunning::Operations` + This is included in the ``metadata`` field of the ``Operation`` + returned by the + ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: @@ -1000,8 +1060,9 @@ class BatchOperationMetadata(proto.Message): to the server. end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and - [google.longrunning.Operation.done][google.longrunning.Operation.done] - is set to true. + `google.longrunning.Operation.done + `__ is + set to true. """ class State(proto.Enum): @@ -1056,8 +1117,10 @@ class ProductSetPurgeConfig(proto.Message): Attributes: product_set_id (str): The ProductSet that contains the Products to delete. If a - Product is a member of product_set_id in addition to other - ProductSets, the Product will still be deleted. + Product is a + member of product_set_id in addition to other ProductSets, + the Product will + still be deleted. """ product_set_id: str = proto.Field( @@ -1067,7 +1130,7 @@ class ProductSetPurgeConfig(proto.Message): class PurgeProductsRequest(proto.Message): - r"""Request message for the `PurgeProducts` method. + r"""Request message for the ``PurgeProducts`` method. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -1084,13 +1147,15 @@ class PurgeProductsRequest(proto.Message): This field is a member of `oneof`_ ``target``. delete_orphan_products (bool): If delete_orphan_products is true, all Products that are not - in any ProductSet will be deleted. + in any + ProductSet will be deleted. This field is a member of `oneof`_ ``target``. parent (str): Required. The project and location in which the Products should be deleted. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. force (bool): The default value is false. Override this value to true to actually perform the purge. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py index 478c39fbfac3..c17d406d9331 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py @@ -36,13 +36,16 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like this: - - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + text. + The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each structural component, starting from Page, may further have - their own properties. Properties describe detected languages, breaks - etc.. Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1.TextAnnotation.TextProperty] + their own + properties. Properties describe detected languages, breaks etc.. + Please refer + to the + `TextAnnotation.TextProperty + `__ message definition below for more detail. Attributes: @@ -58,8 +61,10 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + more + information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. confidence (float): Confidence of detected language. Range [0, 1]. """ @@ -96,8 +101,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not - co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. + End-line hyphen that is not present in text; does not co- + occur with + ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py index 2222bf23b8bb..c3a9939753c9 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py @@ -159,9 +159,11 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for `label`, such as "en-US" or - "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". + For more information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. """ label: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py index 60e1498a7e83..482746f4a670 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py @@ -88,9 +88,10 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""Users describe the type of Google Cloud Vision API tasks to perform - over images by using *Feature*s. Each Feature indicates a type of - image detection task to perform. Features encode the Cloud Vision - API vertical to operate on and the number of top-scoring results to + over + images by using *Feature*s. Each Feature indicates a type of image + detection task to perform. Features encode the Cloud Vision API + vertical to operate on and the number of top-scoring results to return. Attributes: @@ -101,9 +102,11 @@ class Feature(proto.Message): model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) - and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and - `TEXT_DETECTION` also support "builtin/weekly" for the - bleeding edge release updated weekly. + and + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also + support "builtin/weekly" for the bleeding edge release + updated weekly. """ class Type(proto.Enum): @@ -168,28 +171,29 @@ class ImageSource(proto.Message): Attributes: gcs_image_uri (str): - NOTE: For new code `image_uri` below is preferred. + NOTE: For new code ``image_uri`` below is preferred. Google Cloud Storage image URI, which must be in the following form: - - `gs://bucket_name/object_name` (for details, see [Google - Cloud Storage Request - URIs](https://cloud.google.com/storage/docs/reference-uris)). + ``gs://bucket_name/object_name`` (for details, see + `Google Cloud Storage Request + URIs `__). NOTE: Cloud Storage object versioning is not supported. image_uri (str): Image URI which supports: - 1) Google Cloud Storage image URI, which must be in the following form: - - `gs://bucket_name/object_name` (for details, see [Google - Cloud Storage Request - URIs](https://cloud.google.com/storage/docs/reference-uris)). - NOTE: Cloud Storage object versioning is not supported. 2) - Publicly accessible image HTTP/HTTPS URL. - This is preferred over the legacy `gcs_image_uri` above. - When both `gcs_image_uri` and `image_uri` are specified, - `image_uri` takes precedence. + ``gs://bucket_name/object_name`` (for details, see + `Google Cloud Storage Request + URIs `__). + NOTE: Cloud Storage object versioning is not supported. + 2) Publicly accessible image HTTP/HTTPS URL. + This is preferred over the legacy ``gcs_image_uri`` above. + When both + ``gcs_image_uri`` and ``image_uri`` are specified, + ``image_uri`` takes + precedence. """ gcs_image_uri: str = proto.Field( @@ -208,14 +212,15 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: as with all `bytes` fields, protobuffers use a pure - binary representation, whereas JSON representations use - base64. + Note: as with all ``bytes`` fields, protobuffers use a pure + binary + representation, whereas JSON representations use base64. source (google.cloud.vision_v1p1beta1.types.ImageSource): - Google Cloud Storage image location. If both `content` and - `source` are provided for an image, `content` takes - precedence and is used to perform the image annotation - request. + Google Cloud Storage image location. If both ``content`` and + ``source`` + are provided for an image, ``content`` takes precedence and + is + used to perform the image annotation request. """ content: bytes = proto.Field( @@ -236,36 +241,47 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale, as returned - in `ImageParams`. The bounding box is computed to "frame" - the face in accordance with human expectations. It is based - on the landmarker results. Note that one or more x and/or y - coordinates may not be generated in the `BoundingPoly` (the - polygon will be unbounded) if only a partial face appears in - the image to be annotated. + bounding box + are in the original image's scale, as returned in + ``ImageParams``. + The bounding box is computed to "frame" the face in + accordance with human + expectations. It is based on the landmarker results. + Note that one or more x and/or y coordinates may not be + generated in the + ``BoundingPoly`` (the polygon will be unbounded) if only a + partial face + appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The `fd_bounding_poly` bounding polygon is tighter than the - `boundingPoly`, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face - detection) prefix. + The ``fd_bounding_poly`` bounding polygon is tighter than + the + ``boundingPoly``, and encloses only the skin part of the + face. Typically, it + is used to eliminate the face from any image analysis that + detects the + "amount of skin" visible in an image. It is not based on the + landmarker results, only on the initial face detection, + hence + the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p1beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): - Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the face. - Range [-180,180]. + Roll angle, which indicates the amount of clockwise/anti- + clockwise rotation + of the face relative to the image vertical about the axis + perpendicular to + the face. Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. + the face is + pointing relative to the vertical plane perpendicular to the + image. Range + [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's horizontal - plane. Range [-180,180]. + that the face is + pointing relative to the image's horizontal plane. Range + [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -299,8 +315,10 @@ class Landmark(proto.Message): class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the - image without considering mirror projections typical of photos. So, - `LEFT_EYE`, typically, is the person's right eye. + image + without considering mirror projections typical of photos. So, + ``LEFT_EYE``, + typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -510,7 +528,7 @@ class LocationInfo(proto.Message): class Property(proto.Message): - r"""A `Property` consists of a user-supplied name/value pair. + r"""A ``Property`` consists of a user-supplied name/value pair. Attributes: name (str): @@ -541,42 +559,50 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): Opaque entity ID. Some IDs may be available in - [Google Knowledge Graph Search - API](https://developers.google.com/knowledge-graph/). + `Google Knowledge Graph Search + API `__. locale (str): The language code for the locale in which the entity textual - `description` is expressed. + ``description`` is expressed. description (str): - Entity textual description, expressed in its `locale` + Entity textual description, expressed in its ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): The accuracy of the entity detection in an image. For example, for an image in which the "Eiffel Tower" entity - is detected, this field represents the confidence that there - is a tower in the query image. Range [0, 1]. + is detected, + this field represents the confidence that there is a tower + in the query + image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower - in each image may be the same. Range [0, 1]. + the + image. For example, the relevancy of "tower" is likely + higher to an image + containing the detected "Eiffel Tower" than to an image + containing a + detected distant towering building, even though the + confidence that + there is a tower in each image may be the same. Range [0, + 1]. bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): Image region to which this entity belongs. Not produced - for `LABEL_DETECTION` features. + for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p1beta1.types.LocationInfo]): The location information for the detected entity. Multiple - `LocationInfo` elements can be present because one location - may indicate the location of the scene in the image, and - another location may indicate the location of the place - where the image was taken. Location information is usually - present for landmarks. + ``LocationInfo`` elements can be present because one + location may + indicate the location of the scene in the image, and another + location + may indicate the location of the place where the image was + taken. + Location information is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p1beta1.types.Property]): - Some entities may have optional user-supplied `Property` - (name/value) fields, such a score or string that qualifies - the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) + fields, such a score or string that qualifies the entity. """ mid: str = proto.Field( @@ -677,7 +703,7 @@ class SafeSearchAnnotation(proto.Message): class LatLongRect(proto.Message): - r"""Rectangle determined by min and max `LatLng` pairs. + r"""Rectangle determined by min and max ``LatLng`` pairs. Attributes: min_lat_lng (google.type.latlng_pb2.LatLng): @@ -766,8 +792,9 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): The bounding polygon for the crop region. The coordinates of - the bounding box are in the original image's scale, as - returned in `ImageParams`. + the bounding + box are in the original image's scale, as returned in + ``ImageParams``. confidence (float): Confidence of this being a salient region. Range [0, 1]. importance_fraction (float): @@ -844,13 +871,16 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and + DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + for + DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence + score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -875,15 +905,21 @@ class ImageContext(proto.Message): location of the image. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting `language_hints` is not needed. In - rare cases, when the language of the text in the image is - known, setting a hint will help get better results (although - it will be a significant hindrance if the hint is wrong). - Text detection returns an error if one or more of the - specified languages is not one of the [supported - languages](https://cloud.google.com/vision/docs/languages). + an empty value + yields the best results since it enables automatic language + detection. For + languages based on the Latin alphabet, setting + ``language_hints`` is not + needed. In rare cases, when the language of the text in the + image is known, + setting a hint will help get better results (although it + will be a + significant hindrance if the hint is wrong). Text detection + returns an + error if one or more of the specified languages is not one + of the + `supported languages + `__. crop_hints_params (google.cloud.vision_v1p1beta1.types.CropHintsParams): Parameters for crop hints annotation request. web_detection_params (google.cloud.vision_v1p1beta1.types.WebDetectionParams): @@ -989,7 +1025,7 @@ class AnnotateImageResponse(proto.Message): error (google.rpc.status_pb2.Status): If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be - correct, even when `error` is set. + correct, even when ``error`` is set. """ face_annotations: MutableSequence["FaceAnnotation"] = proto.RepeatedField( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py index 619bdbcc4ae3..d73be008bcc2 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py @@ -36,13 +36,16 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like this: - - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + text. + The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each structural component, starting from Page, may further have - their own properties. Properties describe detected languages, breaks - etc.. Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty] + their own + properties. Properties describe detected languages, breaks etc.. + Please refer + to the + `TextAnnotation.TextProperty + `__ message definition below for more detail. Attributes: @@ -58,8 +61,10 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + more + information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. confidence (float): Confidence of detected language. Range [0, 1]. """ @@ -96,8 +101,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not - co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. + End-line hyphen that is not present in text; does not co- + occur with + ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py index 3781c46da0a9..3c9ae6b96925 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py @@ -157,9 +157,11 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for `label`, such as "en-US" or - "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". + For more information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. """ label: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py index b0412a4141ed..43849cf42188 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py @@ -415,12 +415,15 @@ async def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Run async image detection and annotation for a list of generic - files (e.g. PDF) which may contain multiple pages and multiple - images per page. Progress and results can be retrieved through - the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + files (e.g. + PDF) which may contain multiple pages and multiple images per + page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -475,9 +478,10 @@ async def sample_async_batch_annotate_files(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + The result type for the operation will be :class:``googl + e.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesRe + sponse`` Response to an async batch file annotation + request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py index 5c1bae11817a..b52d45666249 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py @@ -833,12 +833,15 @@ def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Run async image detection and annotation for a list of generic - files (e.g. PDF) which may contain multiple pages and multiple - images per page. Progress and results can be retrieved through - the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + files (e.g. + PDF) which may contain multiple pages and multiple images per + page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -893,9 +896,10 @@ def sample_async_batch_annotate_files(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + The result type for the operation will be :class:``googl + e.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesRe + sponse`` Response to an async batch file annotation + request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py index 97f732ecbb93..d91ae084ae07 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py @@ -381,12 +381,15 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run async image detection and annotation for a list of generic - files (e.g. PDF) which may contain multiple pages and multiple - images per page. Progress and results can be retrieved through - the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + files (e.g. + PDF) which may contain multiple pages and multiple images per + page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py index 877279aaceb8..b630edcf3192 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py @@ -390,12 +390,15 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run async image detection and annotation for a list of generic - files (e.g. PDF) which may contain multiple pages and multiple - images per page. Progress and results can be retrieved through - the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + files (e.g. + PDF) which may contain multiple pages and multiple images per + page. + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py index def45e3dcf87..5bb183fff780 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py @@ -100,22 +100,26 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the - maximum number of results to return for that type. Multiple - `Feature` objects can be specified in the `features` list. + maximum + number of results to return for that type. Multiple ``Feature`` + objects can + be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p2beta1.types.Feature.Type): The feature type. max_results (int): Maximum number of results of this type. Does not apply to - `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or - `CROP_HINTS`. + ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or + ``CROP_HINTS``. model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) - and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and - `TEXT_DETECTION` also support "builtin/weekly" for the - bleeding edge release updated weekly. + and + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also + support "builtin/weekly" for the bleeding edge release + updated weekly. """ class Type(proto.Enum): @@ -134,12 +138,14 @@ class Type(proto.Enum): Run label detection. TEXT_DETECTION (5): Run text detection / optical character recognition (OCR). - Text detection is optimized for areas of text within a - larger image; if the image is a document, use - `DOCUMENT_TEXT_DETECTION` instead. + Text detection + is optimized for areas of text within a larger image; if the + image is + a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both - `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. + ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are + present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -184,33 +190,41 @@ class ImageSource(proto.Message): Attributes: gcs_image_uri (str): - **Use `image_uri` instead.** + **Use ``image_uri`` instead.** The Google Cloud Storage URI of the form - `gs://bucket_name/object_name`. Object versioning is not - supported. See [Google Cloud Storage Request - URIs](https://cloud.google.com/storage/docs/reference-uris) - for more info. + ``gs://bucket_name/object_name``. Object versioning is not + supported. See + `Google Cloud Storage Request + URIs `__ for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - `gs://bucket_name/object_name`. Object versioning is not - supported. See [Google Cloud Storage Request - URIs](https://cloud.google.com/storage/docs/reference-uris) - for more info. + ``gs://bucket_name/object_name``. Object versioning is not + supported. See + `Google Cloud Storage Request + URIs `__ for more + info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from HTTP/HTTPS URLs, Google cannot guarantee - that the request will be completed. Your request may - fail if the specified host denies the request (e.g. - due to request throttling or DOS prevention), or if - Google throttles requests to the site for abuse - prevention. You should not depend on - externally-hosted images for production applications. - - When both `gcs_image_uri` and `image_uri` are specified, - `image_uri` takes precedence. + images from + HTTP/HTTPS URLs, Google cannot guarantee that the request + will be + completed. Your request may fail if the specified host + denies the + request (e.g. due to request throttling or DOS prevention), + or if Google + throttles requests to the site for abuse prevention. You + should not + depend on externally-hosted images for production + applications. + + When both ``gcs_image_uri`` and ``image_uri`` are specified, + ``image_uri`` takes + precedence. """ gcs_image_uri: str = proto.Field( @@ -229,14 +243,16 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all `bytes` fields, protobuffers use a pure - binary representation, whereas JSON representations use - base64. + Note: As with all ``bytes`` fields, protobuffers use a pure + binary + representation, whereas JSON representations use base64. source (google.cloud.vision_v1p2beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both `content` and `source` are provided for - an image, `content` takes precedence and is used to perform - the image annotation request. + image + URL. If both ``content`` and ``source`` are provided for an + image, ``content`` + takes precedence and is used to perform the image annotation + request. """ content: bytes = proto.Field( @@ -257,36 +273,47 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale, as returned - in `ImageParams`. The bounding box is computed to "frame" - the face in accordance with human expectations. It is based - on the landmarker results. Note that one or more x and/or y - coordinates may not be generated in the `BoundingPoly` (the - polygon will be unbounded) if only a partial face appears in - the image to be annotated. + bounding box + are in the original image's scale, as returned in + ``ImageParams``. + The bounding box is computed to "frame" the face in + accordance with human + expectations. It is based on the landmarker results. + Note that one or more x and/or y coordinates may not be + generated in the + ``BoundingPoly`` (the polygon will be unbounded) if only a + partial face + appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The `fd_bounding_poly` bounding polygon is tighter than the - `boundingPoly`, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face - detection) prefix. + The ``fd_bounding_poly`` bounding polygon is tighter than + the + ``boundingPoly``, and encloses only the skin part of the + face. Typically, it + is used to eliminate the face from any image analysis that + detects the + "amount of skin" visible in an image. It is not based on the + landmarker results, only on the initial face detection, + hence + the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p2beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): - Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the face. - Range [-180,180]. + Roll angle, which indicates the amount of clockwise/anti- + clockwise rotation + of the face relative to the image vertical about the axis + perpendicular to + the face. Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. + the face is + pointing relative to the vertical plane perpendicular to the + image. Range + [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's horizontal - plane. Range [-180,180]. + that the face is + pointing relative to the image's horizontal plane. Range + [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -320,8 +347,10 @@ class Landmark(proto.Message): class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the - image without considering mirror projections typical of photos. So, - `LEFT_EYE`, typically, is the person's right eye. + image + without considering mirror projections typical of photos. So, + ``LEFT_EYE``, + typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -531,7 +560,7 @@ class LocationInfo(proto.Message): class Property(proto.Message): - r"""A `Property` consists of a user-supplied name/value pair. + r"""A ``Property`` consists of a user-supplied name/value pair. Attributes: name (str): @@ -562,43 +591,51 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): Opaque entity ID. Some IDs may be available in - [Google Knowledge Graph Search - API](https://developers.google.com/knowledge-graph/). + `Google Knowledge Graph Search + API `__. locale (str): The language code for the locale in which the entity textual - `description` is expressed. + ``description`` is expressed. description (str): - Entity textual description, expressed in its `locale` + Entity textual description, expressed in its ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use `score` instead.** - The accuracy of the entity detection in an image. For - example, for an image in which the "Eiffel Tower" entity is - detected, this field represents the confidence that there is - a tower in the query image. Range [0, 1]. + **Deprecated. Use ``score`` instead.** + The accuracy of the entity detection in an image. + For example, for an image in which the "Eiffel Tower" entity + is detected, + this field represents the confidence that there is a tower + in the query + image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower - in each image may be the same. Range [0, 1]. + the + image. For example, the relevancy of "tower" is likely + higher to an image + containing the detected "Eiffel Tower" than to an image + containing a + detected distant towering building, even though the + confidence that + there is a tower in each image may be the same. Range [0, + 1]. bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): Image region to which this entity belongs. Not produced - for `LABEL_DETECTION` features. + for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p2beta1.types.LocationInfo]): The location information for the detected entity. Multiple - `LocationInfo` elements can be present because one location - may indicate the location of the scene in the image, and - another location may indicate the location of the place - where the image was taken. Location information is usually - present for landmarks. + ``LocationInfo`` elements can be present because one + location may + indicate the location of the scene in the image, and another + location + may indicate the location of the place where the image was + taken. + Location information is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p2beta1.types.Property]): - Some entities may have optional user-supplied `Property` - (name/value) fields, such a score or string that qualifies - the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) + fields, such a score or string that qualifies the entity. """ mid: str = proto.Field( @@ -699,7 +736,7 @@ class SafeSearchAnnotation(proto.Message): class LatLongRect(proto.Message): - r"""Rectangle determined by min and max `LatLng` pairs. + r"""Rectangle determined by min and max ``LatLng`` pairs. Attributes: min_lat_lng (google.type.latlng_pb2.LatLng): @@ -788,8 +825,9 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): The bounding polygon for the crop region. The coordinates of - the bounding box are in the original image's scale, as - returned in `ImageParams`. + the bounding + box are in the original image's scale, as returned in + ``ImageParams``. confidence (float): Confidence of this being a salient region. Range [0, 1]. importance_fraction (float): @@ -866,13 +904,16 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and + DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + for + DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence + score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -896,15 +937,21 @@ class ImageContext(proto.Message): Not used. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting `language_hints` is not needed. In - rare cases, when the language of the text in the image is - known, setting a hint will help get better results (although - it will be a significant hindrance if the hint is wrong). - Text detection returns an error if one or more of the - specified languages is not one of the [supported - languages](https://cloud.google.com/vision/docs/languages). + an empty value + yields the best results since it enables automatic language + detection. For + languages based on the Latin alphabet, setting + ``language_hints`` is not + needed. In rare cases, when the language of the text in the + image is known, + setting a hint will help get better results (although it + will be a + significant hindrance if the hint is wrong). Text detection + returns an + error if one or more of the specified languages is not one + of the + `supported languages + `__. crop_hints_params (google.cloud.vision_v1p2beta1.types.CropHintsParams): Parameters for crop hints annotation request. web_detection_params (google.cloud.vision_v1p2beta1.types.WebDetectionParams): @@ -1034,7 +1081,7 @@ class AnnotateImageResponse(proto.Message): error (google.rpc.status_pb2.Status): If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be - correct, even when `error` is set. + correct, even when ``error`` is set. context (google.cloud.vision_v1p2beta1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1282,16 +1329,20 @@ class OutputConfig(proto.Message): the output(s) to. batch_size (int): The max number of response protos to put into each output - JSON file on GCS. The valid range is [1, 100]. If not - specified, the default value is 20. + JSON file on GCS. + The valid range is [1, 100]. If not specified, the default + value is 20. For example, for one pdf file with 100 pages, 100 response - protos will be generated. If `batch_size` = 20, then 5 json - files each containing 20 response protos will be written - under the prefix `gcs_destination`.`uri`. + protos will + be generated. If ``batch_size`` = 20, then 5 json files each + containing 20 response protos will be written under the + prefix + ``gcs_destination``.``uri``. Currently, batch_size only applies to GcsDestination, with - potential future support for other output configurations. + potential future + support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1329,21 +1380,23 @@ class GcsDestination(proto.Message): Attributes: uri (str): Google Cloud Storage URI where the results will be stored. - Results will be in JSON format and preceded by its - corresponding input URI. This field can either represent a - single file, or a prefix for multiple outputs. Prefixes must - end in a `/`. + Results will + be in JSON format and preceded by its corresponding input + URI. This field + can either represent a single file, or a prefix for multiple + outputs. + Prefixes must end in a ``/``. Examples: * File: gs://bucket-name/filename.json * Prefix: gs://bucket-name/prefix/here/ * File: gs://bucket-name/prefix/here If multiple outputs, - each response is still AnnotateFileResponse, each of which - contains some subset of the full list of - AnnotateImageResponse. Multiple outputs can happen if, for - example, the output JSON is too large and overflows into - multiple sharded files. + each response is still AnnotateFileResponse, each of which + contains some subset of the full list of + AnnotateImageResponse. Multiple outputs can happen if, for + example, the output JSON is too large and overflows into + multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py index b296bb77d260..6c85d7c74b78 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py @@ -36,13 +36,16 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like this: - - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + text. + The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each structural component, starting from Page, may further have - their own properties. Properties describe detected languages, breaks - etc.. Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty] + their own + properties. Properties describe detected languages, breaks etc.. + Please refer + to the + `TextAnnotation.TextProperty + `__ message definition below for more detail. Attributes: @@ -58,8 +61,10 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + more + information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. confidence (float): Confidence of detected language. Range [0, 1]. """ @@ -96,8 +101,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not - co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. + End-line hyphen that is not present in text; does not co- + occur with + ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py index a9a668ce4c0e..f795fd530621 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py @@ -157,9 +157,11 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for `label`, such as "en-US" or - "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". + For more information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. """ label: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py index 29494a610d27..ed5efba9c54d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py @@ -418,12 +418,16 @@ async def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + generic + files, such as PDF files, which may contain multiple pages and + multiple + images per page. Progress and results can be retrieved through + the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -478,9 +482,10 @@ async def sample_async_batch_annotate_files(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + The result type for the operation will be :class:``googl + e.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesRe + sponse`` Response to an async batch file annotation + request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py index 0b22287aba8b..27632daf92a7 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py @@ -878,12 +878,16 @@ def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + generic + files, such as PDF files, which may contain multiple pages and + multiple + images per page. Progress and results can be retrieved through + the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -938,9 +942,10 @@ def sample_async_batch_annotate_files(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + The result type for the operation will be :class:``googl + e.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesRe + sponse`` Response to an async batch file annotation + request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py index cf60e8833020..b1aded54bd79 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py @@ -381,12 +381,16 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + generic + files, such as PDF files, which may contain multiple pages and + multiple + images per page. Progress and results can be retrieved through + the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py index 28944f7f6d79..b80736018225 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py @@ -390,12 +390,16 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + generic + files, such as PDF files, which may contain multiple pages and + multiple + images per page. Progress and results can be retrieved through + the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py index 9426f40446e7..fb814125f020 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py @@ -69,23 +69,23 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, - named `projects/*/locations/*/productSets/*`, which acts as a way - to put different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p3beta1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p3beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] - resources, named - `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -335,7 +335,7 @@ async def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. .. code-block:: python @@ -365,11 +365,12 @@ async def sample_create_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.CreateProductSetRequest, dict]]): - The request object. Request message for the `CreateProductSet` method. + The request object. Request message for the ``CreateProductSet`` method. parent (:class:`str`): Required. The project in which the ProductSet should be created. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -381,10 +382,12 @@ async def sample_create_product_set(): should not be set. product_set_id (:class:`str`): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -475,7 +478,7 @@ async def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. .. code-block:: python @@ -506,11 +509,12 @@ async def sample_list_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListProductSetsRequest, dict]]): - The request object. Request message for the `ListProductSets` method. + The request object. Request message for the ``ListProductSets`` method. parent (:class:`str`): Required. The project from which ProductSets should be listed. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -525,7 +529,7 @@ async def sample_list_product_sets(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductSetsAsyncPager: - Response message for the `ListProductSets` method. + Response message for the ``ListProductSets`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -636,13 +640,13 @@ async def sample_get_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.GetProductSetRequest, dict]]): - The request object. Request message for the `GetProductSet` method. + The request object. Request message for the ``GetProductSet`` method. name (:class:`str`): Required. Resource name of the ProductSet to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -730,9 +734,10 @@ async def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. .. code-block:: python @@ -761,7 +766,7 @@ async def sample_update_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.UpdateProductSetRequest, dict]]): - The request object. Request message for the `UpdateProductSet` method. + The request object. Request message for the ``UpdateProductSet`` method. product_set (:class:`google.cloud.vision_v1p3beta1.types.ProductSet`): Required. The ProductSet resource which replaces the one on the server. @@ -770,10 +775,12 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields to + update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is `display_name`. + to be updated. + Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -860,7 +867,8 @@ async def delete_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Permanently deletes a ProductSet. All Products and - ReferenceImages in the ProductSet will be deleted. + ReferenceImages in the + ProductSet will be deleted. The actual image files are not deleted from Google Cloud Storage. @@ -894,13 +902,13 @@ async def sample_delete_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.DeleteProductSetRequest, dict]]): - The request object. Request message for the `DeleteProductSet` method. + The request object. Request message for the ``DeleteProductSet`` method. name (:class:`str`): Required. Resource name of the ProductSet to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -977,9 +985,11 @@ async def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if description - is longer than 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. .. code-block:: python @@ -1009,12 +1019,13 @@ async def sample_create_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.CreateProductRequest, dict]]): - The request object. Request message for the `CreateProduct` method. + The request object. Request message for the ``CreateProduct`` method. parent (:class:`str`): Required. The project in which the Product should be created. + Format is - `projects/PROJECT_ID/locations/LOC_ID`. + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1026,10 +1037,12 @@ async def sample_create_product(): should not be set. product_id (:class:`str`): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1115,7 +1128,7 @@ async def list_products( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. .. code-block:: python @@ -1146,13 +1159,13 @@ async def sample_list_products(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListProductsRequest, dict]]): - The request object. Request message for the `ListProducts` method. + The request object. Request message for the ``ListProducts`` method. parent (:class:`str`): Required. The project OR ProductSet from which Products should be listed. - Format: - `projects/PROJECT_ID/locations/LOC_ID` + Format: + ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1167,7 +1180,7 @@ async def sample_list_products(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsAsyncPager: - Response message for the `ListProducts` method. + Response message for the ``ListProducts`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1276,13 +1289,13 @@ async def sample_get_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.GetProductRequest, dict]]): - The request object. Request message for the `GetProduct` method. + The request object. Request message for the ``GetProduct`` method. name (:class:`str`): Required. Resource name of the Product to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1365,16 +1378,19 @@ async def update_product( now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until + the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in update_mask. + * Returns NOT_FOUND if the Product does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. .. code-block:: python @@ -1403,7 +1419,7 @@ async def sample_update_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.UpdateProductRequest, dict]]): - The request object. Request message for the `UpdateProduct` method. + The request object. Request message for the ``UpdateProduct`` method. product (:class:`google.cloud.vision_v1p3beta1.types.Product`): Required. The Product resource which replaces the one on the server. @@ -1413,11 +1429,14 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields + to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask paths include - `product_labels`, `display_name`, and `description`. + to be updated. + Valid mask paths include ``product_labels``, + ``display_name``, and + ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1501,8 +1520,10 @@ async def delete_product( r"""Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right - away, but search queries against ProductSets containing the - product may still work until all related caches are refreshed. + away, but + search queries against ProductSets containing the product may + still work + until all related caches are refreshed. Possible errors: @@ -1533,13 +1554,13 @@ async def sample_delete_product(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.DeleteProductRequest, dict]]): - The request object. Request message for the `DeleteProduct` method. + The request object. Request message for the ``DeleteProduct`` method. name (:class:`str`): Required. Resource name of product to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1613,23 +1634,30 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The `bounding_poly` field is optional. If `bounding_poly` is not - specified, the system will try to detect regions of interest in - the image that are compatible with the product_category on the - parent product. If it is specified, detection is ALWAYS skipped. - The system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, + the system will try to detect regions of interest in the image + that are + compatible with the product_category on the parent product. If + it is + specified, detection is ALWAYS skipped. The system converts + polygons into + non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too + large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the product - does not exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent product's - product_category is detected. * Returns INVALID_ARGUMENT if - bounding_poly contains more than 10 polygons. + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. .. code-block:: python @@ -1663,12 +1691,14 @@ async def sample_create_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.CreateReferenceImageRequest, dict]]): - The request object. Request message for the `CreateReferenceImage` method. + The request object. Request message for the ``CreateReferenceImage`` method. parent (:class:`str`): Required. Resource name of the product in which to create the reference image. + Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1683,10 +1713,13 @@ async def sample_create_reference_image(): should not be set. reference_image_id (:class:`str`): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + added. If set, + the server will attempt to use this value as the + resource id. If it is + already in use, an error is returned with code + ALREADY_EXISTS. Must be at + most 128 characters long. It cannot contain the + character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1701,8 +1734,9 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1772,8 +1806,10 @@ async def delete_reference_image( r"""Permanently deletes a reference image. The image metadata will be deleted right away, but search - queries against ProductSets containing the image may still work - until all related caches are refreshed. + queries + against ProductSets containing the image may still work until + all related + caches are refreshed. The actual image files are not deleted from Google Cloud Storage. @@ -1807,13 +1843,15 @@ async def sample_delete_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.DeleteReferenceImageRequest, dict]]): - The request object. Request message for the `DeleteReferenceImage` method. + The request object. Request message for the ``DeleteReferenceImage`` method. name (:class:`str`): Required. The resource name of the reference image to delete. + Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1887,9 +1925,9 @@ async def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not exist. + * Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. .. code-block:: python @@ -1920,12 +1958,14 @@ async def sample_list_reference_images(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListReferenceImagesRequest, dict]]): - The request object. Request message for the `ListReferenceImages` method. + The request object. Request message for the ``ListReferenceImages`` method. parent (:class:`str`): Required. Resource name of the product containing the reference images. + Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1940,7 +1980,7 @@ async def sample_list_reference_images(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListReferenceImagesAsyncPager: - Response message for the `ListReferenceImages` method. + Response message for the ``ListReferenceImages`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2051,13 +2091,15 @@ async def sample_get_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.GetReferenceImageRequest, dict]]): - The request object. Request message for the `GetReferenceImage` method. + The request object. Request message for the ``GetReferenceImage`` method. name (:class:`str`): Required. The resource name of the ReferenceImage to get. + Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2072,8 +2114,9 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2138,14 +2181,15 @@ async def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already + present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + exist. .. code-block:: python @@ -2173,13 +2217,15 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the `AddProductToProductSet` method. + The request object. Request message for the ``AddProductToProductSet`` + method. name (:class:`str`): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2187,9 +2233,10 @@ async def sample_add_product_to_product_set(): product (:class:`str`): Required. The resource name for the Product to be added to this ProductSet. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2269,7 +2316,7 @@ async def remove_product_from_product_set( Possible errors: * Returns NOT_FOUND If the Product is not found under the - ProductSet. + ProductSet. .. code-block:: python @@ -2297,14 +2344,15 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the `RemoveProductFromProductSet` + The request object. Request message for the ``RemoveProductFromProductSet`` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2312,9 +2360,10 @@ async def sample_remove_product_from_product_set(): product (:class:`str`): Required. The resource name for the Product to be removed from this ProductSet. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2389,13 +2438,15 @@ async def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the + ProductSet does not exist, the products field of the response + will be + empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. .. code-block:: python @@ -2426,14 +2477,15 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the `ListProductsInProductSet` + The request object. Request message for the ``ListProductsInProductSet`` method. name (:class:`str`): Required. The ProductSet resource for which to retrieve Products. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2448,8 +2500,9 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the `ListProductsInProductSet` + Response message for the ``ListProductsInProductSet`` method. + Iterating over this object will yield results and resolve additional pages automatically. @@ -2531,17 +2584,22 @@ async def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified + product sets based on a list of image information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. - (progress) `Operation.response` contains - `ImportProductSetsResponse`. (results) + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + Storage. + For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri `__. .. code-block:: python @@ -2575,11 +2633,12 @@ async def sample_import_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ImportProductSetsRequest, dict]]): - The request object. Request message for the `ImportProductSets` method. + The request object. Request message for the ``ImportProductSets`` method. parent (:class:`str`): Required. The project in which the ProductSets should be imported. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2603,14 +2662,17 @@ async def sample_import_product_sets(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse` - Response message for the `ImportProductSets` method. + The result type for the operation will be :class:``googl + e.cloud.vision_v1p3beta1.types.ImportProductSetsResponse + `` Response message for the ``ImportProductSets`` + method. This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + `google.longrunning.Operations.GetOperation + `__ method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] + `google.longrunning.Operation.response + `__ field. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py index 3814405d8c91..02783a09a3e7 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py @@ -113,23 +113,23 @@ def get_transport_class( class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, - named `projects/*/locations/*/productSets/*`, which acts as a way - to put different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p3beta1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p3beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] - resources, named - `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -816,7 +816,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. .. code-block:: python @@ -846,11 +846,12 @@ def sample_create_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.CreateProductSetRequest, dict]): - The request object. Request message for the `CreateProductSet` method. + The request object. Request message for the ``CreateProductSet`` method. parent (str): Required. The project in which the ProductSet should be created. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -862,10 +863,12 @@ def sample_create_product_set(): should not be set. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -953,7 +956,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. .. code-block:: python @@ -984,11 +987,12 @@ def sample_list_product_sets(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListProductSetsRequest, dict]): - The request object. Request message for the `ListProductSets` method. + The request object. Request message for the ``ListProductSets`` method. parent (str): Required. The project from which ProductSets should be listed. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1003,7 +1007,7 @@ def sample_list_product_sets(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductSetsPager: - Response message for the `ListProductSets` method. + Response message for the ``ListProductSets`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1111,13 +1115,13 @@ def sample_get_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.GetProductSetRequest, dict]): - The request object. Request message for the `GetProductSet` method. + The request object. Request message for the ``GetProductSet`` method. name (str): Required. Resource name of the ProductSet to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1202,9 +1206,10 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. .. code-block:: python @@ -1233,7 +1238,7 @@ def sample_update_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.UpdateProductSetRequest, dict]): - The request object. Request message for the `UpdateProductSet` method. + The request object. Request message for the ``UpdateProductSet`` method. product_set (google.cloud.vision_v1p3beta1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. @@ -1242,10 +1247,12 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields to + update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is `display_name`. + to be updated. + Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1329,7 +1336,8 @@ def delete_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Permanently deletes a ProductSet. All Products and - ReferenceImages in the ProductSet will be deleted. + ReferenceImages in the + ProductSet will be deleted. The actual image files are not deleted from Google Cloud Storage. @@ -1363,13 +1371,13 @@ def sample_delete_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.DeleteProductSetRequest, dict]): - The request object. Request message for the `DeleteProductSet` method. + The request object. Request message for the ``DeleteProductSet`` method. name (str): Required. Resource name of the ProductSet to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1443,9 +1451,11 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if description - is longer than 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. .. code-block:: python @@ -1475,12 +1485,13 @@ def sample_create_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.CreateProductRequest, dict]): - The request object. Request message for the `CreateProduct` method. + The request object. Request message for the ``CreateProduct`` method. parent (str): Required. The project in which the Product should be created. + Format is - `projects/PROJECT_ID/locations/LOC_ID`. + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1492,10 +1503,12 @@ def sample_create_product(): should not be set. product_id (str): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1578,7 +1591,7 @@ def list_products( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. .. code-block:: python @@ -1609,13 +1622,13 @@ def sample_list_products(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListProductsRequest, dict]): - The request object. Request message for the `ListProducts` method. + The request object. Request message for the ``ListProducts`` method. parent (str): Required. The project OR ProductSet from which Products should be listed. - Format: - `projects/PROJECT_ID/locations/LOC_ID` + Format: + ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1630,7 +1643,7 @@ def sample_list_products(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsPager: - Response message for the `ListProducts` method. + Response message for the ``ListProducts`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1736,13 +1749,13 @@ def sample_get_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.GetProductRequest, dict]): - The request object. Request message for the `GetProduct` method. + The request object. Request message for the ``GetProduct`` method. name (str): Required. Resource name of the Product to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1822,16 +1835,19 @@ def update_product( now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until + the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in update_mask. + * Returns NOT_FOUND if the Product does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. .. code-block:: python @@ -1860,7 +1876,7 @@ def sample_update_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.UpdateProductRequest, dict]): - The request object. Request message for the `UpdateProduct` method. + The request object. Request message for the ``UpdateProduct`` method. product (google.cloud.vision_v1p3beta1.types.Product): Required. The Product resource which replaces the one on the server. @@ -1870,11 +1886,14 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields + to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask paths include - `product_labels`, `display_name`, and `description`. + to be updated. + Valid mask paths include ``product_labels``, + ``display_name``, and + ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1955,8 +1974,10 @@ def delete_product( r"""Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right - away, but search queries against ProductSets containing the - product may still work until all related caches are refreshed. + away, but + search queries against ProductSets containing the product may + still work + until all related caches are refreshed. Possible errors: @@ -1987,13 +2008,13 @@ def sample_delete_product(): Args: request (Union[google.cloud.vision_v1p3beta1.types.DeleteProductRequest, dict]): - The request object. Request message for the `DeleteProduct` method. + The request object. Request message for the ``DeleteProduct`` method. name (str): Required. Resource name of product to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2064,23 +2085,30 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The `bounding_poly` field is optional. If `bounding_poly` is not - specified, the system will try to detect regions of interest in - the image that are compatible with the product_category on the - parent product. If it is specified, detection is ALWAYS skipped. - The system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, + the system will try to detect regions of interest in the image + that are + compatible with the product_category on the parent product. If + it is + specified, detection is ALWAYS skipped. The system converts + polygons into + non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too + large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the product - does not exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent product's - product_category is detected. * Returns INVALID_ARGUMENT if - bounding_poly contains more than 10 polygons. + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. .. code-block:: python @@ -2114,12 +2142,14 @@ def sample_create_reference_image(): Args: request (Union[google.cloud.vision_v1p3beta1.types.CreateReferenceImageRequest, dict]): - The request object. Request message for the `CreateReferenceImage` method. + The request object. Request message for the ``CreateReferenceImage`` method. parent (str): Required. Resource name of the product in which to create the reference image. + Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2134,10 +2164,13 @@ def sample_create_reference_image(): should not be set. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + added. If set, + the server will attempt to use this value as the + resource id. If it is + already in use, an error is returned with code + ALREADY_EXISTS. Must be at + most 128 characters long. It cannot contain the + character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2152,8 +2185,9 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2220,8 +2254,10 @@ def delete_reference_image( r"""Permanently deletes a reference image. The image metadata will be deleted right away, but search - queries against ProductSets containing the image may still work - until all related caches are refreshed. + queries + against ProductSets containing the image may still work until + all related + caches are refreshed. The actual image files are not deleted from Google Cloud Storage. @@ -2255,13 +2291,15 @@ def sample_delete_reference_image(): Args: request (Union[google.cloud.vision_v1p3beta1.types.DeleteReferenceImageRequest, dict]): - The request object. Request message for the `DeleteReferenceImage` method. + The request object. Request message for the ``DeleteReferenceImage`` method. name (str): Required. The resource name of the reference image to delete. + Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2332,9 +2370,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not exist. + * Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. .. code-block:: python @@ -2365,12 +2403,14 @@ def sample_list_reference_images(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListReferenceImagesRequest, dict]): - The request object. Request message for the `ListReferenceImages` method. + The request object. Request message for the ``ListReferenceImages`` method. parent (str): Required. Resource name of the product containing the reference images. + Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2385,7 +2425,7 @@ def sample_list_reference_images(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListReferenceImagesPager: - Response message for the `ListReferenceImages` method. + Response message for the ``ListReferenceImages`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2493,13 +2533,15 @@ def sample_get_reference_image(): Args: request (Union[google.cloud.vision_v1p3beta1.types.GetReferenceImageRequest, dict]): - The request object. Request message for the `GetReferenceImage` method. + The request object. Request message for the ``GetReferenceImage`` method. name (str): Required. The resource name of the ReferenceImage to get. + Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2514,8 +2556,9 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2577,14 +2620,15 @@ def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already + present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + exist. .. code-block:: python @@ -2612,13 +2656,15 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the `AddProductToProductSet` method. + The request object. Request message for the ``AddProductToProductSet`` + method. name (str): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2626,9 +2672,10 @@ def sample_add_product_to_product_set(): product (str): Required. The resource name for the Product to be added to this ProductSet. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2707,7 +2754,7 @@ def remove_product_from_product_set( Possible errors: * Returns NOT_FOUND If the Product is not found under the - ProductSet. + ProductSet. .. code-block:: python @@ -2735,14 +2782,15 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the `RemoveProductFromProductSet` + The request object. Request message for the ``RemoveProductFromProductSet`` method. name (str): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2750,9 +2798,10 @@ def sample_remove_product_from_product_set(): product (str): Required. The resource name for the Product to be removed from this ProductSet. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2826,13 +2875,15 @@ def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the + ProductSet does not exist, the products field of the response + will be + empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. .. code-block:: python @@ -2863,14 +2914,15 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the `ListProductsInProductSet` + The request object. Request message for the ``ListProductsInProductSet`` method. name (str): Required. The ProductSet resource for which to retrieve Products. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2885,8 +2937,9 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the `ListProductsInProductSet` + Response message for the ``ListProductsInProductSet`` method. + Iterating over this object will yield results and resolve additional pages automatically. @@ -2967,17 +3020,22 @@ def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified + product sets based on a list of image information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. - (progress) `Operation.response` contains - `ImportProductSetsResponse`. (results) + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + Storage. + For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri `__. .. code-block:: python @@ -3011,11 +3069,12 @@ def sample_import_product_sets(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ImportProductSetsRequest, dict]): - The request object. Request message for the `ImportProductSets` method. + The request object. Request message for the ``ImportProductSets`` method. parent (str): Required. The project in which the ProductSets should be imported. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3039,14 +3098,17 @@ def sample_import_product_sets(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse` - Response message for the `ImportProductSets` method. + The result type for the operation will be :class:``googl + e.cloud.vision_v1p3beta1.types.ImportProductSetsResponse + `` Response message for the ``ImportProductSets`` + method. This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + `google.longrunning.Operations.GetOperation + `__ method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] + `google.longrunning.Operation.response + `__ field. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py index 1ddfdd089913..179b91376414 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py @@ -113,23 +113,23 @@ class ProductSearchGrpcTransport(ProductSearchTransport): """gRPC backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, - named `projects/*/locations/*/productSets/*`, which acts as a way - to put different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p3beta1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p3beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] - resources, named - `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -371,7 +371,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -405,7 +405,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -471,9 +471,10 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -500,7 +501,8 @@ def delete_product_set( r"""Return a callable for the delete product set method over gRPC. Permanently deletes a ProductSet. All Products and - ReferenceImages in the ProductSet will be deleted. + ReferenceImages in the + ProductSet will be deleted. The actual image files are not deleted from Google Cloud Storage. @@ -540,9 +542,11 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if description - is longer than 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. Returns: Callable[[~.CreateProductRequest], @@ -576,7 +580,7 @@ def list_products( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. Returns: Callable[[~.ListProductsRequest], @@ -641,16 +645,19 @@ def update_product( now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until + the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in update_mask. + * Returns NOT_FOUND if the Product does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -679,8 +686,10 @@ def delete_product( Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right - away, but search queries against ProductSets containing the - product may still work until all related caches are refreshed. + away, but + search queries against ProductSets containing the product may + still work + until all related caches are refreshed. Possible errors: @@ -715,23 +724,30 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The `bounding_poly` field is optional. If `bounding_poly` is not - specified, the system will try to detect regions of interest in - the image that are compatible with the product_category on the - parent product. If it is specified, detection is ALWAYS skipped. - The system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, + the system will try to detect regions of interest in the image + that are + compatible with the product_category on the parent product. If + it is + specified, detection is ALWAYS skipped. The system converts + polygons into + non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too + large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the product - does not exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent product's - product_category is detected. * Returns INVALID_ARGUMENT if - bounding_poly contains more than 10 polygons. + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -762,8 +778,10 @@ def delete_reference_image( Permanently deletes a reference image. The image metadata will be deleted right away, but search - queries against ProductSets containing the image may still work - until all related caches are refreshed. + queries + against ProductSets containing the image may still work until + all related + caches are refreshed. The actual image files are not deleted from Google Cloud Storage. @@ -803,9 +821,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not exist. + * Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -867,14 +885,15 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already + present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -910,7 +929,7 @@ def remove_product_from_product_set( Possible errors: * Returns NOT_FOUND If the Product is not found under the - ProductSet. + ProductSet. Returns: Callable[[~.RemoveProductFromProductSetRequest], @@ -942,13 +961,15 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the + ProductSet does not exist, the products field of the response + will be + empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -979,17 +1000,22 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified + product sets based on a list of image information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. - (progress) `Operation.response` contains - `ImportProductSetsResponse`. (results) + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + Storage. + For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri `__. Returns: Callable[[~.ImportProductSetsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py index 749b0c9412a2..55a006126272 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py @@ -119,23 +119,23 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): """gRPC AsyncIO backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, - named `projects/*/locations/*/productSets/*`, which acts as a way - to put different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p3beta1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p3beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] - resources, named - `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -379,7 +379,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -413,7 +413,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -480,9 +480,10 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -511,7 +512,8 @@ def delete_product_set( r"""Return a callable for the delete product set method over gRPC. Permanently deletes a ProductSet. All Products and - ReferenceImages in the ProductSet will be deleted. + ReferenceImages in the + ProductSet will be deleted. The actual image files are not deleted from Google Cloud Storage. @@ -552,9 +554,11 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if description - is longer than 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. Returns: Callable[[~.CreateProductRequest], @@ -588,7 +592,7 @@ def list_products( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. Returns: Callable[[~.ListProductsRequest], @@ -655,16 +659,19 @@ def update_product( now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until + the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in update_mask. + * Returns NOT_FOUND if the Product does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -695,8 +702,10 @@ def delete_product( Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right - away, but search queries against ProductSets containing the - product may still work until all related caches are refreshed. + away, but + search queries against ProductSets containing the product may + still work + until all related caches are refreshed. Possible errors: @@ -731,23 +740,30 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The `bounding_poly` field is optional. If `bounding_poly` is not - specified, the system will try to detect regions of interest in - the image that are compatible with the product_category on the - parent product. If it is specified, detection is ALWAYS skipped. - The system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, + the system will try to detect regions of interest in the image + that are + compatible with the product_category on the parent product. If + it is + specified, detection is ALWAYS skipped. The system converts + polygons into + non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too + large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the product - does not exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent product's - product_category is detected. * Returns INVALID_ARGUMENT if - bounding_poly contains more than 10 polygons. + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -778,8 +794,10 @@ def delete_reference_image( Permanently deletes a reference image. The image metadata will be deleted right away, but search - queries against ProductSets containing the image may still work - until all related caches are refreshed. + queries + against ProductSets containing the image may still work until + all related + caches are refreshed. The actual image files are not deleted from Google Cloud Storage. @@ -819,9 +837,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not exist. + * Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -884,14 +902,15 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already + present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -928,7 +947,7 @@ def remove_product_from_product_set( Possible errors: * Returns NOT_FOUND If the Product is not found under the - ProductSet. + ProductSet. Returns: Callable[[~.RemoveProductFromProductSetRequest], @@ -960,13 +979,15 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the + ProductSet does not exist, the products field of the response + will be + empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -998,17 +1019,22 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified + product sets based on a list of image information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. - (progress) `Operation.response` contains - `ImportProductSetsResponse`. (results) + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + Storage. + For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri `__. Returns: Callable[[~.ImportProductSetsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py index 58419d460e0d..30b9d6a6e054 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py @@ -950,23 +950,23 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): """REST backend synchronous transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, - named `projects/*/locations/*/productSets/*`, which acts as a way - to put different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p3beta1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p3beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] - resources, named - `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -1114,7 +1114,8 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the `AddProductToProductSet` method. + The request object. Request message for the ``AddProductToProductSet`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1228,7 +1229,7 @@ def __call__( Args: request (~.product_search_service.CreateProductRequest): - The request object. Request message for the `CreateProduct` method. + The request object. Request message for the ``CreateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1378,7 +1379,7 @@ def __call__( Args: request (~.product_search_service.CreateProductSetRequest): - The request object. Request message for the `CreateProductSet` method. + The request object. Request message for the ``CreateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1537,7 +1538,7 @@ def __call__( Args: request (~.product_search_service.CreateReferenceImageRequest): - The request object. Request message for the `CreateReferenceImage` method. + The request object. Request message for the ``CreateReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1548,8 +1549,9 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ @@ -1692,7 +1694,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductRequest): - The request object. Request message for the `DeleteProduct` method. + The request object. Request message for the ``DeleteProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1798,7 +1800,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductSetRequest): - The request object. Request message for the `DeleteProductSet` method. + The request object. Request message for the ``DeleteProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1906,7 +1908,7 @@ def __call__( Args: request (~.product_search_service.DeleteReferenceImageRequest): - The request object. Request message for the `DeleteReferenceImage` method. + The request object. Request message for the ``DeleteReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2014,7 +2016,7 @@ def __call__( Args: request (~.product_search_service.GetProductRequest): - The request object. Request message for the `GetProduct` method. + The request object. Request message for the ``GetProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2162,7 +2164,7 @@ def __call__( Args: request (~.product_search_service.GetProductSetRequest): - The request object. Request message for the `GetProductSet` method. + The request object. Request message for the ``GetProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2313,7 +2315,7 @@ def __call__( Args: request (~.product_search_service.GetReferenceImageRequest): - The request object. Request message for the `GetReferenceImage` method. + The request object. Request message for the ``GetReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2324,8 +2326,9 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ @@ -2464,7 +2467,7 @@ def __call__( Args: request (~.product_search_service.ImportProductSetsRequest): - The request object. Request message for the `ImportProductSets` method. + The request object. Request message for the ``ImportProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2616,7 +2619,7 @@ def __call__( Args: request (~.product_search_service.ListProductsRequest): - The request object. Request message for the `ListProducts` method. + The request object. Request message for the ``ListProducts`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2627,7 +2630,7 @@ def __call__( Returns: ~.product_search_service.ListProductsResponse: - Response message for the `ListProducts` method. + Response message for the ``ListProducts`` method. """ http_options = ( @@ -2762,7 +2765,7 @@ def __call__( Args: request (~.product_search_service.ListProductSetsRequest): - The request object. Request message for the `ListProductSets` method. + The request object. Request message for the ``ListProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2773,7 +2776,7 @@ def __call__( Returns: ~.product_search_service.ListProductSetsResponse: - Response message for the `ListProductSets` method. + Response message for the ``ListProductSets`` method. """ http_options = ( @@ -2912,7 +2915,7 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the `ListProductsInProductSet` + The request object. Request message for the ``ListProductsInProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -2924,7 +2927,7 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the `ListProductsInProductSet` + Response message for the ``ListProductsInProductSet`` method. """ @@ -3067,7 +3070,7 @@ def __call__( Args: request (~.product_search_service.ListReferenceImagesRequest): - The request object. Request message for the `ListReferenceImages` method. + The request object. Request message for the ``ListReferenceImages`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3078,7 +3081,7 @@ def __call__( Returns: ~.product_search_service.ListReferenceImagesResponse: - Response message for the `ListReferenceImages` method. + Response message for the ``ListReferenceImages`` method. """ http_options = ( @@ -3220,7 +3223,7 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the `RemoveProductFromProductSet` + The request object. Request message for the ``RemoveProductFromProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -3337,7 +3340,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductRequest): - The request object. Request message for the `UpdateProduct` method. + The request object. Request message for the ``UpdateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3487,7 +3490,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductSetRequest): - The request object. Request message for the `UpdateProductSet` method. + The request object. Request message for the ``UpdateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py index 606a60af3d9d..bba23b04f564 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py @@ -105,22 +105,26 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the - maximum number of results to return for that type. Multiple - `Feature` objects can be specified in the `features` list. + maximum + number of results to return for that type. Multiple ``Feature`` + objects can + be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p3beta1.types.Feature.Type): The feature type. max_results (int): Maximum number of results of this type. Does not apply to - `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or - `CROP_HINTS`. + ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or + ``CROP_HINTS``. model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) - and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and - `TEXT_DETECTION` also support "builtin/weekly" for the - bleeding edge release updated weekly. + and + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also + support "builtin/weekly" for the bleeding edge release + updated weekly. """ class Type(proto.Enum): @@ -139,12 +143,14 @@ class Type(proto.Enum): Run label detection. TEXT_DETECTION (5): Run text detection / optical character recognition (OCR). - Text detection is optimized for areas of text within a - larger image; if the image is a document, use - `DOCUMENT_TEXT_DETECTION` instead. + Text detection + is optimized for areas of text within a larger image; if the + image is + a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both - `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. + ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are + present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -195,33 +201,41 @@ class ImageSource(proto.Message): Attributes: gcs_image_uri (str): - **Use `image_uri` instead.** + **Use ``image_uri`` instead.** The Google Cloud Storage URI of the form - `gs://bucket_name/object_name`. Object versioning is not - supported. See [Google Cloud Storage Request - URIs](https://cloud.google.com/storage/docs/reference-uris) - for more info. + ``gs://bucket_name/object_name``. Object versioning is not + supported. See + `Google Cloud Storage Request + URIs `__ for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - `gs://bucket_name/object_name`. Object versioning is not - supported. See [Google Cloud Storage Request - URIs](https://cloud.google.com/storage/docs/reference-uris) - for more info. + ``gs://bucket_name/object_name``. Object versioning is not + supported. See + `Google Cloud Storage Request + URIs `__ for more + info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from HTTP/HTTPS URLs, Google cannot guarantee - that the request will be completed. Your request may - fail if the specified host denies the request (e.g. - due to request throttling or DOS prevention), or if - Google throttles requests to the site for abuse - prevention. You should not depend on - externally-hosted images for production applications. - - When both `gcs_image_uri` and `image_uri` are specified, - `image_uri` takes precedence. + images from + HTTP/HTTPS URLs, Google cannot guarantee that the request + will be + completed. Your request may fail if the specified host + denies the + request (e.g. due to request throttling or DOS prevention), + or if Google + throttles requests to the site for abuse prevention. You + should not + depend on externally-hosted images for production + applications. + + When both ``gcs_image_uri`` and ``image_uri`` are specified, + ``image_uri`` takes + precedence. """ gcs_image_uri: str = proto.Field( @@ -240,14 +254,16 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all `bytes` fields, protobuffers use a pure - binary representation, whereas JSON representations use - base64. + Note: As with all ``bytes`` fields, protobuffers use a pure + binary + representation, whereas JSON representations use base64. source (google.cloud.vision_v1p3beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both `content` and `source` are provided for - an image, `content` takes precedence and is used to perform - the image annotation request. + image + URL. If both ``content`` and ``source`` are provided for an + image, ``content`` + takes precedence and is used to perform the image annotation + request. """ content: bytes = proto.Field( @@ -268,36 +284,47 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale, as returned - in `ImageParams`. The bounding box is computed to "frame" - the face in accordance with human expectations. It is based - on the landmarker results. Note that one or more x and/or y - coordinates may not be generated in the `BoundingPoly` (the - polygon will be unbounded) if only a partial face appears in - the image to be annotated. + bounding box + are in the original image's scale, as returned in + ``ImageParams``. + The bounding box is computed to "frame" the face in + accordance with human + expectations. It is based on the landmarker results. + Note that one or more x and/or y coordinates may not be + generated in the + ``BoundingPoly`` (the polygon will be unbounded) if only a + partial face + appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The `fd_bounding_poly` bounding polygon is tighter than the - `boundingPoly`, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face - detection) prefix. + The ``fd_bounding_poly`` bounding polygon is tighter than + the + ``boundingPoly``, and encloses only the skin part of the + face. Typically, it + is used to eliminate the face from any image analysis that + detects the + "amount of skin" visible in an image. It is not based on the + landmarker results, only on the initial face detection, + hence + the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p3beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): - Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the face. - Range [-180,180]. + Roll angle, which indicates the amount of clockwise/anti- + clockwise rotation + of the face relative to the image vertical about the axis + perpendicular to + the face. Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. + the face is + pointing relative to the vertical plane perpendicular to the + image. Range + [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's horizontal - plane. Range [-180,180]. + that the face is + pointing relative to the image's horizontal plane. Range + [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -331,8 +358,10 @@ class Landmark(proto.Message): class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the - image without considering mirror projections typical of photos. So, - `LEFT_EYE`, typically, is the person's right eye. + image + without considering mirror projections typical of photos. So, + ``LEFT_EYE``, + typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -542,7 +571,7 @@ class LocationInfo(proto.Message): class Property(proto.Message): - r"""A `Property` consists of a user-supplied name/value pair. + r"""A ``Property`` consists of a user-supplied name/value pair. Attributes: name (str): @@ -573,43 +602,51 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): Opaque entity ID. Some IDs may be available in - [Google Knowledge Graph Search - API](https://developers.google.com/knowledge-graph/). + `Google Knowledge Graph Search + API `__. locale (str): The language code for the locale in which the entity textual - `description` is expressed. + ``description`` is expressed. description (str): - Entity textual description, expressed in its `locale` + Entity textual description, expressed in its ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use `score` instead.** - The accuracy of the entity detection in an image. For - example, for an image in which the "Eiffel Tower" entity is - detected, this field represents the confidence that there is - a tower in the query image. Range [0, 1]. + **Deprecated. Use ``score`` instead.** + The accuracy of the entity detection in an image. + For example, for an image in which the "Eiffel Tower" entity + is detected, + this field represents the confidence that there is a tower + in the query + image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower - in each image may be the same. Range [0, 1]. + the + image. For example, the relevancy of "tower" is likely + higher to an image + containing the detected "Eiffel Tower" than to an image + containing a + detected distant towering building, even though the + confidence that + there is a tower in each image may be the same. Range [0, + 1]. bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): Image region to which this entity belongs. Not produced - for `LABEL_DETECTION` features. + for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p3beta1.types.LocationInfo]): The location information for the detected entity. Multiple - `LocationInfo` elements can be present because one location - may indicate the location of the scene in the image, and - another location may indicate the location of the place - where the image was taken. Location information is usually - present for landmarks. + ``LocationInfo`` elements can be present because one + location may + indicate the location of the scene in the image, and another + location + may indicate the location of the place where the image was + taken. + Location information is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p3beta1.types.Property]): - Some entities may have optional user-supplied `Property` - (name/value) fields, such a score or string that qualifies - the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) + fields, such a score or string that qualifies the entity. """ mid: str = proto.Field( @@ -662,10 +699,12 @@ class LocalizedObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + more + information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. name (str): - Object name, expressed in its `language_code` language. + Object name, expressed in its ``language_code`` language. score (float): Score of the result. Range [0, 1]. bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): @@ -753,7 +792,7 @@ class SafeSearchAnnotation(proto.Message): class LatLongRect(proto.Message): - r"""Rectangle determined by min and max `LatLng` pairs. + r"""Rectangle determined by min and max ``LatLng`` pairs. Attributes: min_lat_lng (google.type.latlng_pb2.LatLng): @@ -842,8 +881,9 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): The bounding polygon for the crop region. The coordinates of - the bounding box are in the original image's scale, as - returned in `ImageParams`. + the bounding + box are in the original image's scale, as returned in + ``ImageParams``. confidence (float): Confidence of this being a salient region. Range [0, 1]. importance_fraction (float): @@ -920,13 +960,16 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and + DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + for + DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence + score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -950,15 +993,21 @@ class ImageContext(proto.Message): Not used. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting `language_hints` is not needed. In - rare cases, when the language of the text in the image is - known, setting a hint will help get better results (although - it will be a significant hindrance if the hint is wrong). - Text detection returns an error if one or more of the - specified languages is not one of the [supported - languages](https://cloud.google.com/vision/docs/languages). + an empty value + yields the best results since it enables automatic language + detection. For + languages based on the Latin alphabet, setting + ``language_hints`` is not + needed. In rare cases, when the language of the text in the + image is known, + setting a hint will help get better results (although it + will be a + significant hindrance if the hint is wrong). Text detection + returns an + error if one or more of the specified languages is not one + of the + `supported languages + `__. crop_hints_params (google.cloud.vision_v1p3beta1.types.CropHintsParams): Parameters for crop hints annotation request. product_search_params (google.cloud.vision_v1p3beta1.types.ProductSearchParams): @@ -1102,7 +1151,7 @@ class AnnotateImageResponse(proto.Message): error (google.rpc.status_pb2.Status): If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be - correct, even when `error` is set. + correct, even when ``error`` is set. context (google.cloud.vision_v1p3beta1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1362,17 +1411,21 @@ class OutputConfig(proto.Message): the output(s) to. batch_size (int): The max number of response protos to put into each output - JSON file on Google Cloud Storage. + JSON file on + Google Cloud Storage. The valid range is [1, 100]. If not specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response - protos will be generated. If `batch_size` = 20, then 5 json - files each containing 20 response protos will be written - under the prefix `gcs_destination`.`uri`. + protos will + be generated. If ``batch_size`` = 20, then 5 json files each + containing 20 response protos will be written under the + prefix + ``gcs_destination``.``uri``. Currently, batch_size only applies to GcsDestination, with - potential future support for other output configurations. + potential future + support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1410,21 +1463,23 @@ class GcsDestination(proto.Message): Attributes: uri (str): Google Cloud Storage URI where the results will be stored. - Results will be in JSON format and preceded by its - corresponding input URI. This field can either represent a - single file, or a prefix for multiple outputs. Prefixes must - end in a `/`. + Results will + be in JSON format and preceded by its corresponding input + URI. This field + can either represent a single file, or a prefix for multiple + outputs. + Prefixes must end in a ``/``. Examples: * File: gs://bucket-name/filename.json * Prefix: gs://bucket-name/prefix/here/ * File: gs://bucket-name/prefix/here If multiple outputs, - each response is still AnnotateFileResponse, each of which - contains some subset of the full list of - AnnotateImageResponse. Multiple outputs can happen if, for - example, the output JSON is too large and overflows into - multiple sharded files. + each response is still AnnotateFileResponse, each of which + contains some subset of the full list of + AnnotateImageResponse. Multiple outputs can happen if, for + example, the output JSON is too large and overflows into + multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py index 583bf6353f57..15a4c388df67 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py @@ -40,11 +40,13 @@ class ProductSearchParams(proto.Message): interest in the image. If it is not specified, system discretion will be applied. product_set (str): - The resource name of a - [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be - searched for similar images. Format is: + The resource name of a `ProductSet + `__ to be searched + for similar images. - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_S + ET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -148,10 +150,12 @@ class ObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + more + information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. name (str): - Object name, expressed in its `language_code` language. + Object name, expressed in its ``language_code`` language. score (float): Score of the result. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py index 21bb56d1f87d..9a6dc802de95 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py @@ -68,8 +68,8 @@ class Product(proto.Message): The resource name of the product. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + . This field is ignored when creating a product. display_name (str): @@ -88,15 +88,18 @@ class Product(proto.Message): these should not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1p3beta1.types.Product.KeyValue]): Key-value pairs that can be attached to a product. At query - time, constraints can be specified based on the - product_labels. + time, + constraints can be specified based on the product_labels. Note that integer values can be provided as strings, e.g. - "1199". Only strings with integer values can match a - range-based restriction which is to be supported soon. + "1199". Only + strings with integer values can match a range-based + restriction which is + to be supported soon. Multiple values can be assigned to the same key. One product - may have up to 100 product_labels. + may have up to + 100 product_labels. """ class KeyValue(proto.Message): @@ -154,8 +157,8 @@ class ProductSet(proto.Message): The resource name of the ProductSet. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_S + ET_ID``. This field is ignored when creating a ProductSet. display_name (str): @@ -201,8 +204,9 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): - r"""A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + r"""A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. Attributes: name (str): @@ -210,13 +214,15 @@ class ReferenceImage(proto.Message): Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/r + eferenceImages/IMAGE_ID``. This field is ignored when creating a reference image. uri (str): Required. The Google Cloud Storage URI of the reference image. - The URI must start with `gs://`. + + The URI must start with ``gs://``. bounding_polys (MutableSequence[google.cloud.vision_v1p3beta1.types.BoundingPoly]): Optional. Bounding polygons around the areas of interest in the reference image. If this @@ -247,22 +253,25 @@ class ReferenceImage(proto.Message): class CreateProductRequest(proto.Message): - r"""Request message for the `CreateProduct` method. + r"""Request message for the ``CreateProduct`` method. Attributes: parent (str): Required. The project in which the Product should be created. + Format is - `projects/PROJECT_ID/locations/LOC_ID`. + ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1p3beta1.types.Product): Required. The product to create. product_id (str): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -281,15 +290,15 @@ class CreateProductRequest(proto.Message): class ListProductsRequest(proto.Message): - r"""Request message for the `ListProducts` method. + r"""Request message for the ``ListProducts`` method. Attributes: parent (str): Required. The project OR ProductSet from which Products should be listed. - Format: - `projects/PROJECT_ID/locations/LOC_ID` + Format: + ``projects/PROJECT_ID/locations/LOC_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -313,7 +322,7 @@ class ListProductsRequest(proto.Message): class ListProductsResponse(proto.Message): - r"""Response message for the `ListProducts` method. + r"""Response message for the ``ListProducts`` method. Attributes: products (MutableSequence[google.cloud.vision_v1p3beta1.types.Product]): @@ -340,15 +349,15 @@ def raw_page(self): class GetProductRequest(proto.Message): - r"""Request message for the `GetProduct` method. + r"""Request message for the ``GetProduct`` method. Attributes: name (str): Required. Resource name of the Product to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` """ name: str = proto.Field( @@ -358,7 +367,7 @@ class GetProductRequest(proto.Message): class UpdateProductRequest(proto.Message): - r"""Request message for the `UpdateProduct` method. + r"""Request message for the ``UpdateProduct`` method. Attributes: product (google.cloud.vision_v1p3beta1.types.Product): @@ -366,11 +375,14 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields + to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask paths include - `product_labels`, `display_name`, and `description`. + to be updated. + Valid mask paths include ``product_labels``, + ``display_name``, and + ``description``. """ product: "Product" = proto.Field( @@ -386,15 +398,15 @@ class UpdateProductRequest(proto.Message): class DeleteProductRequest(proto.Message): - r"""Request message for the `DeleteProduct` method. + r"""Request message for the ``DeleteProduct`` method. Attributes: name (str): Required. Resource name of product to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` """ name: str = proto.Field( @@ -404,21 +416,24 @@ class DeleteProductRequest(proto.Message): class CreateProductSetRequest(proto.Message): - r"""Request message for the `CreateProductSet` method. + r"""Request message for the ``CreateProductSet`` method. Attributes: parent (str): Required. The project in which the ProductSet should be created. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. product_set (google.cloud.vision_v1p3beta1.types.ProductSet): Required. The ProductSet to create. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -437,13 +452,14 @@ class CreateProductSetRequest(proto.Message): class ListProductSetsRequest(proto.Message): - r"""Request message for the `ListProductSets` method. + r"""Request message for the ``ListProductSets`` method. Attributes: parent (str): Required. The project from which ProductSets should be listed. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -467,7 +483,7 @@ class ListProductSetsRequest(proto.Message): class ListProductSetsResponse(proto.Message): - r"""Response message for the `ListProductSets` method. + r"""Response message for the ``ListProductSets`` method. Attributes: product_sets (MutableSequence[google.cloud.vision_v1p3beta1.types.ProductSet]): @@ -494,15 +510,15 @@ def raw_page(self): class GetProductSetRequest(proto.Message): - r"""Request message for the `GetProductSet` method. + r"""Request message for the ``GetProductSet`` method. Attributes: name (str): Required. Resource name of the ProductSet to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` """ name: str = proto.Field( @@ -512,17 +528,19 @@ class GetProductSetRequest(proto.Message): class UpdateProductSetRequest(proto.Message): - r"""Request message for the `UpdateProductSet` method. + r"""Request message for the ``UpdateProductSet`` method. Attributes: product_set (google.cloud.vision_v1p3beta1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields to + update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is `display_name`. + to be updated. + Valid mask path is ``display_name``. """ product_set: "ProductSet" = proto.Field( @@ -538,15 +556,15 @@ class UpdateProductSetRequest(proto.Message): class DeleteProductSetRequest(proto.Message): - r"""Request message for the `DeleteProductSet` method. + r"""Request message for the ``DeleteProductSet`` method. Attributes: name (str): Required. Resource name of the ProductSet to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` """ name: str = proto.Field( @@ -556,23 +574,28 @@ class DeleteProductSetRequest(proto.Message): class CreateReferenceImageRequest(proto.Message): - r"""Request message for the `CreateReferenceImage` method. + r"""Request message for the ``CreateReferenceImage`` method. Attributes: parent (str): Required. Resource name of the product in which to create the reference image. + Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. reference_image (google.cloud.vision_v1p3beta1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + added. If set, + the server will attempt to use this value as the + resource id. If it is + already in use, an error is returned with code + ALREADY_EXISTS. Must be at + most 128 characters long. It cannot contain the + character ``/``. """ parent: str = proto.Field( @@ -591,21 +614,24 @@ class CreateReferenceImageRequest(proto.Message): class ListReferenceImagesRequest(proto.Message): - r"""Request message for the `ListReferenceImages` method. + r"""Request message for the ``ListReferenceImages`` method. Attributes: parent (str): Required. Resource name of the product containing the reference images. + Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value of `nextPageToken` returned in a previous - reference image list request. + is the value + of ``nextPageToken`` returned in a previous reference image + list request. Defaults to the first page if not specified. """ @@ -625,7 +651,7 @@ class ListReferenceImagesRequest(proto.Message): class ListReferenceImagesResponse(proto.Message): - r"""Response message for the `ListReferenceImages` method. + r"""Response message for the ``ListReferenceImages`` method. Attributes: reference_images (MutableSequence[google.cloud.vision_v1p3beta1.types.ReferenceImage]): @@ -658,15 +684,17 @@ def raw_page(self): class GetReferenceImageRequest(proto.Message): - r"""Request message for the `GetReferenceImage` method. + r"""Request message for the ``GetReferenceImage`` method. Attributes: name (str): Required. The resource name of the ReferenceImage to get. + Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID``. """ name: str = proto.Field( @@ -676,15 +704,17 @@ class GetReferenceImageRequest(proto.Message): class DeleteReferenceImageRequest(proto.Message): - r"""Request message for the `DeleteReferenceImage` method. + r"""Request message for the ``DeleteReferenceImage`` method. Attributes: name (str): Required. The resource name of the reference image to delete. + Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID`` """ name: str = proto.Field( @@ -694,21 +724,24 @@ class DeleteReferenceImageRequest(proto.Message): class AddProductToProductSetRequest(proto.Message): - r"""Request message for the `AddProductToProductSet` method. + r"""Request message for the ``AddProductToProductSet`` + method. Attributes: name (str): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` product (str): Required. The resource name for the Product to be added to this ProductSet. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` """ name: str = proto.Field( @@ -722,22 +755,24 @@ class AddProductToProductSetRequest(proto.Message): class RemoveProductFromProductSetRequest(proto.Message): - r"""Request message for the `RemoveProductFromProductSet` + r"""Request message for the ``RemoveProductFromProductSet`` method. Attributes: name (str): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` product (str): Required. The resource name for the Product to be removed from this ProductSet. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` """ name: str = proto.Field( @@ -751,16 +786,17 @@ class RemoveProductFromProductSetRequest(proto.Message): class ListProductsInProductSetRequest(proto.Message): - r"""Request message for the `ListProductsInProductSet` + r"""Request message for the ``ListProductsInProductSet`` method. Attributes: name (str): Required. The ProductSet resource for which to retrieve Products. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -784,7 +820,7 @@ class ListProductsInProductSetRequest(proto.Message): class ListProductsInProductSetResponse(proto.Message): - r"""Response message for the `ListProductsInProductSet` + r"""Response message for the ``ListProductsInProductSet`` method. Attributes: @@ -819,10 +855,11 @@ class ImportProductSetsGcsSource(proto.Message): csv_file_uri (str): The Google Cloud Storage URI of the input csv file. - The URI must start with `gs://`. + The URI must start with ``gs://``. The format of the input csv file should be one image per - line. In each line, there are 6 columns. + line. + In each line, there are 6 columns. 1. image_uri 2, image_id 3. product_set_id @@ -833,52 +870,68 @@ class ImportProductSetsGcsSource(proto.Message): 8. bounding_poly Columns 1, 3, 4, and 5 are required, other columns are - optional. A new ProductSet/Product with the same id will be - created on the fly if the ProductSet/Product specified by - product_set_id/product_id does not exist. + optional. A new + ProductSet/Product with the same id will be created on the + fly + if the ProductSet/Product specified by + product_set_id/product_id does not + exist. The image_id field is optional but has to be unique if - provided. If it is empty, we will automatically assign an - unique id to the image. + provided. If it is + empty, we will automatically assign an unique id to the + image. The product_display_name field is optional. If it is empty, - a space (" ") is used as the place holder for the product - display_name, which can be updated later through the - realtime API. + a space (" ") + is used as the place holder for the product display_name, + which can + be updated later through the realtime API. If the Product with product_id already exists, the fields product_display_name, product_category and labels are ignored. If a Product doesn't exist and needs to be created on the - fly, the product_display_name field refers to - [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], + fly, the + product_display_name field refers to + `Product.display_name + `__, the product_category field refers to - [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], + `Product.product_category + `__, and the labels field refers to [Product.labels][]. Labels (optional) should be a line containing a list of - comma-separated key-value pairs, with the format - "key_1=value_1,key_2=value_2,...,key_n=value_n". + comma-separated + key-value pairs, with the format + "key_1=value_1,key_2=value_2,...,key_n=value_n". The bounding_poly (optional) field is used to identify one - region of interest from the image in the same manner as - CreateReferenceImage. If no bounding_poly is specified, the - system will try to detect regions of interest automatically. + region of + interest from the image in the same manner as + CreateReferenceImage. If no + bounding_poly is specified, the system will try to detect + regions of + interest automatically. Note that the pipeline will resize the image if the image - resolution is too large to process (above 20MP). + resolution is too + large to process (above 20MP). Also note that at most one bounding_poly is allowed per - line. If the image contains multiple regions of interest, - the csv should contain one line per region of interest. + line. If the image + contains multiple regions of interest, the csv should + contain one line per + region of interest. The bounding_poly column should contain an even number of - comma-separated numbers, with the format - "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative integers - should be used for absolute bounding polygons, and float - values in [0, 1] should be used for normalized bounding - polygons. + comma-separated + numbers, with the format + "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative + integers should be used for absolute bounding polygons, and + float values + in [0, 1] should be used for normalized bounding polygons. """ csv_file_uri: str = proto.Field( @@ -888,7 +941,7 @@ class ImportProductSetsGcsSource(proto.Message): class ImportProductSetsInputConfig(proto.Message): - r"""The input content for the `ImportProductSets` method. + r"""The input content for the ``ImportProductSets`` method. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -910,13 +963,14 @@ class ImportProductSetsInputConfig(proto.Message): class ImportProductSetsRequest(proto.Message): - r"""Request message for the `ImportProductSets` method. + r"""Request message for the ``ImportProductSets`` method. Attributes: parent (str): Required. The project in which the ProductSets should be imported. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. input_config (google.cloud.vision_v1p3beta1.types.ImportProductSetsInputConfig): Required. The input content for the list of requests. @@ -934,12 +988,14 @@ class ImportProductSetsRequest(proto.Message): class ImportProductSetsResponse(proto.Message): - r"""Response message for the `ImportProductSets` method. + r"""Response message for the ``ImportProductSets`` method. This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + `google.longrunning.Operations.GetOperation + `__ method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] + `google.longrunning.Operation.response + `__ field. Attributes: @@ -947,12 +1003,14 @@ class ImportProductSetsResponse(proto.Message): The list of reference_images that are imported successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): The rpc status for each ImportProductSet request, including - both successes and errors. + both successes + and errors. The number of statuses here matches the number of lines in - the csv file, and statuses[i] stores the success or failure - status of processing the i-th line of the csv, starting from - line 0. + the csv file, + and statuses[i] stores the success or failure status of + processing the i-th + line of the csv, starting from line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -970,8 +1028,9 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the `metadata` field of the `Operation` returned - by the `GetOperation` call of the `google::longrunning::Operations` + This is included in the ``metadata`` field of the ``Operation`` + returned by the + ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: @@ -982,8 +1041,9 @@ class BatchOperationMetadata(proto.Message): to the server. end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and - [google.longrunning.Operation.done][google.longrunning.Operation.done] - is set to true. + `google.longrunning.Operation.done + `__ is + set to true. """ class State(proto.Enum): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py index 83a9f47b70af..202017beecde 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py @@ -36,13 +36,16 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like this: - - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + text. + The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each structural component, starting from Page, may further have - their own properties. Properties describe detected languages, breaks - etc.. Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty] + their own + properties. Properties describe detected languages, breaks etc.. + Please refer + to the + `TextAnnotation.TextProperty + `__ message definition below for more detail. Attributes: @@ -58,8 +61,10 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + more + information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. confidence (float): Confidence of detected language. Range [0, 1]. """ @@ -96,8 +101,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not - co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. + End-line hyphen that is not present in text; does not co- + occur with + ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py index 77beced50b26..fb59894ea3a0 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py @@ -157,9 +157,11 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for `label`, such as "en-US" or - "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". + For more information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. """ label: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py index a231aa63afb2..600555c15d56 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py @@ -534,14 +534,17 @@ async def async_batch_annotate_images( ) -> operation_async.AsyncOperation: r"""Run asynchronous image detection and annotation for a list of images. + Progress and results can be retrieved through the - `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateImagesResponse` - (results). + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer + GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -603,9 +606,10 @@ async def sample_async_batch_annotate_images(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse` - Response to an async batch image annotation request. + The result type for the operation will be :class:``googl + e.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesR + esponse`` Response to an async batch image annotation + request. """ # Create or coerce a protobuf request object. @@ -675,12 +679,16 @@ async def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + generic + files, such as PDF files, which may contain multiple pages and + multiple + images per page. Progress and results can be retrieved through + the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -735,9 +743,10 @@ async def sample_async_batch_annotate_files(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + The result type for the operation will be :class:``googl + e.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesRe + sponse`` Response to an async batch file annotation + request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py index f6a0b8b9873a..5f85e92da716 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py @@ -991,14 +991,17 @@ def async_batch_annotate_images( ) -> operation.Operation: r"""Run asynchronous image detection and annotation for a list of images. + Progress and results can be retrieved through the - `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateImagesResponse` - (results). + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer + GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -1060,9 +1063,10 @@ def sample_async_batch_annotate_images(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse` - Response to an async batch image annotation request. + The result type for the operation will be :class:``googl + e.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesR + esponse`` Response to an async batch image annotation + request. """ # Create or coerce a protobuf request object. @@ -1131,12 +1135,16 @@ def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + generic + files, such as PDF files, which may contain multiple pages and + multiple + images per page. Progress and results can be retrieved through + the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -1191,9 +1199,10 @@ def sample_async_batch_annotate_files(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesResponse` - Response to an async batch file annotation request. + The result type for the operation will be :class:``googl + e.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesRe + sponse`` Response to an async batch file annotation + request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py index bbd1d83513a4..13b4825e4865 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py @@ -419,14 +419,17 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. + Progress and results can be retrieved through the - `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateImagesResponse` - (results). + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer + GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -458,12 +461,16 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + generic + files, such as PDF files, which may contain multiple pages and + multiple + images per page. Progress and results can be retrieved through + the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py index ac24da43eea8..a14c3b4a4a68 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py @@ -428,14 +428,17 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. + Progress and results can be retrieved through the - `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateImagesResponse` - (results). + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer + GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -468,12 +471,16 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `OperationMetadata` (metadata). - `Operation.response` contains `AsyncBatchAnnotateFilesResponse` - (results). + generic + files, such as PDF files, which may contain multiple pages and + multiple + images per page. Progress and results can be retrieved through + the + ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). + ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py index 9feb2ec05f6d..e0bac055836b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py @@ -70,23 +70,23 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, - named `projects/*/locations/*/productSets/*`, which acts as a way - to put different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p4beta1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p4beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] - resources, named - `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -336,7 +336,7 @@ async def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. .. code-block:: python @@ -366,11 +366,12 @@ async def sample_create_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.CreateProductSetRequest, dict]]): - The request object. Request message for the `CreateProductSet` method. + The request object. Request message for the ``CreateProductSet`` method. parent (:class:`str`): Required. The project in which the ProductSet should be created. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -382,10 +383,12 @@ async def sample_create_product_set(): should not be set. product_set_id (:class:`str`): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -476,7 +479,7 @@ async def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. .. code-block:: python @@ -507,11 +510,12 @@ async def sample_list_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListProductSetsRequest, dict]]): - The request object. Request message for the `ListProductSets` method. + The request object. Request message for the ``ListProductSets`` method. parent (:class:`str`): Required. The project from which ProductSets should be listed. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -526,7 +530,7 @@ async def sample_list_product_sets(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductSetsAsyncPager: - Response message for the `ListProductSets` method. + Response message for the ``ListProductSets`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -637,13 +641,13 @@ async def sample_get_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.GetProductSetRequest, dict]]): - The request object. Request message for the `GetProductSet` method. + The request object. Request message for the ``GetProductSet`` method. name (:class:`str`): Required. Resource name of the ProductSet to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -731,9 +735,10 @@ async def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. .. code-block:: python @@ -762,7 +767,7 @@ async def sample_update_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.UpdateProductSetRequest, dict]]): - The request object. Request message for the `UpdateProductSet` method. + The request object. Request message for the ``UpdateProductSet`` method. product_set (:class:`google.cloud.vision_v1p4beta1.types.ProductSet`): Required. The ProductSet resource which replaces the one on the server. @@ -771,10 +776,12 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields to + update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is `display_name`. + to be updated. + Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -891,13 +898,13 @@ async def sample_delete_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.DeleteProductSetRequest, dict]]): - The request object. Request message for the `DeleteProductSet` method. + The request object. Request message for the ``DeleteProductSet`` method. name (:class:`str`): Required. Resource name of the ProductSet to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -974,9 +981,11 @@ async def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if description - is longer than 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. .. code-block:: python @@ -1006,12 +1015,13 @@ async def sample_create_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.CreateProductRequest, dict]]): - The request object. Request message for the `CreateProduct` method. + The request object. Request message for the ``CreateProduct`` method. parent (:class:`str`): Required. The project in which the Product should be created. + Format is - `projects/PROJECT_ID/locations/LOC_ID`. + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1023,10 +1033,12 @@ async def sample_create_product(): should not be set. product_id (:class:`str`): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1112,7 +1124,7 @@ async def list_products( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. .. code-block:: python @@ -1143,13 +1155,13 @@ async def sample_list_products(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListProductsRequest, dict]]): - The request object. Request message for the `ListProducts` method. + The request object. Request message for the ``ListProducts`` method. parent (:class:`str`): Required. The project OR ProductSet from which Products should be listed. - Format: - `projects/PROJECT_ID/locations/LOC_ID` + Format: + ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1164,7 +1176,7 @@ async def sample_list_products(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsAsyncPager: - Response message for the `ListProducts` method. + Response message for the ``ListProducts`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1273,13 +1285,13 @@ async def sample_get_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.GetProductRequest, dict]]): - The request object. Request message for the `GetProduct` method. + The request object. Request message for the ``GetProduct`` method. name (:class:`str`): Required. Resource name of the Product to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1358,20 +1370,24 @@ async def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the `display_name`, `description`, and `labels` fields can - be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated + right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until + the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in update_mask. + * Returns NOT_FOUND if the Product does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. .. code-block:: python @@ -1400,7 +1416,7 @@ async def sample_update_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.UpdateProductRequest, dict]]): - The request object. Request message for the `UpdateProduct` method. + The request object. Request message for the ``UpdateProduct`` method. product (:class:`google.cloud.vision_v1p4beta1.types.Product`): Required. The Product resource which replaces the one on the server. @@ -1410,11 +1426,14 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields + to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask paths include - `product_labels`, `display_name`, and `description`. + to be updated. + Valid mask paths include ``product_labels``, + ``display_name``, and + ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1527,13 +1546,13 @@ async def sample_delete_product(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.DeleteProductRequest, dict]]): - The request object. Request message for the `DeleteProduct` method. + The request object. Request message for the ``DeleteProduct`` method. name (:class:`str`): Required. Resource name of product to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1607,23 +1626,30 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The `bounding_poly` field is optional. If `bounding_poly` is not - specified, the system will try to detect regions of interest in - the image that are compatible with the product_category on the - parent product. If it is specified, detection is ALWAYS skipped. - The system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, + the system will try to detect regions of interest in the image + that are + compatible with the product_category on the parent product. If + it is + specified, detection is ALWAYS skipped. The system converts + polygons into + non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too + large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the product - does not exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent product's - product_category is detected. * Returns INVALID_ARGUMENT if - bounding_poly contains more than 10 polygons. + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. .. code-block:: python @@ -1657,13 +1683,15 @@ async def sample_create_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.CreateReferenceImageRequest, dict]]): - The request object. Request message for the `CreateReferenceImage` method. + The request object. Request message for the ``CreateReferenceImage`` method. parent (:class:`str`): Required. Resource name of the product in which to - create the reference image. + create the reference + image. Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1678,10 +1706,13 @@ async def sample_create_reference_image(): should not be set. reference_image_id (:class:`str`): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + added. If set, + the server will attempt to use this value as the + resource id. If it is + already in use, an error is returned with code + ALREADY_EXISTS. Must be at + most 128 characters long. It cannot contain the + character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1696,8 +1727,9 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1798,13 +1830,15 @@ async def sample_delete_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.DeleteReferenceImageRequest, dict]]): - The request object. Request message for the `DeleteReferenceImage` method. + The request object. Request message for the ``DeleteReferenceImage`` method. name (:class:`str`): Required. The resource name of the reference image to delete. + Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1878,9 +1912,9 @@ async def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not exist. + * Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. .. code-block:: python @@ -1911,12 +1945,14 @@ async def sample_list_reference_images(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListReferenceImagesRequest, dict]]): - The request object. Request message for the `ListReferenceImages` method. + The request object. Request message for the ``ListReferenceImages`` method. parent (:class:`str`): Required. Resource name of the product containing the reference images. + Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1931,7 +1967,7 @@ async def sample_list_reference_images(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListReferenceImagesAsyncPager: - Response message for the `ListReferenceImages` method. + Response message for the ``ListReferenceImages`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2042,13 +2078,15 @@ async def sample_get_reference_image(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.GetReferenceImageRequest, dict]]): - The request object. Request message for the `GetReferenceImage` method. + The request object. Request message for the ``GetReferenceImage`` method. name (:class:`str`): Required. The resource name of the ReferenceImage to get. + Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2063,8 +2101,9 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2129,14 +2168,15 @@ async def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already + present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + exist. .. code-block:: python @@ -2164,13 +2204,15 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the `AddProductToProductSet` method. + The request object. Request message for the ``AddProductToProductSet`` + method. name (:class:`str`): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2178,9 +2220,10 @@ async def sample_add_product_to_product_set(): product (:class:`str`): Required. The resource name for the Product to be added to this ProductSet. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2283,25 +2326,27 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the `RemoveProductFromProductSet` + The request object. Request message for the ``RemoveProductFromProductSet`` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): Required. The resource name for the Product to be - removed from this ProductSet. + removed from this + ProductSet. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2376,13 +2421,15 @@ async def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the + ProductSet does not exist, the products field of the response + will be + empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. .. code-block:: python @@ -2413,14 +2460,15 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the `ListProductsInProductSet` + The request object. Request message for the ``ListProductsInProductSet`` method. name (:class:`str`): Required. The ProductSet resource for which to retrieve Products. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2435,8 +2483,9 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the `ListProductsInProductSet` + Response message for the ``ListProductsInProductSet`` method. + Iterating over this object will yield results and resolve additional pages automatically. @@ -2518,17 +2567,22 @@ async def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified + product sets based on a list of image information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. - (progress) `Operation.response` contains - `ImportProductSetsResponse`. (results) + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. + Storage. + For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri `__. .. code-block:: python @@ -2562,11 +2616,12 @@ async def sample_import_product_sets(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ImportProductSetsRequest, dict]]): - The request object. Request message for the `ImportProductSets` method. + The request object. Request message for the ``ImportProductSets`` method. parent (:class:`str`): Required. The project in which the ProductSets should be imported. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2590,14 +2645,17 @@ async def sample_import_product_sets(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse` - Response message for the `ImportProductSets` method. + The result type for the operation will be :class:``googl + e.cloud.vision_v1p4beta1.types.ImportProductSetsResponse + `` Response message for the ``ImportProductSets`` + method. This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + `google.longrunning.Operations.GetOperation + `__ method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] + `google.longrunning.Operation.response + `__ field. """ @@ -2672,31 +2730,42 @@ async def purge_products( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products + that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other + ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + after this + operation has completed. It is also recommended to not add any + of the + Products involved in the batch delete to a new ProductSet while + this + operation is running because those Products may still end up + deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. + Therefore, it is + recommended to keep the csv files used in ImportProductSets (if + that was + how you originally built the Product Set) before starting + PurgeProducts, in + case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. + and then + re-use the empty ProductSet to re-import new Products into the + empty + ProductSet, you must wait until the PurgeProducts operation has + finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -2731,11 +2800,12 @@ async def sample_purge_products(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.PurgeProductsRequest, dict]]): - The request object. Request message for the `PurgeProducts` method. + The request object. Request message for the ``PurgeProducts`` method. parent (:class:`str`): Required. The project and location in which the Products should be deleted. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2753,15 +2823,17 @@ async def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:`google.protobuf.empty_pb2.Empty` A generic empty - message that you can re-use to avoid defining duplicated + :class:``google.protobuf.empty_pb2.Empty`` A generic + empty message that you can re-use to avoid defining + duplicated empty messages in your APIs. A typical example is to use - it as the request or the response type of an API method. - For instance: + it as the request + or the response type of an API method. For instance: - service Foo { - rpc Bar(google.protobuf.Empty) returns - (google.protobuf.Empty); } + service Foo { + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); + } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py index 089fd5f68bd3..a11fa9229b91 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py @@ -114,23 +114,23 @@ def get_transport_class( class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, - named `projects/*/locations/*/productSets/*`, which acts as a way - to put different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p4beta1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p4beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] - resources, named - `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -817,7 +817,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. .. code-block:: python @@ -847,11 +847,12 @@ def sample_create_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.CreateProductSetRequest, dict]): - The request object. Request message for the `CreateProductSet` method. + The request object. Request message for the ``CreateProductSet`` method. parent (str): Required. The project in which the ProductSet should be created. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -863,10 +864,12 @@ def sample_create_product_set(): should not be set. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -954,7 +957,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. .. code-block:: python @@ -985,11 +988,12 @@ def sample_list_product_sets(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListProductSetsRequest, dict]): - The request object. Request message for the `ListProductSets` method. + The request object. Request message for the ``ListProductSets`` method. parent (str): Required. The project from which ProductSets should be listed. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1004,7 +1008,7 @@ def sample_list_product_sets(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductSetsPager: - Response message for the `ListProductSets` method. + Response message for the ``ListProductSets`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1112,13 +1116,13 @@ def sample_get_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.GetProductSetRequest, dict]): - The request object. Request message for the `GetProductSet` method. + The request object. Request message for the ``GetProductSet`` method. name (str): Required. Resource name of the ProductSet to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1203,9 +1207,10 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. .. code-block:: python @@ -1234,7 +1239,7 @@ def sample_update_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.UpdateProductSetRequest, dict]): - The request object. Request message for the `UpdateProductSet` method. + The request object. Request message for the ``UpdateProductSet`` method. product_set (google.cloud.vision_v1p4beta1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. @@ -1243,10 +1248,12 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields to + update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is `display_name`. + to be updated. + Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1360,13 +1367,13 @@ def sample_delete_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.DeleteProductSetRequest, dict]): - The request object. Request message for the `DeleteProductSet` method. + The request object. Request message for the ``DeleteProductSet`` method. name (str): Required. Resource name of the ProductSet to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1440,9 +1447,11 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if description - is longer than 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. .. code-block:: python @@ -1472,12 +1481,13 @@ def sample_create_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.CreateProductRequest, dict]): - The request object. Request message for the `CreateProduct` method. + The request object. Request message for the ``CreateProduct`` method. parent (str): Required. The project in which the Product should be created. + Format is - `projects/PROJECT_ID/locations/LOC_ID`. + ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1489,10 +1499,12 @@ def sample_create_product(): should not be set. product_id (str): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1575,7 +1587,7 @@ def list_products( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. .. code-block:: python @@ -1606,13 +1618,13 @@ def sample_list_products(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListProductsRequest, dict]): - The request object. Request message for the `ListProducts` method. + The request object. Request message for the ``ListProducts`` method. parent (str): Required. The project OR ProductSet from which Products should be listed. - Format: - `projects/PROJECT_ID/locations/LOC_ID` + Format: + ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1627,7 +1639,7 @@ def sample_list_products(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsPager: - Response message for the `ListProducts` method. + Response message for the ``ListProducts`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -1733,13 +1745,13 @@ def sample_get_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.GetProductRequest, dict]): - The request object. Request message for the `GetProduct` method. + The request object. Request message for the ``GetProduct`` method. name (str): Required. Resource name of the Product to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1815,20 +1827,24 @@ def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the `display_name`, `description`, and `labels` fields can - be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated + right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until + the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in update_mask. + * Returns NOT_FOUND if the Product does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. .. code-block:: python @@ -1857,7 +1873,7 @@ def sample_update_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.UpdateProductRequest, dict]): - The request object. Request message for the `UpdateProduct` method. + The request object. Request message for the ``UpdateProduct`` method. product (google.cloud.vision_v1p4beta1.types.Product): Required. The Product resource which replaces the one on the server. @@ -1867,11 +1883,14 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields + to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask paths include - `product_labels`, `display_name`, and `description`. + to be updated. + Valid mask paths include ``product_labels``, + ``display_name``, and + ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1981,13 +2000,13 @@ def sample_delete_product(): Args: request (Union[google.cloud.vision_v1p4beta1.types.DeleteProductRequest, dict]): - The request object. Request message for the `DeleteProduct` method. + The request object. Request message for the ``DeleteProduct`` method. name (str): Required. Resource name of product to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2058,23 +2077,30 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The `bounding_poly` field is optional. If `bounding_poly` is not - specified, the system will try to detect regions of interest in - the image that are compatible with the product_category on the - parent product. If it is specified, detection is ALWAYS skipped. - The system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, + the system will try to detect regions of interest in the image + that are + compatible with the product_category on the parent product. If + it is + specified, detection is ALWAYS skipped. The system converts + polygons into + non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too + large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the product - does not exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent product's - product_category is detected. * Returns INVALID_ARGUMENT if - bounding_poly contains more than 10 polygons. + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. .. code-block:: python @@ -2108,13 +2134,15 @@ def sample_create_reference_image(): Args: request (Union[google.cloud.vision_v1p4beta1.types.CreateReferenceImageRequest, dict]): - The request object. Request message for the `CreateReferenceImage` method. + The request object. Request message for the ``CreateReferenceImage`` method. parent (str): Required. Resource name of the product in which to - create the reference image. + create the reference + image. Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2129,10 +2157,13 @@ def sample_create_reference_image(): should not be set. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + added. If set, + the server will attempt to use this value as the + resource id. If it is + already in use, an error is returned with code + ALREADY_EXISTS. Must be at + most 128 characters long. It cannot contain the + character ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2147,8 +2178,9 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2246,13 +2278,15 @@ def sample_delete_reference_image(): Args: request (Union[google.cloud.vision_v1p4beta1.types.DeleteReferenceImageRequest, dict]): - The request object. Request message for the `DeleteReferenceImage` method. + The request object. Request message for the ``DeleteReferenceImage`` method. name (str): Required. The resource name of the reference image to delete. + Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2323,9 +2357,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not exist. + * Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. .. code-block:: python @@ -2356,12 +2390,14 @@ def sample_list_reference_images(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListReferenceImagesRequest, dict]): - The request object. Request message for the `ListReferenceImages` method. + The request object. Request message for the ``ListReferenceImages`` method. parent (str): Required. Resource name of the product containing the reference images. + Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2376,7 +2412,7 @@ def sample_list_reference_images(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListReferenceImagesPager: - Response message for the `ListReferenceImages` method. + Response message for the ``ListReferenceImages`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2484,13 +2520,15 @@ def sample_get_reference_image(): Args: request (Union[google.cloud.vision_v1p4beta1.types.GetReferenceImageRequest, dict]): - The request object. Request message for the `GetReferenceImage` method. + The request object. Request message for the ``GetReferenceImage`` method. name (str): Required. The resource name of the ReferenceImage to get. + Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2505,8 +2543,9 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2568,14 +2607,15 @@ def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already + present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + exist. .. code-block:: python @@ -2603,13 +2643,15 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the `AddProductToProductSet` method. + The request object. Request message for the ``AddProductToProductSet`` + method. name (str): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2617,9 +2659,10 @@ def sample_add_product_to_product_set(): product (str): Required. The resource name for the Product to be added to this ProductSet. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2721,25 +2764,27 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the `RemoveProductFromProductSet` + The request object. Request message for the ``RemoveProductFromProductSet`` method. name (str): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): Required. The resource name for the Product to be - removed from this ProductSet. + removed from this + ProductSet. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2813,13 +2858,15 @@ def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the + ProductSet does not exist, the products field of the response + will be + empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. .. code-block:: python @@ -2850,14 +2897,15 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the `ListProductsInProductSet` + The request object. Request message for the ``ListProductsInProductSet`` method. name (str): Required. The ProductSet resource for which to retrieve Products. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2872,8 +2920,9 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the `ListProductsInProductSet` + Response message for the ``ListProductsInProductSet`` method. + Iterating over this object will yield results and resolve additional pages automatically. @@ -2954,17 +3003,22 @@ def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified + product sets based on a list of image information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. - (progress) `Operation.response` contains - `ImportProductSetsResponse`. (results) + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. + Storage. + For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri `__. .. code-block:: python @@ -2998,11 +3052,12 @@ def sample_import_product_sets(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ImportProductSetsRequest, dict]): - The request object. Request message for the `ImportProductSets` method. + The request object. Request message for the ``ImportProductSets`` method. parent (str): Required. The project in which the ProductSets should be imported. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3026,14 +3081,17 @@ def sample_import_product_sets(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be - :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse` - Response message for the `ImportProductSets` method. + The result type for the operation will be :class:``googl + e.cloud.vision_v1p4beta1.types.ImportProductSetsResponse + `` Response message for the ``ImportProductSets`` + method. This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + `google.longrunning.Operations.GetOperation + `__ method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] + `google.longrunning.Operation.response + `__ field. """ @@ -3105,31 +3163,42 @@ def purge_products( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products + that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other + ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + after this + operation has completed. It is also recommended to not add any + of the + Products involved in the batch delete to a new ProductSet while + this + operation is running because those Products may still end up + deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. + Therefore, it is + recommended to keep the csv files used in ImportProductSets (if + that was + how you originally built the Product Set) before starting + PurgeProducts, in + case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. + and then + re-use the empty ProductSet to re-import new Products into the + empty + ProductSet, you must wait until the PurgeProducts operation has + finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -3164,11 +3233,12 @@ def sample_purge_products(): Args: request (Union[google.cloud.vision_v1p4beta1.types.PurgeProductsRequest, dict]): - The request object. Request message for the `PurgeProducts` method. + The request object. Request message for the ``PurgeProducts`` method. parent (str): Required. The project and location in which the Products should be deleted. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -3186,15 +3256,17 @@ def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:`google.protobuf.empty_pb2.Empty` A generic empty - message that you can re-use to avoid defining duplicated + :class:``google.protobuf.empty_pb2.Empty`` A generic + empty message that you can re-use to avoid defining + duplicated empty messages in your APIs. A typical example is to use - it as the request or the response type of an API method. - For instance: + it as the request + or the response type of an API method. For instance: - service Foo { - rpc Bar(google.protobuf.Empty) returns - (google.protobuf.Empty); } + service Foo { + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); + } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py index b4f1954e6fb9..6ae32f50c9e8 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py @@ -113,23 +113,23 @@ class ProductSearchGrpcTransport(ProductSearchTransport): """gRPC backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, - named `projects/*/locations/*/productSets/*`, which acts as a way - to put different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p4beta1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p4beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] - resources, named - `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -371,7 +371,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -405,7 +405,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -471,9 +471,10 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -536,9 +537,11 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if description - is longer than 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. Returns: Callable[[~.CreateProductRequest], @@ -572,7 +575,7 @@ def list_products( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. Returns: Callable[[~.ListProductsRequest], @@ -633,20 +636,24 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the `display_name`, `description`, and `labels` fields can - be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated + right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until + the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in update_mask. + * Returns NOT_FOUND if the Product does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -708,23 +715,30 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The `bounding_poly` field is optional. If `bounding_poly` is not - specified, the system will try to detect regions of interest in - the image that are compatible with the product_category on the - parent product. If it is specified, detection is ALWAYS skipped. - The system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, + the system will try to detect regions of interest in the image + that are + compatible with the product_category on the parent product. If + it is + specified, detection is ALWAYS skipped. The system converts + polygons into + non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too + large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the product - does not exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent product's - product_category is detected. * Returns INVALID_ARGUMENT if - bounding_poly contains more than 10 polygons. + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -792,9 +806,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not exist. + * Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -856,14 +870,15 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already + present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -926,13 +941,15 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the + ProductSet does not exist, the products field of the response + will be + empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -963,17 +980,22 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified + product sets based on a list of image information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. - (progress) `Operation.response` contains - `ImportProductSetsResponse`. (results) + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. + Storage. + For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1002,31 +1024,42 @@ def purge_products( r"""Return a callable for the purge products method over gRPC. Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products + that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other + ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + after this + operation has completed. It is also recommended to not add any + of the + Products involved in the batch delete to a new ProductSet while + this + operation is running because those Products may still end up + deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. + Therefore, it is + recommended to keep the csv files used in ImportProductSets (if + that was + how you originally built the Product Set) before starting + PurgeProducts, in + case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. + and then + re-use the empty ProductSet to re-import new Products into the + empty + ProductSet, you must wait until the PurgeProducts operation has + finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py index b16bebce24cb..4aa05d54f789 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py @@ -119,23 +119,23 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): """gRPC AsyncIO backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, - named `projects/*/locations/*/productSets/*`, which acts as a way - to put different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p4beta1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p4beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] - resources, named - `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -379,7 +379,7 @@ def create_product_set( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is - longer than 4096 characters. + longer than 4096 characters. Returns: Callable[[~.CreateProductSetRequest], @@ -413,7 +413,7 @@ def list_product_sets( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or - less than 1. + less than 1. Returns: Callable[[~.ListProductSetsRequest], @@ -480,9 +480,10 @@ def update_product_set( Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -548,9 +549,11 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if description - is longer than 4096 characters. * Returns INVALID_ARGUMENT if - product_category is missing or invalid. + than 4096 characters. + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. Returns: Callable[[~.CreateProductRequest], @@ -584,7 +587,7 @@ def list_products( Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. Returns: Callable[[~.ListProductsRequest], @@ -647,20 +650,24 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the `display_name`, `description`, and `labels` fields can - be updated right now. + Only the ``display_name``, ``description``, and ``labels`` + fields can be updated + right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until + the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in update_mask. + * Returns NOT_FOUND if the Product does not exist. + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. + * Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. + * Returns INVALID_ARGUMENT if product_category is present in + update_mask. Returns: Callable[[~.UpdateProductRequest], @@ -724,23 +731,30 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The `bounding_poly` field is optional. If `bounding_poly` is not - specified, the system will try to detect regions of interest in - the image that are compatible with the product_category on the - parent product. If it is specified, detection is ALWAYS skipped. - The system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is + not specified, + the system will try to detect regions of interest in the image + that are + compatible with the product_category on the parent product. If + it is + specified, detection is ALWAYS skipped. The system converts + polygons into + non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too + large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the product - does not exist. * Returns INVALID_ARGUMENT if bounding_poly is - not provided, and nothing compatible with the parent product's - product_category is detected. * Returns INVALID_ARGUMENT if - bounding_poly contains more than 10 polygons. + than 4096 characters. + * Returns INVALID_ARGUMENT if the product does not exist. + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -808,9 +822,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, - or less than 1. + * Returns NOT_FOUND if the parent product does not exist. + * Returns INVALID_ARGUMENT if the page_size is greater than 100, + or less than 1. Returns: Callable[[~.ListReferenceImagesRequest], @@ -873,14 +887,15 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already + present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't - exist. + exist. Returns: Callable[[~.AddProductToProductSetRequest], @@ -944,13 +959,15 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the + ProductSet does not exist, the products field of the response + will be + empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or - less than 1. + less than 1. Returns: Callable[[~.ListProductsInProductSetRequest], @@ -982,17 +999,22 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified + product sets based on a list of image information. - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. - (progress) `Operation.response` contains - `ImportProductSetsResponse`. (results) + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. + (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see - [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. + Storage. + For the format of the csv file please see + `ImportProductSetsGcsSource.csv_file_uri `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1022,31 +1044,42 @@ def purge_products( r"""Return a callable for the purge products method over gRPC. Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products + that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other + ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those - Products may still end up deleted. + after this + operation has completed. It is also recommended to not add any + of the + Products involved in the batch delete to a new ProductSet while + this + operation is running because those Products may still end up + deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to - re-import the data after deletion. + Therefore, it is + recommended to keep the csv files used in ImportProductSets (if + that was + how you originally built the Product Set) before starting + PurgeProducts, in + case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the PurgeProducts - operation has finished for that ProductSet. - - The [google.longrunning.Operation][google.longrunning.Operation] - API can be used to keep track of the progress and results of the - request. `Operation.metadata` contains `BatchOperationMetadata`. + and then + re-use the empty ProductSet to re-import new Products into the + empty + ProductSet, you must wait until the PurgeProducts operation has + finished + for that ProductSet. + + The `google.longrunning.Operation + `__ API can be + used to keep track of the progress and results of the request. + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py index bce1319cc59d..0e3e52fe45f9 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py @@ -1007,23 +1007,23 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): """REST backend synchronous transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product + search. It uses the following resource model: - - The API has a collection of - [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, - named `projects/*/locations/*/productSets/*`, which acts as a way - to put different products into groups to limit identification. In + - The API has a collection of `ProductSet + `__ resources, named + ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - - The API has a collection of - [Product][google.cloud.vision.v1p4beta1.Product] resources, named - `projects/*/locations/*/products/*` + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` - - Each [Product][google.cloud.vision.v1p4beta1.Product] has a - collection of - [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] - resources, named - `projects/*/locations/*/products/*/referenceImages/*` + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -1171,7 +1171,8 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the `AddProductToProductSet` method. + The request object. Request message for the ``AddProductToProductSet`` + method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1285,7 +1286,7 @@ def __call__( Args: request (~.product_search_service.CreateProductRequest): - The request object. Request message for the `CreateProduct` method. + The request object. Request message for the ``CreateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1435,7 +1436,7 @@ def __call__( Args: request (~.product_search_service.CreateProductSetRequest): - The request object. Request message for the `CreateProductSet` method. + The request object. Request message for the ``CreateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1594,7 +1595,7 @@ def __call__( Args: request (~.product_search_service.CreateReferenceImageRequest): - The request object. Request message for the `CreateReferenceImage` method. + The request object. Request message for the ``CreateReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1605,8 +1606,9 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ @@ -1749,7 +1751,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductRequest): - The request object. Request message for the `DeleteProduct` method. + The request object. Request message for the ``DeleteProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1855,7 +1857,7 @@ def __call__( Args: request (~.product_search_service.DeleteProductSetRequest): - The request object. Request message for the `DeleteProductSet` method. + The request object. Request message for the ``DeleteProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1963,7 +1965,7 @@ def __call__( Args: request (~.product_search_service.DeleteReferenceImageRequest): - The request object. Request message for the `DeleteReferenceImage` method. + The request object. Request message for the ``DeleteReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2071,7 +2073,7 @@ def __call__( Args: request (~.product_search_service.GetProductRequest): - The request object. Request message for the `GetProduct` method. + The request object. Request message for the ``GetProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2219,7 +2221,7 @@ def __call__( Args: request (~.product_search_service.GetProductSetRequest): - The request object. Request message for the `GetProductSet` method. + The request object. Request message for the ``GetProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2370,7 +2372,7 @@ def __call__( Args: request (~.product_search_service.GetReferenceImageRequest): - The request object. Request message for the `GetReferenceImage` method. + The request object. Request message for the ``GetReferenceImage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2381,8 +2383,9 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: - A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. """ @@ -2521,7 +2524,7 @@ def __call__( Args: request (~.product_search_service.ImportProductSetsRequest): - The request object. Request message for the `ImportProductSets` method. + The request object. Request message for the ``ImportProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2673,7 +2676,7 @@ def __call__( Args: request (~.product_search_service.ListProductsRequest): - The request object. Request message for the `ListProducts` method. + The request object. Request message for the ``ListProducts`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2684,7 +2687,7 @@ def __call__( Returns: ~.product_search_service.ListProductsResponse: - Response message for the `ListProducts` method. + Response message for the ``ListProducts`` method. """ http_options = ( @@ -2819,7 +2822,7 @@ def __call__( Args: request (~.product_search_service.ListProductSetsRequest): - The request object. Request message for the `ListProductSets` method. + The request object. Request message for the ``ListProductSets`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2830,7 +2833,7 @@ def __call__( Returns: ~.product_search_service.ListProductSetsResponse: - Response message for the `ListProductSets` method. + Response message for the ``ListProductSets`` method. """ http_options = ( @@ -2969,7 +2972,7 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the `ListProductsInProductSet` + The request object. Request message for the ``ListProductsInProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -2981,7 +2984,7 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the `ListProductsInProductSet` + Response message for the ``ListProductsInProductSet`` method. """ @@ -3124,7 +3127,7 @@ def __call__( Args: request (~.product_search_service.ListReferenceImagesRequest): - The request object. Request message for the `ListReferenceImages` method. + The request object. Request message for the ``ListReferenceImages`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3135,7 +3138,7 @@ def __call__( Returns: ~.product_search_service.ListReferenceImagesResponse: - Response message for the `ListReferenceImages` method. + Response message for the ``ListReferenceImages`` method. """ http_options = ( @@ -3275,7 +3278,7 @@ def __call__( Args: request (~.product_search_service.PurgeProductsRequest): - The request object. Request message for the `PurgeProducts` method. + The request object. Request message for the ``PurgeProducts`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3428,7 +3431,7 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the `RemoveProductFromProductSet` + The request object. Request message for the ``RemoveProductFromProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -3545,7 +3548,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductRequest): - The request object. Request message for the `UpdateProduct` method. + The request object. Request message for the ``UpdateProduct`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3695,7 +3698,7 @@ def __call__( Args: request (~.product_search_service.UpdateProductSetRequest): - The request object. Request message for the `UpdateProductSet` method. + The request object. Request message for the ``UpdateProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py index 3be3bbed59d1..866b02f1c4eb 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py @@ -35,11 +35,14 @@ class FaceRecognitionParams(proto.Message): Attributes: celebrity_set (MutableSequence[str]): The resource names for one or more - [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]s. - A celebrity set is preloaded and can be specified as - "builtin/default". If this is specified, the algorithm will - try to match the faces detected in the input image to the - Celebrities in the CelebritySets. + `CelebritySet + `__s. A + celebrity + set is preloaded and can be specified as "builtin/default". + If this is + specified, the algorithm will try to match the faces + detected in the input + image to the Celebrities in the CelebritySets. """ celebrity_set: MutableSequence[str] = proto.RepeatedField( @@ -54,7 +57,7 @@ class Celebrity(proto.Message): Attributes: name (str): The resource name of the preloaded Celebrity. Has the format - `builtin/{mid}`. + ``builtin/{mid}``. display_name (str): The Celebrity's display name. description (str): @@ -80,8 +83,9 @@ class FaceRecognitionResult(proto.Message): Attributes: celebrity (google.cloud.vision_v1p4beta1.types.Celebrity): - The [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] - that this face was matched to. + The `Celebrity `__ + that this face was + matched to. confidence (float): Recognition confidence. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py index 4eafc04a4630..db79b59f0254 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py @@ -106,22 +106,26 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the - maximum number of results to return for that type. Multiple - `Feature` objects can be specified in the `features` list. + maximum + number of results to return for that type. Multiple ``Feature`` + objects can + be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p4beta1.types.Feature.Type): The feature type. max_results (int): Maximum number of results of this type. Does not apply to - `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or - `CROP_HINTS`. + ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or + ``CROP_HINTS``. model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) - and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and - `TEXT_DETECTION` also support "builtin/weekly" for the - bleeding edge release updated weekly. + and + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and + ``TEXT_DETECTION`` also + support "builtin/weekly" for the bleeding edge release + updated weekly. """ class Type(proto.Enum): @@ -140,12 +144,14 @@ class Type(proto.Enum): Run label detection. TEXT_DETECTION (5): Run text detection / optical character recognition (OCR). - Text detection is optimized for areas of text within a - larger image; if the image is a document, use - `DOCUMENT_TEXT_DETECTION` instead. + Text detection + is optimized for areas of text within a larger image; if the + image is + a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both - `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. + ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are + present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -196,33 +202,41 @@ class ImageSource(proto.Message): Attributes: gcs_image_uri (str): - **Use `image_uri` instead.** + **Use ``image_uri`` instead.** The Google Cloud Storage URI of the form - `gs://bucket_name/object_name`. Object versioning is not - supported. See [Google Cloud Storage Request - URIs](https://cloud.google.com/storage/docs/reference-uris) - for more info. + ``gs://bucket_name/object_name``. Object versioning is not + supported. See + `Google Cloud Storage Request + URIs `__ for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - `gs://bucket_name/object_name`. Object versioning is not - supported. See [Google Cloud Storage Request - URIs](https://cloud.google.com/storage/docs/reference-uris) - for more info. + ``gs://bucket_name/object_name``. Object versioning is not + supported. See + `Google Cloud Storage Request + URIs `__ for more + info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from HTTP/HTTPS URLs, Google cannot guarantee - that the request will be completed. Your request may - fail if the specified host denies the request (e.g. - due to request throttling or DOS prevention), or if - Google throttles requests to the site for abuse - prevention. You should not depend on - externally-hosted images for production applications. - - When both `gcs_image_uri` and `image_uri` are specified, - `image_uri` takes precedence. + images from + HTTP/HTTPS URLs, Google cannot guarantee that the request + will be + completed. Your request may fail if the specified host + denies the + request (e.g. due to request throttling or DOS prevention), + or if Google + throttles requests to the site for abuse prevention. You + should not + depend on externally-hosted images for production + applications. + + When both ``gcs_image_uri`` and ``image_uri`` are specified, + ``image_uri`` takes + precedence. """ gcs_image_uri: str = proto.Field( @@ -241,14 +255,16 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all `bytes` fields, protobuffers use a pure - binary representation, whereas JSON representations use - base64. + Note: As with all ``bytes`` fields, protobuffers use a pure + binary + representation, whereas JSON representations use base64. source (google.cloud.vision_v1p4beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both `content` and `source` are provided for - an image, `content` takes precedence and is used to perform - the image annotation request. + image + URL. If both ``content`` and ``source`` are provided for an + image, ``content`` + takes precedence and is used to perform the image annotation + request. """ content: bytes = proto.Field( @@ -269,35 +285,46 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale. The bounding - box is computed to "frame" the face in accordance with human - expectations. It is based on the landmarker results. Note - that one or more x and/or y coordinates may not be generated - in the `BoundingPoly` (the polygon will be unbounded) if - only a partial face appears in the image to be annotated. + bounding box + are in the original image's scale. + The bounding box is computed to "frame" the face in + accordance with human + expectations. It is based on the landmarker results. + Note that one or more x and/or y coordinates may not be + generated in the + ``BoundingPoly`` (the polygon will be unbounded) if only a + partial face + appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): - The `fd_bounding_poly` bounding polygon is tighter than the - `boundingPoly`, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face - detection) prefix. + The ``fd_bounding_poly`` bounding polygon is tighter than + the + ``boundingPoly``, and encloses only the skin part of the + face. Typically, it + is used to eliminate the face from any image analysis that + detects the + "amount of skin" visible in an image. It is not based on the + landmarker results, only on the initial face detection, + hence + the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p4beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): - Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the face. - Range [-180,180]. + Roll angle, which indicates the amount of clockwise/anti- + clockwise rotation + of the face relative to the image vertical about the axis + perpendicular to + the face. Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. + the face is + pointing relative to the vertical plane perpendicular to the + image. Range + [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's horizontal - plane. Range [-180,180]. + that the face is + pointing relative to the image's horizontal plane. Range + [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -319,12 +346,13 @@ class FaceAnnotation(proto.Message): recognition_result (MutableSequence[google.cloud.vision_v1p4beta1.types.FaceRecognitionResult]): Additional recognition information. Only computed if image_context.face_recognition_params is provided, **and** a - match is found to a - [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] in the - input - [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]. - This field is sorted in order of decreasing confidence - values. + match is found + to a `Celebrity `__ + in the input + `CelebritySet + `__. This field + is + sorted in order of decreasing confidence values. """ class Landmark(proto.Message): @@ -340,8 +368,10 @@ class Landmark(proto.Message): class Type(proto.Enum): r"""Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the - image without considering mirror projections typical of photos. So, - `LEFT_EYE`, typically, is the person's right eye. + image + without considering mirror projections typical of photos. So, + ``LEFT_EYE``, + typically, is the person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -558,7 +588,7 @@ class LocationInfo(proto.Message): class Property(proto.Message): - r"""A `Property` consists of a user-supplied name/value pair. + r"""A ``Property`` consists of a user-supplied name/value pair. Attributes: name (str): @@ -589,43 +619,51 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): Opaque entity ID. Some IDs may be available in - [Google Knowledge Graph Search - API](https://developers.google.com/knowledge-graph/). + `Google Knowledge Graph Search + API `__. locale (str): The language code for the locale in which the entity textual - `description` is expressed. + ``description`` is expressed. description (str): - Entity textual description, expressed in its `locale` + Entity textual description, expressed in its ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use `score` instead.** - The accuracy of the entity detection in an image. For - example, for an image in which the "Eiffel Tower" entity is - detected, this field represents the confidence that there is - a tower in the query image. Range [0, 1]. + **Deprecated. Use ``score`` instead.** + The accuracy of the entity detection in an image. + For example, for an image in which the "Eiffel Tower" entity + is detected, + this field represents the confidence that there is a tower + in the query + image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower - in each image may be the same. Range [0, 1]. + the + image. For example, the relevancy of "tower" is likely + higher to an image + containing the detected "Eiffel Tower" than to an image + containing a + detected distant towering building, even though the + confidence that + there is a tower in each image may be the same. Range [0, + 1]. bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): Image region to which this entity belongs. Not produced - for `LABEL_DETECTION` features. + for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p4beta1.types.LocationInfo]): The location information for the detected entity. Multiple - `LocationInfo` elements can be present because one location - may indicate the location of the scene in the image, and - another location may indicate the location of the place - where the image was taken. Location information is usually - present for landmarks. + ``LocationInfo`` elements can be present because one + location may + indicate the location of the scene in the image, and another + location + may indicate the location of the place where the image was + taken. + Location information is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p4beta1.types.Property]): - Some entities may have optional user-supplied `Property` - (name/value) fields, such a score or string that qualifies - the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) + fields, such a score or string that qualifies the entity. """ mid: str = proto.Field( @@ -678,10 +716,12 @@ class LocalizedObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + more + information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. name (str): - Object name, expressed in its `language_code` language. + Object name, expressed in its ``language_code`` language. score (float): Score of the result. Range [0, 1]. bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): @@ -769,7 +809,7 @@ class SafeSearchAnnotation(proto.Message): class LatLongRect(proto.Message): - r"""Rectangle determined by min and max `LatLng` pairs. + r"""Rectangle determined by min and max ``LatLng`` pairs. Attributes: min_lat_lng (google.type.latlng_pb2.LatLng): @@ -936,13 +976,16 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and + DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + for + DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence + score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -966,15 +1009,21 @@ class ImageContext(proto.Message): Not used. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting `language_hints` is not needed. In - rare cases, when the language of the text in the image is - known, setting a hint will help get better results (although - it will be a significant hindrance if the hint is wrong). - Text detection returns an error if one or more of the - specified languages is not one of the [supported - languages](https://cloud.google.com/vision/docs/languages). + an empty value + yields the best results since it enables automatic language + detection. For + languages based on the Latin alphabet, setting + ``language_hints`` is not + needed. In rare cases, when the language of the text in the + image is known, + setting a hint will help get better results (although it + will be a + significant hindrance if the hint is wrong). Text detection + returns an + error if one or more of the specified languages is not one + of the + `supported languages + `__. crop_hints_params (google.cloud.vision_v1p4beta1.types.CropHintsParams): Parameters for crop hints annotation request. face_recognition_params (google.cloud.vision_v1p4beta1.types.FaceRecognitionParams): @@ -1126,7 +1175,7 @@ class AnnotateImageResponse(proto.Message): error (google.rpc.status_pb2.Status): If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be - correct, even when `error` is set. + correct, even when ``error`` is set. context (google.cloud.vision_v1p4beta1.types.ImageAnnotationContext): If present, contextual information is needed to understand where this image comes from. @@ -1303,13 +1352,15 @@ class AnnotateFileResponse(proto.Message): response is generated. responses (MutableSequence[google.cloud.vision_v1p4beta1.types.AnnotateImageResponse]): Individual responses to images found within the file. This - field will be empty if the `error` field is set. + field will be + empty if the ``error`` field is set. total_pages (int): This field gives the total number of pages in the file. error (google.rpc.status_pb2.Status): If set, represents the error message for the failed request. - The `responses` field will not be set in this case. + The + ``responses`` field will not be set in this case. """ input_config: "InputConfig" = proto.Field( @@ -1507,13 +1558,13 @@ class InputConfig(proto.Message): input from. content (bytes): File content, represented as a stream of bytes. - Note: As with all `bytes` fields, protobuffers use a pure - binary representation, whereas JSON representations use - base64. + Note: As with all ``bytes`` fields, protobuffers use a pure + binary + representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateFiles - requests. It does not work for AsyncBatchAnnotateFiles - requests. + requests. It does + not work for AsyncBatchAnnotateFiles requests. mime_type (str): The type of the file. Currently only "application/pdf", "image/tiff" and "image/gif" @@ -1544,17 +1595,21 @@ class OutputConfig(proto.Message): the output(s) to. batch_size (int): The max number of response protos to put into each output - JSON file on Google Cloud Storage. + JSON file on + Google Cloud Storage. The valid range is [1, 100]. If not specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response - protos will be generated. If `batch_size` = 20, then 5 json - files each containing 20 response protos will be written - under the prefix `gcs_destination`.`uri`. + protos will + be generated. If ``batch_size`` = 20, then 5 json files each + containing 20 response protos will be written under the + prefix + ``gcs_destination``.``uri``. Currently, batch_size only applies to GcsDestination, with - potential future support for other output configurations. + potential future + support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1592,29 +1647,35 @@ class GcsDestination(proto.Message): Attributes: uri (str): Google Cloud Storage URI prefix where the results will be - stored. Results will be in JSON format and preceded by its - corresponding input URI prefix. This field can either - represent a gcs file prefix or gcs directory. In either - case, the uri should be unique because in order to get all - of the output files, you will need to do a wildcard gcs - search on the uri prefix you provide. + stored. Results + will be in JSON format and preceded by its corresponding + input URI prefix. + This field can either represent a gcs file prefix or gcs + directory. In + either case, the uri should be unique because in order to + get all of the + output files, you will need to do a wildcard gcs search on + the uri prefix + you provide. Examples: * File Prefix: gs://bucket-name/here/filenameprefix The - output files will be created in gs://bucket-name/here/ and - the names of the output files will begin with - "filenameprefix". + output files will be created in gs://bucket-name/here/ and + the names of the output files will begin with + "filenameprefix". * Directory Prefix: gs://bucket-name/some/location/ The - output files will be created in - gs://bucket-name/some/location/ and the names of the output - files could be anything because there was no filename prefix - specified. If multiple outputs, each response is still - AnnotateFileResponse, each of which contains some subset of - the full list of AnnotateImageResponse. Multiple outputs can - happen if, for example, the output JSON is too large and - overflows into multiple sharded files. + output files will be created in gs://bucket- + name/some/location/ and the names of the output files + could be anything because there was no filename prefix + specified. If multiple outputs, each response is still + AnnotateFileResponse, each of which contains some subset + of the full list of AnnotateImageResponse. + + Multiple outputs can happen if, for example, the output JSON + is too large + and overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py index 8dcd8d292f5d..80160012e539 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py @@ -41,12 +41,13 @@ class ProductSearchParams(proto.Message): system discretion will be applied. product_set (str): The resource name of a - [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] to be - searched for similar images. + `ProductSet `__ to + be searched for + similar images. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_S + ET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -150,10 +151,12 @@ class ObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + more + information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. name (str): - Object name, expressed in its `language_code` language. + Object name, expressed in its ``language_code`` language. score (float): Score of the result. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py index 5e7b437c5294..cbc6262d4cef 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py @@ -70,8 +70,8 @@ class Product(proto.Message): The resource name of the product. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + . This field is ignored when creating a product. display_name (str): @@ -90,20 +90,24 @@ class Product(proto.Message): these should not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1p4beta1.types.Product.KeyValue]): Key-value pairs that can be attached to a product. At query - time, constraints can be specified based on the - product_labels. + time, + constraints can be specified based on the product_labels. Note that integer values can be provided as strings, e.g. - "1199". Only strings with integer values can match a - range-based restriction which is to be supported soon. + "1199". Only + strings with integer values can match a range-based + restriction which is + to be supported soon. Multiple values can be assigned to the same key. One product - may have up to 500 product_labels. + may have up to + 500 product_labels. Notice that the total number of distinct product_labels over - all products in one ProductSet cannot exceed 1M, otherwise - the product search pipeline will refuse to work for that - ProductSet. + all products + in one ProductSet cannot exceed 1M, otherwise the product + search pipeline + will refuse to work for that ProductSet. """ class KeyValue(proto.Message): @@ -161,8 +165,8 @@ class ProductSet(proto.Message): The resource name of the ProductSet. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_S + ET_ID``. This field is ignored when creating a ProductSet. display_name (str): @@ -209,8 +213,9 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): - r"""A `ReferenceImage` represents a product image and its - associated metadata, such as bounding boxes. + r"""A ``ReferenceImage`` represents a product image and its + associated metadata, + such as bounding boxes. Attributes: name (str): @@ -218,13 +223,15 @@ class ReferenceImage(proto.Message): Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/r + eferenceImages/IMAGE_ID``. This field is ignored when creating a reference image. uri (str): Required. The Google Cloud Storage URI of the reference image. - The URI must start with `gs://`. + + The URI must start with ``gs://``. bounding_polys (MutableSequence[google.cloud.vision_v1p4beta1.types.BoundingPoly]): Optional. Bounding polygons around the areas of interest in the reference image. If this @@ -255,22 +262,25 @@ class ReferenceImage(proto.Message): class CreateProductRequest(proto.Message): - r"""Request message for the `CreateProduct` method. + r"""Request message for the ``CreateProduct`` method. Attributes: parent (str): Required. The project in which the Product should be created. + Format is - `projects/PROJECT_ID/locations/LOC_ID`. + ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1p4beta1.types.Product): Required. The product to create. product_id (str): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -289,15 +299,15 @@ class CreateProductRequest(proto.Message): class ListProductsRequest(proto.Message): - r"""Request message for the `ListProducts` method. + r"""Request message for the ``ListProducts`` method. Attributes: parent (str): Required. The project OR ProductSet from which Products should be listed. - Format: - `projects/PROJECT_ID/locations/LOC_ID` + Format: + ``projects/PROJECT_ID/locations/LOC_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -321,7 +331,7 @@ class ListProductsRequest(proto.Message): class ListProductsResponse(proto.Message): - r"""Response message for the `ListProducts` method. + r"""Response message for the ``ListProducts`` method. Attributes: products (MutableSequence[google.cloud.vision_v1p4beta1.types.Product]): @@ -348,15 +358,15 @@ def raw_page(self): class GetProductRequest(proto.Message): - r"""Request message for the `GetProduct` method. + r"""Request message for the ``GetProduct`` method. Attributes: name (str): Required. Resource name of the Product to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` """ name: str = proto.Field( @@ -366,7 +376,7 @@ class GetProductRequest(proto.Message): class UpdateProductRequest(proto.Message): - r"""Request message for the `UpdateProduct` method. + r"""Request message for the ``UpdateProduct`` method. Attributes: product (google.cloud.vision_v1p4beta1.types.Product): @@ -374,11 +384,14 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields + to update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask paths include - `product_labels`, `display_name`, and `description`. + to be updated. + Valid mask paths include ``product_labels``, + ``display_name``, and + ``description``. """ product: "Product" = proto.Field( @@ -394,15 +407,15 @@ class UpdateProductRequest(proto.Message): class DeleteProductRequest(proto.Message): - r"""Request message for the `DeleteProduct` method. + r"""Request message for the ``DeleteProduct`` method. Attributes: name (str): Required. Resource name of product to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` """ name: str = proto.Field( @@ -412,21 +425,24 @@ class DeleteProductRequest(proto.Message): class CreateProductSetRequest(proto.Message): - r"""Request message for the `CreateProductSet` method. + r"""Request message for the ``CreateProductSet`` method. Attributes: parent (str): Required. The project in which the ProductSet should be created. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. product_set (google.cloud.vision_v1p4beta1.types.ProductSet): Required. The ProductSet to create. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + the server will + attempt to use this value as the resource id. If it is + already in use, an + error is returned with code ALREADY_EXISTS. Must be at + most 128 characters + long. It cannot contain the character ``/``. """ parent: str = proto.Field( @@ -445,13 +461,14 @@ class CreateProductSetRequest(proto.Message): class ListProductSetsRequest(proto.Message): - r"""Request message for the `ListProductSets` method. + r"""Request message for the ``ListProductSets`` method. Attributes: parent (str): Required. The project from which ProductSets should be listed. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -475,7 +492,7 @@ class ListProductSetsRequest(proto.Message): class ListProductSetsResponse(proto.Message): - r"""Response message for the `ListProductSets` method. + r"""Response message for the ``ListProductSets`` method. Attributes: product_sets (MutableSequence[google.cloud.vision_v1p4beta1.types.ProductSet]): @@ -502,15 +519,15 @@ def raw_page(self): class GetProductSetRequest(proto.Message): - r"""Request message for the `GetProductSet` method. + r"""Request message for the ``GetProductSet`` method. Attributes: name (str): Required. Resource name of the ProductSet to get. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` """ name: str = proto.Field( @@ -520,17 +537,19 @@ class GetProductSetRequest(proto.Message): class UpdateProductSetRequest(proto.Message): - r"""Request message for the `UpdateProductSet` method. + r"""Request message for the ``UpdateProductSet`` method. Attributes: product_set (google.cloud.vision_v1p4beta1.types.ProductSet): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The [FieldMask][google.protobuf.FieldMask] that - specifies which fields to update. + The `FieldMask `__ that + specifies which fields to + update. If update_mask isn't specified, all mutable fields are - to be updated. Valid mask path is `display_name`. + to be updated. + Valid mask path is ``display_name``. """ product_set: "ProductSet" = proto.Field( @@ -546,15 +565,15 @@ class UpdateProductSetRequest(proto.Message): class DeleteProductSetRequest(proto.Message): - r"""Request message for the `DeleteProductSet` method. + r"""Request message for the ``DeleteProductSet`` method. Attributes: name (str): Required. Resource name of the ProductSet to delete. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` """ name: str = proto.Field( @@ -564,24 +583,29 @@ class DeleteProductSetRequest(proto.Message): class CreateReferenceImageRequest(proto.Message): - r"""Request message for the `CreateReferenceImage` method. + r"""Request message for the ``CreateReferenceImage`` method. Attributes: parent (str): Required. Resource name of the product in which to - create the reference image. + create the reference + image. Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. reference_image (google.cloud.vision_v1p4beta1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value - as the resource id. If it is already in use, an error is - returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character `/`. + added. If set, + the server will attempt to use this value as the + resource id. If it is + already in use, an error is returned with code + ALREADY_EXISTS. Must be at + most 128 characters long. It cannot contain the + character ``/``. """ parent: str = proto.Field( @@ -600,21 +624,24 @@ class CreateReferenceImageRequest(proto.Message): class ListReferenceImagesRequest(proto.Message): - r"""Request message for the `ListReferenceImages` method. + r"""Request message for the ``ListReferenceImages`` method. Attributes: parent (str): Required. Resource name of the product containing the reference images. + Format is - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value of `nextPageToken` returned in a previous - reference image list request. + is the value + of ``nextPageToken`` returned in a previous reference image + list request. Defaults to the first page if not specified. """ @@ -634,7 +661,7 @@ class ListReferenceImagesRequest(proto.Message): class ListReferenceImagesResponse(proto.Message): - r"""Response message for the `ListReferenceImages` method. + r"""Response message for the ``ListReferenceImages`` method. Attributes: reference_images (MutableSequence[google.cloud.vision_v1p4beta1.types.ReferenceImage]): @@ -667,15 +694,17 @@ def raw_page(self): class GetReferenceImageRequest(proto.Message): - r"""Request message for the `GetReferenceImage` method. + r"""Request message for the ``GetReferenceImage`` method. Attributes: name (str): Required. The resource name of the ReferenceImage to get. + Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID``. """ name: str = proto.Field( @@ -685,15 +714,17 @@ class GetReferenceImageRequest(proto.Message): class DeleteReferenceImageRequest(proto.Message): - r"""Request message for the `DeleteReferenceImage` method. + r"""Request message for the ``DeleteReferenceImage`` method. Attributes: name (str): Required. The resource name of the reference image to delete. + Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID/referenceImages/IMAGE_ID`` """ name: str = proto.Field( @@ -703,21 +734,24 @@ class DeleteReferenceImageRequest(proto.Message): class AddProductToProductSetRequest(proto.Message): - r"""Request message for the `AddProductToProductSet` method. + r"""Request message for the ``AddProductToProductSet`` + method. Attributes: name (str): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` product (str): Required. The resource name for the Product to be added to this ProductSet. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` """ name: str = proto.Field( @@ -731,23 +765,25 @@ class AddProductToProductSetRequest(proto.Message): class RemoveProductFromProductSetRequest(proto.Message): - r"""Request message for the `RemoveProductFromProductSet` + r"""Request message for the ``RemoveProductFromProductSet`` method. Attributes: name (str): Required. The resource name for the ProductSet to modify. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` product (str): Required. The resource name for the Product to be - removed from this ProductSet. + removed from this + ProductSet. Format is: - - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ + ID`` """ name: str = proto.Field( @@ -761,16 +797,17 @@ class RemoveProductFromProductSetRequest(proto.Message): class ListProductsInProductSetRequest(proto.Message): - r"""Request message for the `ListProductsInProductSet` + r"""Request message for the ``ListProductsInProductSet`` method. Attributes: name (str): Required. The ProductSet resource for which to retrieve Products. - Format is: - `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU + CT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -794,7 +831,7 @@ class ListProductsInProductSetRequest(proto.Message): class ListProductsInProductSetResponse(proto.Message): - r"""Response message for the `ListProductsInProductSet` + r"""Response message for the ``ListProductsInProductSet`` method. Attributes: @@ -829,10 +866,11 @@ class ImportProductSetsGcsSource(proto.Message): csv_file_uri (str): The Google Cloud Storage URI of the input csv file. - The URI must start with `gs://`. + The URI must start with ``gs://``. The format of the input csv file should be one image per - line. In each line, there are 8 columns. + line. + In each line, there are 8 columns. 1. image-uri 2. image-id @@ -843,59 +881,78 @@ class ImportProductSetsGcsSource(proto.Message): 7. labels 8. bounding-poly - The `image-uri`, `product-set-id`, `product-id`, and - `product-category` columns are required. All other columns - are optional. - - If the `ProductSet` or `Product` specified by the - `product-set-id` and `product-id` values does not exist, - then the system will create a new `ProductSet` or `Product` - for the image. In this case, the `product-display-name` - column refers to - [display_name][google.cloud.vision.v1p4beta1.Product.display_name], - the `product-category` column refers to - [product_category][google.cloud.vision.v1p4beta1.Product.product_category], - and the `labels` column refers to - [product_labels][google.cloud.vision.v1p4beta1.Product.product_labels]. - - The `image-id` column is optional but must be unique if - provided. If it is empty, the system will automatically - assign a unique id to the image. - - The `product-display-name` column is optional. If it is - empty, the system sets the - [display_name][google.cloud.vision.v1p4beta1.Product.display_name] + The ``image-uri``, ``product-set-id``, ``product-id``, and + ``product-category`` + columns are required. All other columns are optional. + + If the ``ProductSet`` or ``Product`` specified by the + ``product-set-id`` and + ``product-id`` values does not exist, then the system will + create a new + ``ProductSet`` or ``Product`` for the image. In this case, + the + ``product-display-name`` column refers to + `display_name + `__, the + ``product-category`` column refers to + `product_category + `__, + and the ``labels`` column refers to + `product_labels + `__. + + The ``image-id`` column is optional but must be unique if + provided. If it is + empty, the system will automatically assign a unique id to + the image. + + The ``product-display-name`` column is optional. If it is + empty, the system + sets the `display_name + `__ field for the product to a space (" "). You can update the - `display_name` later by using the API. - - If a `Product` with the specified `product-id` already - exists, then the system ignores the `product-display-name`, - `product-category`, and `labels` columns. - - The `labels` column (optional) is a line containing a list - of comma-separated key-value pairs, in the following format: - - "key_1=value_1,key_2=value_2,...,key_n=value_n" - - The `bounding-poly` column (optional) identifies one region - of interest from the image in the same manner as - `CreateReferenceImage`. If you do not specify the - `bounding-poly` column, then the system will try to detect - regions of interest automatically. - - At most one `bounding-poly` column is allowed per line. If - the image contains multiple regions of interest, add a line - to the CSV file that includes the same product information, - and the `bounding-poly` values for each region of interest. - - The `bounding-poly` column must contain an even number of - comma-separated numbers, in the format - "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative - integers for absolute bounding polygons, and float values in - [0, 1] for normalized bounding polygons. + ``display_name`` + later by using the API. + + If a ``Product`` with the specified ``product-id`` already + exists, then the + system ignores the ``product-display-name``, ``product- + category``, and ``labels`` + columns. + + The ``labels`` column (optional) is a line containing a list + of + comma-separated key-value pairs, in the following format: + + "key_1=value_1,key_2=value_2,...,key_n=value_n" + + The ``bounding-poly`` column (optional) identifies one + region of + interest from the image in the same manner as + ``CreateReferenceImage``. If + you do not specify the ``bounding-poly`` column, then the + system will try to + detect regions of interest automatically. + + At most one ``bounding-poly`` column is allowed per line. If + the image + contains multiple regions of interest, add a line to the CSV + file that + includes the same product information, and the ``bounding- + poly`` values for + each region of interest. + + The ``bounding-poly`` column must contain an even number of + comma-separated + numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". + Use + non-negative integers for absolute bounding polygons, and + float values + in [0, 1] for normalized bounding polygons. The system will resize the image if the image resolution is - too large to process (larger than 20MP). + too + large to process (larger than 20MP). """ csv_file_uri: str = proto.Field( @@ -905,7 +962,7 @@ class ImportProductSetsGcsSource(proto.Message): class ImportProductSetsInputConfig(proto.Message): - r"""The input content for the `ImportProductSets` method. + r"""The input content for the ``ImportProductSets`` method. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -927,13 +984,14 @@ class ImportProductSetsInputConfig(proto.Message): class ImportProductSetsRequest(proto.Message): - r"""Request message for the `ImportProductSets` method. + r"""Request message for the ``ImportProductSets`` method. Attributes: parent (str): Required. The project in which the ProductSets should be imported. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. input_config (google.cloud.vision_v1p4beta1.types.ImportProductSetsInputConfig): Required. The input content for the list of requests. @@ -951,12 +1009,14 @@ class ImportProductSetsRequest(proto.Message): class ImportProductSetsResponse(proto.Message): - r"""Response message for the `ImportProductSets` method. + r"""Response message for the ``ImportProductSets`` method. This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] + `google.longrunning.Operations.GetOperation + `__ method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] + `google.longrunning.Operation.response + `__ field. Attributes: @@ -964,12 +1024,14 @@ class ImportProductSetsResponse(proto.Message): The list of reference_images that are imported successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): The rpc status for each ImportProductSet request, including - both successes and errors. + both successes + and errors. The number of statuses here matches the number of lines in - the csv file, and statuses[i] stores the success or failure - status of processing the i-th line of the csv, starting from - line 0. + the csv file, + and statuses[i] stores the success or failure status of + processing the i-th + line of the csv, starting from line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -987,8 +1049,9 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the `metadata` field of the `Operation` returned - by the `GetOperation` call of the `google::longrunning::Operations` + This is included in the ``metadata`` field of the ``Operation`` + returned by the + ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: @@ -999,8 +1062,9 @@ class BatchOperationMetadata(proto.Message): to the server. end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and - [google.longrunning.Operation.done][google.longrunning.Operation.done] - is set to true. + `google.longrunning.Operation.done + `__ is + set to true. """ class State(proto.Enum): @@ -1055,8 +1119,10 @@ class ProductSetPurgeConfig(proto.Message): Attributes: product_set_id (str): The ProductSet that contains the Products to delete. If a - Product is a member of product_set_id in addition to other - ProductSets, the Product will still be deleted. + Product is a + member of product_set_id in addition to other ProductSets, + the Product will + still be deleted. """ product_set_id: str = proto.Field( @@ -1066,7 +1132,7 @@ class ProductSetPurgeConfig(proto.Message): class PurgeProductsRequest(proto.Message): - r"""Request message for the `PurgeProducts` method. + r"""Request message for the ``PurgeProducts`` method. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -1083,13 +1149,15 @@ class PurgeProductsRequest(proto.Message): This field is a member of `oneof`_ ``target``. delete_orphan_products (bool): If delete_orphan_products is true, all Products that are not - in any ProductSet will be deleted. + in any + ProductSet will be deleted. This field is a member of `oneof`_ ``target``. parent (str): Required. The project and location in which the Products should be deleted. - Format is `projects/PROJECT_ID/locations/LOC_ID`. + + Format is ``projects/PROJECT_ID/locations/LOC_ID``. force (bool): The default value is false. Override this value to true to actually perform the purge. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py index 27bab8965fc4..cbdf26b46594 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py @@ -36,13 +36,16 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like this: - - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + text. + The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each structural component, starting from Page, may further have - their own properties. Properties describe detected languages, breaks - etc.. Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty] + their own + properties. Properties describe detected languages, breaks etc.. + Please refer + to the + `TextAnnotation.TextProperty + `__ message definition below for more detail. Attributes: @@ -58,8 +61,10 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + more + information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. confidence (float): Confidence of detected language. Range [0, 1]. """ @@ -96,8 +101,9 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not - co-occur with `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. + End-line hyphen that is not present in text; does not co- + occur with + ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py index f655f0e91986..fffcd2f4d9ec 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py @@ -159,9 +159,11 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for `label`, such as "en-US" or - "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". + For more information, see + http://www.unicode.org/reports/tr35/#Unicode_locale_identifi + er. """ label: str = proto.Field( From f10729d75b8d49affaa6fdaa8170487620809d3a Mon Sep 17 00:00:00 2001 From: ohmayr Date: Fri, 16 Jan 2026 23:50:21 +0000 Subject: [PATCH 5/9] version 5 --- .../services/image_annotator/async_client.py | 24 ++-- .../services/image_annotator/client.py | 24 ++-- .../image_annotator/transports/grpc.py | 12 +- .../transports/grpc_asyncio.py | 12 +- .../services/product_search/async_client.py | 87 ++++++-------- .../services/product_search/client.py | 87 ++++++-------- .../product_search/transports/grpc.py | 25 ++-- .../product_search/transports/grpc_asyncio.py | 25 ++-- .../product_search/transports/rest.py | 21 ++-- .../cloud/vision_v1/types/image_annotator.py | 80 +++++++------ .../cloud/vision_v1/types/product_search.py | 6 +- .../vision_v1/types/product_search_service.py | 107 +++++++----------- .../cloud/vision_v1/types/text_annotation.py | 7 +- .../cloud/vision_v1/types/web_detection.py | 7 +- .../vision_v1p1beta1/types/image_annotator.py | 39 ++++--- .../vision_v1p1beta1/types/text_annotation.py | 7 +- .../vision_v1p1beta1/types/web_detection.py | 7 +- .../services/image_annotator/async_client.py | 13 +-- .../services/image_annotator/client.py | 13 +-- .../image_annotator/transports/grpc.py | 6 +- .../transports/grpc_asyncio.py | 6 +- .../vision_v1p2beta1/types/image_annotator.py | 60 +++++----- .../vision_v1p2beta1/types/text_annotation.py | 7 +- .../vision_v1p2beta1/types/web_detection.py | 7 +- .../services/image_annotator/async_client.py | 13 +-- .../services/image_annotator/client.py | 13 +-- .../image_annotator/transports/grpc.py | 6 +- .../transports/grpc_asyncio.py | 6 +- .../services/product_search/async_client.py | 73 +++++------- .../services/product_search/client.py | 73 +++++------- .../product_search/transports/grpc.py | 15 +-- .../product_search/transports/grpc_asyncio.py | 15 +-- .../product_search/transports/rest.py | 18 +-- .../vision_v1p3beta1/types/image_annotator.py | 63 +++++------ .../vision_v1p3beta1/types/product_search.py | 6 +- .../types/product_search_service.py | 67 ++++------- .../vision_v1p3beta1/types/text_annotation.py | 7 +- .../vision_v1p3beta1/types/web_detection.py | 7 +- .../services/image_annotator/async_client.py | 26 ++--- .../services/image_annotator/client.py | 26 ++--- .../image_annotator/transports/grpc.py | 12 +- .../transports/grpc_asyncio.py | 12 +- .../services/product_search/async_client.py | 85 +++++--------- .../services/product_search/client.py | 85 +++++--------- .../product_search/transports/grpc.py | 22 ++-- .../product_search/transports/grpc_asyncio.py | 22 ++-- .../product_search/transports/rest.py | 18 +-- .../vision_v1p4beta1/types/image_annotator.py | 80 +++++++------ .../vision_v1p4beta1/types/product_search.py | 6 +- .../types/product_search_service.py | 107 +++++++----------- .../vision_v1p4beta1/types/text_annotation.py | 7 +- .../vision_v1p4beta1/types/web_detection.py | 7 +- 52 files changed, 632 insertions(+), 954 deletions(-) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py index c48fdb628811..aff9026e4ca4 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py @@ -538,10 +538,8 @@ async def async_batch_annotate_images( Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer @@ -607,9 +605,9 @@ async def sample_async_batch_annotate_images(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse - `` Response to an async batch image annotation request. + The result type for the operation will be + :class:``google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch + image annotation request. """ # Create or coerce a protobuf request object. @@ -685,10 +683,8 @@ async def async_batch_annotate_files( images per page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -743,9 +739,9 @@ async def sample_async_batch_annotate_files(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse` - ` Response to an async batch file annotation request. + The result type for the operation will be + :class:``google.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py index e5ad6b9aa31d..7e6d08609e48 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py @@ -995,10 +995,8 @@ def async_batch_annotate_images( Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer @@ -1064,9 +1062,9 @@ def sample_async_batch_annotate_images(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse - `` Response to an async batch image annotation request. + The result type for the operation will be + :class:``google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch + image annotation request. """ # Create or coerce a protobuf request object. @@ -1141,10 +1139,8 @@ def async_batch_annotate_files( images per page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -1199,9 +1195,9 @@ def sample_async_batch_annotate_files(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse` - ` Response to an async batch file annotation request. + The result type for the operation will be + :class:``google.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py index 3dfc108fe6d4..b401b4cb672d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py @@ -422,10 +422,8 @@ def async_batch_annotate_images( Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer @@ -467,10 +465,8 @@ def async_batch_annotate_files( images per page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py index 952c5eb0cabb..edd8146e7637 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py @@ -431,10 +431,8 @@ def async_batch_annotate_images( Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer @@ -477,10 +475,8 @@ def async_batch_annotate_files( images per page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py index 067e75e1d217..97d291074807 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py @@ -76,9 +76,8 @@ class ProductSearchAsyncClient: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -86,8 +85,7 @@ class ProductSearchAsyncClient: - Each `Product `__ has a collection of `ReferenceImage `__ - resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -647,8 +645,7 @@ async def sample_get_product_set(): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -904,8 +901,7 @@ async def sample_delete_product_set(): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1291,8 +1287,7 @@ async def sample_get_product(): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1371,8 +1366,8 @@ async def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in @@ -1552,8 +1547,7 @@ async def sample_delete_product(): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1691,8 +1685,7 @@ async def sample_create_reference_image(): image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1837,8 +1830,7 @@ async def sample_delete_reference_image(): delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1951,8 +1943,7 @@ async def sample_list_reference_images(): reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2084,8 +2075,7 @@ async def sample_get_reference_image(): get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2203,15 +2193,13 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the ``AddProductToProductSet`` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2221,8 +2209,7 @@ async def sample_add_product_to_product_set(): to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2325,15 +2312,13 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the ``RemoveProductFromProductSet`` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2344,8 +2329,7 @@ async def sample_remove_product_from_product_set(): ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2459,15 +2443,13 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the ``ListProductsInProductSet`` method. name (:class:`str`): Required. The ProductSet resource for which to retrieve Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2482,8 +2464,7 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the ``ListProductsInProductSet`` - method. + Response message for the ``ListProductsInProductSet`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2572,16 +2553,14 @@ async def import_product_sets( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. - (results) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri `__. + `ImportProductSetsGcsSource.csv_file_uri + `__. .. code-block:: python @@ -2644,9 +2623,9 @@ async def sample_import_product_sets(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1.types.ImportProductSetsResponse`` - Response message for the ``ImportProductSets`` method. + The result type for the operation will be + :class:``google.cloud.vision_v1.types.ImportProductSetsResponse`` Response message for the + ``ImportProductSets`` method. This message is returned by the `google.longrunning.Operations.GetOperation @@ -2763,8 +2742,7 @@ async def purge_products( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -2821,9 +2799,8 @@ async def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:``google.protobuf.empty_pb2.Empty`` A generic - empty message that you can re-use to avoid defining - duplicated + :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that + you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py index 1e664080a779..d814549d1bd2 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py @@ -120,9 +120,8 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -130,8 +129,7 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): - Each `Product `__ has a collection of `ReferenceImage `__ - resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -1122,8 +1120,7 @@ def sample_get_product_set(): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1373,8 +1370,7 @@ def sample_delete_product_set(): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1751,8 +1747,7 @@ def sample_get_product(): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1828,8 +1823,8 @@ def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in @@ -2006,8 +2001,7 @@ def sample_delete_product(): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2142,8 +2136,7 @@ def sample_create_reference_image(): image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2285,8 +2278,7 @@ def sample_delete_reference_image(): delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2396,8 +2388,7 @@ def sample_list_reference_images(): reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2526,8 +2517,7 @@ def sample_get_reference_image(): get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2642,15 +2632,13 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the ``AddProductToProductSet`` method. name (str): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2660,8 +2648,7 @@ def sample_add_product_to_product_set(): to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2763,15 +2750,13 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the ``RemoveProductFromProductSet`` method. name (str): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2782,8 +2767,7 @@ def sample_remove_product_from_product_set(): ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2896,15 +2880,13 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the ``ListProductsInProductSet`` method. name (str): Required. The ProductSet resource for which to retrieve Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2919,8 +2901,7 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the ``ListProductsInProductSet`` - method. + Response message for the ``ListProductsInProductSet`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -3008,16 +2989,14 @@ def import_product_sets( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. - (results) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri `__. + `ImportProductSetsGcsSource.csv_file_uri + `__. .. code-block:: python @@ -3080,9 +3059,9 @@ def sample_import_product_sets(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1.types.ImportProductSetsResponse`` - Response message for the ``ImportProductSets`` method. + The result type for the operation will be + :class:``google.cloud.vision_v1.types.ImportProductSetsResponse`` Response message for the + ``ImportProductSets`` method. This message is returned by the `google.longrunning.Operations.GetOperation @@ -3196,8 +3175,7 @@ def purge_products( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -3254,9 +3232,8 @@ def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:``google.protobuf.empty_pb2.Empty`` A generic - empty message that you can re-use to avoid defining - duplicated + :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that + you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py index 4932df073b02..38274eea61c5 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py @@ -118,9 +118,8 @@ class ProductSearchGrpcTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -128,8 +127,7 @@ class ProductSearchGrpcTransport(ProductSearchTransport): - Each `Product `__ has a collection of `ReferenceImage `__ - resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -636,8 +634,8 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in @@ -986,16 +984,14 @@ def import_product_sets( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. - (results) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri `__. + `ImportProductSetsGcsSource.csv_file_uri + `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1059,8 +1055,7 @@ def purge_products( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: Callable[[~.PurgeProductsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py index 9661af3e2b08..08f72df9b7fa 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py @@ -124,9 +124,8 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -134,8 +133,7 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): - Each `Product `__ has a collection of `ReferenceImage `__ - resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -650,8 +648,8 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in @@ -1005,16 +1003,14 @@ def import_product_sets( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. - (results) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri `__. + `ImportProductSetsGcsSource.csv_file_uri + `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1079,8 +1075,7 @@ def purge_products( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: Callable[[~.PurgeProductsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py index 79d8b4f6ff62..d34f06f7794a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py @@ -1037,9 +1037,8 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -1047,8 +1046,7 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): - Each `Product `__ has a collection of `ReferenceImage `__ - resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -1215,8 +1213,7 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the ``AddProductToProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3016,8 +3013,7 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the ``ListProductsInProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3028,9 +3024,7 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the ``ListProductsInProductSet`` - method. - + Response message for the ``ListProductsInProductSet`` method. """ http_options = ( @@ -3475,8 +3469,7 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the ``RemoveProductFromProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py index 41eaf0847c9b..22e87af8f4bc 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py @@ -102,8 +102,8 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the maximum - number of results to return for that type. Multiple ``Feature`` - objects can + number of results to return for that type. Multiple + ``Feature`` objects can be specified in the ``features`` list. Attributes: @@ -111,14 +111,13 @@ class Feature(proto.Message): The feature type. max_results (int): Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. + ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` + also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -145,8 +144,7 @@ class Type(proto.Enum): a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both - ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are - present. + ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -200,20 +198,20 @@ class ImageSource(proto.Message): **Use ``image_uri`` instead.** The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See + ``gs://bucket_name/object_name``. Object versioning is not supported. See `Google Cloud Storage Request - URIs `__ for more info. + URIs + `__ + for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See + ``gs://bucket_name/object_name``. Object versioning is not supported. See `Google Cloud Storage Request - URIs `__ for more + URIs + `__ + for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching @@ -229,8 +227,8 @@ class ImageSource(proto.Message): depend on externally-hosted images for production applications. - When both ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes + When both ``gcs_image_uri`` and ``image_uri`` are + specified, ``image_uri`` takes precedence. """ @@ -250,8 +248,8 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use a pure - binary + Note: As with all ``bytes`` fields, protobuffers use + a pure binary representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateImages @@ -260,8 +258,8 @@ class Image(proto.Message): source (google.cloud.vision_v1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible image - URL. If both ``content`` and ``source`` are provided for an - image, ``content`` + URL. If both ``content`` and ``source`` are + provided for an image, ``content`` takes precedence and is used to perform the image annotation request. """ @@ -295,8 +293,7 @@ class FaceAnnotation(proto.Message): partial face appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the + The ``fd_bounding_poly`` bounding polygon is tighter than the ``boundingPoly``, and encloses only the skin part of the face. Typically, it is used to eliminate the face from any image analysis that @@ -308,8 +305,8 @@ class FaceAnnotation(proto.Message): landmarks (MutableSequence[google.cloud.vision_v1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): - Roll angle, which indicates the amount of clockwise/anti- - clockwise rotation + Roll angle, which indicates the amount of + clockwise/anti-clockwise rotation of the face relative to the image vertical about the axis perpendicular to the face. Range [-180,180]. @@ -613,8 +610,8 @@ class EntityAnnotation(proto.Message): The language code for the locale in which the entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its ``locale`` - language. + Entity textual description, expressed in its + ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): @@ -649,8 +646,8 @@ class EntityAnnotation(proto.Message): taken. Location information is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1.types.Property]): - Some entities may have optional user-supplied ``Property`` - (name/value) + Some entities may have optional user-supplied + ``Property`` (name/value) fields, such a score or string that qualifies the entity. """ @@ -706,8 +703,7 @@ class LocalizedObjectAnnotation(proto.Message): The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. score (float): @@ -1675,8 +1671,8 @@ class InputConfig(proto.Message): input from. content (bytes): File content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use a pure - binary + Note: As with all ``bytes`` fields, protobuffers use + a pure binary representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateFiles @@ -1719,7 +1715,8 @@ class OutputConfig(proto.Message): For example, for one pdf file with 100 pages, 100 response protos will - be generated. If ``batch_size`` = 20, then 5 json files each + be generated. If ``batch_size`` = 20, then 5 json files + each containing 20 response protos will be written under the prefix ``gcs_destination``.``uri``. @@ -1783,12 +1780,13 @@ class GcsDestination(proto.Message): "filenameprefix". * Directory Prefix: gs://bucket-name/some/location/ The - output files will be created in gs://bucket- - name/some/location/ and the names of the output files - could be anything because there was no filename prefix - specified. If multiple outputs, each response is still - AnnotateFileResponse, each of which contains some subset - of the full list of AnnotateImageResponse. + output files will be created in + gs://bucket-name/some/location/ and the names of the + output files could be anything because there was no + filename prefix specified. If multiple outputs, each + response is still AnnotateFileResponse, each of which + contains some subset of the full list of + AnnotateImageResponse. Multiple outputs can happen if, for example, the output JSON is too large diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py index 5b41b74ea516..37bc2c363f4f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py @@ -45,8 +45,7 @@ class ProductSearchParams(proto.Message): be searched for similar images. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_S - ET_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -152,8 +151,7 @@ class ObjectAnnotation(proto.Message): The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. score (float): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py index 6049b4afe0a0..b46ccc642fe2 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py @@ -70,8 +70,7 @@ class Product(proto.Message): The resource name of the product. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - . + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This field is ignored when creating a product. display_name (str): @@ -166,8 +165,7 @@ class ProductSet(proto.Message): The resource name of the ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_S - ET_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. This field is ignored when creating a ProductSet. display_name (str): @@ -223,8 +221,7 @@ class ReferenceImage(proto.Message): The resource name of the reference image. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/r - eferenceImages/IMAGE_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This field is ignored when creating a reference image. uri (str): @@ -365,8 +362,7 @@ class GetProductRequest(proto.Message): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -414,8 +410,7 @@ class DeleteProductRequest(proto.Message): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -526,8 +521,7 @@ class GetProductSetRequest(proto.Message): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -572,8 +566,7 @@ class DeleteProductSetRequest(proto.Message): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -592,8 +585,7 @@ class CreateReferenceImageRequest(proto.Message): image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. reference_image (google.cloud.vision_v1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. @@ -632,8 +624,7 @@ class ListReferenceImagesRequest(proto.Message): reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -702,8 +693,7 @@ class GetReferenceImageRequest(proto.Message): get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. """ name: str = proto.Field( @@ -721,8 +711,7 @@ class DeleteReferenceImageRequest(proto.Message): delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` """ name: str = proto.Field( @@ -732,8 +721,7 @@ class DeleteReferenceImageRequest(proto.Message): class AddProductToProductSetRequest(proto.Message): - r"""Request message for the ``AddProductToProductSet`` - method. + r"""Request message for the ``AddProductToProductSet`` method. Attributes: name (str): @@ -741,15 +729,13 @@ class AddProductToProductSetRequest(proto.Message): modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be added to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -763,8 +749,7 @@ class AddProductToProductSetRequest(proto.Message): class RemoveProductFromProductSetRequest(proto.Message): - r"""Request message for the ``RemoveProductFromProductSet`` - method. + r"""Request message for the ``RemoveProductFromProductSet`` method. Attributes: name (str): @@ -772,16 +757,14 @@ class RemoveProductFromProductSetRequest(proto.Message): modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be removed from this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -795,8 +778,7 @@ class RemoveProductFromProductSetRequest(proto.Message): class ListProductsInProductSetRequest(proto.Message): - r"""Request message for the ``ListProductsInProductSet`` - method. + r"""Request message for the ``ListProductsInProductSet`` method. Attributes: name (str): @@ -804,8 +786,7 @@ class ListProductsInProductSetRequest(proto.Message): Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -829,8 +810,7 @@ class ListProductsInProductSetRequest(proto.Message): class ListProductsInProductSetResponse(proto.Message): - r"""Response message for the ``ListProductsInProductSet`` - method. + r"""Response message for the ``ListProductsInProductSet`` method. Attributes: products (MutableSequence[google.cloud.vision_v1.types.Product]): @@ -879,16 +859,16 @@ class ImportProductSetsGcsSource(proto.Message): 7. labels 8. bounding-poly - The ``image-uri``, ``product-set-id``, ``product-id``, and - ``product-category`` + The ``image-uri``, ``product-set-id``, ``product-id``, + and ``product-category`` columns are required. All other columns are optional. - If the ``ProductSet`` or ``Product`` specified by the - ``product-set-id`` and - ``product-id`` values does not exist, then the system will - create a new - ``ProductSet`` or ``Product`` for the image. In this case, - the + If the ``ProductSet`` or ``Product`` specified by + the ``product-set-id`` and + ``product-id`` values does not exist, then the system + will create a new + ``ProductSet`` or ``Product`` for the image. In + this case, the ``product-display-name`` column refers to `display_name `__, the @@ -899,27 +879,27 @@ class ImportProductSetsGcsSource(proto.Message): `product_labels `__. - The ``image-id`` column is optional but must be unique if - provided. If it is + The ``image-id`` column is optional but must be unique + if provided. If it is empty, the system will automatically assign a unique id to the image. - The ``product-display-name`` column is optional. If it is - empty, the system + The ``product-display-name`` column is optional. If it is empty, + the system sets the `display_name `__ field for the product to a space (" "). You can update the ``display_name`` later by using the API. - If a ``Product`` with the specified ``product-id`` already - exists, then the - system ignores the ``product-display-name``, ``product- - category``, and ``labels`` + If a ``Product`` with the specified ``product-id`` + already exists, then the + system ignores the ``product-display-name``, ``product-category``, and + ``labels`` columns. - The ``labels`` column (optional) is a line containing a list - of + The ``labels`` column (optional) is a line containing + a list of comma-separated key-value pairs, in the following format: "key_1=value_1,key_2=value_2,...,key_n=value_n" @@ -936,8 +916,8 @@ class ImportProductSetsGcsSource(proto.Message): the image contains multiple regions of interest, add a line to the CSV file that - includes the same product information, and the ``bounding- - poly`` values for + includes the same product information, and the + ``bounding-poly`` values for each region of interest. The ``bounding-poly`` column must contain an even number of @@ -1047,10 +1027,9 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` - returned by the - ``GetOperation`` call of the ``google::longrunning::Operations`` - service. + This is included in the ``metadata`` field of the + ``Operation`` returned by the + ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1.types.BatchOperationMetadata.State): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py index c17d406d9331..5a2cc7b4c39a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py @@ -63,8 +63,7 @@ class DetectedLanguage(proto.Message): The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. """ @@ -101,8 +100,8 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not co- - occur with + End-line hyphen that is not present in text; does not + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py index c3a9939753c9..9682b2d431d3 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py @@ -159,11 +159,10 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". + The BCP-47 language code for ``label``, such as + "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ label: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py index 482746f4a670..345f23901196 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py @@ -103,8 +103,8 @@ class Feature(proto.Message): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` + also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -176,8 +176,8 @@ class ImageSource(proto.Message): following form: ``gs://bucket_name/object_name`` (for details, see `Google Cloud Storage Request - URIs `__). + URIs + `__). NOTE: Cloud Storage object versioning is not supported. image_uri (str): Image URI which supports: @@ -185,8 +185,8 @@ class ImageSource(proto.Message): following form: ``gs://bucket_name/object_name`` (for details, see `Google Cloud Storage Request - URIs `__). + URIs + `__). NOTE: Cloud Storage object versioning is not supported. 2) Publicly accessible image HTTP/HTTPS URL. This is preferred over the legacy ``gcs_image_uri`` above. @@ -212,14 +212,14 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: as with all ``bytes`` fields, protobuffers use a pure - binary + Note: as with all ``bytes`` fields, protobuffers use + a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p1beta1.types.ImageSource): - Google Cloud Storage image location. If both ``content`` and - ``source`` - are provided for an image, ``content`` takes precedence and - is + Google Cloud Storage image location. If both + ``content`` and ``source`` + are provided for an image, ``content`` takes + precedence and is used to perform the image annotation request. """ @@ -253,8 +253,7 @@ class FaceAnnotation(proto.Message): partial face appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the + The ``fd_bounding_poly`` bounding polygon is tighter than the ``boundingPoly``, and encloses only the skin part of the face. Typically, it is used to eliminate the face from any image analysis that @@ -266,8 +265,8 @@ class FaceAnnotation(proto.Message): landmarks (MutableSequence[google.cloud.vision_v1p1beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): - Roll angle, which indicates the amount of clockwise/anti- - clockwise rotation + Roll angle, which indicates the amount of + clockwise/anti-clockwise rotation of the face relative to the image vertical about the axis perpendicular to the face. Range [-180,180]. @@ -565,8 +564,8 @@ class EntityAnnotation(proto.Message): The language code for the locale in which the entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its ``locale`` - language. + Entity textual description, expressed in its + ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): @@ -600,8 +599,8 @@ class EntityAnnotation(proto.Message): taken. Location information is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p1beta1.types.Property]): - Some entities may have optional user-supplied ``Property`` - (name/value) + Some entities may have optional user-supplied + ``Property`` (name/value) fields, such a score or string that qualifies the entity. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py index d73be008bcc2..0ad3e38682d5 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py @@ -63,8 +63,7 @@ class DetectedLanguage(proto.Message): The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. """ @@ -101,8 +100,8 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not co- - occur with + End-line hyphen that is not present in text; does not + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py index 3c9ae6b96925..3f4163872cd8 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py @@ -157,11 +157,10 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". + The BCP-47 language code for ``label``, such as + "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ label: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py index 43849cf42188..b96339df935f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py @@ -420,10 +420,8 @@ async def async_batch_annotate_files( page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -478,10 +476,9 @@ async def sample_async_batch_annotate_files(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesRe - sponse`` Response to an async batch file annotation - request. + The result type for the operation will be + :class:``google.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py index b52d45666249..905ac68c029d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py @@ -838,10 +838,8 @@ def async_batch_annotate_files( page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -896,10 +894,9 @@ def sample_async_batch_annotate_files(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesRe - sponse`` Response to an async batch file annotation - request. + The result type for the operation will be + :class:``google.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py index d91ae084ae07..87dd6d567258 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py @@ -386,10 +386,8 @@ def async_batch_annotate_files( page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py index b630edcf3192..a39de12dda09 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py @@ -395,10 +395,8 @@ def async_batch_annotate_files( page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py index 5bb183fff780..f4ada3cb6a1d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py @@ -101,8 +101,8 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the maximum - number of results to return for that type. Multiple ``Feature`` - objects can + number of results to return for that type. Multiple + ``Feature`` objects can be specified in the ``features`` list. Attributes: @@ -110,14 +110,13 @@ class Feature(proto.Message): The feature type. max_results (int): Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. + ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` + also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -144,8 +143,7 @@ class Type(proto.Enum): a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both - ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are - present. + ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -193,20 +191,20 @@ class ImageSource(proto.Message): **Use ``image_uri`` instead.** The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See + ``gs://bucket_name/object_name``. Object versioning is not supported. See `Google Cloud Storage Request - URIs `__ for more info. + URIs + `__ + for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See + ``gs://bucket_name/object_name``. Object versioning is not supported. See `Google Cloud Storage Request - URIs `__ for more + URIs + `__ + for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching @@ -222,8 +220,8 @@ class ImageSource(proto.Message): depend on externally-hosted images for production applications. - When both ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes + When both ``gcs_image_uri`` and ``image_uri`` are + specified, ``image_uri`` takes precedence. """ @@ -243,14 +241,14 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use a pure - binary + Note: As with all ``bytes`` fields, protobuffers use + a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p2beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible image - URL. If both ``content`` and ``source`` are provided for an - image, ``content`` + URL. If both ``content`` and ``source`` are + provided for an image, ``content`` takes precedence and is used to perform the image annotation request. """ @@ -285,8 +283,7 @@ class FaceAnnotation(proto.Message): partial face appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the + The ``fd_bounding_poly`` bounding polygon is tighter than the ``boundingPoly``, and encloses only the skin part of the face. Typically, it is used to eliminate the face from any image analysis that @@ -298,8 +295,8 @@ class FaceAnnotation(proto.Message): landmarks (MutableSequence[google.cloud.vision_v1p2beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): - Roll angle, which indicates the amount of clockwise/anti- - clockwise rotation + Roll angle, which indicates the amount of + clockwise/anti-clockwise rotation of the face relative to the image vertical about the axis perpendicular to the face. Range [-180,180]. @@ -597,8 +594,8 @@ class EntityAnnotation(proto.Message): The language code for the locale in which the entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its ``locale`` - language. + Entity textual description, expressed in its + ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): @@ -633,8 +630,8 @@ class EntityAnnotation(proto.Message): taken. Location information is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p2beta1.types.Property]): - Some entities may have optional user-supplied ``Property`` - (name/value) + Some entities may have optional user-supplied + ``Property`` (name/value) fields, such a score or string that qualifies the entity. """ @@ -1335,7 +1332,8 @@ class OutputConfig(proto.Message): For example, for one pdf file with 100 pages, 100 response protos will - be generated. If ``batch_size`` = 20, then 5 json files each + be generated. If ``batch_size`` = 20, then 5 json files + each containing 20 response protos will be written under the prefix ``gcs_destination``.``uri``. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py index 6c85d7c74b78..dea841089fb5 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py @@ -63,8 +63,7 @@ class DetectedLanguage(proto.Message): The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. """ @@ -101,8 +100,8 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not co- - occur with + End-line hyphen that is not present in text; does not + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py index f795fd530621..7b50cbeabee1 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py @@ -157,11 +157,10 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". + The BCP-47 language code for ``label``, such as + "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ label: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py index ed5efba9c54d..924761d4fb9b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py @@ -424,10 +424,8 @@ async def async_batch_annotate_files( images per page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -482,10 +480,9 @@ async def sample_async_batch_annotate_files(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesRe - sponse`` Response to an async batch file annotation - request. + The result type for the operation will be + :class:``google.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py index 27632daf92a7..ca5e1f87284a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py @@ -884,10 +884,8 @@ def async_batch_annotate_files( images per page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -942,10 +940,9 @@ def sample_async_batch_annotate_files(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesRe - sponse`` Response to an async batch file annotation - request. + The result type for the operation will be + :class:``google.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py index b1aded54bd79..6c1360204a22 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py @@ -387,10 +387,8 @@ def async_batch_annotate_files( images per page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py index b80736018225..26638560caef 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py @@ -396,10 +396,8 @@ def async_batch_annotate_files( images per page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py index fb814125f020..86074dd2ecca 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py @@ -74,9 +74,8 @@ class ProductSearchAsyncClient: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -645,8 +644,7 @@ async def sample_get_product_set(): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -907,8 +905,7 @@ async def sample_delete_product_set(): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1294,8 +1291,7 @@ async def sample_get_product(): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1559,8 +1555,7 @@ async def sample_delete_product(): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1697,8 +1692,7 @@ async def sample_create_reference_image(): create the reference image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1850,8 +1844,7 @@ async def sample_delete_reference_image(): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1964,8 +1957,7 @@ async def sample_list_reference_images(): reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2098,8 +2090,7 @@ async def sample_get_reference_image(): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2217,15 +2208,13 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the ``AddProductToProductSet`` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2235,8 +2224,7 @@ async def sample_add_product_to_product_set(): to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2344,15 +2332,13 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the ``RemoveProductFromProductSet`` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2362,8 +2348,7 @@ async def sample_remove_product_from_product_set(): removed from this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2477,15 +2462,13 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p3beta1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the ``ListProductsInProductSet`` method. name (:class:`str`): Required. The ProductSet resource for which to retrieve Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2500,8 +2483,7 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the ``ListProductsInProductSet`` - method. + Response message for the ``ListProductsInProductSet`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2590,16 +2572,14 @@ async def import_product_sets( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. - (results) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri `__. + `ImportProductSetsGcsSource.csv_file_uri + `__. .. code-block:: python @@ -2662,10 +2642,9 @@ async def sample_import_product_sets(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1p3beta1.types.ImportProductSetsResponse - `` Response message for the ``ImportProductSets`` - method. + The result type for the operation will be + :class:``google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` Response message for the + ``ImportProductSets`` method. This message is returned by the `google.longrunning.Operations.GetOperation diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py index 02783a09a3e7..7a4a82ea1fca 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py @@ -118,9 +118,8 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -1120,8 +1119,7 @@ def sample_get_product_set(): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1376,8 +1374,7 @@ def sample_delete_product_set(): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1754,8 +1751,7 @@ def sample_get_product(): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2013,8 +2009,7 @@ def sample_delete_product(): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2148,8 +2143,7 @@ def sample_create_reference_image(): create the reference image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2298,8 +2292,7 @@ def sample_delete_reference_image(): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2409,8 +2402,7 @@ def sample_list_reference_images(): reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2540,8 +2532,7 @@ def sample_get_reference_image(): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2656,15 +2647,13 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the ``AddProductToProductSet`` method. name (str): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2674,8 +2663,7 @@ def sample_add_product_to_product_set(): to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2782,15 +2770,13 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the ``RemoveProductFromProductSet`` method. name (str): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2800,8 +2786,7 @@ def sample_remove_product_from_product_set(): removed from this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2914,15 +2899,13 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1p3beta1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the ``ListProductsInProductSet`` method. name (str): Required. The ProductSet resource for which to retrieve Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2937,8 +2920,7 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p3beta1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the ``ListProductsInProductSet`` - method. + Response message for the ``ListProductsInProductSet`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -3026,16 +3008,14 @@ def import_product_sets( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. - (results) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri `__. + `ImportProductSetsGcsSource.csv_file_uri + `__. .. code-block:: python @@ -3098,10 +3078,9 @@ def sample_import_product_sets(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1p3beta1.types.ImportProductSetsResponse - `` Response message for the ``ImportProductSets`` - method. + The result type for the operation will be + :class:``google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` Response message for the + ``ImportProductSets`` method. This message is returned by the `google.longrunning.Operations.GetOperation diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py index 179b91376414..4960b3a7c18a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py @@ -118,9 +118,8 @@ class ProductSearchGrpcTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -1006,16 +1005,14 @@ def import_product_sets( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. - (results) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri `__. + `ImportProductSetsGcsSource.csv_file_uri + `__. Returns: Callable[[~.ImportProductSetsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py index 55a006126272..4e6a74f89719 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py @@ -124,9 +124,8 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -1025,16 +1024,14 @@ def import_product_sets( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. - (results) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri `__. + `ImportProductSetsGcsSource.csv_file_uri + `__. Returns: Callable[[~.ImportProductSetsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py index 30b9d6a6e054..894adb3c80d5 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py @@ -955,9 +955,8 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -1114,8 +1113,7 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the ``AddProductToProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2915,8 +2913,7 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the ``ListProductsInProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2927,9 +2924,7 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the ``ListProductsInProductSet`` - method. - + Response message for the ``ListProductsInProductSet`` method. """ http_options = ( @@ -3223,8 +3218,7 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the ``RemoveProductFromProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py index bba23b04f564..83e90405c45a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py @@ -106,8 +106,8 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the maximum - number of results to return for that type. Multiple ``Feature`` - objects can + number of results to return for that type. Multiple + ``Feature`` objects can be specified in the ``features`` list. Attributes: @@ -115,14 +115,13 @@ class Feature(proto.Message): The feature type. max_results (int): Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. + ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` + also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -149,8 +148,7 @@ class Type(proto.Enum): a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both - ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are - present. + ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -204,20 +202,20 @@ class ImageSource(proto.Message): **Use ``image_uri`` instead.** The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See + ``gs://bucket_name/object_name``. Object versioning is not supported. See `Google Cloud Storage Request - URIs `__ for more info. + URIs + `__ + for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See + ``gs://bucket_name/object_name``. Object versioning is not supported. See `Google Cloud Storage Request - URIs `__ for more + URIs + `__ + for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching @@ -233,8 +231,8 @@ class ImageSource(proto.Message): depend on externally-hosted images for production applications. - When both ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes + When both ``gcs_image_uri`` and ``image_uri`` are + specified, ``image_uri`` takes precedence. """ @@ -254,14 +252,14 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use a pure - binary + Note: As with all ``bytes`` fields, protobuffers use + a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p3beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible image - URL. If both ``content`` and ``source`` are provided for an - image, ``content`` + URL. If both ``content`` and ``source`` are + provided for an image, ``content`` takes precedence and is used to perform the image annotation request. """ @@ -296,8 +294,7 @@ class FaceAnnotation(proto.Message): partial face appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the + The ``fd_bounding_poly`` bounding polygon is tighter than the ``boundingPoly``, and encloses only the skin part of the face. Typically, it is used to eliminate the face from any image analysis that @@ -309,8 +306,8 @@ class FaceAnnotation(proto.Message): landmarks (MutableSequence[google.cloud.vision_v1p3beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): - Roll angle, which indicates the amount of clockwise/anti- - clockwise rotation + Roll angle, which indicates the amount of + clockwise/anti-clockwise rotation of the face relative to the image vertical about the axis perpendicular to the face. Range [-180,180]. @@ -608,8 +605,8 @@ class EntityAnnotation(proto.Message): The language code for the locale in which the entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its ``locale`` - language. + Entity textual description, expressed in its + ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): @@ -644,8 +641,8 @@ class EntityAnnotation(proto.Message): taken. Location information is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p3beta1.types.Property]): - Some entities may have optional user-supplied ``Property`` - (name/value) + Some entities may have optional user-supplied + ``Property`` (name/value) fields, such a score or string that qualifies the entity. """ @@ -701,8 +698,7 @@ class LocalizedObjectAnnotation(proto.Message): The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. score (float): @@ -1418,7 +1414,8 @@ class OutputConfig(proto.Message): For example, for one pdf file with 100 pages, 100 response protos will - be generated. If ``batch_size`` = 20, then 5 json files each + be generated. If ``batch_size`` = 20, then 5 json files + each containing 20 response protos will be written under the prefix ``gcs_destination``.``uri``. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py index 15a4c388df67..36b3bb9c95e7 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py @@ -45,8 +45,7 @@ class ProductSearchParams(proto.Message): for similar images. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_S - ET_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -152,8 +151,7 @@ class ObjectAnnotation(proto.Message): The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. score (float): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py index 9a6dc802de95..b27f7541d514 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py @@ -68,8 +68,7 @@ class Product(proto.Message): The resource name of the product. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - . + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This field is ignored when creating a product. display_name (str): @@ -157,8 +156,7 @@ class ProductSet(proto.Message): The resource name of the ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_S - ET_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. This field is ignored when creating a ProductSet. display_name (str): @@ -214,8 +212,7 @@ class ReferenceImage(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/r - eferenceImages/IMAGE_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This field is ignored when creating a reference image. uri (str): @@ -356,8 +353,7 @@ class GetProductRequest(proto.Message): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -405,8 +401,7 @@ class DeleteProductRequest(proto.Message): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -517,8 +512,7 @@ class GetProductSetRequest(proto.Message): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -563,8 +557,7 @@ class DeleteProductSetRequest(proto.Message): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -582,8 +575,7 @@ class CreateReferenceImageRequest(proto.Message): create the reference image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. reference_image (google.cloud.vision_v1p3beta1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. @@ -622,8 +614,7 @@ class ListReferenceImagesRequest(proto.Message): reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -693,8 +684,7 @@ class GetReferenceImageRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. """ name: str = proto.Field( @@ -713,8 +703,7 @@ class DeleteReferenceImageRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` """ name: str = proto.Field( @@ -724,8 +713,7 @@ class DeleteReferenceImageRequest(proto.Message): class AddProductToProductSetRequest(proto.Message): - r"""Request message for the ``AddProductToProductSet`` - method. + r"""Request message for the ``AddProductToProductSet`` method. Attributes: name (str): @@ -733,15 +721,13 @@ class AddProductToProductSetRequest(proto.Message): modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be added to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -755,8 +741,7 @@ class AddProductToProductSetRequest(proto.Message): class RemoveProductFromProductSetRequest(proto.Message): - r"""Request message for the ``RemoveProductFromProductSet`` - method. + r"""Request message for the ``RemoveProductFromProductSet`` method. Attributes: name (str): @@ -764,15 +749,13 @@ class RemoveProductFromProductSetRequest(proto.Message): modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be removed from this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -786,8 +769,7 @@ class RemoveProductFromProductSetRequest(proto.Message): class ListProductsInProductSetRequest(proto.Message): - r"""Request message for the ``ListProductsInProductSet`` - method. + r"""Request message for the ``ListProductsInProductSet`` method. Attributes: name (str): @@ -795,8 +777,7 @@ class ListProductsInProductSetRequest(proto.Message): Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -820,8 +801,7 @@ class ListProductsInProductSetRequest(proto.Message): class ListProductsInProductSetResponse(proto.Message): - r"""Response message for the ``ListProductsInProductSet`` - method. + r"""Response message for the ``ListProductsInProductSet`` method. Attributes: products (MutableSequence[google.cloud.vision_v1p3beta1.types.Product]): @@ -1028,10 +1008,9 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` - returned by the - ``GetOperation`` call of the ``google::longrunning::Operations`` - service. + This is included in the ``metadata`` field of the + ``Operation`` returned by the + ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1p3beta1.types.BatchOperationMetadata.State): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py index 202017beecde..709b75f6c9c4 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py @@ -63,8 +63,7 @@ class DetectedLanguage(proto.Message): The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. """ @@ -101,8 +100,8 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not co- - occur with + End-line hyphen that is not present in text; does not + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py index fb59894ea3a0..04a073d2284a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py @@ -157,11 +157,10 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". + The BCP-47 language code for ``label``, such as + "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ label: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py index 600555c15d56..c561b5305226 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py @@ -537,10 +537,8 @@ async def async_batch_annotate_images( Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer @@ -606,10 +604,9 @@ async def sample_async_batch_annotate_images(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesR - esponse`` Response to an async batch image annotation - request. + The result type for the operation will be + :class:``google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch + image annotation request. """ # Create or coerce a protobuf request object. @@ -685,10 +682,8 @@ async def async_batch_annotate_files( images per page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -743,10 +738,9 @@ async def sample_async_batch_annotate_files(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesRe - sponse`` Response to an async batch file annotation - request. + The result type for the operation will be + :class:``google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py index 5f85e92da716..5aa46becac04 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py @@ -994,10 +994,8 @@ def async_batch_annotate_images( Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer @@ -1063,10 +1061,9 @@ def sample_async_batch_annotate_images(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesR - esponse`` Response to an async batch image annotation - request. + The result type for the operation will be + :class:``google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch + image annotation request. """ # Create or coerce a protobuf request object. @@ -1141,10 +1138,8 @@ def async_batch_annotate_files( images per page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -1199,10 +1194,9 @@ def sample_async_batch_annotate_files(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesRe - sponse`` Response to an async batch file annotation - request. + The result type for the operation will be + :class:``google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file + annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py index 13b4825e4865..141bfb01e443 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py @@ -422,10 +422,8 @@ def async_batch_annotate_images( Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer @@ -467,10 +465,8 @@ def async_batch_annotate_files( images per page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py index a14c3b4a4a68..0dc3ff649511 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py @@ -431,10 +431,8 @@ def async_batch_annotate_images( Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateImagesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer @@ -477,10 +475,8 @@ def async_batch_annotate_files( images per page. Progress and results can be retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). - ``Operation.response`` contains - ``AsyncBatchAnnotateFilesResponse`` (results). + ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py index e0bac055836b..9683ea89d857 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py @@ -75,9 +75,8 @@ class ProductSearchAsyncClient: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -646,8 +645,7 @@ async def sample_get_product_set(): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -903,8 +901,7 @@ async def sample_delete_product_set(): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1290,8 +1287,7 @@ async def sample_get_product(): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1370,8 +1366,8 @@ async def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in @@ -1551,8 +1547,7 @@ async def sample_delete_product(): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1690,8 +1685,7 @@ async def sample_create_reference_image(): image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1837,8 +1831,7 @@ async def sample_delete_reference_image(): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1951,8 +1944,7 @@ async def sample_list_reference_images(): reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2085,8 +2077,7 @@ async def sample_get_reference_image(): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2204,15 +2195,13 @@ async def sample_add_product_to_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.AddProductToProductSetRequest, dict]]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the ``AddProductToProductSet`` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2222,8 +2211,7 @@ async def sample_add_product_to_product_set(): to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2326,15 +2314,13 @@ async def sample_remove_product_from_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.RemoveProductFromProductSetRequest, dict]]): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the ``RemoveProductFromProductSet`` method. name (:class:`str`): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2345,8 +2331,7 @@ async def sample_remove_product_from_product_set(): ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2460,15 +2445,13 @@ async def sample_list_products_in_product_set(): Args: request (Optional[Union[google.cloud.vision_v1p4beta1.types.ListProductsInProductSetRequest, dict]]): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the ``ListProductsInProductSet`` method. name (:class:`str`): Required. The ProductSet resource for which to retrieve Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2483,8 +2466,7 @@ async def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsInProductSetAsyncPager: - Response message for the ``ListProductsInProductSet`` - method. + Response message for the ``ListProductsInProductSet`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -2573,16 +2555,14 @@ async def import_product_sets( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. - (results) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri `__. + `ImportProductSetsGcsSource.csv_file_uri + `__. .. code-block:: python @@ -2645,10 +2625,9 @@ async def sample_import_product_sets(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1p4beta1.types.ImportProductSetsResponse - `` Response message for the ``ImportProductSets`` - method. + The result type for the operation will be + :class:``google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` Response message for the + ``ImportProductSets`` method. This message is returned by the `google.longrunning.Operations.GetOperation @@ -2765,8 +2744,7 @@ async def purge_products( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -2823,9 +2801,8 @@ async def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:``google.protobuf.empty_pb2.Empty`` A generic - empty message that you can re-use to avoid defining - duplicated + :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that + you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py index a11fa9229b91..0b67744bed7b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py @@ -119,9 +119,8 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -1121,8 +1120,7 @@ def sample_get_product_set(): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1372,8 +1370,7 @@ def sample_delete_product_set(): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1750,8 +1747,7 @@ def sample_get_product(): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1827,8 +1823,8 @@ def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in @@ -2005,8 +2001,7 @@ def sample_delete_product(): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2141,8 +2136,7 @@ def sample_create_reference_image(): image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2285,8 +2279,7 @@ def sample_delete_reference_image(): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2396,8 +2389,7 @@ def sample_list_reference_images(): reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2527,8 +2519,7 @@ def sample_get_reference_image(): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2643,15 +2634,13 @@ def sample_add_product_to_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.AddProductToProductSetRequest, dict]): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the ``AddProductToProductSet`` method. name (str): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2661,8 +2650,7 @@ def sample_add_product_to_product_set(): to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2764,15 +2752,13 @@ def sample_remove_product_from_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.RemoveProductFromProductSetRequest, dict]): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the ``RemoveProductFromProductSet`` method. name (str): Required. The resource name for the ProductSet to modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2783,8 +2769,7 @@ def sample_remove_product_from_product_set(): ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2897,15 +2882,13 @@ def sample_list_products_in_product_set(): Args: request (Union[google.cloud.vision_v1p4beta1.types.ListProductsInProductSetRequest, dict]): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the ``ListProductsInProductSet`` method. name (str): Required. The ProductSet resource for which to retrieve Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2920,8 +2903,7 @@ def sample_list_products_in_product_set(): Returns: google.cloud.vision_v1p4beta1.services.product_search.pagers.ListProductsInProductSetPager: - Response message for the ``ListProductsInProductSet`` - method. + Response message for the ``ListProductsInProductSet`` method. Iterating over this object will yield results and resolve additional pages automatically. @@ -3009,16 +2991,14 @@ def import_product_sets( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. - (results) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri `__. + `ImportProductSetsGcsSource.csv_file_uri + `__. .. code-block:: python @@ -3081,10 +3061,9 @@ def sample_import_product_sets(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:``googl - e.cloud.vision_v1p4beta1.types.ImportProductSetsResponse - `` Response message for the ``ImportProductSets`` - method. + The result type for the operation will be + :class:``google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` Response message for the + ``ImportProductSets`` method. This message is returned by the `google.longrunning.Operations.GetOperation @@ -3198,8 +3177,7 @@ def purge_products( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -3256,9 +3234,8 @@ def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:``google.protobuf.empty_pb2.Empty`` A generic - empty message that you can re-use to avoid defining - duplicated + :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that + you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py index 6ae32f50c9e8..0385bc4d49f3 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py @@ -118,9 +118,8 @@ class ProductSearchGrpcTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -636,8 +635,8 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in @@ -986,16 +985,14 @@ def import_product_sets( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. - (results) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri `__. + `ImportProductSetsGcsSource.csv_file_uri + `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1059,8 +1056,7 @@ def purge_products( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: Callable[[~.PurgeProductsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py index 4aa05d54f789..b0c202910d6a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py @@ -124,9 +124,8 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -650,8 +649,8 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. - Only the ``display_name``, ``description``, and ``labels`` - fields can be updated + Only the ``display_name``, ``description``, and + ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in @@ -1005,16 +1004,14 @@ def import_product_sets( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. - (results) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri `__. + `ImportProductSetsGcsSource.csv_file_uri + `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1079,8 +1076,7 @@ def purge_products( The `google.longrunning.Operation `__ API can be used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. - (progress) + ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: Callable[[~.PurgeProductsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py index 0e3e52fe45f9..1d74059e3938 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py @@ -1012,9 +1012,8 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to - put different products into groups to limit identification. In - parallel, + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products + into groups to limit identification. In parallel, - The API has a collection of `Product `__ resources, named @@ -1171,8 +1170,7 @@ def __call__( Args: request (~.product_search_service.AddProductToProductSetRequest): - The request object. Request message for the ``AddProductToProductSet`` - method. + The request object. Request message for the ``AddProductToProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2972,8 +2970,7 @@ def __call__( Args: request (~.product_search_service.ListProductsInProductSetRequest): - The request object. Request message for the ``ListProductsInProductSet`` - method. + The request object. Request message for the ``ListProductsInProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2984,9 +2981,7 @@ def __call__( Returns: ~.product_search_service.ListProductsInProductSetResponse: - Response message for the ``ListProductsInProductSet`` - method. - + Response message for the ``ListProductsInProductSet`` method. """ http_options = ( @@ -3431,8 +3426,7 @@ def __call__( Args: request (~.product_search_service.RemoveProductFromProductSetRequest): - The request object. Request message for the ``RemoveProductFromProductSet`` - method. + The request object. Request message for the ``RemoveProductFromProductSet`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py index db79b59f0254..c23badcfdcaa 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py @@ -107,8 +107,8 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the maximum - number of results to return for that type. Multiple ``Feature`` - objects can + number of results to return for that type. Multiple + ``Feature`` objects can be specified in the ``features`` list. Attributes: @@ -116,14 +116,13 @@ class Feature(proto.Message): The feature type. max_results (int): Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. + ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and - ``TEXT_DETECTION`` also + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` + also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -150,8 +149,7 @@ class Type(proto.Enum): a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both - ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are - present. + ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are present. SAFE_SEARCH_DETECTION (6): Run Safe Search to detect potentially unsafe or undesirable content. @@ -205,20 +203,20 @@ class ImageSource(proto.Message): **Use ``image_uri`` instead.** The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See + ``gs://bucket_name/object_name``. Object versioning is not supported. See `Google Cloud Storage Request - URIs `__ for more info. + URIs + `__ + for more info. image_uri (str): The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See + ``gs://bucket_name/object_name``. Object versioning is not supported. See `Google Cloud Storage Request - URIs `__ for more + URIs + `__ + for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching @@ -234,8 +232,8 @@ class ImageSource(proto.Message): depend on externally-hosted images for production applications. - When both ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes + When both ``gcs_image_uri`` and ``image_uri`` are + specified, ``image_uri`` takes precedence. """ @@ -255,14 +253,14 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use a pure - binary + Note: As with all ``bytes`` fields, protobuffers use + a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p4beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible image - URL. If both ``content`` and ``source`` are provided for an - image, ``content`` + URL. If both ``content`` and ``source`` are + provided for an image, ``content`` takes precedence and is used to perform the image annotation request. """ @@ -296,8 +294,7 @@ class FaceAnnotation(proto.Message): partial face appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): - The ``fd_bounding_poly`` bounding polygon is tighter than - the + The ``fd_bounding_poly`` bounding polygon is tighter than the ``boundingPoly``, and encloses only the skin part of the face. Typically, it is used to eliminate the face from any image analysis that @@ -309,8 +306,8 @@ class FaceAnnotation(proto.Message): landmarks (MutableSequence[google.cloud.vision_v1p4beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): - Roll angle, which indicates the amount of clockwise/anti- - clockwise rotation + Roll angle, which indicates the amount of + clockwise/anti-clockwise rotation of the face relative to the image vertical about the axis perpendicular to the face. Range [-180,180]. @@ -625,8 +622,8 @@ class EntityAnnotation(proto.Message): The language code for the locale in which the entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its ``locale`` - language. + Entity textual description, expressed in its + ``locale`` language. score (float): Overall score of the result. Range [0, 1]. confidence (float): @@ -661,8 +658,8 @@ class EntityAnnotation(proto.Message): taken. Location information is usually present for landmarks. properties (MutableSequence[google.cloud.vision_v1p4beta1.types.Property]): - Some entities may have optional user-supplied ``Property`` - (name/value) + Some entities may have optional user-supplied + ``Property`` (name/value) fields, such a score or string that qualifies the entity. """ @@ -718,8 +715,7 @@ class LocalizedObjectAnnotation(proto.Message): The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. score (float): @@ -1558,8 +1554,8 @@ class InputConfig(proto.Message): input from. content (bytes): File content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use a pure - binary + Note: As with all ``bytes`` fields, protobuffers use + a pure binary representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateFiles @@ -1602,7 +1598,8 @@ class OutputConfig(proto.Message): For example, for one pdf file with 100 pages, 100 response protos will - be generated. If ``batch_size`` = 20, then 5 json files each + be generated. If ``batch_size`` = 20, then 5 json files + each containing 20 response protos will be written under the prefix ``gcs_destination``.``uri``. @@ -1666,12 +1663,13 @@ class GcsDestination(proto.Message): "filenameprefix". * Directory Prefix: gs://bucket-name/some/location/ The - output files will be created in gs://bucket- - name/some/location/ and the names of the output files - could be anything because there was no filename prefix - specified. If multiple outputs, each response is still - AnnotateFileResponse, each of which contains some subset - of the full list of AnnotateImageResponse. + output files will be created in + gs://bucket-name/some/location/ and the names of the + output files could be anything because there was no + filename prefix specified. If multiple outputs, each + response is still AnnotateFileResponse, each of which + contains some subset of the full list of + AnnotateImageResponse. Multiple outputs can happen if, for example, the output JSON is too large diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py index 80160012e539..ea643e841b9a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py @@ -46,8 +46,7 @@ class ProductSearchParams(proto.Message): similar images. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_S - ET_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -153,8 +152,7 @@ class ObjectAnnotation(proto.Message): The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. score (float): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py index cbc6262d4cef..2458330cf6e1 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py @@ -70,8 +70,7 @@ class Product(proto.Message): The resource name of the product. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - . + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This field is ignored when creating a product. display_name (str): @@ -165,8 +164,7 @@ class ProductSet(proto.Message): The resource name of the ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_S - ET_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. This field is ignored when creating a ProductSet. display_name (str): @@ -223,8 +221,7 @@ class ReferenceImage(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/r - eferenceImages/IMAGE_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This field is ignored when creating a reference image. uri (str): @@ -365,8 +362,7 @@ class GetProductRequest(proto.Message): Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -414,8 +410,7 @@ class DeleteProductRequest(proto.Message): Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -526,8 +521,7 @@ class GetProductSetRequest(proto.Message): Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -572,8 +566,7 @@ class DeleteProductSetRequest(proto.Message): Required. Resource name of the ProductSet to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -592,8 +585,7 @@ class CreateReferenceImageRequest(proto.Message): image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. reference_image (google.cloud.vision_v1p4beta1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. @@ -632,8 +624,7 @@ class ListReferenceImagesRequest(proto.Message): reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -703,8 +694,7 @@ class GetReferenceImageRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID``. + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. """ name: str = proto.Field( @@ -723,8 +713,7 @@ class DeleteReferenceImageRequest(proto.Message): Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID/referenceImages/IMAGE_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` """ name: str = proto.Field( @@ -734,8 +723,7 @@ class DeleteReferenceImageRequest(proto.Message): class AddProductToProductSetRequest(proto.Message): - r"""Request message for the ``AddProductToProductSet`` - method. + r"""Request message for the ``AddProductToProductSet`` method. Attributes: name (str): @@ -743,15 +731,13 @@ class AddProductToProductSetRequest(proto.Message): modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be added to this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -765,8 +751,7 @@ class AddProductToProductSetRequest(proto.Message): class RemoveProductFromProductSetRequest(proto.Message): - r"""Request message for the ``RemoveProductFromProductSet`` - method. + r"""Request message for the ``RemoveProductFromProductSet`` method. Attributes: name (str): @@ -774,16 +759,14 @@ class RemoveProductFromProductSetRequest(proto.Message): modify. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be removed from this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ - ID`` + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -797,8 +780,7 @@ class RemoveProductFromProductSetRequest(proto.Message): class ListProductsInProductSetRequest(proto.Message): - r"""Request message for the ``ListProductsInProductSet`` - method. + r"""Request message for the ``ListProductsInProductSet`` method. Attributes: name (str): @@ -806,8 +788,7 @@ class ListProductsInProductSetRequest(proto.Message): Products. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODU - CT_SET_ID`` + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -831,8 +812,7 @@ class ListProductsInProductSetRequest(proto.Message): class ListProductsInProductSetResponse(proto.Message): - r"""Response message for the ``ListProductsInProductSet`` - method. + r"""Response message for the ``ListProductsInProductSet`` method. Attributes: products (MutableSequence[google.cloud.vision_v1p4beta1.types.Product]): @@ -881,16 +861,16 @@ class ImportProductSetsGcsSource(proto.Message): 7. labels 8. bounding-poly - The ``image-uri``, ``product-set-id``, ``product-id``, and - ``product-category`` + The ``image-uri``, ``product-set-id``, ``product-id``, + and ``product-category`` columns are required. All other columns are optional. - If the ``ProductSet`` or ``Product`` specified by the - ``product-set-id`` and - ``product-id`` values does not exist, then the system will - create a new - ``ProductSet`` or ``Product`` for the image. In this case, - the + If the ``ProductSet`` or ``Product`` specified by + the ``product-set-id`` and + ``product-id`` values does not exist, then the system + will create a new + ``ProductSet`` or ``Product`` for the image. In + this case, the ``product-display-name`` column refers to `display_name `__, the @@ -901,27 +881,27 @@ class ImportProductSetsGcsSource(proto.Message): `product_labels `__. - The ``image-id`` column is optional but must be unique if - provided. If it is + The ``image-id`` column is optional but must be unique + if provided. If it is empty, the system will automatically assign a unique id to the image. - The ``product-display-name`` column is optional. If it is - empty, the system + The ``product-display-name`` column is optional. If it is empty, + the system sets the `display_name `__ field for the product to a space (" "). You can update the ``display_name`` later by using the API. - If a ``Product`` with the specified ``product-id`` already - exists, then the - system ignores the ``product-display-name``, ``product- - category``, and ``labels`` + If a ``Product`` with the specified ``product-id`` + already exists, then the + system ignores the ``product-display-name``, ``product-category``, and + ``labels`` columns. - The ``labels`` column (optional) is a line containing a list - of + The ``labels`` column (optional) is a line containing + a list of comma-separated key-value pairs, in the following format: "key_1=value_1,key_2=value_2,...,key_n=value_n" @@ -938,8 +918,8 @@ class ImportProductSetsGcsSource(proto.Message): the image contains multiple regions of interest, add a line to the CSV file that - includes the same product information, and the ``bounding- - poly`` values for + includes the same product information, and the + ``bounding-poly`` values for each region of interest. The ``bounding-poly`` column must contain an even number of @@ -1049,10 +1029,9 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` - returned by the - ``GetOperation`` call of the ``google::longrunning::Operations`` - service. + This is included in the ``metadata`` field of the + ``Operation`` returned by the + ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1p4beta1.types.BatchOperationMetadata.State): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py index cbdf26b46594..6cef7c5ed598 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py @@ -63,8 +63,7 @@ class DetectedLanguage(proto.Message): The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. """ @@ -101,8 +100,8 @@ class BreakType(proto.Enum): EOL_SURE_SPACE (3): Line-wrapping break. HYPHEN (4): - End-line hyphen that is not present in text; does not co- - occur with + End-line hyphen that is not present in text; does not + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py index fffcd2f4d9ec..2723585b5d8f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py @@ -159,11 +159,10 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". + The BCP-47 language code for ``label``, such as + "en-US" or "sr-Latn". For more information, see - http://www.unicode.org/reports/tr35/#Unicode_locale_identifi - er. + http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ label: str = proto.Field( From 9dc4768ec3cd1e5904d05a3e75be2a9ad462c7a7 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Sat, 17 Jan 2026 00:15:35 +0000 Subject: [PATCH 6/9] version 6 --- .../services/image_annotator/async_client.py | 26 +- .../services/image_annotator/client.py | 26 +- .../image_annotator/transports/grpc.py | 22 +- .../transports/grpc_asyncio.py | 22 +- .../services/product_search/async_client.py | 289 ++++++---------- .../services/product_search/client.py | 289 ++++++---------- .../product_search/transports/grpc.py | 159 ++++----- .../product_search/transports/grpc_asyncio.py | 159 ++++----- .../product_search/transports/rest.py | 28 +- .../cloud/vision_v1/types/image_annotator.py | 320 +++++++----------- .../cloud/vision_v1/types/product_search.py | 10 +- .../vision_v1/types/product_search_service.py | 280 ++++++--------- .../cloud/vision_v1/types/text_annotation.py | 24 +- .../cloud/vision_v1/types/web_detection.py | 5 +- .../vision_v1p1beta1/types/image_annotator.py | 211 +++++------- .../vision_v1p1beta1/types/text_annotation.py | 20 +- .../vision_v1p1beta1/types/web_detection.py | 5 +- .../services/image_annotator/async_client.py | 11 +- .../services/image_annotator/client.py | 11 +- .../image_annotator/transports/grpc.py | 11 +- .../transports/grpc_asyncio.py | 11 +- .../vision_v1p2beta1/types/image_annotator.py | 259 ++++++-------- .../vision_v1p2beta1/types/text_annotation.py | 20 +- .../vision_v1p2beta1/types/web_detection.py | 5 +- .../services/image_annotator/async_client.py | 12 +- .../services/image_annotator/client.py | 12 +- .../image_annotator/transports/grpc.py | 12 +- .../transports/grpc_asyncio.py | 12 +- .../services/product_search/async_client.py | 235 +++++-------- .../services/product_search/client.py | 235 +++++-------- .../product_search/transports/grpc.py | 130 +++---- .../product_search/transports/grpc_asyncio.py | 130 +++---- .../product_search/transports/rest.py | 27 +- .../vision_v1p3beta1/types/image_annotator.py | 263 ++++++-------- .../vision_v1p3beta1/types/product_search.py | 6 +- .../types/product_search_service.py | 211 +++++------- .../vision_v1p3beta1/types/text_annotation.py | 20 +- .../vision_v1p3beta1/types/web_detection.py | 5 +- .../services/image_annotator/async_client.py | 26 +- .../services/image_annotator/client.py | 26 +- .../image_annotator/transports/grpc.py | 22 +- .../transports/grpc_asyncio.py | 22 +- .../services/product_search/async_client.py | 282 ++++++--------- .../services/product_search/client.py | 282 ++++++--------- .../product_search/transports/grpc.py | 158 ++++----- .../product_search/transports/grpc_asyncio.py | 158 ++++----- .../product_search/transports/rest.py | 27 +- .../cloud/vision_v1p4beta1/types/face.py | 16 +- .../vision_v1p4beta1/types/image_annotator.py | 298 +++++++--------- .../vision_v1p4beta1/types/product_search.py | 13 +- .../types/product_search_service.py | 267 ++++++--------- .../vision_v1p4beta1/types/text_annotation.py | 20 +- .../vision_v1p4beta1/types/web_detection.py | 5 +- 53 files changed, 1984 insertions(+), 3171 deletions(-) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py index aff9026e4ca4..bb22347ad551 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py @@ -536,14 +536,12 @@ async def async_batch_annotate_images( r"""Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer - GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -606,8 +604,8 @@ async def sample_async_batch_annotate_images(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch - image annotation request. + :class:``google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch image + annotation request. """ # Create or coerce a protobuf request object. @@ -677,14 +675,10 @@ async def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Run asynchronous image detection and annotation for a list of - generic - files, such as PDF files, which may contain multiple pages and - multiple - images per page. Progress and results can be retrieved through - the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py index 7e6d08609e48..c42711904c1c 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py @@ -993,14 +993,12 @@ def async_batch_annotate_images( r"""Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer - GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -1063,8 +1061,8 @@ def sample_async_batch_annotate_images(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch - image annotation request. + :class:``google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch image + annotation request. """ # Create or coerce a protobuf request object. @@ -1133,14 +1131,10 @@ def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Run asynchronous image detection and annotation for a list of - generic - files, such as PDF files, which may contain multiple pages and - multiple - images per page. Progress and results can be retrieved through - the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py index b401b4cb672d..24c69e199f3a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py @@ -420,14 +420,12 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer - GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -459,14 +457,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic - files, such as PDF files, which may contain multiple pages and - multiple - images per page. Progress and results can be retrieved through - the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py index edd8146e7637..57f686f4d018 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py @@ -429,14 +429,12 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer - GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -469,14 +467,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic - files, such as PDF files, which may contain multiple pages and - multiple - images per page. Progress and results can be retrieved through - the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py index 97d291074807..1084205d714f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py @@ -71,21 +71,17 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `__ resources, named ``projects/*/locations/*/productSets/*``, + which acts as a way to put different products into groups to limit + identification. In parallel, - The API has a collection of + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has + a collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -382,12 +378,11 @@ async def sample_create_product_set(): should not be set. product_set_id (:class:`str`): A user-supplied resource id for this ProductSet. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -644,8 +639,7 @@ async def sample_get_product_set(): name (:class:`str`): Required. Resource name of the ProductSet to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -728,15 +722,14 @@ async def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. - Only display_name can be updated currently. + r"""Makes changes to a ProductSet resource. Only display_name can + be updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. .. code-block:: python @@ -775,11 +768,9 @@ async def sample_update_product_set(): should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): The `FieldMask `__ that - specifies which fields to - update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask path is ``display_name``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -900,8 +891,7 @@ async def sample_delete_product_set(): name (:class:`str`): Required. Resource name of the ProductSet to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -978,11 +968,9 @@ async def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - * Returns INVALID_ARGUMENT if product_category is missing or - invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if + description is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is missing or invalid. .. code-block:: python @@ -1017,8 +1005,7 @@ async def sample_create_product(): Required. The project in which the Product should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1030,12 +1017,11 @@ async def sample_create_product(): should not be set. product_id (:class:`str`): A user-supplied resource id for this Product. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1157,8 +1143,7 @@ async def sample_list_products(): Required. The project OR ProductSet from which Products should be listed. - Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1286,8 +1271,7 @@ async def sample_get_product(): name (:class:`str`): Required. Resource name of the Product to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1365,24 +1349,20 @@ async def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated - right now. + r"""Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until - the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1423,13 +1403,9 @@ async def sample_update_product(): should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): The `FieldMask `__ that - specifies which fields - to update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask paths include ``product_labels``, - ``display_name``, and - ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1546,8 +1522,7 @@ async def sample_delete_product(): name (:class:`str`): Required. Resource name of product to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1621,30 +1596,24 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are - compatible with the product_category on the parent product. If - it is - specified, detection is ALWAYS skipped. The system converts - polygons into - non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too - large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. - * Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - * Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the + product does not exist. * Returns INVALID_ARGUMENT if + bounding_poly is not provided, and nothing compatible with the + parent product's product_category is detected. * Returns + INVALID_ARGUMENT if bounding_poly contains more than 10 + polygons. .. code-block:: python @@ -1681,11 +1650,9 @@ async def sample_create_reference_image(): The request object. Request message for the ``CreateReferenceImage`` method. parent (:class:`str`): Required. Resource name of the product in which to - create the reference - image. + create the reference image. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1700,11 +1667,9 @@ async def sample_create_reference_image(): should not be set. reference_image_id (:class:`str`): A user-supplied resource id for the ReferenceImage to be - added. If set, - the server will attempt to use this value as the - resource id. If it is - already in use, an error is returned with code - ALREADY_EXISTS. Must be at + added. If set, the server will attempt to use this + value as the resource id. If it is already in use, an + error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character ``/``. @@ -1722,8 +1687,7 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1829,8 +1793,7 @@ async def sample_delete_reference_image(): Required. The resource name of the reference image to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1904,8 +1867,8 @@ async def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. - * Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. .. code-block:: python @@ -1942,8 +1905,7 @@ async def sample_list_reference_images(): Required. Resource name of the product containing the reference images. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2074,8 +2036,7 @@ async def sample_get_reference_image(): Required. The resource name of the ReferenceImage to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2091,8 +2052,7 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2157,8 +2117,7 @@ async def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already - present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -2198,8 +2157,7 @@ async def sample_add_product_to_product_set(): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2208,8 +2166,7 @@ async def sample_add_product_to_product_set(): Required. The resource name for the Product to be added to this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2317,19 +2274,16 @@ async def sample_remove_product_from_product_set(): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): Required. The resource name for the Product to be - removed from this - ProductSet. + removed from this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2404,10 +2358,8 @@ async def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the - ProductSet does not exist, the products field of the response - will be - empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -2448,8 +2400,7 @@ async def sample_list_products_in_product_set(): Required. The ProductSet resource for which to retrieve Products. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2547,18 +2498,15 @@ async def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API that imports a list of reference images to - specified - product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. - For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -2624,16 +2572,14 @@ async def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1.types.ImportProductSetsResponse`` Response message for the - ``ImportProductSets`` method. + :class:``google.cloud.vision_v1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets`` + method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned - `google.longrunning.Operation.response - `__ - field. + `__ method + in the returned `google.longrunning.Operation.response + `__ field. """ # Create or coerce a protobuf request object. @@ -2707,42 +2653,32 @@ async def purge_products( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API to delete all Products in a ProductSet or all - Products - that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other - ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this - operation has completed. It is also recommended to not add any - of the - Products involved in the batch delete to a new ProductSet while - this - operation is running because those Products may still end up - deleted. + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is - recommended to keep the csv files used in ImportProductSets (if - that was - how you originally built the Product Set) before starting - PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then - re-use the empty ProductSet to re-import new Products into the - empty - ProductSet, you must wait until the PurgeProducts operation has - finished - for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the + PurgeProducts operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -2799,16 +2735,13 @@ async def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that - you can re-use to avoid defining duplicated - empty messages in your APIs. A typical example is to use - it as the request + :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that you can + re-use to avoid defining duplicated empty messages in + your APIs. A typical example is to use it as the request or the response type of an API method. For instance: - service Foo { - rpc Bar(google.protobuf.Empty) returns - (google.protobuf.Empty); - } + service Foo { rpc Bar(google.protobuf.Empty) + returns (google.protobuf.Empty); } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py index d814549d1bd2..ba0f24d0f7c5 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py @@ -115,21 +115,17 @@ def get_transport_class( class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `__ resources, named ``projects/*/locations/*/productSets/*``, + which acts as a way to put different products into groups to limit + identification. In parallel, - The API has a collection of + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has + a collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -863,12 +859,11 @@ def sample_create_product_set(): should not be set. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1119,8 +1114,7 @@ def sample_get_product_set(): name (str): Required. Resource name of the ProductSet to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1200,15 +1194,14 @@ def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. - Only display_name can be updated currently. + r"""Makes changes to a ProductSet resource. Only display_name can + be updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. .. code-block:: python @@ -1247,11 +1240,9 @@ def sample_update_product_set(): should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to - update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask path is ``display_name``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1369,8 +1360,7 @@ def sample_delete_product_set(): name (str): Required. Resource name of the ProductSet to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1444,11 +1434,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - * Returns INVALID_ARGUMENT if product_category is missing or - invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if + description is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is missing or invalid. .. code-block:: python @@ -1483,8 +1471,7 @@ def sample_create_product(): Required. The project in which the Product should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1496,12 +1483,11 @@ def sample_create_product(): should not be set. product_id (str): A user-supplied resource id for this Product. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1620,8 +1606,7 @@ def sample_list_products(): Required. The project OR ProductSet from which Products should be listed. - Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1746,8 +1731,7 @@ def sample_get_product(): name (str): Required. Resource name of the Product to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1822,24 +1806,20 @@ def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated - right now. + r"""Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until - the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1880,13 +1860,9 @@ def sample_update_product(): should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields - to update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask paths include ``product_labels``, - ``display_name``, and - ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -2000,8 +1976,7 @@ def sample_delete_product(): name (str): Required. Resource name of product to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2072,30 +2047,24 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are - compatible with the product_category on the parent product. If - it is - specified, detection is ALWAYS skipped. The system converts - polygons into - non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too - large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. - * Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - * Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the + product does not exist. * Returns INVALID_ARGUMENT if + bounding_poly is not provided, and nothing compatible with the + parent product's product_category is detected. * Returns + INVALID_ARGUMENT if bounding_poly contains more than 10 + polygons. .. code-block:: python @@ -2132,11 +2101,9 @@ def sample_create_reference_image(): The request object. Request message for the ``CreateReferenceImage`` method. parent (str): Required. Resource name of the product in which to - create the reference - image. + create the reference image. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2151,11 +2118,9 @@ def sample_create_reference_image(): should not be set. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, - the server will attempt to use this value as the - resource id. If it is - already in use, an error is returned with code - ALREADY_EXISTS. Must be at + added. If set, the server will attempt to use this + value as the resource id. If it is already in use, an + error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character ``/``. @@ -2173,8 +2138,7 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2277,8 +2241,7 @@ def sample_delete_reference_image(): Required. The resource name of the reference image to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2349,8 +2312,8 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. - * Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. .. code-block:: python @@ -2387,8 +2350,7 @@ def sample_list_reference_images(): Required. Resource name of the product containing the reference images. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2516,8 +2478,7 @@ def sample_get_reference_image(): Required. The resource name of the ReferenceImage to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2533,8 +2494,7 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2596,8 +2556,7 @@ def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already - present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -2637,8 +2596,7 @@ def sample_add_product_to_product_set(): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2647,8 +2605,7 @@ def sample_add_product_to_product_set(): Required. The resource name for the Product to be added to this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2755,19 +2712,16 @@ def sample_remove_product_from_product_set(): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): Required. The resource name for the Product to be - removed from this - ProductSet. + removed from this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2841,10 +2795,8 @@ def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the - ProductSet does not exist, the products field of the response - will be - empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -2885,8 +2837,7 @@ def sample_list_products_in_product_set(): Required. The ProductSet resource for which to retrieve Products. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2983,18 +2934,15 @@ def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API that imports a list of reference images to - specified - product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. - For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -3060,16 +3008,14 @@ def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1.types.ImportProductSetsResponse`` Response message for the - ``ImportProductSets`` method. + :class:``google.cloud.vision_v1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets`` + method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned - `google.longrunning.Operation.response - `__ - field. + `__ method + in the returned `google.longrunning.Operation.response + `__ field. """ # Create or coerce a protobuf request object. @@ -3140,42 +3086,32 @@ def purge_products( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API to delete all Products in a ProductSet or all - Products - that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other - ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this - operation has completed. It is also recommended to not add any - of the - Products involved in the batch delete to a new ProductSet while - this - operation is running because those Products may still end up - deleted. + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is - recommended to keep the csv files used in ImportProductSets (if - that was - how you originally built the Product Set) before starting - PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then - re-use the empty ProductSet to re-import new Products into the - empty - ProductSet, you must wait until the PurgeProducts operation has - finished - for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the + PurgeProducts operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -3232,16 +3168,13 @@ def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that - you can re-use to avoid defining duplicated - empty messages in your APIs. A typical example is to use - it as the request + :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that you can + re-use to avoid defining duplicated empty messages in + your APIs. A typical example is to use it as the request or the response type of an API method. For instance: - service Foo { - rpc Bar(google.protobuf.Empty) returns - (google.protobuf.Empty); - } + service Foo { rpc Bar(google.protobuf.Empty) + returns (google.protobuf.Empty); } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py index 38274eea61c5..560b4e3750fb 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py @@ -113,21 +113,17 @@ class ProductSearchGrpcTransport(ProductSearchTransport): """gRPC backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `__ resources, named ``projects/*/locations/*/productSets/*``, + which acts as a way to put different products into groups to limit + identification. In parallel, - The API has a collection of + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has + a collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -464,15 +460,14 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. - Only display_name can be updated currently. + Makes changes to a ProductSet resource. Only display_name can + be updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -535,11 +530,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - * Returns INVALID_ARGUMENT if product_category is missing or - invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if + description is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -633,24 +626,20 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated - right now. + Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until - the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. Returns: @@ -713,30 +702,24 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are - compatible with the product_category on the parent product. If - it is - specified, detection is ALWAYS skipped. The system converts - polygons into - non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too - large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. - * Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - * Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the + product does not exist. * Returns INVALID_ARGUMENT if + bounding_poly is not provided, and nothing compatible with the + parent product's product_category is detected. * Returns + INVALID_ARGUMENT if bounding_poly contains more than 10 + polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -804,8 +787,8 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. - * Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. Returns: @@ -868,8 +851,7 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already - present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -939,10 +921,8 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the - ProductSet does not exist, the products field of the response - will be - empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -978,18 +958,15 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified - product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. - For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -1020,42 +997,32 @@ def purge_products( r"""Return a callable for the purge products method over gRPC. Asynchronous API to delete all Products in a ProductSet or all - Products - that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other - ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this - operation has completed. It is also recommended to not add any - of the - Products involved in the batch delete to a new ProductSet while - this - operation is running because those Products may still end up - deleted. + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is - recommended to keep the csv files used in ImportProductSets (if - that was - how you originally built the Product Set) before starting - PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then - re-use the empty ProductSet to re-import new Products into the - empty - ProductSet, you must wait until the PurgeProducts operation has - finished - for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the + PurgeProducts operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) Returns: Callable[[~.PurgeProductsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py index 08f72df9b7fa..f0978778ca61 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py @@ -119,21 +119,17 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): """gRPC AsyncIO backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `__ resources, named ``projects/*/locations/*/productSets/*``, + which acts as a way to put different products into groups to limit + identification. In parallel, - The API has a collection of + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has + a collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -473,15 +469,14 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. - Only display_name can be updated currently. + Makes changes to a ProductSet resource. Only display_name can + be updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -547,11 +542,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - * Returns INVALID_ARGUMENT if product_category is missing or - invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if + description is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -647,24 +640,20 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated - right now. + Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until - the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. Returns: @@ -729,30 +718,24 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are - compatible with the product_category on the parent product. If - it is - specified, detection is ALWAYS skipped. The system converts - polygons into - non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too - large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. - * Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - * Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the + product does not exist. * Returns INVALID_ARGUMENT if + bounding_poly is not provided, and nothing compatible with the + parent product's product_category is detected. * Returns + INVALID_ARGUMENT if bounding_poly contains more than 10 + polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -820,8 +803,8 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. - * Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. Returns: @@ -885,8 +868,7 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already - present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -957,10 +939,8 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the - ProductSet does not exist, the products field of the response - will be - empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -997,18 +977,15 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified - product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. - For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -1040,42 +1017,32 @@ def purge_products( r"""Return a callable for the purge products method over gRPC. Asynchronous API to delete all Products in a ProductSet or all - Products - that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other - ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this - operation has completed. It is also recommended to not add any - of the - Products involved in the batch delete to a new ProductSet while - this - operation is running because those Products may still end up - deleted. + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is - recommended to keep the csv files used in ImportProductSets (if - that was - how you originally built the Product Set) before starting - PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then - re-use the empty ProductSet to re-import new Products into the - empty - ProductSet, you must wait until the PurgeProducts operation has - finished - for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the + PurgeProducts operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) Returns: Callable[[~.PurgeProductsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py index d34f06f7794a..69f22a1d6ce9 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py @@ -1032,21 +1032,17 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): """REST backend synchronous transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `__ resources, named ``projects/*/locations/*/productSets/*``, + which acts as a way to put different products into groups to limit + identification. In parallel, - The API has a collection of + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has + a collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -1648,8 +1644,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ @@ -2425,8 +2420,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py index 22e87af8f4bc..a1bbc4a42ccc 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py @@ -101,10 +101,8 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the - maximum - number of results to return for that type. Multiple - ``Feature`` objects can - be specified in the ``features`` list. + maximum number of results to return for that type. Multiple + ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1.types.Feature.Type): @@ -113,13 +111,11 @@ class Feature(proto.Message): Maximum number of results of this type. Does not apply to ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): - Model to use for the feature. - Supported values: "builtin/stable" (the default if unset) - and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` - also - support "builtin/weekly" for the bleeding edge release - updated weekly. + Model to use for the feature. Supported values: + "builtin/stable" (the default if unset) and + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support + "builtin/weekly" for the bleeding edge release updated + weekly. """ class Type(proto.Enum): @@ -138,10 +134,9 @@ class Type(proto.Enum): Run label detection. TEXT_DETECTION (5): Run text detection / optical character recognition (OCR). - Text detection - is optimized for areas of text within a larger image; if the - image is - a document, use ``DOCUMENT_TEXT_DETECTION`` instead. + Text detection is optimized for areas of text within a + larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` + instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are present. @@ -197,39 +192,31 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not supported. See - `Google Cloud Storage Request - URIs + The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google Cloud Storage + Request URIs `__ for more info. image_uri (str): The URI of the source image. Can be either: - 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not supported. See - `Google Cloud Storage Request - URIs + 1. A Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. + Object versioning is not supported. See `Google Cloud + Storage Request URIs `__ - for more - info. + for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from - HTTP/HTTPS URLs, Google cannot guarantee that the request - will be - completed. Your request may fail if the specified host - denies the - request (e.g. due to request throttling or DOS prevention), - or if Google + images from HTTP/HTTPS URLs, Google cannot guarantee + that the request will be completed. Your request may + fail if the specified host denies the request (e.g. due + to request throttling or DOS prevention), or if Google throttles requests to the site for abuse prevention. You - should not - depend on externally-hosted images for production - applications. + should not depend on externally-hosted images for + production applications. - When both ``gcs_image_uri`` and ``image_uri`` are - specified, ``image_uri`` takes - precedence. + When both ``gcs_image_uri`` and ``image_uri`` are specified, ``image_uri`` + takes precedence. """ gcs_image_uri: str = proto.Field( @@ -247,21 +234,18 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use - a pure binary + Image content, represented as a stream of bytes. Note: As + with all ``bytes`` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateImages - requests. It does - not work for AsyncBatchAnnotateImages requests. + requests. It does not work for AsyncBatchAnnotateImages + requests. source (google.cloud.vision_v1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image - URL. If both ``content`` and ``source`` are - provided for an image, ``content`` - takes precedence and is used to perform the image annotation - request. + image URL. If both ``content`` and ``source`` are provided for + an image, ``content`` takes precedence and is used to perform + the image annotation request. """ content: bytes = proto.Field( @@ -282,45 +266,36 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box - are in the original image's scale. - The bounding box is computed to "frame" the face in - accordance with human - expectations. It is based on the landmarker results. - Note that one or more x and/or y coordinates may not be - generated in the - ``BoundingPoly`` (the polygon will be unbounded) if only a - partial face - appears in the image to be annotated. + bounding box are in the original image's scale. The + bounding box is computed to "frame" the face in accordance + with human expectations. It is based on the landmarker + results. Note that one or more x and/or y coordinates may + not be generated in the ``BoundingPoly`` (the polygon will be + unbounded) if only a partial face appears in the image to + be annotated. fd_bounding_poly (google.cloud.vision_v1.types.BoundingPoly): The ``fd_bounding_poly`` bounding polygon is tighter than the - ``boundingPoly``, and encloses only the skin part of the - face. Typically, it - is used to eliminate the face from any image analysis that - detects the - "amount of skin" visible in an image. It is not based on the - landmarker results, only on the initial face detection, - hence - the fd (face detection) prefix. + ``boundingPoly``, and encloses only the skin part of the face. + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face + detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation - of the face relative to the image vertical about the axis - perpendicular to - the face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the + face. Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is - pointing relative to the vertical plane perpendicular to the - image. Range - [-180,180]. + the face is pointing relative to the vertical plane + perpendicular to the image. Range [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is - pointing relative to the image's horizontal plane. Range - [-180,180]. + that the face is pointing relative to the image's + horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -352,12 +327,10 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. - Left and right are defined from the vantage of the viewer of the - image - without considering mirror projections typical of photos. So, - ``LEFT_EYE``, - typically, is the person's right eye. + r"""Face landmark (feature) type. Left and right are defined from the + vantage of the viewer of the image without considering mirror + projections typical of photos. So, ``LEFT_EYE``, typically, is the + person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -603,52 +576,44 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in - `Google Knowledge Graph Search - API `__. + Opaque entity ID. Some IDs may be available in `Google + Knowledge Graph Search API + `__. locale (str): The language code for the locale in which the entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its - ``locale`` language. + Entity textual description, expressed in its ``locale`` + language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** - The accuracy of the entity detection in an image. - For example, for an image in which the "Eiffel Tower" entity - is detected, - this field represents the confidence that there is a tower - in the query + **Deprecated. Use ``score`` instead.** The accuracy of the + entity detection in an image. For example, for an image in + which the "Eiffel Tower" entity is detected, this field + represents the confidence that there is a tower in the query image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the - image. For example, the relevancy of "tower" is likely - higher to an image - containing the detected "Eiffel Tower" than to an image - containing a - detected distant towering building, even though the - confidence that - there is a tower in each image may be the same. Range [0, - 1]. + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower + in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1.types.BoundingPoly): - Image region to which this entity belongs. Not produced - for ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not produced for + ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may + ``LocationInfo`` elements can be present because one location may indicate the location of the scene in the image, and another - location - may indicate the location of the place where the image was - taken. - Location information is usually present for landmarks. + location may indicate the location of the place where the + image was taken. Location information is usually present + for landmarks. properties (MutableSequence[google.cloud.vision_v1.types.Property]): - Some entities may have optional user-supplied - ``Property`` (name/value) - fields, such a score or string that qualifies the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) fields, such a score or string that qualifies + the entity. """ mid: str = proto.Field( @@ -701,8 +666,7 @@ class LocalizedObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more - information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. @@ -961,26 +925,21 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and - DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for - DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence - score for TEXT_DETECTION as well. + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to further fine-tune OCR - behavior. - Current valid values are: - - - ``legacy_layout``: a heuristics layout detection - algorithm, which serves as an alternative to the current - ML-based layout detection algorithm. Customers can choose - the best suitable layout algorithm based on their - situation. + behavior. Current valid values are: + + - ``legacy_layout``: a heuristics layout detection algorithm, which + serves as an alternative to the current ML-based layout + detection algorithm. Customers can choose the best + suitable layout algorithm based on their situation. """ enable_text_detection_confidence_score: bool = proto.Field( @@ -1001,20 +960,14 @@ class ImageContext(proto.Message): Not used. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value - yields the best results since it enables automatic language - detection. For - languages based on the Latin alphabet, setting - ``language_hints`` is not - needed. In rare cases, when the language of the text in the - image is known, + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In rare + cases, when the language of the text in the image is known, setting a hint will help get better results (although it - will be a - significant hindrance if the hint is wrong). Text detection - returns an - error if one or more of the specified languages is not one - of the - `supported languages + will be a significant hindrance if the hint is wrong). Text + detection returns an error if one or more of the specified + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1.types.CropHintsParams): Parameters for crop hints annotation request. @@ -1256,8 +1209,7 @@ class BatchAnnotateImagesRequest(proto.Message): If no parent is specified, a region will be chosen automatically. - Supported location-ids: - ``us``: USA country only, + Supported location-ids: ``us``: USA country only, ``asia``: East asia areas, like Japan, Taiwan, ``eu``: The European Union. @@ -1369,15 +1321,13 @@ class AnnotateFileResponse(proto.Message): response is generated. responses (MutableSequence[google.cloud.vision_v1.types.AnnotateImageResponse]): Individual responses to images found within the file. This - field will be - empty if the ``error`` field is set. + field will be empty if the ``error`` field is set. total_pages (int): This field gives the total number of pages in the file. error (google.rpc.status_pb2.Status): If set, represents the error message for the failed request. - The - ``responses`` field will not be set in this case. + The ``responses`` field will not be set in this case. """ input_config: "InputConfig" = proto.Field( @@ -1419,8 +1369,7 @@ class BatchAnnotateFilesRequest(proto.Message): If no parent is specified, a region will be chosen automatically. - Supported location-ids: - ``us``: USA country only, + Supported location-ids: ``us``: USA country only, ``asia``: East asia areas, like Japan, Taiwan, ``eu``: The European Union. @@ -1542,8 +1491,7 @@ class AsyncBatchAnnotateImagesRequest(proto.Message): If no parent is specified, a region will be chosen automatically. - Supported location-ids: - ``us``: USA country only, + Supported location-ids: ``us``: USA country only, ``asia``: East asia areas, like Japan, Taiwan, ``eu``: The European Union. @@ -1612,8 +1560,7 @@ class AsyncBatchAnnotateFilesRequest(proto.Message): If no parent is specified, a region will be chosen automatically. - Supported location-ids: - ``us``: USA country only, + Supported location-ids: ``us``: USA country only, ``asia``: East asia areas, like Japan, Taiwan, ``eu``: The European Union. @@ -1670,14 +1617,13 @@ class InputConfig(proto.Message): The Google Cloud Storage location to read the input from. content (bytes): - File content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use - a pure binary + File content, represented as a stream of bytes. Note: As + with all ``bytes`` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateFiles - requests. It does - not work for AsyncBatchAnnotateFiles requests. + requests. It does not work for AsyncBatchAnnotateFiles + requests. mime_type (str): The type of the file. Currently only "application/pdf", "image/tiff" and "image/gif" @@ -1708,22 +1654,16 @@ class OutputConfig(proto.Message): the output(s) to. batch_size (int): The max number of response protos to put into each output - JSON file on - Google Cloud Storage. - The valid range is [1, 100]. If not specified, the default - value is 20. + JSON file on Google Cloud Storage. The valid range is [1, + 100]. If not specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response - protos will - be generated. If ``batch_size`` = 20, then 5 json files - each - containing 20 response protos will be written under the - prefix - ``gcs_destination``.``uri``. + protos will be generated. If ``batch_size`` = 20, then 5 json + files each containing 20 response protos will be written + under the prefix ``gcs_destination``.``uri``. Currently, batch_size only applies to GcsDestination, with - potential future - support for other output configurations. + potential future support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1761,36 +1701,28 @@ class GcsDestination(proto.Message): Attributes: uri (str): Google Cloud Storage URI prefix where the results will be - stored. Results - will be in JSON format and preceded by its corresponding - input URI prefix. - This field can either represent a gcs file prefix or gcs - directory. In - either case, the uri should be unique because in order to - get all of the - output files, you will need to do a wildcard gcs search on - the uri prefix - you provide. + stored. Results will be in JSON format and preceded by its + corresponding input URI prefix. This field can either + represent a gcs file prefix or gcs directory. In either + case, the uri should be unique because in order to get all + of the output files, you will need to do a wildcard gcs + search on the uri prefix you provide. Examples: * File Prefix: gs://bucket-name/here/filenameprefix The output files will be created in gs://bucket-name/here/ and the names of the output files will begin with - "filenameprefix". - - * Directory Prefix: gs://bucket-name/some/location/ The - output files will be created in - gs://bucket-name/some/location/ and the names of the - output files could be anything because there was no + "filenameprefix". * Directory Prefix: + gs://bucket-name/some/location/ The output files will be + created in gs://bucket-name/some/location/ and the names + of the output files could be anything because there was no filename prefix specified. If multiple outputs, each - response is still AnnotateFileResponse, each of which + response is still AnnotateFileResponse, each of which contains some subset of the full list of - AnnotateImageResponse. - - Multiple outputs can happen if, for example, the output JSON - is too large - and overflows into multiple sharded files. + AnnotateImageResponse. Multiple outputs can happen if, + for example, the output JSON is too large and overflows + into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py index 37bc2c363f4f..f47f0fe5133c 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py @@ -41,11 +41,10 @@ class ProductSearchParams(proto.Message): system discretion will be applied. product_set (str): The resource name of a `ProductSet - `__ to - be searched for similar images. + `__ to be searched for + similar images. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -149,8 +148,7 @@ class ObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more - information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py index b46ccc642fe2..92d9abcaf985 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py @@ -69,8 +69,7 @@ class Product(proto.Message): name (str): The resource name of the product. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This field is ignored when creating a product. display_name (str): @@ -90,24 +89,20 @@ class Product(proto.Message): not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1.types.Product.KeyValue]): Key-value pairs that can be attached to a product. At query - time, - constraints can be specified based on the product_labels. + time, constraints can be specified based on the + product_labels. Note that integer values can be provided as strings, e.g. - "1199". Only - strings with integer values can match a range-based - restriction which is - to be supported soon. + "1199". Only strings with integer values can match a + range-based restriction which is to be supported soon. Multiple values can be assigned to the same key. One product - may have up to - 500 product_labels. + may have up to 500 product_labels. Notice that the total number of distinct product_labels over - all products - in one ProductSet cannot exceed 1M, otherwise the product - search pipeline - will refuse to work for that ProductSet. + all products in one ProductSet cannot exceed 1M, otherwise + the product search pipeline will refuse to work for that + ProductSet. """ class KeyValue(proto.Message): @@ -164,8 +159,7 @@ class ProductSet(proto.Message): name (str): The resource name of the ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. This field is ignored when creating a ProductSet. display_name (str): @@ -213,15 +207,13 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): r"""A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. Attributes: name (str): The resource name of the reference image. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This field is ignored when creating a reference image. uri (str): @@ -266,18 +258,16 @@ class CreateProductRequest(proto.Message): Required. The project in which the Product should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1.types.Product): Required. The product to create. product_id (str): A user-supplied resource id for this Product. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. """ parent: str = proto.Field( @@ -303,8 +293,7 @@ class ListProductsRequest(proto.Message): Required. The project OR ProductSet from which Products should be listed. - Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -361,8 +350,7 @@ class GetProductRequest(proto.Message): name (str): Required. Resource name of the Product to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -381,13 +369,9 @@ class UpdateProductRequest(proto.Message): immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields - to update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask paths include ``product_labels``, - ``display_name``, and - ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. """ product: "Product" = proto.Field( @@ -409,8 +393,7 @@ class DeleteProductRequest(proto.Message): name (str): Required. Resource name of product to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -432,12 +415,11 @@ class CreateProductSetRequest(proto.Message): Required. The ProductSet to create. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. """ parent: str = proto.Field( @@ -520,8 +502,7 @@ class GetProductSetRequest(proto.Message): name (str): Required. Resource name of the ProductSet to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -539,11 +520,9 @@ class UpdateProductSetRequest(proto.Message): replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to - update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask path is ``display_name``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask path is ``display_name``. """ product_set: "ProductSet" = proto.Field( @@ -565,8 +544,7 @@ class DeleteProductSetRequest(proto.Message): name (str): Required. Resource name of the ProductSet to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -581,21 +559,17 @@ class CreateReferenceImageRequest(proto.Message): Attributes: parent (str): Required. Resource name of the product in which to - create the reference - image. + create the reference image. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. reference_image (google.cloud.vision_v1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, - the server will attempt to use this value as the - resource id. If it is - already in use, an error is returned with code - ALREADY_EXISTS. Must be at + added. If set, the server will attempt to use this + value as the resource id. If it is already in use, an + error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character ``/``. """ @@ -623,16 +597,14 @@ class ListReferenceImagesRequest(proto.Message): Required. Resource name of the product containing the reference images. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value - of ``nextPageToken`` returned in a previous reference image - list request. + is the value of ``nextPageToken`` returned in a previous reference + image list request. Defaults to the first page if not specified. """ @@ -692,8 +664,7 @@ class GetReferenceImageRequest(proto.Message): Required. The resource name of the ReferenceImage to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. """ name: str = proto.Field( @@ -710,8 +681,7 @@ class DeleteReferenceImageRequest(proto.Message): Required. The resource name of the reference image to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` """ name: str = proto.Field( @@ -728,14 +698,12 @@ class AddProductToProductSetRequest(proto.Message): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be added to this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -756,15 +724,12 @@ class RemoveProductFromProductSetRequest(proto.Message): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be - removed from this - ProductSet. + removed from this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -785,8 +750,7 @@ class ListProductsInProductSetRequest(proto.Message): Required. The ProductSet resource for which to retrieve Products. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -847,90 +811,63 @@ class ImportProductSetsGcsSource(proto.Message): The URI must start with ``gs://``. The format of the input csv file should be one image per - line. - In each line, there are 8 columns. - - 1. image-uri - 2. image-id - 3. product-set-id - 4. product-id - 5. product-category - 6. product-display-name - 7. labels - 8. bounding-poly - - The ``image-uri``, ``product-set-id``, ``product-id``, - and ``product-category`` - columns are required. All other columns are optional. - - If the ``ProductSet`` or ``Product`` specified by - the ``product-set-id`` and - ``product-id`` values does not exist, then the system - will create a new - ``ProductSet`` or ``Product`` for the image. In - this case, the - ``product-display-name`` column refers to - `display_name + line. In each line, there are 8 columns. + + 1. image-uri 2. image-id 3. product-set-id 4. + product-id 5. product-category 6. product-display-name + 7. labels 8. bounding-poly + + The ``image-uri``, ``product-set-id``, ``product-id``, and ``product-category`` columns + are required. All other columns are optional. + + If the ``ProductSet`` or ``Product`` specified by the ``product-set-id`` and + ``product-id`` values does not exist, then the system will create + a new ``ProductSet`` or ``Product`` for the image. In this case, + the ``product-display-name`` column refers to `display_name `__, the - ``product-category`` column refers to - `product_category + ``product-category`` column refers to `product_category `__, and - the ``labels`` column refers to - `product_labels + the ``labels`` column refers to `product_labels `__. - The ``image-id`` column is optional but must be unique - if provided. If it is - empty, the system will automatically assign a unique id to - the image. + The ``image-id`` column is optional but must be unique if + provided. If it is empty, the system will automatically + assign a unique id to the image. - The ``product-display-name`` column is optional. If it is empty, - the system + The ``product-display-name`` column is optional. If it is empty, the system sets the `display_name - `__ field - for the product to a space (" "). You can update the - ``display_name`` later - by using the API. + `__ field for + the product to a space (" "). You can update the ``display_name`` + later by using the API. - If a ``Product`` with the specified ``product-id`` - already exists, then the - system ignores the ``product-display-name``, ``product-category``, and - ``labels`` - columns. + If a ``Product`` with the specified ``product-id`` already exists, + then the system ignores the ``product-display-name``, ``product-category``, and + ``labels`` columns. - The ``labels`` column (optional) is a line containing - a list of - comma-separated key-value pairs, in the following format: + The ``labels`` column (optional) is a line containing a list + of comma-separated key-value pairs, in the following + format: "key_1=value_1,key_2=value_2,...,key_n=value_n" - The ``bounding-poly`` column (optional) identifies one - region of - interest from the image in the same manner as - ``CreateReferenceImage``. If - you do not specify the ``bounding-poly`` column, then the - system will try to - detect regions of interest automatically. - - At most one ``bounding-poly`` column is allowed per line. If - the image - contains multiple regions of interest, add a line to the CSV - file that - includes the same product information, and the - ``bounding-poly`` values for - each region of interest. + The ``bounding-poly`` column (optional) identifies one region of + interest from the image in the same manner as ``CreateReferenceImage``. If + you do not specify the ``bounding-poly`` column, then the system + will try to detect regions of interest automatically. + + At most one ``bounding-poly`` column is allowed per line. If the + image contains multiple regions of interest, add a line to + the CSV file that includes the same product information, + and the ``bounding-poly`` values for each region of interest. The ``bounding-poly`` column must contain an even number of - comma-separated - numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". - Use - non-negative integers for absolute bounding polygons, and - float values + comma-separated numbers, in the format + "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative + integers for absolute bounding polygons, and float values in [0, 1] for normalized bounding polygons. The system will resize the image if the image resolution is - too - large to process (larger than 20MP). + too large to process (larger than 20MP). """ csv_file_uri: str = proto.Field( @@ -991,25 +928,21 @@ class ImportProductSetsResponse(proto.Message): This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned - `google.longrunning.Operation.response - `__ - field. + `__ method in the + returned `google.longrunning.Operation.response + `__ field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1.types.ReferenceImage]): The list of reference_images that are imported successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): The rpc status for each ImportProductSet request, including - both successes - and errors. + both successes and errors. The number of statuses here matches the number of lines in - the csv file, - and statuses[i] stores the success or failure status of - processing the i-th - line of the csv, starting from line 0. + the csv file, and statuses[i] stores the success or failure + status of processing the i-th line of the csv, starting + from line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -1027,9 +960,8 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the - ``Operation`` returned by the - ``GetOperation`` call of the ``google::longrunning::Operations`` service. + This is included in the ``metadata`` field of the ``Operation`` returned by + the ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1.types.BatchOperationMetadata.State): @@ -1040,8 +972,7 @@ class BatchOperationMetadata(proto.Message): end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and `google.longrunning.Operation.done - `__ is - set to true. + `__ is set to true. """ class State(proto.Enum): @@ -1096,10 +1027,8 @@ class ProductSetPurgeConfig(proto.Message): Attributes: product_set_id (str): The ProductSet that contains the Products to delete. If a - Product is a - member of product_set_id in addition to other ProductSets, - the Product will - still be deleted. + Product is a member of product_set_id in addition to other + ProductSets, the Product will still be deleted. """ product_set_id: str = proto.Field( @@ -1126,8 +1055,7 @@ class PurgeProductsRequest(proto.Message): This field is a member of `oneof`_ ``target``. delete_orphan_products (bool): If delete_orphan_products is true, all Products that are not - in any - ProductSet will be deleted. + in any ProductSet will be deleted. This field is a member of `oneof`_ ``target``. parent (str): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py index 5a2cc7b4c39a..dc4a2a637e54 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py @@ -36,17 +36,13 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. - The hierarchy of an OCR extracted text structure is like this: - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol - Each structural component, starting from Page, may further have - their own - properties. Properties describe detected languages, breaks etc.. - Please refer - to the - `TextAnnotation.TextProperty - `__ - message definition below for more detail. + text. The hierarchy of an OCR extracted text structure is like + this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> + Symbol Each structural component, starting from Page, may further + have their own properties. Properties describe detected languages, + breaks etc.. Please refer to the `TextAnnotation.TextProperty + `__ message + definition below for more detail. Attributes: pages (MutableSequence[google.cloud.vision_v1.types.Page]): @@ -61,8 +57,7 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more - information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -101,8 +96,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with - ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py index 9682b2d431d3..a0852ab4f637 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py @@ -159,9 +159,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as - "en-US" or "sr-Latn". - For more information, see + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py index 345f23901196..9326456bc422 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py @@ -88,10 +88,9 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""Users describe the type of Google Cloud Vision API tasks to perform - over - images by using *Feature*s. Each Feature indicates a type of image - detection task to perform. Features encode the Cloud Vision API - vertical to operate on and the number of top-scoring results to + over images by using *Feature*s. Each Feature indicates a type of + image detection task to perform. Features encode the Cloud Vision + API vertical to operate on and the number of top-scoring results to return. Attributes: @@ -100,13 +99,11 @@ class Feature(proto.Message): max_results (int): Maximum number of results of this type. model (str): - Model to use for the feature. - Supported values: "builtin/stable" (the default if unset) - and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` - also - support "builtin/weekly" for the bleeding edge release - updated weekly. + Model to use for the feature. Supported values: + "builtin/stable" (the default if unset) and + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support + "builtin/weekly" for the bleeding edge release updated + weekly. """ class Type(proto.Enum): @@ -171,29 +168,21 @@ class ImageSource(proto.Message): Attributes: gcs_image_uri (str): - NOTE: For new code ``image_uri`` below is preferred. - Google Cloud Storage image URI, which must be in the - following form: - ``gs://bucket_name/object_name`` (for details, see - `Google Cloud Storage Request - URIs + NOTE: For new code ``image_uri`` below is preferred. Google + Cloud Storage image URI, which must be in the following + form: ``gs://bucket_name/object_name`` (for details, see `Google Cloud Storage + Request URIs `__). NOTE: Cloud Storage object versioning is not supported. image_uri (str): - Image URI which supports: - 1) Google Cloud Storage image URI, which must be in the - following form: - ``gs://bucket_name/object_name`` (for details, see - `Google Cloud Storage Request - URIs + Image URI which supports: 1) Google Cloud Storage image + URI, which must be in the following form: ``gs://bucket_name/object_name`` (for + details, see `Google Cloud Storage Request URIs `__). - NOTE: Cloud Storage object versioning is not supported. - 2) Publicly accessible image HTTP/HTTPS URL. - This is preferred over the legacy ``gcs_image_uri`` above. - When both - ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes - precedence. + NOTE: Cloud Storage object versioning is not supported. 2) + Publicly accessible image HTTP/HTTPS URL. This is preferred + over the legacy ``gcs_image_uri`` above. When both ``gcs_image_uri`` and + ``image_uri`` are specified, ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -211,16 +200,14 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. - Note: as with all ``bytes`` fields, protobuffers use - a pure binary + Image content, represented as a stream of bytes. Note: as + with all ``bytes`` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p1beta1.types.ImageSource): - Google Cloud Storage image location. If both - ``content`` and ``source`` - are provided for an image, ``content`` takes - precedence and is - used to perform the image annotation request. + Google Cloud Storage image location. If both ``content`` and + ``source`` are provided for an image, ``content`` takes + precedence and is used to perform the image annotation + request. """ content: bytes = proto.Field( @@ -241,46 +228,36 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box - are in the original image's scale, as returned in - ``ImageParams``. - The bounding box is computed to "frame" the face in - accordance with human - expectations. It is based on the landmarker results. - Note that one or more x and/or y coordinates may not be - generated in the - ``BoundingPoly`` (the polygon will be unbounded) if only a - partial face - appears in the image to be annotated. + bounding box are in the original image's scale, as returned + in ``ImageParams``. The bounding box is computed to "frame" the + face in accordance with human expectations. It is based on + the landmarker results. Note that one or more x and/or y + coordinates may not be generated in the ``BoundingPoly`` (the + polygon will be unbounded) if only a partial face appears + in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): The ``fd_bounding_poly`` bounding polygon is tighter than the - ``boundingPoly``, and encloses only the skin part of the - face. Typically, it - is used to eliminate the face from any image analysis that - detects the - "amount of skin" visible in an image. It is not based on the - landmarker results, only on the initial face detection, - hence - the fd (face detection) prefix. + ``boundingPoly``, and encloses only the skin part of the face. + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face + detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p1beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation - of the face relative to the image vertical about the axis - perpendicular to - the face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the + face. Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is - pointing relative to the vertical plane perpendicular to the - image. Range - [-180,180]. + the face is pointing relative to the vertical plane + perpendicular to the image. Range [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is - pointing relative to the image's horizontal plane. Range - [-180,180]. + that the face is pointing relative to the image's + horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -312,12 +289,10 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. - Left and right are defined from the vantage of the viewer of the - image - without considering mirror projections typical of photos. So, - ``LEFT_EYE``, - typically, is the person's right eye. + r"""Face landmark (feature) type. Left and right are defined from the + vantage of the viewer of the image without considering mirror + projections typical of photos. So, ``LEFT_EYE``, typically, is the + person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -557,51 +532,43 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in - `Google Knowledge Graph Search - API `__. + Opaque entity ID. Some IDs may be available in `Google + Knowledge Graph Search API + `__. locale (str): The language code for the locale in which the entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its - ``locale`` language. + Entity textual description, expressed in its ``locale`` + language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - The accuracy of the entity detection in an image. - For example, for an image in which the "Eiffel Tower" entity - is detected, - this field represents the confidence that there is a tower - in the query - image. Range [0, 1]. + The accuracy of the entity detection in an image. For + example, for an image in which the "Eiffel Tower" entity is + detected, this field represents the confidence that there + is a tower in the query image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the - image. For example, the relevancy of "tower" is likely - higher to an image - containing the detected "Eiffel Tower" than to an image - containing a - detected distant towering building, even though the - confidence that - there is a tower in each image may be the same. Range [0, - 1]. + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower + in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): - Image region to which this entity belongs. Not produced - for ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not produced for + ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p1beta1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may + ``LocationInfo`` elements can be present because one location may indicate the location of the scene in the image, and another - location - may indicate the location of the place where the image was - taken. - Location information is usually present for landmarks. + location may indicate the location of the place where the + image was taken. Location information is usually present + for landmarks. properties (MutableSequence[google.cloud.vision_v1p1beta1.types.Property]): - Some entities may have optional user-supplied - ``Property`` (name/value) - fields, such a score or string that qualifies the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) fields, such a score or string that qualifies + the entity. """ mid: str = proto.Field( @@ -791,9 +758,8 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): The bounding polygon for the crop region. The coordinates of - the bounding - box are in the original image's scale, as returned in - ``ImageParams``. + the bounding box are in the original image's scale, as + returned in ``ImageParams``. confidence (float): Confidence of this being a salient region. Range [0, 1]. importance_fraction (float): @@ -870,16 +836,13 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and - DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for - DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence - score for TEXT_DETECTION as well. + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -904,20 +867,14 @@ class ImageContext(proto.Message): location of the image. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value - yields the best results since it enables automatic language - detection. For - languages based on the Latin alphabet, setting - ``language_hints`` is not - needed. In rare cases, when the language of the text in the - image is known, + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In rare + cases, when the language of the text in the image is known, setting a hint will help get better results (although it - will be a - significant hindrance if the hint is wrong). Text detection - returns an - error if one or more of the specified languages is not one - of the - `supported languages + will be a significant hindrance if the hint is wrong). Text + detection returns an error if one or more of the specified + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p1beta1.types.CropHintsParams): Parameters for crop hints annotation request. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py index 0ad3e38682d5..a11fcc15b6e0 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py @@ -36,15 +36,11 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. - The hierarchy of an OCR extracted text structure is like this: - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol - Each structural component, starting from Page, may further have - their own - properties. Properties describe detected languages, breaks etc.. - Please refer - to the - `TextAnnotation.TextProperty + text. The hierarchy of an OCR extracted text structure is like + this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> + Symbol Each structural component, starting from Page, may further + have their own properties. Properties describe detected languages, + breaks etc.. Please refer to the `TextAnnotation.TextProperty `__ message definition below for more detail. @@ -61,8 +57,7 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more - information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -101,8 +96,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with - ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py index 3f4163872cd8..d7733d016960 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py @@ -157,9 +157,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as - "en-US" or "sr-Latn". - For more information, see + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py index b96339df935f..ae3958e86973 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py @@ -415,13 +415,10 @@ async def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Run async image detection and annotation for a list of generic - files (e.g. - PDF) which may contain multiple pages and multiple images per - page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + files (e.g. PDF) which may contain multiple pages and multiple + images per page. Progress and results can be retrieved through + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py index 905ac68c029d..20b4d0cf0d5a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py @@ -833,13 +833,10 @@ def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Run async image detection and annotation for a list of generic - files (e.g. - PDF) which may contain multiple pages and multiple images per - page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + files (e.g. PDF) which may contain multiple pages and multiple + images per page. Progress and results can be retrieved through + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py index 87dd6d567258..14856d1d6389 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py @@ -381,13 +381,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run async image detection and annotation for a list of generic - files (e.g. - PDF) which may contain multiple pages and multiple images per - page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + files (e.g. PDF) which may contain multiple pages and multiple + images per page. Progress and results can be retrieved through + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py index a39de12dda09..5ec85ee343fd 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py @@ -390,13 +390,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run async image detection and annotation for a list of generic - files (e.g. - PDF) which may contain multiple pages and multiple images per - page. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + files (e.g. PDF) which may contain multiple pages and multiple + images per page. Progress and results can be retrieved through + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py index f4ada3cb6a1d..b80e358f193b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py @@ -100,10 +100,8 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the - maximum - number of results to return for that type. Multiple - ``Feature`` objects can - be specified in the ``features`` list. + maximum number of results to return for that type. Multiple + ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p2beta1.types.Feature.Type): @@ -112,13 +110,11 @@ class Feature(proto.Message): Maximum number of results of this type. Does not apply to ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): - Model to use for the feature. - Supported values: "builtin/stable" (the default if unset) - and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` - also - support "builtin/weekly" for the bleeding edge release - updated weekly. + Model to use for the feature. Supported values: + "builtin/stable" (the default if unset) and + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support + "builtin/weekly" for the bleeding edge release updated + weekly. """ class Type(proto.Enum): @@ -137,10 +133,9 @@ class Type(proto.Enum): Run label detection. TEXT_DETECTION (5): Run text detection / optical character recognition (OCR). - Text detection - is optimized for areas of text within a larger image; if the - image is - a document, use ``DOCUMENT_TEXT_DETECTION`` instead. + Text detection is optimized for areas of text within a + larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` + instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are present. @@ -190,39 +185,31 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not supported. See - `Google Cloud Storage Request - URIs + The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google Cloud Storage + Request URIs `__ for more info. image_uri (str): The URI of the source image. Can be either: - 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not supported. See - `Google Cloud Storage Request - URIs + 1. A Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. + Object versioning is not supported. See `Google Cloud + Storage Request URIs `__ - for more - info. + for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from - HTTP/HTTPS URLs, Google cannot guarantee that the request - will be - completed. Your request may fail if the specified host - denies the - request (e.g. due to request throttling or DOS prevention), - or if Google + images from HTTP/HTTPS URLs, Google cannot guarantee + that the request will be completed. Your request may + fail if the specified host denies the request (e.g. due + to request throttling or DOS prevention), or if Google throttles requests to the site for abuse prevention. You - should not - depend on externally-hosted images for production - applications. + should not depend on externally-hosted images for + production applications. - When both ``gcs_image_uri`` and ``image_uri`` are - specified, ``image_uri`` takes - precedence. + When both ``gcs_image_uri`` and ``image_uri`` are specified, ``image_uri`` + takes precedence. """ gcs_image_uri: str = proto.Field( @@ -240,17 +227,14 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use - a pure binary + Image content, represented as a stream of bytes. Note: As + with all ``bytes`` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p2beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image - URL. If both ``content`` and ``source`` are - provided for an image, ``content`` - takes precedence and is used to perform the image annotation - request. + image URL. If both ``content`` and ``source`` are provided for + an image, ``content`` takes precedence and is used to perform + the image annotation request. """ content: bytes = proto.Field( @@ -271,46 +255,36 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box - are in the original image's scale, as returned in - ``ImageParams``. - The bounding box is computed to "frame" the face in - accordance with human - expectations. It is based on the landmarker results. - Note that one or more x and/or y coordinates may not be - generated in the - ``BoundingPoly`` (the polygon will be unbounded) if only a - partial face - appears in the image to be annotated. + bounding box are in the original image's scale, as returned + in ``ImageParams``. The bounding box is computed to "frame" the + face in accordance with human expectations. It is based on + the landmarker results. Note that one or more x and/or y + coordinates may not be generated in the ``BoundingPoly`` (the + polygon will be unbounded) if only a partial face appears + in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): The ``fd_bounding_poly`` bounding polygon is tighter than the - ``boundingPoly``, and encloses only the skin part of the - face. Typically, it - is used to eliminate the face from any image analysis that - detects the - "amount of skin" visible in an image. It is not based on the - landmarker results, only on the initial face detection, - hence - the fd (face detection) prefix. + ``boundingPoly``, and encloses only the skin part of the face. + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face + detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p2beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation - of the face relative to the image vertical about the axis - perpendicular to - the face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the + face. Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is - pointing relative to the vertical plane perpendicular to the - image. Range - [-180,180]. + the face is pointing relative to the vertical plane + perpendicular to the image. Range [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is - pointing relative to the image's horizontal plane. Range - [-180,180]. + that the face is pointing relative to the image's + horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -342,12 +316,10 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. - Left and right are defined from the vantage of the viewer of the - image - without considering mirror projections typical of photos. So, - ``LEFT_EYE``, - typically, is the person's right eye. + r"""Face landmark (feature) type. Left and right are defined from the + vantage of the viewer of the image without considering mirror + projections typical of photos. So, ``LEFT_EYE``, typically, is the + person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -587,52 +559,44 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in - `Google Knowledge Graph Search - API `__. + Opaque entity ID. Some IDs may be available in `Google + Knowledge Graph Search API + `__. locale (str): The language code for the locale in which the entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its - ``locale`` language. + Entity textual description, expressed in its ``locale`` + language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** - The accuracy of the entity detection in an image. - For example, for an image in which the "Eiffel Tower" entity - is detected, - this field represents the confidence that there is a tower - in the query + **Deprecated. Use ``score`` instead.** The accuracy of the + entity detection in an image. For example, for an image in + which the "Eiffel Tower" entity is detected, this field + represents the confidence that there is a tower in the query image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the - image. For example, the relevancy of "tower" is likely - higher to an image - containing the detected "Eiffel Tower" than to an image - containing a - detected distant towering building, even though the - confidence that - there is a tower in each image may be the same. Range [0, - 1]. + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower + in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): - Image region to which this entity belongs. Not produced - for ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not produced for + ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p2beta1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may + ``LocationInfo`` elements can be present because one location may indicate the location of the scene in the image, and another - location - may indicate the location of the place where the image was - taken. - Location information is usually present for landmarks. + location may indicate the location of the place where the + image was taken. Location information is usually present + for landmarks. properties (MutableSequence[google.cloud.vision_v1p2beta1.types.Property]): - Some entities may have optional user-supplied - ``Property`` (name/value) - fields, such a score or string that qualifies the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) fields, such a score or string that qualifies + the entity. """ mid: str = proto.Field( @@ -822,9 +786,8 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): The bounding polygon for the crop region. The coordinates of - the bounding - box are in the original image's scale, as returned in - ``ImageParams``. + the bounding box are in the original image's scale, as + returned in ``ImageParams``. confidence (float): Confidence of this being a salient region. Range [0, 1]. importance_fraction (float): @@ -901,16 +864,13 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and - DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for - DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence - score for TEXT_DETECTION as well. + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -934,20 +894,14 @@ class ImageContext(proto.Message): Not used. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value - yields the best results since it enables automatic language - detection. For - languages based on the Latin alphabet, setting - ``language_hints`` is not - needed. In rare cases, when the language of the text in the - image is known, + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In rare + cases, when the language of the text in the image is known, setting a hint will help get better results (although it - will be a - significant hindrance if the hint is wrong). Text detection - returns an - error if one or more of the specified languages is not one - of the - `supported languages + will be a significant hindrance if the hint is wrong). Text + detection returns an error if one or more of the specified + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p2beta1.types.CropHintsParams): Parameters for crop hints annotation request. @@ -1326,21 +1280,16 @@ class OutputConfig(proto.Message): the output(s) to. batch_size (int): The max number of response protos to put into each output - JSON file on GCS. - The valid range is [1, 100]. If not specified, the default - value is 20. + JSON file on GCS. The valid range is [1, 100]. If not + specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response - protos will - be generated. If ``batch_size`` = 20, then 5 json files - each - containing 20 response protos will be written under the - prefix - ``gcs_destination``.``uri``. + protos will be generated. If ``batch_size`` = 20, then 5 json + files each containing 20 response protos will be written + under the prefix ``gcs_destination``.``uri``. Currently, batch_size only applies to GcsDestination, with - potential future - support for other output configurations. + potential future support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1378,19 +1327,17 @@ class GcsDestination(proto.Message): Attributes: uri (str): Google Cloud Storage URI where the results will be stored. - Results will - be in JSON format and preceded by its corresponding input - URI. This field - can either represent a single file, or a prefix for multiple - outputs. - Prefixes must end in a ``/``. + Results will be in JSON format and preceded by its + corresponding input URI. This field can either represent a + single file, or a prefix for multiple outputs. Prefixes + must end in a ``/``. Examples: - * File: gs://bucket-name/filename.json - * Prefix: gs://bucket-name/prefix/here/ - * File: gs://bucket-name/prefix/here If multiple outputs, - each response is still AnnotateFileResponse, each of which + * File: gs://bucket-name/filename.json * Prefix: + gs://bucket-name/prefix/here/ * File: + gs://bucket-name/prefix/here If multiple outputs, each + response is still AnnotateFileResponse, each of which contains some subset of the full list of AnnotateImageResponse. Multiple outputs can happen if, for example, the output JSON is too large and overflows into diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py index dea841089fb5..254596fe2167 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py @@ -36,15 +36,11 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. - The hierarchy of an OCR extracted text structure is like this: - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol - Each structural component, starting from Page, may further have - their own - properties. Properties describe detected languages, breaks etc.. - Please refer - to the - `TextAnnotation.TextProperty + text. The hierarchy of an OCR extracted text structure is like + this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> + Symbol Each structural component, starting from Page, may further + have their own properties. Properties describe detected languages, + breaks etc.. Please refer to the `TextAnnotation.TextProperty `__ message definition below for more detail. @@ -61,8 +57,7 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more - information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -101,8 +96,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with - ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py index 7b50cbeabee1..3f7f7835d72b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py @@ -157,9 +157,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as - "en-US" or "sr-Latn". - For more information, see + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py index 924761d4fb9b..c82871e80464 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py @@ -418,14 +418,10 @@ async def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Run asynchronous image detection and annotation for a list of - generic - files, such as PDF files, which may contain multiple pages and - multiple - images per page. Progress and results can be retrieved through - the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py index ca5e1f87284a..27c218eb78d3 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py @@ -878,14 +878,10 @@ def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Run asynchronous image detection and annotation for a list of - generic - files, such as PDF files, which may contain multiple pages and - multiple - images per page. Progress and results can be retrieved through - the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py index 6c1360204a22..fe29fa7ffd30 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py @@ -381,14 +381,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic - files, such as PDF files, which may contain multiple pages and - multiple - images per page. Progress and results can be retrieved through - the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py index 26638560caef..11205280e166 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py @@ -390,14 +390,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic - files, such as PDF files, which may contain multiple pages and - multiple - images per page. Progress and results can be retrieved through - the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py index 86074dd2ecca..7ee396ddc54b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py @@ -69,22 +69,17 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - The API has a + collection of `Product `__ + resources, named ``projects/*/locations/*/products/*`` - Each `Product + `__ has a collection of + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -381,12 +376,11 @@ async def sample_create_product_set(): should not be set. product_set_id (:class:`str`): A user-supplied resource id for this ProductSet. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -643,8 +637,7 @@ async def sample_get_product_set(): name (:class:`str`): Required. Resource name of the ProductSet to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -727,15 +720,14 @@ async def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. - Only display_name can be updated currently. + r"""Makes changes to a ProductSet resource. Only display_name can + be updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. .. code-block:: python @@ -774,11 +766,9 @@ async def sample_update_product_set(): should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): The `FieldMask `__ that - specifies which fields to - update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask path is ``display_name``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -865,8 +855,7 @@ async def delete_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Permanently deletes a ProductSet. All Products and - ReferenceImages in the - ProductSet will be deleted. + ReferenceImages in the ProductSet will be deleted. The actual image files are not deleted from Google Cloud Storage. @@ -904,8 +893,7 @@ async def sample_delete_product_set(): name (:class:`str`): Required. Resource name of the ProductSet to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -982,11 +970,9 @@ async def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - * Returns INVALID_ARGUMENT if product_category is missing or - invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if + description is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is missing or invalid. .. code-block:: python @@ -1021,8 +1007,7 @@ async def sample_create_product(): Required. The project in which the Product should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1034,12 +1019,11 @@ async def sample_create_product(): should not be set. product_id (:class:`str`): A user-supplied resource id for this Product. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1161,8 +1145,7 @@ async def sample_list_products(): Required. The project OR ProductSet from which Products should be listed. - Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1290,8 +1273,7 @@ async def sample_get_product(): name (:class:`str`): Required. Resource name of the Product to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1369,23 +1351,20 @@ async def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. - Only display_name, description and labels can be updated right - now. + r"""Makes changes to a Product resource. Only display_name, + description and labels can be updated right now. If labels are updated, the change will not be reflected in - queries until - the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1426,13 +1405,9 @@ async def sample_update_product(): should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): The `FieldMask `__ that - specifies which fields - to update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask paths include ``product_labels``, - ``display_name``, and - ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1516,10 +1491,8 @@ async def delete_product( r"""Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right - away, but - search queries against ProductSets containing the product may - still work - until all related caches are refreshed. + away, but search queries against ProductSets containing the + product may still work until all related caches are refreshed. Possible errors: @@ -1554,8 +1527,7 @@ async def sample_delete_product(): name (:class:`str`): Required. Resource name of product to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1629,30 +1601,24 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are - compatible with the product_category on the parent product. If - it is - specified, detection is ALWAYS skipped. The system converts - polygons into - non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too - large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. - * Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - * Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the + product does not exist. * Returns INVALID_ARGUMENT if + bounding_poly is not provided, and nothing compatible with the + parent product's product_category is detected. * Returns + INVALID_ARGUMENT if bounding_poly contains more than 10 + polygons. .. code-block:: python @@ -1691,8 +1657,7 @@ async def sample_create_reference_image(): Required. Resource name of the product in which to create the reference image. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1707,11 +1672,9 @@ async def sample_create_reference_image(): should not be set. reference_image_id (:class:`str`): A user-supplied resource id for the ReferenceImage to be - added. If set, - the server will attempt to use this value as the - resource id. If it is - already in use, an error is returned with code - ALREADY_EXISTS. Must be at + added. If set, the server will attempt to use this + value as the resource id. If it is already in use, an + error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character ``/``. @@ -1729,8 +1692,7 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1800,10 +1762,8 @@ async def delete_reference_image( r"""Permanently deletes a reference image. The image metadata will be deleted right away, but search - queries - against ProductSets containing the image may still work until - all related - caches are refreshed. + queries against ProductSets containing the image may still work + until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. @@ -1918,8 +1878,8 @@ async def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. - * Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. .. code-block:: python @@ -1956,8 +1916,7 @@ async def sample_list_reference_images(): Required. Resource name of the product containing the reference images. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2106,8 +2065,7 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2172,8 +2130,7 @@ async def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already - present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -2213,8 +2170,7 @@ async def sample_add_product_to_product_set(): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2223,8 +2179,7 @@ async def sample_add_product_to_product_set(): Required. The resource name for the Product to be added to this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2337,8 +2292,7 @@ async def sample_remove_product_from_product_set(): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2347,8 +2301,7 @@ async def sample_remove_product_from_product_set(): Required. The resource name for the Product to be removed from this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2423,10 +2376,8 @@ async def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the - ProductSet does not exist, the products field of the response - will be - empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -2467,8 +2418,7 @@ async def sample_list_products_in_product_set(): Required. The ProductSet resource for which to retrieve Products. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2566,18 +2516,15 @@ async def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API that imports a list of reference images to - specified - product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. - For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -2643,16 +2590,14 @@ async def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` Response message for the - ``ImportProductSets`` method. + :class:``google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets`` + method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned - `google.longrunning.Operation.response - `__ - field. + `__ method + in the returned `google.longrunning.Operation.response + `__ field. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py index 7a4a82ea1fca..9577e129aa68 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py @@ -113,22 +113,17 @@ def get_transport_class( class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - The API has a + collection of `Product `__ + resources, named ``projects/*/locations/*/products/*`` - Each `Product + `__ has a collection of + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -862,12 +857,11 @@ def sample_create_product_set(): should not be set. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1118,8 +1112,7 @@ def sample_get_product_set(): name (str): Required. Resource name of the ProductSet to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1199,15 +1192,14 @@ def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. - Only display_name can be updated currently. + r"""Makes changes to a ProductSet resource. Only display_name can + be updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. .. code-block:: python @@ -1246,11 +1238,9 @@ def sample_update_product_set(): should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to - update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask path is ``display_name``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1334,8 +1324,7 @@ def delete_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Permanently deletes a ProductSet. All Products and - ReferenceImages in the - ProductSet will be deleted. + ReferenceImages in the ProductSet will be deleted. The actual image files are not deleted from Google Cloud Storage. @@ -1373,8 +1362,7 @@ def sample_delete_product_set(): name (str): Required. Resource name of the ProductSet to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1448,11 +1436,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - * Returns INVALID_ARGUMENT if product_category is missing or - invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if + description is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is missing or invalid. .. code-block:: python @@ -1487,8 +1473,7 @@ def sample_create_product(): Required. The project in which the Product should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1500,12 +1485,11 @@ def sample_create_product(): should not be set. product_id (str): A user-supplied resource id for this Product. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1624,8 +1608,7 @@ def sample_list_products(): Required. The project OR ProductSet from which Products should be listed. - Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1750,8 +1733,7 @@ def sample_get_product(): name (str): Required. Resource name of the Product to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1826,23 +1808,20 @@ def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. - Only display_name, description and labels can be updated right - now. + r"""Makes changes to a Product resource. Only display_name, + description and labels can be updated right now. If labels are updated, the change will not be reflected in - queries until - the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1883,13 +1862,9 @@ def sample_update_product(): should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields - to update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask paths include ``product_labels``, - ``display_name``, and - ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1970,10 +1945,8 @@ def delete_product( r"""Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right - away, but - search queries against ProductSets containing the product may - still work - until all related caches are refreshed. + away, but search queries against ProductSets containing the + product may still work until all related caches are refreshed. Possible errors: @@ -2008,8 +1981,7 @@ def sample_delete_product(): name (str): Required. Resource name of product to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2080,30 +2052,24 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are - compatible with the product_category on the parent product. If - it is - specified, detection is ALWAYS skipped. The system converts - polygons into - non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too - large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. - * Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - * Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the + product does not exist. * Returns INVALID_ARGUMENT if + bounding_poly is not provided, and nothing compatible with the + parent product's product_category is detected. * Returns + INVALID_ARGUMENT if bounding_poly contains more than 10 + polygons. .. code-block:: python @@ -2142,8 +2108,7 @@ def sample_create_reference_image(): Required. Resource name of the product in which to create the reference image. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2158,11 +2123,9 @@ def sample_create_reference_image(): should not be set. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, - the server will attempt to use this value as the - resource id. If it is - already in use, an error is returned with code - ALREADY_EXISTS. Must be at + added. If set, the server will attempt to use this + value as the resource id. If it is already in use, an + error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character ``/``. @@ -2180,8 +2143,7 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2248,10 +2210,8 @@ def delete_reference_image( r"""Permanently deletes a reference image. The image metadata will be deleted right away, but search - queries - against ProductSets containing the image may still work until - all related - caches are refreshed. + queries against ProductSets containing the image may still work + until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. @@ -2363,8 +2323,8 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. - * Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. .. code-block:: python @@ -2401,8 +2361,7 @@ def sample_list_reference_images(): Required. Resource name of the product containing the reference images. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2548,8 +2507,7 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2611,8 +2569,7 @@ def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already - present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -2652,8 +2609,7 @@ def sample_add_product_to_product_set(): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2662,8 +2618,7 @@ def sample_add_product_to_product_set(): Required. The resource name for the Product to be added to this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2775,8 +2730,7 @@ def sample_remove_product_from_product_set(): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2785,8 +2739,7 @@ def sample_remove_product_from_product_set(): Required. The resource name for the Product to be removed from this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2860,10 +2813,8 @@ def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the - ProductSet does not exist, the products field of the response - will be - empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -2904,8 +2855,7 @@ def sample_list_products_in_product_set(): Required. The ProductSet resource for which to retrieve Products. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -3002,18 +2952,15 @@ def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API that imports a list of reference images to - specified - product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. - For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -3079,16 +3026,14 @@ def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` Response message for the - ``ImportProductSets`` method. + :class:``google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets`` + method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned - `google.longrunning.Operation.response - `__ - field. + `__ method + in the returned `google.longrunning.Operation.response + `__ field. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py index 4960b3a7c18a..ee3b612d5526 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py @@ -113,22 +113,17 @@ class ProductSearchGrpcTransport(ProductSearchTransport): """gRPC backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - The API has a + collection of `Product `__ + resources, named ``projects/*/locations/*/products/*`` - Each `Product + `__ has a collection of + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -465,15 +460,14 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. - Only display_name can be updated currently. + Makes changes to a ProductSet resource. Only display_name can + be updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -500,8 +494,7 @@ def delete_product_set( r"""Return a callable for the delete product set method over gRPC. Permanently deletes a ProductSet. All Products and - ReferenceImages in the - ProductSet will be deleted. + ReferenceImages in the ProductSet will be deleted. The actual image files are not deleted from Google Cloud Storage. @@ -541,11 +534,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - * Returns INVALID_ARGUMENT if product_category is missing or - invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if + description is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -639,23 +630,20 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. - Only display_name, description and labels can be updated right - now. + Makes changes to a Product resource. Only display_name, + description and labels can be updated right now. If labels are updated, the change will not be reflected in - queries until - the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. Returns: @@ -685,10 +673,8 @@ def delete_product( Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right - away, but - search queries against ProductSets containing the product may - still work - until all related caches are refreshed. + away, but search queries against ProductSets containing the + product may still work until all related caches are refreshed. Possible errors: @@ -723,30 +709,24 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are - compatible with the product_category on the parent product. If - it is - specified, detection is ALWAYS skipped. The system converts - polygons into - non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too - large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. - * Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - * Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the + product does not exist. * Returns INVALID_ARGUMENT if + bounding_poly is not provided, and nothing compatible with the + parent product's product_category is detected. * Returns + INVALID_ARGUMENT if bounding_poly contains more than 10 + polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -777,10 +757,8 @@ def delete_reference_image( Permanently deletes a reference image. The image metadata will be deleted right away, but search - queries - against ProductSets containing the image may still work until - all related - caches are refreshed. + queries against ProductSets containing the image may still work + until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. @@ -820,8 +798,8 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. - * Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. Returns: @@ -884,8 +862,7 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already - present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -960,10 +937,8 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the - ProductSet does not exist, the products field of the response - will be - empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -999,18 +974,15 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified - product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. - For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py index 4e6a74f89719..0a75a90e07ab 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py @@ -119,22 +119,17 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): """gRPC AsyncIO backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - The API has a + collection of `Product `__ + resources, named ``projects/*/locations/*/products/*`` - Each `Product + `__ has a collection of + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -474,15 +469,14 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. - Only display_name can be updated currently. + Makes changes to a ProductSet resource. Only display_name can + be updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -511,8 +505,7 @@ def delete_product_set( r"""Return a callable for the delete product set method over gRPC. Permanently deletes a ProductSet. All Products and - ReferenceImages in the - ProductSet will be deleted. + ReferenceImages in the ProductSet will be deleted. The actual image files are not deleted from Google Cloud Storage. @@ -553,11 +546,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - * Returns INVALID_ARGUMENT if product_category is missing or - invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if + description is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -653,23 +644,20 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. - Only display_name, description and labels can be updated right - now. + Makes changes to a Product resource. Only display_name, + description and labels can be updated right now. If labels are updated, the change will not be reflected in - queries until - the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. Returns: @@ -701,10 +689,8 @@ def delete_product( Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right - away, but - search queries against ProductSets containing the product may - still work - until all related caches are refreshed. + away, but search queries against ProductSets containing the + product may still work until all related caches are refreshed. Possible errors: @@ -739,30 +725,24 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are - compatible with the product_category on the parent product. If - it is - specified, detection is ALWAYS skipped. The system converts - polygons into - non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too - large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. - * Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - * Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the + product does not exist. * Returns INVALID_ARGUMENT if + bounding_poly is not provided, and nothing compatible with the + parent product's product_category is detected. * Returns + INVALID_ARGUMENT if bounding_poly contains more than 10 + polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -793,10 +773,8 @@ def delete_reference_image( Permanently deletes a reference image. The image metadata will be deleted right away, but search - queries - against ProductSets containing the image may still work until - all related - caches are refreshed. + queries against ProductSets containing the image may still work + until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. @@ -836,8 +814,8 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. - * Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. Returns: @@ -901,8 +879,7 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already - present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -978,10 +955,8 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the - ProductSet does not exist, the products field of the response - will be - empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -1018,18 +993,15 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified - product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. - For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py index 894adb3c80d5..bb434ed55cac 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py @@ -950,22 +950,17 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): """REST backend synchronous transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - The API has a + collection of `Product `__ + resources, named ``projects/*/locations/*/products/*`` - Each `Product + `__ has a collection of + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -1548,8 +1543,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ @@ -2325,8 +2319,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py index 83e90405c45a..07e30deeb0ad 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py @@ -105,10 +105,8 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the - maximum - number of results to return for that type. Multiple - ``Feature`` objects can - be specified in the ``features`` list. + maximum number of results to return for that type. Multiple + ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p3beta1.types.Feature.Type): @@ -117,13 +115,11 @@ class Feature(proto.Message): Maximum number of results of this type. Does not apply to ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): - Model to use for the feature. - Supported values: "builtin/stable" (the default if unset) - and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` - also - support "builtin/weekly" for the bleeding edge release - updated weekly. + Model to use for the feature. Supported values: + "builtin/stable" (the default if unset) and + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support + "builtin/weekly" for the bleeding edge release updated + weekly. """ class Type(proto.Enum): @@ -142,10 +138,9 @@ class Type(proto.Enum): Run label detection. TEXT_DETECTION (5): Run text detection / optical character recognition (OCR). - Text detection - is optimized for areas of text within a larger image; if the - image is - a document, use ``DOCUMENT_TEXT_DETECTION`` instead. + Text detection is optimized for areas of text within a + larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` + instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are present. @@ -201,39 +196,31 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not supported. See - `Google Cloud Storage Request - URIs + The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google Cloud Storage + Request URIs `__ for more info. image_uri (str): The URI of the source image. Can be either: - 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not supported. See - `Google Cloud Storage Request - URIs + 1. A Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. + Object versioning is not supported. See `Google Cloud + Storage Request URIs `__ - for more - info. + for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from - HTTP/HTTPS URLs, Google cannot guarantee that the request - will be - completed. Your request may fail if the specified host - denies the - request (e.g. due to request throttling or DOS prevention), - or if Google + images from HTTP/HTTPS URLs, Google cannot guarantee + that the request will be completed. Your request may + fail if the specified host denies the request (e.g. due + to request throttling or DOS prevention), or if Google throttles requests to the site for abuse prevention. You - should not - depend on externally-hosted images for production - applications. + should not depend on externally-hosted images for + production applications. - When both ``gcs_image_uri`` and ``image_uri`` are - specified, ``image_uri`` takes - precedence. + When both ``gcs_image_uri`` and ``image_uri`` are specified, ``image_uri`` + takes precedence. """ gcs_image_uri: str = proto.Field( @@ -251,17 +238,14 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use - a pure binary + Image content, represented as a stream of bytes. Note: As + with all ``bytes`` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p3beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image - URL. If both ``content`` and ``source`` are - provided for an image, ``content`` - takes precedence and is used to perform the image annotation - request. + image URL. If both ``content`` and ``source`` are provided for + an image, ``content`` takes precedence and is used to perform + the image annotation request. """ content: bytes = proto.Field( @@ -282,46 +266,36 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box - are in the original image's scale, as returned in - ``ImageParams``. - The bounding box is computed to "frame" the face in - accordance with human - expectations. It is based on the landmarker results. - Note that one or more x and/or y coordinates may not be - generated in the - ``BoundingPoly`` (the polygon will be unbounded) if only a - partial face - appears in the image to be annotated. + bounding box are in the original image's scale, as returned + in ``ImageParams``. The bounding box is computed to "frame" the + face in accordance with human expectations. It is based on + the landmarker results. Note that one or more x and/or y + coordinates may not be generated in the ``BoundingPoly`` (the + polygon will be unbounded) if only a partial face appears + in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): The ``fd_bounding_poly`` bounding polygon is tighter than the - ``boundingPoly``, and encloses only the skin part of the - face. Typically, it - is used to eliminate the face from any image analysis that - detects the - "amount of skin" visible in an image. It is not based on the - landmarker results, only on the initial face detection, - hence - the fd (face detection) prefix. + ``boundingPoly``, and encloses only the skin part of the face. + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face + detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p3beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation - of the face relative to the image vertical about the axis - perpendicular to - the face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the + face. Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is - pointing relative to the vertical plane perpendicular to the - image. Range - [-180,180]. + the face is pointing relative to the vertical plane + perpendicular to the image. Range [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is - pointing relative to the image's horizontal plane. Range - [-180,180]. + that the face is pointing relative to the image's + horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -353,12 +327,10 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. - Left and right are defined from the vantage of the viewer of the - image - without considering mirror projections typical of photos. So, - ``LEFT_EYE``, - typically, is the person's right eye. + r"""Face landmark (feature) type. Left and right are defined from the + vantage of the viewer of the image without considering mirror + projections typical of photos. So, ``LEFT_EYE``, typically, is the + person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -598,52 +570,44 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in - `Google Knowledge Graph Search - API `__. + Opaque entity ID. Some IDs may be available in `Google + Knowledge Graph Search API + `__. locale (str): The language code for the locale in which the entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its - ``locale`` language. + Entity textual description, expressed in its ``locale`` + language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** - The accuracy of the entity detection in an image. - For example, for an image in which the "Eiffel Tower" entity - is detected, - this field represents the confidence that there is a tower - in the query + **Deprecated. Use ``score`` instead.** The accuracy of the + entity detection in an image. For example, for an image in + which the "Eiffel Tower" entity is detected, this field + represents the confidence that there is a tower in the query image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the - image. For example, the relevancy of "tower" is likely - higher to an image - containing the detected "Eiffel Tower" than to an image - containing a - detected distant towering building, even though the - confidence that - there is a tower in each image may be the same. Range [0, - 1]. + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower + in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): - Image region to which this entity belongs. Not produced - for ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not produced for + ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p3beta1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may + ``LocationInfo`` elements can be present because one location may indicate the location of the scene in the image, and another - location - may indicate the location of the place where the image was - taken. - Location information is usually present for landmarks. + location may indicate the location of the place where the + image was taken. Location information is usually present + for landmarks. properties (MutableSequence[google.cloud.vision_v1p3beta1.types.Property]): - Some entities may have optional user-supplied - ``Property`` (name/value) - fields, such a score or string that qualifies the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) fields, such a score or string that qualifies + the entity. """ mid: str = proto.Field( @@ -696,8 +660,7 @@ class LocalizedObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more - information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. @@ -877,9 +840,8 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): The bounding polygon for the crop region. The coordinates of - the bounding - box are in the original image's scale, as returned in - ``ImageParams``. + the bounding box are in the original image's scale, as + returned in ``ImageParams``. confidence (float): Confidence of this being a salient region. Range [0, 1]. importance_fraction (float): @@ -956,16 +918,13 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and - DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for - DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence - score for TEXT_DETECTION as well. + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -989,20 +948,14 @@ class ImageContext(proto.Message): Not used. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value - yields the best results since it enables automatic language - detection. For - languages based on the Latin alphabet, setting - ``language_hints`` is not - needed. In rare cases, when the language of the text in the - image is known, + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In rare + cases, when the language of the text in the image is known, setting a hint will help get better results (although it - will be a - significant hindrance if the hint is wrong). Text detection - returns an - error if one or more of the specified languages is not one - of the - `supported languages + will be a significant hindrance if the hint is wrong). Text + detection returns an error if one or more of the specified + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p3beta1.types.CropHintsParams): Parameters for crop hints annotation request. @@ -1407,22 +1360,16 @@ class OutputConfig(proto.Message): the output(s) to. batch_size (int): The max number of response protos to put into each output - JSON file on - Google Cloud Storage. - The valid range is [1, 100]. If not specified, the default - value is 20. + JSON file on Google Cloud Storage. The valid range is [1, + 100]. If not specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response - protos will - be generated. If ``batch_size`` = 20, then 5 json files - each - containing 20 response protos will be written under the - prefix - ``gcs_destination``.``uri``. + protos will be generated. If ``batch_size`` = 20, then 5 json + files each containing 20 response protos will be written + under the prefix ``gcs_destination``.``uri``. Currently, batch_size only applies to GcsDestination, with - potential future - support for other output configurations. + potential future support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1460,19 +1407,17 @@ class GcsDestination(proto.Message): Attributes: uri (str): Google Cloud Storage URI where the results will be stored. - Results will - be in JSON format and preceded by its corresponding input - URI. This field - can either represent a single file, or a prefix for multiple - outputs. - Prefixes must end in a ``/``. + Results will be in JSON format and preceded by its + corresponding input URI. This field can either represent a + single file, or a prefix for multiple outputs. Prefixes + must end in a ``/``. Examples: - * File: gs://bucket-name/filename.json - * Prefix: gs://bucket-name/prefix/here/ - * File: gs://bucket-name/prefix/here If multiple outputs, - each response is still AnnotateFileResponse, each of which + * File: gs://bucket-name/filename.json * Prefix: + gs://bucket-name/prefix/here/ * File: + gs://bucket-name/prefix/here If multiple outputs, each + response is still AnnotateFileResponse, each of which contains some subset of the full list of AnnotateImageResponse. Multiple outputs can happen if, for example, the output JSON is too large and overflows into diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py index 36b3bb9c95e7..7169ef05eb21 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py @@ -44,8 +44,7 @@ class ProductSearchParams(proto.Message): `__ to be searched for similar images. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -149,8 +148,7 @@ class ObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more - information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py index b27f7541d514..78a03d623a91 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py @@ -67,8 +67,7 @@ class Product(proto.Message): name (str): The resource name of the product. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This field is ignored when creating a product. display_name (str): @@ -87,18 +86,15 @@ class Product(proto.Message): these should not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1p3beta1.types.Product.KeyValue]): Key-value pairs that can be attached to a product. At query - time, - constraints can be specified based on the product_labels. + time, constraints can be specified based on the + product_labels. Note that integer values can be provided as strings, e.g. - "1199". Only - strings with integer values can match a range-based - restriction which is - to be supported soon. + "1199". Only strings with integer values can match a + range-based restriction which is to be supported soon. Multiple values can be assigned to the same key. One product - may have up to - 100 product_labels. + may have up to 100 product_labels. """ class KeyValue(proto.Message): @@ -155,8 +151,7 @@ class ProductSet(proto.Message): name (str): The resource name of the ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. This field is ignored when creating a ProductSet. display_name (str): @@ -203,8 +198,7 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): r"""A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. Attributes: name (str): @@ -257,18 +251,16 @@ class CreateProductRequest(proto.Message): Required. The project in which the Product should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1p3beta1.types.Product): Required. The product to create. product_id (str): A user-supplied resource id for this Product. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. """ parent: str = proto.Field( @@ -294,8 +286,7 @@ class ListProductsRequest(proto.Message): Required. The project OR ProductSet from which Products should be listed. - Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -352,8 +343,7 @@ class GetProductRequest(proto.Message): name (str): Required. Resource name of the Product to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -372,13 +362,9 @@ class UpdateProductRequest(proto.Message): immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields - to update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask paths include ``product_labels``, - ``display_name``, and - ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. """ product: "Product" = proto.Field( @@ -400,8 +386,7 @@ class DeleteProductRequest(proto.Message): name (str): Required. Resource name of product to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -423,12 +408,11 @@ class CreateProductSetRequest(proto.Message): Required. The ProductSet to create. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. """ parent: str = proto.Field( @@ -511,8 +495,7 @@ class GetProductSetRequest(proto.Message): name (str): Required. Resource name of the ProductSet to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -530,11 +513,9 @@ class UpdateProductSetRequest(proto.Message): replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to - update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask path is ``display_name``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask path is ``display_name``. """ product_set: "ProductSet" = proto.Field( @@ -556,8 +537,7 @@ class DeleteProductSetRequest(proto.Message): name (str): Required. Resource name of the ProductSet to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -574,18 +554,15 @@ class CreateReferenceImageRequest(proto.Message): Required. Resource name of the product in which to create the reference image. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. reference_image (google.cloud.vision_v1p3beta1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, - the server will attempt to use this value as the - resource id. If it is - already in use, an error is returned with code - ALREADY_EXISTS. Must be at + added. If set, the server will attempt to use this + value as the resource id. If it is already in use, an + error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character ``/``. """ @@ -613,16 +590,14 @@ class ListReferenceImagesRequest(proto.Message): Required. Resource name of the product containing the reference images. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value - of ``nextPageToken`` returned in a previous reference image - list request. + is the value of ``nextPageToken`` returned in a previous reference + image list request. Defaults to the first page if not specified. """ @@ -720,14 +695,12 @@ class AddProductToProductSetRequest(proto.Message): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be added to this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -748,14 +721,12 @@ class RemoveProductFromProductSetRequest(proto.Message): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be removed from this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -776,8 +747,7 @@ class ListProductsInProductSetRequest(proto.Message): Required. The ProductSet resource for which to retrieve Products. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -838,43 +808,31 @@ class ImportProductSetsGcsSource(proto.Message): The URI must start with ``gs://``. The format of the input csv file should be one image per - line. - In each line, there are 6 columns. - 1. image_uri - 2, image_id - 3. product_set_id - 4. product_id - 5, product_category - 6, product_display_name - 7, labels - 8. bounding_poly + line. In each line, there are 6 columns. 1. image_uri 2, + image_id 3. product_set_id 4. product_id 5, + product_category 6, product_display_name 7, labels 8. + bounding_poly Columns 1, 3, 4, and 5 are required, other columns are - optional. A new - ProductSet/Product with the same id will be created on the - fly - if the ProductSet/Product specified by - product_set_id/product_id does not - exist. + optional. A new ProductSet/Product with the same id will be + created on the fly if the ProductSet/Product specified by + product_set_id/product_id does not exist. The image_id field is optional but has to be unique if - provided. If it is - empty, we will automatically assign an unique id to the - image. + provided. If it is empty, we will automatically assign an + unique id to the image. The product_display_name field is optional. If it is empty, - a space (" ") - is used as the place holder for the product display_name, - which can - be updated later through the realtime API. + a space (" ") is used as the place holder for the product + display_name, which can be updated later through the + realtime API. If the Product with product_id already exists, the fields product_display_name, product_category and labels are ignored. If a Product doesn't exist and needs to be created on the - fly, the - product_display_name field refers to + fly, the product_display_name field refers to `Product.display_name `__, the product_category field refers to @@ -883,35 +841,28 @@ class ImportProductSetsGcsSource(proto.Message): and the labels field refers to [Product.labels][]. Labels (optional) should be a line containing a list of - comma-separated - key-value pairs, with the format + comma-separated key-value pairs, with the format "key_1=value_1,key_2=value_2,...,key_n=value_n". The bounding_poly (optional) field is used to identify one - region of - interest from the image in the same manner as - CreateReferenceImage. If no - bounding_poly is specified, the system will try to detect - regions of - interest automatically. + region of interest from the image in the same manner as + CreateReferenceImage. If no bounding_poly is specified, the + system will try to detect regions of interest + automatically. Note that the pipeline will resize the image if the image - resolution is too - large to process (above 20MP). + resolution is too large to process (above 20MP). Also note that at most one bounding_poly is allowed per - line. If the image - contains multiple regions of interest, the csv should - contain one line per - region of interest. + line. If the image contains multiple regions of interest, + the csv should contain one line per region of interest. The bounding_poly column should contain an even number of - comma-separated - numbers, with the format - "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative - integers should be used for absolute bounding polygons, and - float values - in [0, 1] should be used for normalized bounding polygons. + comma-separated numbers, with the format + "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative integers + should be used for absolute bounding polygons, and float + values in [0, 1] should be used for normalized bounding + polygons. """ csv_file_uri: str = proto.Field( @@ -972,25 +923,21 @@ class ImportProductSetsResponse(proto.Message): This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned - `google.longrunning.Operation.response - `__ - field. + `__ method in the + returned `google.longrunning.Operation.response + `__ field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1p3beta1.types.ReferenceImage]): The list of reference_images that are imported successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): The rpc status for each ImportProductSet request, including - both successes - and errors. + both successes and errors. The number of statuses here matches the number of lines in - the csv file, - and statuses[i] stores the success or failure status of - processing the i-th - line of the csv, starting from line 0. + the csv file, and statuses[i] stores the success or failure + status of processing the i-th line of the csv, starting + from line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -1008,9 +955,8 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the - ``Operation`` returned by the - ``GetOperation`` call of the ``google::longrunning::Operations`` service. + This is included in the ``metadata`` field of the ``Operation`` returned by + the ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1p3beta1.types.BatchOperationMetadata.State): @@ -1021,8 +967,7 @@ class BatchOperationMetadata(proto.Message): end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and `google.longrunning.Operation.done - `__ is - set to true. + `__ is set to true. """ class State(proto.Enum): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py index 709b75f6c9c4..51be9403be1d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py @@ -36,15 +36,11 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. - The hierarchy of an OCR extracted text structure is like this: - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol - Each structural component, starting from Page, may further have - their own - properties. Properties describe detected languages, breaks etc.. - Please refer - to the - `TextAnnotation.TextProperty + text. The hierarchy of an OCR extracted text structure is like + this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> + Symbol Each structural component, starting from Page, may further + have their own properties. Properties describe detected languages, + breaks etc.. Please refer to the `TextAnnotation.TextProperty `__ message definition below for more detail. @@ -61,8 +57,7 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more - information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -101,8 +96,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with - ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py index 04a073d2284a..82c8650c287f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py @@ -157,9 +157,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as - "en-US" or "sr-Latn". - For more information, see + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py index c561b5305226..9f6f078e5348 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py @@ -535,14 +535,12 @@ async def async_batch_annotate_images( r"""Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer - GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -605,8 +603,8 @@ async def sample_async_batch_annotate_images(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch - image annotation request. + :class:``google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch image + annotation request. """ # Create or coerce a protobuf request object. @@ -676,14 +674,10 @@ async def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Run asynchronous image detection and annotation for a list of - generic - files, such as PDF files, which may contain multiple pages and - multiple - images per page. Progress and results can be retrieved through - the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py index 5aa46becac04..1a465a27b6cb 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py @@ -992,14 +992,12 @@ def async_batch_annotate_images( r"""Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer - GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -1062,8 +1060,8 @@ def sample_async_batch_annotate_images(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch - image annotation request. + :class:``google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch image + annotation request. """ # Create or coerce a protobuf request object. @@ -1132,14 +1130,10 @@ def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Run asynchronous image detection and annotation for a list of - generic - files, such as PDF files, which may contain multiple pages and - multiple - images per page. Progress and results can be retrieved through - the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py index 141bfb01e443..57314f19c727 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py @@ -420,14 +420,12 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer - GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -459,14 +457,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic - files, such as PDF files, which may contain multiple pages and - multiple - images per page. Progress and results can be retrieved through - the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py index 0dc3ff649511..c94621ee3e7b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py @@ -429,14 +429,12 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer - GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -469,14 +467,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic - files, such as PDF files, which may contain multiple pages and - multiple - images per page. Progress and results can be retrieved through - the - ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``OperationMetadata`` (metadata). - ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py index 9683ea89d857..554929226b7e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py @@ -70,22 +70,17 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - The API has a + collection of `Product `__ + resources, named ``projects/*/locations/*/products/*`` - Each `Product + `__ has a collection of + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -382,12 +377,11 @@ async def sample_create_product_set(): should not be set. product_set_id (:class:`str`): A user-supplied resource id for this ProductSet. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -644,8 +638,7 @@ async def sample_get_product_set(): name (:class:`str`): Required. Resource name of the ProductSet to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -728,15 +721,14 @@ async def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. - Only display_name can be updated currently. + r"""Makes changes to a ProductSet resource. Only display_name can + be updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. .. code-block:: python @@ -775,11 +767,9 @@ async def sample_update_product_set(): should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): The `FieldMask `__ that - specifies which fields to - update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask path is ``display_name``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -900,8 +890,7 @@ async def sample_delete_product_set(): name (:class:`str`): Required. Resource name of the ProductSet to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -978,11 +967,9 @@ async def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - * Returns INVALID_ARGUMENT if product_category is missing or - invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if + description is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is missing or invalid. .. code-block:: python @@ -1017,8 +1004,7 @@ async def sample_create_product(): Required. The project in which the Product should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1030,12 +1016,11 @@ async def sample_create_product(): should not be set. product_id (:class:`str`): A user-supplied resource id for this Product. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1157,8 +1142,7 @@ async def sample_list_products(): Required. The project OR ProductSet from which Products should be listed. - Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1286,8 +1270,7 @@ async def sample_get_product(): name (:class:`str`): Required. Resource name of the Product to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1365,24 +1348,20 @@ async def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated - right now. + r"""Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until - the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1423,13 +1402,9 @@ async def sample_update_product(): should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): The `FieldMask `__ that - specifies which fields - to update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask paths include ``product_labels``, - ``display_name``, and - ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1546,8 +1521,7 @@ async def sample_delete_product(): name (:class:`str`): Required. Resource name of product to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1621,30 +1595,24 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are - compatible with the product_category on the parent product. If - it is - specified, detection is ALWAYS skipped. The system converts - polygons into - non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too - large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. - * Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - * Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the + product does not exist. * Returns INVALID_ARGUMENT if + bounding_poly is not provided, and nothing compatible with the + parent product's product_category is detected. * Returns + INVALID_ARGUMENT if bounding_poly contains more than 10 + polygons. .. code-block:: python @@ -1681,11 +1649,9 @@ async def sample_create_reference_image(): The request object. Request message for the ``CreateReferenceImage`` method. parent (:class:`str`): Required. Resource name of the product in which to - create the reference - image. + create the reference image. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1700,11 +1666,9 @@ async def sample_create_reference_image(): should not be set. reference_image_id (:class:`str`): A user-supplied resource id for the ReferenceImage to be - added. If set, - the server will attempt to use this value as the - resource id. If it is - already in use, an error is returned with code - ALREADY_EXISTS. Must be at + added. If set, the server will attempt to use this + value as the resource id. If it is already in use, an + error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character ``/``. @@ -1722,8 +1686,7 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1905,8 +1868,8 @@ async def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. - * Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. .. code-block:: python @@ -1943,8 +1906,7 @@ async def sample_list_reference_images(): Required. Resource name of the product containing the reference images. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2093,8 +2055,7 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2159,8 +2120,7 @@ async def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already - present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -2200,8 +2160,7 @@ async def sample_add_product_to_product_set(): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2210,8 +2169,7 @@ async def sample_add_product_to_product_set(): Required. The resource name for the Product to be added to this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2319,19 +2277,16 @@ async def sample_remove_product_from_product_set(): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): Required. The resource name for the Product to be - removed from this - ProductSet. + removed from this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2406,10 +2361,8 @@ async def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the - ProductSet does not exist, the products field of the response - will be - empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -2450,8 +2403,7 @@ async def sample_list_products_in_product_set(): Required. The ProductSet resource for which to retrieve Products. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2549,18 +2501,15 @@ async def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API that imports a list of reference images to - specified - product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. - For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -2626,16 +2575,14 @@ async def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` Response message for the - ``ImportProductSets`` method. + :class:``google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets`` + method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned - `google.longrunning.Operation.response - `__ - field. + `__ method + in the returned `google.longrunning.Operation.response + `__ field. """ # Create or coerce a protobuf request object. @@ -2709,42 +2656,32 @@ async def purge_products( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API to delete all Products in a ProductSet or all - Products - that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other - ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this - operation has completed. It is also recommended to not add any - of the - Products involved in the batch delete to a new ProductSet while - this - operation is running because those Products may still end up - deleted. + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is - recommended to keep the csv files used in ImportProductSets (if - that was - how you originally built the Product Set) before starting - PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then - re-use the empty ProductSet to re-import new Products into the - empty - ProductSet, you must wait until the PurgeProducts operation has - finished - for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the + PurgeProducts operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -2801,16 +2738,13 @@ async def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that - you can re-use to avoid defining duplicated - empty messages in your APIs. A typical example is to use - it as the request + :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that you can + re-use to avoid defining duplicated empty messages in + your APIs. A typical example is to use it as the request or the response type of an API method. For instance: - service Foo { - rpc Bar(google.protobuf.Empty) returns - (google.protobuf.Empty); - } + service Foo { rpc Bar(google.protobuf.Empty) + returns (google.protobuf.Empty); } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py index 0b67744bed7b..cc3d99213754 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py @@ -114,22 +114,17 @@ def get_transport_class( class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - The API has a + collection of `Product `__ + resources, named ``projects/*/locations/*/products/*`` - Each `Product + `__ has a collection of + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -863,12 +858,11 @@ def sample_create_product_set(): should not be set. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1119,8 +1113,7 @@ def sample_get_product_set(): name (str): Required. Resource name of the ProductSet to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1200,15 +1193,14 @@ def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. - Only display_name can be updated currently. + r"""Makes changes to a ProductSet resource. Only display_name can + be updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. .. code-block:: python @@ -1247,11 +1239,9 @@ def sample_update_product_set(): should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to - update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask path is ``display_name``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1369,8 +1359,7 @@ def sample_delete_product_set(): name (str): Required. Resource name of the ProductSet to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1444,11 +1433,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - * Returns INVALID_ARGUMENT if product_category is missing or - invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if + description is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is missing or invalid. .. code-block:: python @@ -1483,8 +1470,7 @@ def sample_create_product(): Required. The project in which the Product should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1496,12 +1482,11 @@ def sample_create_product(): should not be set. product_id (str): A user-supplied resource id for this Product. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1620,8 +1605,7 @@ def sample_list_products(): Required. The project OR ProductSet from which Products should be listed. - Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1746,8 +1730,7 @@ def sample_get_product(): name (str): Required. Resource name of the Product to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1822,24 +1805,20 @@ def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated - right now. + r"""Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until - the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1880,13 +1859,9 @@ def sample_update_product(): should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields - to update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask paths include ``product_labels``, - ``display_name``, and - ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -2000,8 +1975,7 @@ def sample_delete_product(): name (str): Required. Resource name of product to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2072,30 +2046,24 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are - compatible with the product_category on the parent product. If - it is - specified, detection is ALWAYS skipped. The system converts - polygons into - non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too - large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. - * Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - * Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the + product does not exist. * Returns INVALID_ARGUMENT if + bounding_poly is not provided, and nothing compatible with the + parent product's product_category is detected. * Returns + INVALID_ARGUMENT if bounding_poly contains more than 10 + polygons. .. code-block:: python @@ -2132,11 +2100,9 @@ def sample_create_reference_image(): The request object. Request message for the ``CreateReferenceImage`` method. parent (str): Required. Resource name of the product in which to - create the reference - image. + create the reference image. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2151,11 +2117,9 @@ def sample_create_reference_image(): should not be set. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, - the server will attempt to use this value as the - resource id. If it is - already in use, an error is returned with code - ALREADY_EXISTS. Must be at + added. If set, the server will attempt to use this + value as the resource id. If it is already in use, an + error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character ``/``. @@ -2173,8 +2137,7 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2350,8 +2313,8 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. - * Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. .. code-block:: python @@ -2388,8 +2351,7 @@ def sample_list_reference_images(): Required. Resource name of the product containing the reference images. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2535,8 +2497,7 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2598,8 +2559,7 @@ def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already - present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -2639,8 +2599,7 @@ def sample_add_product_to_product_set(): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2649,8 +2608,7 @@ def sample_add_product_to_product_set(): Required. The resource name for the Product to be added to this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2757,19 +2715,16 @@ def sample_remove_product_from_product_set(): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): Required. The resource name for the Product to be - removed from this - ProductSet. + removed from this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2843,10 +2798,8 @@ def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the - ProductSet does not exist, the products field of the response - will be - empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -2887,8 +2840,7 @@ def sample_list_products_in_product_set(): Required. The ProductSet resource for which to retrieve Products. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2985,18 +2937,15 @@ def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API that imports a list of reference images to - specified - product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. - For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -3062,16 +3011,14 @@ def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` Response message for the - ``ImportProductSets`` method. + :class:``google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets`` + method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned - `google.longrunning.Operation.response - `__ - field. + `__ method + in the returned `google.longrunning.Operation.response + `__ field. """ # Create or coerce a protobuf request object. @@ -3142,42 +3089,32 @@ def purge_products( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API to delete all Products in a ProductSet or all - Products - that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other - ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this - operation has completed. It is also recommended to not add any - of the - Products involved in the batch delete to a new ProductSet while - this - operation is running because those Products may still end up - deleted. + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is - recommended to keep the csv files used in ImportProductSets (if - that was - how you originally built the Product Set) before starting - PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then - re-use the empty ProductSet to re-import new Products into the - empty - ProductSet, you must wait until the PurgeProducts operation has - finished - for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the + PurgeProducts operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -3234,16 +3171,13 @@ def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that - you can re-use to avoid defining duplicated - empty messages in your APIs. A typical example is to use - it as the request + :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that you can + re-use to avoid defining duplicated empty messages in + your APIs. A typical example is to use it as the request or the response type of an API method. For instance: - service Foo { - rpc Bar(google.protobuf.Empty) returns - (google.protobuf.Empty); - } + service Foo { rpc Bar(google.protobuf.Empty) + returns (google.protobuf.Empty); } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py index 0385bc4d49f3..f5b999d7dabf 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py @@ -113,22 +113,17 @@ class ProductSearchGrpcTransport(ProductSearchTransport): """gRPC backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - The API has a + collection of `Product `__ + resources, named ``projects/*/locations/*/products/*`` - Each `Product + `__ has a collection of + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -465,15 +460,14 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. - Only display_name can be updated currently. + Makes changes to a ProductSet resource. Only display_name can + be updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -536,11 +530,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - * Returns INVALID_ARGUMENT if product_category is missing or - invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if + description is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -634,24 +626,20 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated - right now. + Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until - the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. Returns: @@ -714,30 +702,24 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are - compatible with the product_category on the parent product. If - it is - specified, detection is ALWAYS skipped. The system converts - polygons into - non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too - large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. - * Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - * Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the + product does not exist. * Returns INVALID_ARGUMENT if + bounding_poly is not provided, and nothing compatible with the + parent product's product_category is detected. * Returns + INVALID_ARGUMENT if bounding_poly contains more than 10 + polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -805,8 +787,8 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. - * Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. Returns: @@ -869,8 +851,7 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already - present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -940,10 +921,8 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the - ProductSet does not exist, the products field of the response - will be - empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -979,18 +958,15 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified - product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. - For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -1021,42 +997,32 @@ def purge_products( r"""Return a callable for the purge products method over gRPC. Asynchronous API to delete all Products in a ProductSet or all - Products - that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other - ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this - operation has completed. It is also recommended to not add any - of the - Products involved in the batch delete to a new ProductSet while - this - operation is running because those Products may still end up - deleted. + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is - recommended to keep the csv files used in ImportProductSets (if - that was - how you originally built the Product Set) before starting - PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then - re-use the empty ProductSet to re-import new Products into the - empty - ProductSet, you must wait until the PurgeProducts operation has - finished - for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the + PurgeProducts operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) Returns: Callable[[~.PurgeProductsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py index b0c202910d6a..761866075e3d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py @@ -119,22 +119,17 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): """gRPC AsyncIO backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - The API has a + collection of `Product `__ + resources, named ``projects/*/locations/*/products/*`` - Each `Product + `__ has a collection of + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -474,15 +469,14 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. - Only display_name can be updated currently. + Makes changes to a ProductSet resource. Only display_name can + be updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but missing from the request or longer than 4096 - characters. + * Returns NOT_FOUND if the ProductSet does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + missing from the request or longer than 4096 characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -548,11 +542,9 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if description is longer than 4096 - characters. - * Returns INVALID_ARGUMENT if product_category is missing or - invalid. + than 4096 characters. * Returns INVALID_ARGUMENT if + description is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is missing or invalid. Returns: Callable[[~.CreateProductRequest], @@ -648,24 +640,20 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. - Only the ``display_name``, ``description``, and - ``labels`` fields can be updated - right now. + Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until - the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. - * Returns INVALID_ARGUMENT if display_name is present in - update_mask but is missing from the request or longer than - 4096 characters. - * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. - * Returns INVALID_ARGUMENT if product_category is present in + * Returns NOT_FOUND if the Product does not exist. * Returns + INVALID_ARGUMENT if display_name is present in update_mask but + is missing from the request or longer than 4096 characters. * + Returns INVALID_ARGUMENT if description is present in + update_mask but is longer than 4096 characters. * Returns + INVALID_ARGUMENT if product_category is present in update_mask. Returns: @@ -730,30 +718,24 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is - not specified, + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are - compatible with the product_category on the parent product. If - it is - specified, detection is ALWAYS skipped. The system converts - polygons into - non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too - large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. - * Returns INVALID_ARGUMENT if the product does not exist. - * Returns INVALID_ARGUMENT if bounding_poly is not provided, and - nothing compatible with the parent product's product_category - is detected. - * Returns INVALID_ARGUMENT if bounding_poly contains more than - 10 polygons. + than 4096 characters. * Returns INVALID_ARGUMENT if the + product does not exist. * Returns INVALID_ARGUMENT if + bounding_poly is not provided, and nothing compatible with the + parent product's product_category is detected. * Returns + INVALID_ARGUMENT if bounding_poly contains more than 10 + polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -821,8 +803,8 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. - * Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. * + Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. Returns: @@ -886,8 +868,7 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already - present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -958,10 +939,8 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the - ProductSet does not exist, the products field of the response - will be - empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -998,18 +977,15 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified - product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) - ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. - For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -1041,42 +1017,32 @@ def purge_products( r"""Return a callable for the purge products method over gRPC. Asynchronous API to delete all Products in a ProductSet or all - Products - that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other - ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this - operation has completed. It is also recommended to not add any - of the - Products involved in the batch delete to a new ProductSet while - this - operation is running because those Products may still end up - deleted. + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those + Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is - recommended to keep the csv files used in ImportProductSets (if - that was - how you originally built the Product Set) before starting - PurgeProducts, in - case you need to re-import the data after deletion. + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to + re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then - re-use the empty ProductSet to re-import new Products into the - empty - ProductSet, you must wait until the PurgeProducts operation has - finished - for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the + PurgeProducts operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be - used to keep track of the progress and results of the request. - ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) Returns: Callable[[~.PurgeProductsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py index 1d74059e3938..b9d1403f99ce 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py @@ -1007,22 +1007,17 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): """REST backend synchronous transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product - search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products - into groups to limit identification. In parallel, - - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` - - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - The API has a + collection of `Product `__ + resources, named ``projects/*/locations/*/products/*`` - Each `Product + `__ has a collection of + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -1605,8 +1600,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ @@ -2382,8 +2376,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py index 866b02f1c4eb..7197937544ba 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py @@ -34,15 +34,12 @@ class FaceRecognitionParams(proto.Message): Attributes: celebrity_set (MutableSequence[str]): - The resource names for one or more - `CelebritySet + The resource names for one or more `CelebritySet `__s. A - celebrity - set is preloaded and can be specified as "builtin/default". - If this is - specified, the algorithm will try to match the faces - detected in the input - image to the Celebrities in the CelebritySets. + celebrity set is preloaded and can be specified as + "builtin/default". If this is specified, the algorithm will + try to match the faces detected in the input image to the + Celebrities in the CelebritySets. """ celebrity_set: MutableSequence[str] = proto.RepeatedField( @@ -84,8 +81,7 @@ class FaceRecognitionResult(proto.Message): Attributes: celebrity (google.cloud.vision_v1p4beta1.types.Celebrity): The `Celebrity `__ - that this face was - matched to. + that this face was matched to. confidence (float): Recognition confidence. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py index c23badcfdcaa..7b13f4a04e1d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py @@ -106,10 +106,8 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the - maximum - number of results to return for that type. Multiple - ``Feature`` objects can - be specified in the ``features`` list. + maximum number of results to return for that type. Multiple + ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p4beta1.types.Feature.Type): @@ -118,13 +116,11 @@ class Feature(proto.Message): Maximum number of results of this type. Does not apply to ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): - Model to use for the feature. - Supported values: "builtin/stable" (the default if unset) - and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` - also - support "builtin/weekly" for the bleeding edge release - updated weekly. + Model to use for the feature. Supported values: + "builtin/stable" (the default if unset) and + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support + "builtin/weekly" for the bleeding edge release updated + weekly. """ class Type(proto.Enum): @@ -143,10 +139,9 @@ class Type(proto.Enum): Run label detection. TEXT_DETECTION (5): Run text detection / optical character recognition (OCR). - Text detection - is optimized for areas of text within a larger image; if the - image is - a document, use ``DOCUMENT_TEXT_DETECTION`` instead. + Text detection is optimized for areas of text within a + larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` + instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are present. @@ -202,39 +197,31 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not supported. See - `Google Cloud Storage Request - URIs + The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google Cloud Storage + Request URIs `__ for more info. image_uri (str): The URI of the source image. Can be either: - 1. A Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not supported. See - `Google Cloud Storage Request - URIs + 1. A Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. + Object versioning is not supported. See `Google Cloud + Storage Request URIs `__ - for more - info. + for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from - HTTP/HTTPS URLs, Google cannot guarantee that the request - will be - completed. Your request may fail if the specified host - denies the - request (e.g. due to request throttling or DOS prevention), - or if Google + images from HTTP/HTTPS URLs, Google cannot guarantee + that the request will be completed. Your request may + fail if the specified host denies the request (e.g. due + to request throttling or DOS prevention), or if Google throttles requests to the site for abuse prevention. You - should not - depend on externally-hosted images for production - applications. + should not depend on externally-hosted images for + production applications. - When both ``gcs_image_uri`` and ``image_uri`` are - specified, ``image_uri`` takes - precedence. + When both ``gcs_image_uri`` and ``image_uri`` are specified, ``image_uri`` + takes precedence. """ gcs_image_uri: str = proto.Field( @@ -252,17 +239,14 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use - a pure binary + Image content, represented as a stream of bytes. Note: As + with all ``bytes`` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p4beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image - URL. If both ``content`` and ``source`` are - provided for an image, ``content`` - takes precedence and is used to perform the image annotation - request. + image URL. If both ``content`` and ``source`` are provided for + an image, ``content`` takes precedence and is used to perform + the image annotation request. """ content: bytes = proto.Field( @@ -283,45 +267,36 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box - are in the original image's scale. - The bounding box is computed to "frame" the face in - accordance with human - expectations. It is based on the landmarker results. - Note that one or more x and/or y coordinates may not be - generated in the - ``BoundingPoly`` (the polygon will be unbounded) if only a - partial face - appears in the image to be annotated. + bounding box are in the original image's scale. The + bounding box is computed to "frame" the face in accordance + with human expectations. It is based on the landmarker + results. Note that one or more x and/or y coordinates may + not be generated in the ``BoundingPoly`` (the polygon will be + unbounded) if only a partial face appears in the image to + be annotated. fd_bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): The ``fd_bounding_poly`` bounding polygon is tighter than the - ``boundingPoly``, and encloses only the skin part of the - face. Typically, it - is used to eliminate the face from any image analysis that - detects the - "amount of skin" visible in an image. It is not based on the - landmarker results, only on the initial face detection, - hence - the fd (face detection) prefix. + ``boundingPoly``, and encloses only the skin part of the face. + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face + detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p4beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation - of the face relative to the image vertical about the axis - perpendicular to - the face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the + face. Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is - pointing relative to the vertical plane perpendicular to the - image. Range - [-180,180]. + the face is pointing relative to the vertical plane + perpendicular to the image. Range [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is - pointing relative to the image's horizontal plane. Range - [-180,180]. + that the face is pointing relative to the image's + horizontal plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -343,13 +318,11 @@ class FaceAnnotation(proto.Message): recognition_result (MutableSequence[google.cloud.vision_v1p4beta1.types.FaceRecognitionResult]): Additional recognition information. Only computed if image_context.face_recognition_params is provided, **and** a - match is found - to a `Celebrity `__ - in the input + match is found to a `Celebrity + `__ in the input `CelebritySet `__. This field - is - sorted in order of decreasing confidence values. + is sorted in order of decreasing confidence values. """ class Landmark(proto.Message): @@ -363,12 +336,10 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. - Left and right are defined from the vantage of the viewer of the - image - without considering mirror projections typical of photos. So, - ``LEFT_EYE``, - typically, is the person's right eye. + r"""Face landmark (feature) type. Left and right are defined from the + vantage of the viewer of the image without considering mirror + projections typical of photos. So, ``LEFT_EYE``, typically, is the + person's right eye. Values: UNKNOWN_LANDMARK (0): @@ -615,52 +586,44 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in - `Google Knowledge Graph Search - API `__. + Opaque entity ID. Some IDs may be available in `Google + Knowledge Graph Search API + `__. locale (str): The language code for the locale in which the entity textual ``description`` is expressed. description (str): - Entity textual description, expressed in its - ``locale`` language. + Entity textual description, expressed in its ``locale`` + language. score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** - The accuracy of the entity detection in an image. - For example, for an image in which the "Eiffel Tower" entity - is detected, - this field represents the confidence that there is a tower - in the query + **Deprecated. Use ``score`` instead.** The accuracy of the + entity detection in an image. For example, for an image in + which the "Eiffel Tower" entity is detected, this field + represents the confidence that there is a tower in the query image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the - image. For example, the relevancy of "tower" is likely - higher to an image - containing the detected "Eiffel Tower" than to an image - containing a - detected distant towering building, even though the - confidence that - there is a tower in each image may be the same. Range [0, - 1]. + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower + in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): - Image region to which this entity belongs. Not produced - for ``LABEL_DETECTION`` features. + Image region to which this entity belongs. Not produced for + ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p4beta1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one - location may + ``LocationInfo`` elements can be present because one location may indicate the location of the scene in the image, and another - location - may indicate the location of the place where the image was - taken. - Location information is usually present for landmarks. + location may indicate the location of the place where the + image was taken. Location information is usually present + for landmarks. properties (MutableSequence[google.cloud.vision_v1p4beta1.types.Property]): - Some entities may have optional user-supplied - ``Property`` (name/value) - fields, such a score or string that qualifies the entity. + Some entities may have optional user-supplied ``Property`` + (name/value) fields, such a score or string that qualifies + the entity. """ mid: str = proto.Field( @@ -713,8 +676,7 @@ class LocalizedObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more - information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. @@ -972,16 +934,13 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and - DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for - DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence - score for TEXT_DETECTION as well. + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -1005,20 +964,14 @@ class ImageContext(proto.Message): Not used. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value - yields the best results since it enables automatic language - detection. For - languages based on the Latin alphabet, setting - ``language_hints`` is not - needed. In rare cases, when the language of the text in the - image is known, + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In rare + cases, when the language of the text in the image is known, setting a hint will help get better results (although it - will be a - significant hindrance if the hint is wrong). Text detection - returns an - error if one or more of the specified languages is not one - of the - `supported languages + will be a significant hindrance if the hint is wrong). Text + detection returns an error if one or more of the specified + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p4beta1.types.CropHintsParams): Parameters for crop hints annotation request. @@ -1348,15 +1301,13 @@ class AnnotateFileResponse(proto.Message): response is generated. responses (MutableSequence[google.cloud.vision_v1p4beta1.types.AnnotateImageResponse]): Individual responses to images found within the file. This - field will be - empty if the ``error`` field is set. + field will be empty if the ``error`` field is set. total_pages (int): This field gives the total number of pages in the file. error (google.rpc.status_pb2.Status): If set, represents the error message for the failed request. - The - ``responses`` field will not be set in this case. + The ``responses`` field will not be set in this case. """ input_config: "InputConfig" = proto.Field( @@ -1553,14 +1504,13 @@ class InputConfig(proto.Message): The Google Cloud Storage location to read the input from. content (bytes): - File content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use - a pure binary + File content, represented as a stream of bytes. Note: As + with all ``bytes`` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateFiles - requests. It does - not work for AsyncBatchAnnotateFiles requests. + requests. It does not work for AsyncBatchAnnotateFiles + requests. mime_type (str): The type of the file. Currently only "application/pdf", "image/tiff" and "image/gif" @@ -1591,22 +1541,16 @@ class OutputConfig(proto.Message): the output(s) to. batch_size (int): The max number of response protos to put into each output - JSON file on - Google Cloud Storage. - The valid range is [1, 100]. If not specified, the default - value is 20. + JSON file on Google Cloud Storage. The valid range is [1, + 100]. If not specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response - protos will - be generated. If ``batch_size`` = 20, then 5 json files - each - containing 20 response protos will be written under the - prefix - ``gcs_destination``.``uri``. + protos will be generated. If ``batch_size`` = 20, then 5 json + files each containing 20 response protos will be written + under the prefix ``gcs_destination``.``uri``. Currently, batch_size only applies to GcsDestination, with - potential future - support for other output configurations. + potential future support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1644,36 +1588,28 @@ class GcsDestination(proto.Message): Attributes: uri (str): Google Cloud Storage URI prefix where the results will be - stored. Results - will be in JSON format and preceded by its corresponding - input URI prefix. - This field can either represent a gcs file prefix or gcs - directory. In - either case, the uri should be unique because in order to - get all of the - output files, you will need to do a wildcard gcs search on - the uri prefix - you provide. + stored. Results will be in JSON format and preceded by its + corresponding input URI prefix. This field can either + represent a gcs file prefix or gcs directory. In either + case, the uri should be unique because in order to get all + of the output files, you will need to do a wildcard gcs + search on the uri prefix you provide. Examples: * File Prefix: gs://bucket-name/here/filenameprefix The output files will be created in gs://bucket-name/here/ and the names of the output files will begin with - "filenameprefix". - - * Directory Prefix: gs://bucket-name/some/location/ The - output files will be created in - gs://bucket-name/some/location/ and the names of the - output files could be anything because there was no + "filenameprefix". * Directory Prefix: + gs://bucket-name/some/location/ The output files will be + created in gs://bucket-name/some/location/ and the names + of the output files could be anything because there was no filename prefix specified. If multiple outputs, each - response is still AnnotateFileResponse, each of which + response is still AnnotateFileResponse, each of which contains some subset of the full list of - AnnotateImageResponse. - - Multiple outputs can happen if, for example, the output JSON - is too large - and overflows into multiple sharded files. + AnnotateImageResponse. Multiple outputs can happen if, + for example, the output JSON is too large and overflows + into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py index ea643e841b9a..86ca50d51309 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py @@ -40,13 +40,11 @@ class ProductSearchParams(proto.Message): interest in the image. If it is not specified, system discretion will be applied. product_set (str): - The resource name of a - `ProductSet `__ to - be searched for - similar images. + The resource name of a `ProductSet + `__ to be searched + for similar images. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -150,8 +148,7 @@ class ObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more - information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py index 2458330cf6e1..c1e0a4ab577d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py @@ -69,8 +69,7 @@ class Product(proto.Message): name (str): The resource name of the product. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This field is ignored when creating a product. display_name (str): @@ -89,24 +88,20 @@ class Product(proto.Message): these should not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1p4beta1.types.Product.KeyValue]): Key-value pairs that can be attached to a product. At query - time, - constraints can be specified based on the product_labels. + time, constraints can be specified based on the + product_labels. Note that integer values can be provided as strings, e.g. - "1199". Only - strings with integer values can match a range-based - restriction which is - to be supported soon. + "1199". Only strings with integer values can match a + range-based restriction which is to be supported soon. Multiple values can be assigned to the same key. One product - may have up to - 500 product_labels. + may have up to 500 product_labels. Notice that the total number of distinct product_labels over - all products - in one ProductSet cannot exceed 1M, otherwise the product - search pipeline - will refuse to work for that ProductSet. + all products in one ProductSet cannot exceed 1M, otherwise + the product search pipeline will refuse to work for that + ProductSet. """ class KeyValue(proto.Message): @@ -163,8 +158,7 @@ class ProductSet(proto.Message): name (str): The resource name of the ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. This field is ignored when creating a ProductSet. display_name (str): @@ -212,8 +206,7 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): r"""A ``ReferenceImage`` represents a product image and its - associated metadata, - such as bounding boxes. + associated metadata, such as bounding boxes. Attributes: name (str): @@ -266,18 +259,16 @@ class CreateProductRequest(proto.Message): Required. The project in which the Product should be created. - Format is - ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1p4beta1.types.Product): Required. The product to create. product_id (str): A user-supplied resource id for this Product. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. """ parent: str = proto.Field( @@ -303,8 +294,7 @@ class ListProductsRequest(proto.Message): Required. The project OR ProductSet from which Products should be listed. - Format: - ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -361,8 +351,7 @@ class GetProductRequest(proto.Message): name (str): Required. Resource name of the Product to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -381,13 +370,9 @@ class UpdateProductRequest(proto.Message): immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields - to update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask paths include ``product_labels``, - ``display_name``, and - ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. """ product: "Product" = proto.Field( @@ -409,8 +394,7 @@ class DeleteProductRequest(proto.Message): name (str): Required. Resource name of product to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -432,12 +416,11 @@ class CreateProductSetRequest(proto.Message): Required. The ProductSet to create. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will - attempt to use this value as the resource id. If it is - already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters - long. It cannot contain the character ``/``. + the server will attempt to use this value as the + resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. """ parent: str = proto.Field( @@ -520,8 +503,7 @@ class GetProductSetRequest(proto.Message): name (str): Required. Resource name of the ProductSet to get. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -539,11 +521,9 @@ class UpdateProductSetRequest(proto.Message): replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to - update. - If update_mask isn't specified, all mutable fields are - to be updated. - Valid mask path is ``display_name``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask path is ``display_name``. """ product_set: "ProductSet" = proto.Field( @@ -565,8 +545,7 @@ class DeleteProductSetRequest(proto.Message): name (str): Required. Resource name of the ProductSet to delete. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -581,21 +560,17 @@ class CreateReferenceImageRequest(proto.Message): Attributes: parent (str): Required. Resource name of the product in which to - create the reference - image. + create the reference image. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. reference_image (google.cloud.vision_v1p4beta1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, - the server will attempt to use this value as the - resource id. If it is - already in use, an error is returned with code - ALREADY_EXISTS. Must be at + added. If set, the server will attempt to use this + value as the resource id. If it is already in use, an + error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character ``/``. """ @@ -623,16 +598,14 @@ class ListReferenceImagesRequest(proto.Message): Required. Resource name of the product containing the reference images. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value - of ``nextPageToken`` returned in a previous reference image - list request. + is the value of ``nextPageToken`` returned in a previous reference + image list request. Defaults to the first page if not specified. """ @@ -730,14 +703,12 @@ class AddProductToProductSetRequest(proto.Message): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be added to this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -758,15 +729,12 @@ class RemoveProductFromProductSetRequest(proto.Message): Required. The resource name for the ProductSet to modify. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be - removed from this - ProductSet. + removed from this ProductSet. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -787,8 +755,7 @@ class ListProductsInProductSetRequest(proto.Message): Required. The ProductSet resource for which to retrieve Products. - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -849,90 +816,63 @@ class ImportProductSetsGcsSource(proto.Message): The URI must start with ``gs://``. The format of the input csv file should be one image per - line. - In each line, there are 8 columns. - - 1. image-uri - 2. image-id - 3. product-set-id - 4. product-id - 5. product-category - 6. product-display-name - 7. labels - 8. bounding-poly - - The ``image-uri``, ``product-set-id``, ``product-id``, - and ``product-category`` - columns are required. All other columns are optional. - - If the ``ProductSet`` or ``Product`` specified by - the ``product-set-id`` and - ``product-id`` values does not exist, then the system - will create a new - ``ProductSet`` or ``Product`` for the image. In - this case, the - ``product-display-name`` column refers to - `display_name + line. In each line, there are 8 columns. + + 1. image-uri 2. image-id 3. product-set-id 4. + product-id 5. product-category 6. product-display-name + 7. labels 8. bounding-poly + + The ``image-uri``, ``product-set-id``, ``product-id``, and ``product-category`` columns + are required. All other columns are optional. + + If the ``ProductSet`` or ``Product`` specified by the ``product-set-id`` and + ``product-id`` values does not exist, then the system will create + a new ``ProductSet`` or ``Product`` for the image. In this case, + the ``product-display-name`` column refers to `display_name `__, the - ``product-category`` column refers to - `product_category + ``product-category`` column refers to `product_category `__, - and the ``labels`` column refers to - `product_labels + and the ``labels`` column refers to `product_labels `__. - The ``image-id`` column is optional but must be unique - if provided. If it is - empty, the system will automatically assign a unique id to - the image. + The ``image-id`` column is optional but must be unique if + provided. If it is empty, the system will automatically + assign a unique id to the image. - The ``product-display-name`` column is optional. If it is empty, - the system + The ``product-display-name`` column is optional. If it is empty, the system sets the `display_name `__ field for the product to a space (" "). You can update the - ``display_name`` - later by using the API. + ``display_name`` later by using the API. - If a ``Product`` with the specified ``product-id`` - already exists, then the - system ignores the ``product-display-name``, ``product-category``, and - ``labels`` - columns. + If a ``Product`` with the specified ``product-id`` already exists, + then the system ignores the ``product-display-name``, ``product-category``, and + ``labels`` columns. - The ``labels`` column (optional) is a line containing - a list of - comma-separated key-value pairs, in the following format: + The ``labels`` column (optional) is a line containing a list + of comma-separated key-value pairs, in the following + format: "key_1=value_1,key_2=value_2,...,key_n=value_n" - The ``bounding-poly`` column (optional) identifies one - region of - interest from the image in the same manner as - ``CreateReferenceImage``. If - you do not specify the ``bounding-poly`` column, then the - system will try to - detect regions of interest automatically. - - At most one ``bounding-poly`` column is allowed per line. If - the image - contains multiple regions of interest, add a line to the CSV - file that - includes the same product information, and the - ``bounding-poly`` values for - each region of interest. + The ``bounding-poly`` column (optional) identifies one region of + interest from the image in the same manner as ``CreateReferenceImage``. If + you do not specify the ``bounding-poly`` column, then the system + will try to detect regions of interest automatically. + + At most one ``bounding-poly`` column is allowed per line. If the + image contains multiple regions of interest, add a line to + the CSV file that includes the same product information, + and the ``bounding-poly`` values for each region of interest. The ``bounding-poly`` column must contain an even number of - comma-separated - numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". - Use - non-negative integers for absolute bounding polygons, and - float values + comma-separated numbers, in the format + "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative + integers for absolute bounding polygons, and float values in [0, 1] for normalized bounding polygons. The system will resize the image if the image resolution is - too - large to process (larger than 20MP). + too large to process (larger than 20MP). """ csv_file_uri: str = proto.Field( @@ -993,25 +933,21 @@ class ImportProductSetsResponse(proto.Message): This message is returned by the `google.longrunning.Operations.GetOperation - `__ - method in the returned - `google.longrunning.Operation.response - `__ - field. + `__ method in the + returned `google.longrunning.Operation.response + `__ field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1p4beta1.types.ReferenceImage]): The list of reference_images that are imported successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): The rpc status for each ImportProductSet request, including - both successes - and errors. + both successes and errors. The number of statuses here matches the number of lines in - the csv file, - and statuses[i] stores the success or failure status of - processing the i-th - line of the csv, starting from line 0. + the csv file, and statuses[i] stores the success or failure + status of processing the i-th line of the csv, starting + from line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -1029,9 +965,8 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the - ``Operation`` returned by the - ``GetOperation`` call of the ``google::longrunning::Operations`` service. + This is included in the ``metadata`` field of the ``Operation`` returned by + the ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1p4beta1.types.BatchOperationMetadata.State): @@ -1042,8 +977,7 @@ class BatchOperationMetadata(proto.Message): end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and `google.longrunning.Operation.done - `__ is - set to true. + `__ is set to true. """ class State(proto.Enum): @@ -1098,10 +1032,8 @@ class ProductSetPurgeConfig(proto.Message): Attributes: product_set_id (str): The ProductSet that contains the Products to delete. If a - Product is a - member of product_set_id in addition to other ProductSets, - the Product will - still be deleted. + Product is a member of product_set_id in addition to other + ProductSets, the Product will still be deleted. """ product_set_id: str = proto.Field( @@ -1128,8 +1060,7 @@ class PurgeProductsRequest(proto.Message): This field is a member of `oneof`_ ``target``. delete_orphan_products (bool): If delete_orphan_products is true, all Products that are not - in any - ProductSet will be deleted. + in any ProductSet will be deleted. This field is a member of `oneof`_ ``target``. parent (str): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py index 6cef7c5ed598..8089e029796f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py @@ -36,15 +36,11 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. - The hierarchy of an OCR extracted text structure is like this: - TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol - Each structural component, starting from Page, may further have - their own - properties. Properties describe detected languages, breaks etc.. - Please refer - to the - `TextAnnotation.TextProperty + text. The hierarchy of an OCR extracted text structure is like + this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> + Symbol Each structural component, starting from Page, may further + have their own properties. Properties describe detected languages, + breaks etc.. Please refer to the `TextAnnotation.TextProperty `__ message definition below for more detail. @@ -61,8 +57,7 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more - information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -101,8 +96,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with - ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py index 2723585b5d8f..e6222a155751 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py @@ -159,9 +159,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as - "en-US" or "sr-Latn". - For more information, see + The BCP-47 language code for ``label``, such as "en-US" or + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ From dccd6c08b7a6bab13ccd5aca067ceee013a7099a Mon Sep 17 00:00:00 2001 From: ohmayr Date: Sat, 17 Jan 2026 00:23:28 +0000 Subject: [PATCH 7/9] version 7 --- .../services/product_search/async_client.py | 38 +++++++++++------- .../services/product_search/client.py | 38 +++++++++++------- .../product_search/transports/grpc.py | 38 +++++++++++------- .../product_search/transports/grpc_asyncio.py | 38 +++++++++++------- .../product_search/transports/rest.py | 16 +++++--- .../cloud/vision_v1/types/image_annotator.py | 23 ++++++----- .../vision_v1p2beta1/types/image_annotator.py | 16 ++++---- .../services/product_search/async_client.py | 40 ++++++++++++------- .../services/product_search/client.py | 40 ++++++++++++------- .../product_search/transports/grpc.py | 40 ++++++++++++------- .../product_search/transports/grpc_asyncio.py | 40 ++++++++++++------- .../product_search/transports/rest.py | 18 ++++++--- .../vision_v1p3beta1/types/image_annotator.py | 16 ++++---- .../services/product_search/async_client.py | 40 ++++++++++++------- .../services/product_search/client.py | 40 ++++++++++++------- .../product_search/transports/grpc.py | 40 ++++++++++++------- .../product_search/transports/grpc_asyncio.py | 40 ++++++++++++------- .../product_search/transports/rest.py | 18 ++++++--- .../vision_v1p4beta1/types/image_annotator.py | 23 ++++++----- 19 files changed, 370 insertions(+), 232 deletions(-) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py index 1084205d714f..75fee9d6d92b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py @@ -76,12 +76,16 @@ class ProductSearchAsyncClient: - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups to limit - identification. In parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` - Each `Product `__ has - a collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -969,8 +973,10 @@ async def create_product( * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is missing or invalid. + description is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. .. code-block:: python @@ -1359,8 +1365,9 @@ async def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in + is missing from the request or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask. @@ -1609,11 +1616,12 @@ async def create_reference_image( * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. * Returns INVALID_ARGUMENT if - bounding_poly is not provided, and nothing compatible with the - parent product's product_category is detected. * Returns - INVALID_ARGUMENT if bounding_poly contains more than 10 - polygons. + product does not exist. + + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py index ba0f24d0f7c5..868378778396 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py @@ -120,12 +120,16 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups to limit - identification. In parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` - Each `Product `__ has - a collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -1435,8 +1439,10 @@ def create_product( * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is missing or invalid. + description is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. .. code-block:: python @@ -1816,8 +1822,9 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in + is missing from the request or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask. @@ -2060,11 +2067,12 @@ def create_reference_image( * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. * Returns INVALID_ARGUMENT if - bounding_poly is not provided, and nothing compatible with the - parent product's product_category is detected. * Returns - INVALID_ARGUMENT if bounding_poly contains more than 10 - polygons. + product does not exist. + + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py index 560b4e3750fb..870f356ee22f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py @@ -118,12 +118,16 @@ class ProductSearchGrpcTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups to limit - identification. In parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` - Each `Product `__ has - a collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -531,8 +535,10 @@ def create_product( * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is missing or invalid. + description is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. Returns: Callable[[~.CreateProductRequest], @@ -636,8 +642,9 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in + is missing from the request or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask. @@ -715,11 +722,12 @@ def create_reference_image( * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. * Returns INVALID_ARGUMENT if - bounding_poly is not provided, and nothing compatible with the - parent product's product_category is detected. * Returns - INVALID_ARGUMENT if bounding_poly contains more than 10 - polygons. + product does not exist. + + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py index f0978778ca61..483a9076413c 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py @@ -124,12 +124,16 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups to limit - identification. In parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` - Each `Product `__ has - a collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -543,8 +547,10 @@ def create_product( * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is missing or invalid. + description is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. Returns: Callable[[~.CreateProductRequest], @@ -650,8 +656,9 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in + is missing from the request or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask. @@ -731,11 +738,12 @@ def create_reference_image( * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. * Returns INVALID_ARGUMENT if - bounding_poly is not provided, and nothing compatible with the - parent product's product_category is detected. * Returns - INVALID_ARGUMENT if bounding_poly contains more than 10 - polygons. + product does not exist. + + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py index 69f22a1d6ce9..7aa895f56b76 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py @@ -1037,12 +1037,16 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups to limit - identification. In parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` - Each `Product `__ has - a collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a collection + of `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py index a1bbc4a42ccc..70e638f0ead6 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py @@ -1713,16 +1713,19 @@ class GcsDestination(proto.Message): * File Prefix: gs://bucket-name/here/filenameprefix The output files will be created in gs://bucket-name/here/ and the names of the output files will begin with - "filenameprefix". * Directory Prefix: - gs://bucket-name/some/location/ The output files will be - created in gs://bucket-name/some/location/ and the names - of the output files could be anything because there was no - filename prefix specified. If multiple outputs, each - response is still AnnotateFileResponse, each of which - contains some subset of the full list of - AnnotateImageResponse. Multiple outputs can happen if, - for example, the output JSON is too large and overflows - into multiple sharded files. + "filenameprefix". + + * Directory Prefix: gs://bucket-name/some/location/ The + output files will be created in + gs://bucket-name/some/location/ and the names of the + output files could be anything because there was no + filename prefix specified. + + If multiple outputs, each response is still + AnnotateFileResponse, each of which contains some subset of + the full list of AnnotateImageResponse. Multiple outputs + can happen if, for example, the output JSON is too large + and overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py index b80e358f193b..1813e6c74642 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py @@ -1335,13 +1335,15 @@ class GcsDestination(proto.Message): Examples: * File: gs://bucket-name/filename.json * Prefix: - gs://bucket-name/prefix/here/ * File: - gs://bucket-name/prefix/here If multiple outputs, each - response is still AnnotateFileResponse, each of which - contains some subset of the full list of - AnnotateImageResponse. Multiple outputs can happen if, for - example, the output JSON is too large and overflows into - multiple sharded files. + gs://bucket-name/prefix/here/ + + * File: gs://bucket-name/prefix/here + + If multiple outputs, each response is still + AnnotateFileResponse, each of which contains some subset of + the full list of AnnotateImageResponse. Multiple outputs + can happen if, for example, the output JSON is too large + and overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py index 7ee396ddc54b..2fc414f9895a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py @@ -74,12 +74,18 @@ class ProductSearchAsyncClient: - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. In parallel, - The API has a - collection of `Product `__ - resources, named ``projects/*/locations/*/products/*`` - Each `Product - `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + groups to limit identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -971,8 +977,10 @@ async def create_product( * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is missing or invalid. + description is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. .. code-block:: python @@ -1361,8 +1369,9 @@ async def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in + is missing from the request or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask. @@ -1614,11 +1623,12 @@ async def create_reference_image( * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. * Returns INVALID_ARGUMENT if - bounding_poly is not provided, and nothing compatible with the - parent product's product_category is detected. * Returns - INVALID_ARGUMENT if bounding_poly contains more than 10 - polygons. + product does not exist. + + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py index 9577e129aa68..85714bf5e432 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py @@ -118,12 +118,18 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. In parallel, - The API has a - collection of `Product `__ - resources, named ``projects/*/locations/*/products/*`` - Each `Product - `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + groups to limit identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -1437,8 +1443,10 @@ def create_product( * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is missing or invalid. + description is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. .. code-block:: python @@ -1818,8 +1826,9 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in + is missing from the request or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask. @@ -2065,11 +2074,12 @@ def create_reference_image( * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. * Returns INVALID_ARGUMENT if - bounding_poly is not provided, and nothing compatible with the - parent product's product_category is detected. * Returns - INVALID_ARGUMENT if bounding_poly contains more than 10 - polygons. + product does not exist. + + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py index ee3b612d5526..dd7c8bd28eb6 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py @@ -118,12 +118,18 @@ class ProductSearchGrpcTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. In parallel, - The API has a - collection of `Product `__ - resources, named ``projects/*/locations/*/products/*`` - Each `Product - `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + groups to limit identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -535,8 +541,10 @@ def create_product( * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is missing or invalid. + description is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. Returns: Callable[[~.CreateProductRequest], @@ -640,8 +648,9 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in + is missing from the request or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask. @@ -722,11 +731,12 @@ def create_reference_image( * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. * Returns INVALID_ARGUMENT if - bounding_poly is not provided, and nothing compatible with the - parent product's product_category is detected. * Returns - INVALID_ARGUMENT if bounding_poly contains more than 10 - polygons. + product does not exist. + + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py index 0a75a90e07ab..f7a6a1acb983 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py @@ -124,12 +124,18 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. In parallel, - The API has a - collection of `Product `__ - resources, named ``projects/*/locations/*/products/*`` - Each `Product - `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + groups to limit identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -547,8 +553,10 @@ def create_product( * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is missing or invalid. + description is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. Returns: Callable[[~.CreateProductRequest], @@ -654,8 +662,9 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in + is missing from the request or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask. @@ -738,11 +747,12 @@ def create_reference_image( * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. * Returns INVALID_ARGUMENT if - bounding_poly is not provided, and nothing compatible with the - parent product's product_category is detected. * Returns - INVALID_ARGUMENT if bounding_poly contains more than 10 - polygons. + product does not exist. + + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py index bb434ed55cac..f4a5c1222acc 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py @@ -955,12 +955,18 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. In parallel, - The API has a - collection of `Product `__ - resources, named ``projects/*/locations/*/products/*`` - Each `Product - `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + groups to limit identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py index 07e30deeb0ad..0d1be5b3e8bc 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py @@ -1415,13 +1415,15 @@ class GcsDestination(proto.Message): Examples: * File: gs://bucket-name/filename.json * Prefix: - gs://bucket-name/prefix/here/ * File: - gs://bucket-name/prefix/here If multiple outputs, each - response is still AnnotateFileResponse, each of which - contains some subset of the full list of - AnnotateImageResponse. Multiple outputs can happen if, for - example, the output JSON is too large and overflows into - multiple sharded files. + gs://bucket-name/prefix/here/ + + * File: gs://bucket-name/prefix/here + + If multiple outputs, each response is still + AnnotateFileResponse, each of which contains some subset of + the full list of AnnotateImageResponse. Multiple outputs + can happen if, for example, the output JSON is too large + and overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py index 554929226b7e..7426c9e7b6fe 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py @@ -75,12 +75,18 @@ class ProductSearchAsyncClient: - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. In parallel, - The API has a - collection of `Product `__ - resources, named ``projects/*/locations/*/products/*`` - Each `Product - `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + groups to limit identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -968,8 +974,10 @@ async def create_product( * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is missing or invalid. + description is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. .. code-block:: python @@ -1358,8 +1366,9 @@ async def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in + is missing from the request or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask. @@ -1608,11 +1617,12 @@ async def create_reference_image( * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. * Returns INVALID_ARGUMENT if - bounding_poly is not provided, and nothing compatible with the - parent product's product_category is detected. * Returns - INVALID_ARGUMENT if bounding_poly contains more than 10 - polygons. + product does not exist. + + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py index cc3d99213754..a664b9ec93f9 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py @@ -119,12 +119,18 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. In parallel, - The API has a - collection of `Product `__ - resources, named ``projects/*/locations/*/products/*`` - Each `Product - `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + groups to limit identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -1434,8 +1440,10 @@ def create_product( * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is missing or invalid. + description is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. .. code-block:: python @@ -1815,8 +1823,9 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in + is missing from the request or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask. @@ -2059,11 +2068,12 @@ def create_reference_image( * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. * Returns INVALID_ARGUMENT if - bounding_poly is not provided, and nothing compatible with the - parent product's product_category is detected. * Returns - INVALID_ARGUMENT if bounding_poly contains more than 10 - polygons. + product does not exist. + + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py index f5b999d7dabf..9b7f63fa7fbc 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py @@ -118,12 +118,18 @@ class ProductSearchGrpcTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. In parallel, - The API has a - collection of `Product `__ - resources, named ``projects/*/locations/*/products/*`` - Each `Product - `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + groups to limit identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -531,8 +537,10 @@ def create_product( * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is missing or invalid. + description is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. Returns: Callable[[~.CreateProductRequest], @@ -636,8 +644,9 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in + is missing from the request or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask. @@ -715,11 +724,12 @@ def create_reference_image( * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. * Returns INVALID_ARGUMENT if - bounding_poly is not provided, and nothing compatible with the - parent product's product_category is detected. * Returns - INVALID_ARGUMENT if bounding_poly contains more than 10 - polygons. + product does not exist. + + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py index 761866075e3d..c797e9e66c32 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py @@ -124,12 +124,18 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. In parallel, - The API has a - collection of `Product `__ - resources, named ``projects/*/locations/*/products/*`` - Each `Product - `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + groups to limit identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -543,8 +549,10 @@ def create_product( * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is missing or invalid. + description is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is missing or + invalid. Returns: Callable[[~.CreateProductRequest], @@ -650,8 +658,9 @@ def update_product( * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. * - Returns INVALID_ARGUMENT if description is present in + is missing from the request or longer than 4096 characters. + + * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask. @@ -731,11 +740,12 @@ def create_reference_image( * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. * Returns INVALID_ARGUMENT if - bounding_poly is not provided, and nothing compatible with the - parent product's product_category is detected. * Returns - INVALID_ARGUMENT if bounding_poly contains more than 10 - polygons. + product does not exist. + + * Returns INVALID_ARGUMENT if bounding_poly is not provided, and + nothing compatible with the parent product's product_category + is detected. * Returns INVALID_ARGUMENT if bounding_poly + contains more than 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py index b9d1403f99ce..01851e45be2f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py @@ -1012,12 +1012,18 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. In parallel, - The API has a - collection of `Product `__ - resources, named ``projects/*/locations/*/products/*`` - Each `Product - `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + groups to limit identification. + + In parallel, + + - The API has a collection of `Product + `__ resources, named + ``projects/*/locations/*/products/*`` + + - Each `Product `__ has a + collection of `ReferenceImage + `__ resources, named + ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py index 7b13f4a04e1d..11ca0e738bba 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py @@ -1600,16 +1600,19 @@ class GcsDestination(proto.Message): * File Prefix: gs://bucket-name/here/filenameprefix The output files will be created in gs://bucket-name/here/ and the names of the output files will begin with - "filenameprefix". * Directory Prefix: - gs://bucket-name/some/location/ The output files will be - created in gs://bucket-name/some/location/ and the names - of the output files could be anything because there was no - filename prefix specified. If multiple outputs, each - response is still AnnotateFileResponse, each of which - contains some subset of the full list of - AnnotateImageResponse. Multiple outputs can happen if, - for example, the output JSON is too large and overflows - into multiple sharded files. + "filenameprefix". + + * Directory Prefix: gs://bucket-name/some/location/ The + output files will be created in + gs://bucket-name/some/location/ and the names of the + output files could be anything because there was no + filename prefix specified. + + If multiple outputs, each response is still + AnnotateFileResponse, each of which contains some subset of + the full list of AnnotateImageResponse. Multiple outputs + can happen if, for example, the output JSON is too large + and overflows into multiple sharded files. """ uri: str = proto.Field( From e2cb3b8debfa55ce619b57bcd2c8e85ff099443d Mon Sep 17 00:00:00 2001 From: ohmayr Date: Sat, 17 Jan 2026 00:33:00 +0000 Subject: [PATCH 8/9] version 8 --- .../services/image_annotator/async_client.py | 22 +- .../services/image_annotator/client.py | 22 +- .../image_annotator/transports/grpc.py | 14 +- .../transports/grpc_asyncio.py | 14 +- .../services/product_search/async_client.py | 216 ++++++++------- .../services/product_search/client.py | 216 ++++++++------- .../product_search/transports/grpc.py | 122 +++++---- .../product_search/transports/grpc_asyncio.py | 122 +++++---- .../product_search/transports/rest.py | 23 +- .../cloud/vision_v1/types/image_annotator.py | 246 ++++++++++-------- .../cloud/vision_v1/types/product_search.py | 6 +- .../vision_v1/types/product_search_service.py | 175 +++++++------ .../cloud/vision_v1/types/text_annotation.py | 116 ++++++--- .../cloud/vision_v1/types/web_detection.py | 2 +- .../vision_v1p1beta1/types/image_annotator.py | 130 ++++----- .../vision_v1p1beta1/types/text_annotation.py | 113 ++++++-- .../vision_v1p1beta1/types/web_detection.py | 2 +- .../services/image_annotator/async_client.py | 12 +- .../services/image_annotator/client.py | 12 +- .../image_annotator/transports/grpc.py | 8 +- .../transports/grpc_asyncio.py | 8 +- .../vision_v1p2beta1/types/image_annotator.py | 178 ++++++------- .../vision_v1p2beta1/types/text_annotation.py | 114 +++++--- .../vision_v1p2beta1/types/web_detection.py | 2 +- .../services/image_annotator/async_client.py | 12 +- .../services/image_annotator/client.py | 12 +- .../image_annotator/transports/grpc.py | 8 +- .../transports/grpc_asyncio.py | 8 +- .../services/product_search/async_client.py | 162 ++++++------ .../services/product_search/client.py | 162 ++++++------ .../product_search/transports/grpc.py | 92 ++++--- .../product_search/transports/grpc_asyncio.py | 92 ++++--- .../product_search/transports/rest.py | 11 +- .../vision_v1p3beta1/types/image_annotator.py | 180 ++++++------- .../vision_v1p3beta1/types/product_search.py | 4 +- .../types/product_search_service.py | 154 ++++++----- .../vision_v1p3beta1/types/text_annotation.py | 114 +++++--- .../vision_v1p3beta1/types/web_detection.py | 2 +- .../services/image_annotator/async_client.py | 22 +- .../services/image_annotator/client.py | 22 +- .../image_annotator/transports/grpc.py | 14 +- .../transports/grpc_asyncio.py | 14 +- .../services/product_search/async_client.py | 218 +++++++++------- .../services/product_search/client.py | 218 +++++++++------- .../product_search/transports/grpc.py | 128 +++++---- .../product_search/transports/grpc_asyncio.py | 128 +++++---- .../product_search/transports/rest.py | 29 ++- .../cloud/vision_v1p4beta1/types/face.py | 10 +- .../vision_v1p4beta1/types/image_annotator.py | 202 +++++++------- .../vision_v1p4beta1/types/product_search.py | 8 +- .../types/product_search_service.py | 167 ++++++------ .../vision_v1p4beta1/types/text_annotation.py | 114 +++++--- .../vision_v1p4beta1/types/web_detection.py | 2 +- 53 files changed, 2339 insertions(+), 1865 deletions(-) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py index bb22347ad551..c41b09cedb02 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py @@ -536,12 +536,12 @@ async def async_batch_annotate_images( r"""Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -604,8 +604,8 @@ async def sample_async_batch_annotate_images(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch image - annotation request. + :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse` + Response to an async batch image annotation request. """ # Create or coerce a protobuf request object. @@ -675,10 +675,10 @@ async def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -734,8 +734,8 @@ async def sample_async_batch_annotate_files(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file - annotation request. + :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse` + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py index c42711904c1c..d6a329ad5da4 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py @@ -993,12 +993,12 @@ def async_batch_annotate_images( r"""Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -1061,8 +1061,8 @@ def sample_async_batch_annotate_images(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch image - annotation request. + :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse` + Response to an async batch image annotation request. """ # Create or coerce a protobuf request object. @@ -1131,10 +1131,10 @@ def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -1190,8 +1190,8 @@ def sample_async_batch_annotate_files(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file - annotation request. + :class:`google.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse` + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py index 24c69e199f3a..b53dd5ccdded 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py @@ -420,12 +420,12 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -457,10 +457,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py index 57f686f4d018..23b4eb8f39e8 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py @@ -429,12 +429,12 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -467,10 +467,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py index 75fee9d6d92b..6d32716132f2 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py @@ -71,21 +71,26 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet - `__ resources, named ``projects/*/locations/*/productSets/*``, - which acts as a way to put different products into groups to limit - identification. + `__ + + resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different + products into groups to limit identification. In parallel, - The API has a collection of `Product - `__ resources, named ``projects/*/locations/*/products/*`` + `__ + + resources, named ``projects/*/locations/*/products/*`` - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + of + + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -382,10 +387,10 @@ async def sample_create_product_set(): should not be set. product_set_id (:class:`str`): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field @@ -643,7 +648,7 @@ async def sample_get_product_set(): name (:class:`str`): Required. Resource name of the ProductSet to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -726,14 +731,16 @@ async def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. Only display_name can - be updated currently. + r"""Makes changes to a ProductSet resource. Only display_name can be + updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. .. code-block:: python @@ -772,8 +779,8 @@ async def sample_update_product_set(): should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field @@ -895,7 +902,7 @@ async def sample_delete_product_set(): name (:class:`str`): Required. Resource name of the ProductSet to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -972,8 +979,10 @@ async def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid. @@ -1011,7 +1020,7 @@ async def sample_create_product(): Required. The project in which the Product should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1023,10 +1032,10 @@ async def sample_create_product(): should not be set. product_id (:class:`str`): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field @@ -1149,7 +1158,7 @@ async def sample_list_products(): Required. The project OR ProductSet from which Products should be listed. - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1277,7 +1286,7 @@ async def sample_get_product(): name (:class:`str`): Required. Resource name of the Product to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1355,21 +1364,24 @@ async def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + r"""Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the Product does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1410,9 +1422,9 @@ async def sample_update_product(): should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1529,7 +1541,7 @@ async def sample_delete_product(): name (:class:`str`): Required. Resource name of product to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1605,23 +1617,26 @@ async def create_reference_image( The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. + than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. .. code-block:: python @@ -1658,9 +1673,9 @@ async def sample_create_reference_image(): The request object. Request message for the ``CreateReferenceImage`` method. parent (:class:`str`): Required. Resource name of the product in which to - create the reference image. + create the reference image. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1675,11 +1690,11 @@ async def sample_create_reference_image(): should not be set. reference_image_id (:class:`str`): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this - value as the resource id. If it is already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters long. It cannot contain the - character ``/``. + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1695,7 +1710,7 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1801,7 +1816,7 @@ async def sample_delete_reference_image(): Required. The resource name of the reference image to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1875,8 +1890,9 @@ async def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. + + * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. .. code-block:: python @@ -1913,7 +1929,7 @@ async def sample_list_reference_images(): Required. Resource name of the product containing the reference images. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2044,7 +2060,7 @@ async def sample_get_reference_image(): Required. The resource name of the ReferenceImage to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2060,7 +2076,7 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2125,7 +2141,7 @@ async def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -2165,7 +2181,7 @@ async def sample_add_product_to_product_set(): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2174,7 +2190,7 @@ async def sample_add_product_to_product_set(): Required. The resource name for the Product to be added to this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2282,16 +2298,16 @@ async def sample_remove_product_from_product_set(): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): Required. The resource name for the Product to be - removed from this ProductSet. + removed from this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2366,8 +2382,8 @@ async def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -2408,7 +2424,7 @@ async def sample_list_products_in_product_set(): Required. The ProductSet resource for which to retrieve Products. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2506,15 +2522,15 @@ async def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -2580,14 +2596,14 @@ async def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets`` + :class:`google.cloud.vision_v1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets` method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ method - in the returned `google.longrunning.Operation.response - `__ field. + `__ method + in the returned `google.longrunning.Operation.response + `__ field. """ # Create or coerce a protobuf request object. @@ -2661,31 +2677,31 @@ async def purge_products( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the - PurgeProducts operation has finished for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -2743,13 +2759,15 @@ async def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that you can - re-use to avoid defining duplicated empty messages in - your APIs. A typical example is to use it as the request - or the response type of an API method. For instance: - - service Foo { rpc Bar(google.protobuf.Empty) - returns (google.protobuf.Empty); } + :class:`google.protobuf.empty_pb2.Empty` A generic empty + message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to use + it as the request or the response type of an API method. + For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py index 868378778396..47af16483752 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py @@ -115,21 +115,26 @@ def get_transport_class( class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet - `__ resources, named ``projects/*/locations/*/productSets/*``, - which acts as a way to put different products into groups to limit - identification. + `__ + + resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different + products into groups to limit identification. In parallel, - The API has a collection of `Product - `__ resources, named ``projects/*/locations/*/products/*`` + `__ + + resources, named ``projects/*/locations/*/products/*`` - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + of + + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -863,10 +868,10 @@ def sample_create_product_set(): should not be set. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field @@ -1118,7 +1123,7 @@ def sample_get_product_set(): name (str): Required. Resource name of the ProductSet to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1198,14 +1203,16 @@ def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. Only display_name can - be updated currently. + r"""Makes changes to a ProductSet resource. Only display_name can be + updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. .. code-block:: python @@ -1244,8 +1251,8 @@ def sample_update_product_set(): should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field @@ -1364,7 +1371,7 @@ def sample_delete_product_set(): name (str): Required. Resource name of the ProductSet to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1438,8 +1445,10 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid. @@ -1477,7 +1486,7 @@ def sample_create_product(): Required. The project in which the Product should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1489,10 +1498,10 @@ def sample_create_product(): should not be set. product_id (str): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field @@ -1612,7 +1621,7 @@ def sample_list_products(): Required. The project OR ProductSet from which Products should be listed. - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1737,7 +1746,7 @@ def sample_get_product(): name (str): Required. Resource name of the Product to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1812,21 +1821,24 @@ def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + r"""Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the Product does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1867,9 +1879,9 @@ def sample_update_product(): should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1983,7 +1995,7 @@ def sample_delete_product(): name (str): Required. Resource name of product to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2056,23 +2068,26 @@ def create_reference_image( The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. + than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. .. code-block:: python @@ -2109,9 +2124,9 @@ def sample_create_reference_image(): The request object. Request message for the ``CreateReferenceImage`` method. parent (str): Required. Resource name of the product in which to - create the reference image. + create the reference image. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2126,11 +2141,11 @@ def sample_create_reference_image(): should not be set. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this - value as the resource id. If it is already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters long. It cannot contain the - character ``/``. + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2146,7 +2161,7 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2249,7 +2264,7 @@ def sample_delete_reference_image(): Required. The resource name of the reference image to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2320,8 +2335,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. + + * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. .. code-block:: python @@ -2358,7 +2374,7 @@ def sample_list_reference_images(): Required. Resource name of the product containing the reference images. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2486,7 +2502,7 @@ def sample_get_reference_image(): Required. The resource name of the ReferenceImage to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2502,7 +2518,7 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2564,7 +2580,7 @@ def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -2604,7 +2620,7 @@ def sample_add_product_to_product_set(): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2613,7 +2629,7 @@ def sample_add_product_to_product_set(): Required. The resource name for the Product to be added to this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2720,16 +2736,16 @@ def sample_remove_product_from_product_set(): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): Required. The resource name for the Product to be - removed from this ProductSet. + removed from this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2803,8 +2819,8 @@ def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -2845,7 +2861,7 @@ def sample_list_products_in_product_set(): Required. The ProductSet resource for which to retrieve Products. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2942,15 +2958,15 @@ def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -3016,14 +3032,14 @@ def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets`` + :class:`google.cloud.vision_v1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets` method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ method - in the returned `google.longrunning.Operation.response - `__ field. + `__ method + in the returned `google.longrunning.Operation.response + `__ field. """ # Create or coerce a protobuf request object. @@ -3094,31 +3110,31 @@ def purge_products( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the - PurgeProducts operation has finished for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -3176,13 +3192,15 @@ def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that you can - re-use to avoid defining duplicated empty messages in - your APIs. A typical example is to use it as the request - or the response type of an API method. For instance: - - service Foo { rpc Bar(google.protobuf.Empty) - returns (google.protobuf.Empty); } + :class:`google.protobuf.empty_pb2.Empty` A generic empty + message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to use + it as the request or the response type of an API method. + For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py index 870f356ee22f..5b2e5bfe3b1e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py @@ -113,21 +113,26 @@ class ProductSearchGrpcTransport(ProductSearchTransport): """gRPC backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet - `__ resources, named ``projects/*/locations/*/productSets/*``, - which acts as a way to put different products into groups to limit - identification. + `__ + + resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different + products into groups to limit identification. In parallel, - The API has a collection of `Product - `__ resources, named ``projects/*/locations/*/products/*`` + `__ + + resources, named ``projects/*/locations/*/products/*`` - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + of + + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -464,14 +469,16 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. Only display_name can - be updated currently. + Makes changes to a ProductSet resource. Only display_name can be + updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -534,8 +541,10 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid. @@ -632,21 +641,24 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the Product does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is present in update_mask. Returns: @@ -711,23 +723,26 @@ def create_reference_image( The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. + than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -795,8 +810,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. + + * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. Returns: @@ -859,7 +875,7 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -929,8 +945,8 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -966,15 +982,15 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -1005,31 +1021,31 @@ def purge_products( r"""Return a callable for the purge products method over gRPC. Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the - PurgeProducts operation has finished for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py index 483a9076413c..08f533bd4fef 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py @@ -119,21 +119,26 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): """gRPC AsyncIO backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet - `__ resources, named ``projects/*/locations/*/productSets/*``, - which acts as a way to put different products into groups to limit - identification. + `__ + + resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different + products into groups to limit identification. In parallel, - The API has a collection of `Product - `__ resources, named ``projects/*/locations/*/products/*`` + `__ + + resources, named ``projects/*/locations/*/products/*`` - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + of + + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -473,14 +478,16 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. Only display_name can - be updated currently. + Makes changes to a ProductSet resource. Only display_name can be + updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -546,8 +553,10 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid. @@ -646,21 +655,24 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the Product does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is present in update_mask. Returns: @@ -727,23 +739,26 @@ def create_reference_image( The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. + than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -811,8 +826,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. + + * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. Returns: @@ -876,7 +892,7 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -947,8 +963,8 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -985,15 +1001,15 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -1025,31 +1041,31 @@ def purge_products( r"""Return a callable for the purge products method over gRPC. Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the - PurgeProducts operation has finished for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py index 7aa895f56b76..55616342c999 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py @@ -1032,21 +1032,26 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): """REST backend synchronous transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet - `__ resources, named ``projects/*/locations/*/productSets/*``, - which acts as a way to put different products into groups to limit - identification. + `__ + + resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different + products into groups to limit identification. In parallel, - The API has a collection of `Product - `__ resources, named ``projects/*/locations/*/products/*`` + `__ + + resources, named ``projects/*/locations/*/products/*`` - Each `Product `__ has a collection - of `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + of + + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -1648,7 +1653,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ @@ -2424,7 +2429,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py index 70e638f0ead6..3db7af9dfc13 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py @@ -101,8 +101,8 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the - maximum number of results to return for that type. Multiple - ``Feature`` objects can be specified in the ``features`` list. + maximum number of results to return for that type. Multiple + ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1.types.Feature.Type): @@ -111,9 +111,9 @@ class Feature(proto.Message): Maximum number of results of this type. Does not apply to ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): - Model to use for the feature. Supported values: + Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -134,8 +134,8 @@ class Type(proto.Enum): Run label detection. TEXT_DETECTION (5): Run text detection / optical character recognition (OCR). - Text detection is optimized for areas of text within a - larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` + Text detection is optimized for areas of text within a + larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both @@ -192,31 +192,34 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud Storage - Request URIs + The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google Cloud Storage + Request URIs `__ for more info. image_uri (str): The URI of the source image. Can be either: - 1. A Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. - Object versioning is not supported. See `Google Cloud - Storage Request URIs - `__ - for more info. + 1. A Google Cloud Storage URI of the form + + 1. A Google Cloud Storage URI of the form + ``gs://bucket_name/object_name``. Object versioning is not supported. See + `Google Cloud Storage Request + URIs `__ for more + info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from HTTP/HTTPS URLs, Google cannot guarantee - that the request will be completed. Your request may - fail if the specified host denies the request (e.g. due - to request throttling or DOS prevention), or if Google - throttles requests to the site for abuse prevention. You - should not depend on externally-hosted images for - production applications. + images from + + 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from + HTTP/HTTPS URLs, Google cannot guarantee that the request will be + completed. Your request may fail if the specified host denies the + request (e.g. due to request throttling or DOS prevention), or if Google + throttles requests to the site for abuse prevention. You should not + depend on externally-hosted images for production applications. When both ``gcs_image_uri`` and ``image_uri`` are specified, ``image_uri`` - takes precedence. + takes precedence. """ gcs_image_uri: str = proto.Field( @@ -234,17 +237,17 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. Note: As + Image content, represented as a stream of bytes. Note: As with all ``bytes`` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateImages - requests. It does not work for AsyncBatchAnnotateImages + requests. It does not work for AsyncBatchAnnotateImages requests. source (google.cloud.vision_v1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided for - an image, ``content`` takes precedence and is used to perform + image URL. If both ``content`` and ``source`` are provided for + an image, ``content`` takes precedence and is used to perform the image annotation request. """ @@ -266,36 +269,35 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale. The - bounding box is computed to "frame" the face in accordance - with human expectations. It is based on the landmarker - results. Note that one or more x and/or y coordinates may - not be generated in the ``BoundingPoly`` (the polygon will be - unbounded) if only a partial face appears in the image to - be annotated. + bounding box are in the original image's scale. The bounding + box is computed to "frame" the face in accordance with human + expectations. It is based on the landmarker results. Note + that one or more x and/or y coordinates may not be generated + in the ``BoundingPoly`` (the polygon will be unbounded) if only a + partial face appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1.types.BoundingPoly): The ``fd_bounding_poly`` bounding polygon is tighter than the ``boundingPoly``, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the - face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the face. + Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. + the face is pointing relative to the vertical plane + perpendicular to the image. Range [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's - horizontal plane. Range [-180,180]. + that the face is pointing relative to the image's horizontal + plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -327,9 +329,9 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. Left and right are defined from the - vantage of the viewer of the image without considering mirror - projections typical of photos. So, ``LEFT_EYE``, typically, is the + r"""Face landmark (feature) type. Left and right are defined from the + vantage of the viewer of the image without considering mirror + projections typical of photos. So, ``LEFT_EYE``, typically, is the person's right eye. Values: @@ -576,8 +578,8 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API + Opaque entity ID. Some IDs may be available in `Google + Knowledge Graph Search API `__. locale (str): The language code for the locale in which the entity textual @@ -588,31 +590,31 @@ class EntityAnnotation(proto.Message): score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field + **Deprecated. Use ``score`` instead.** The accuracy of the + entity detection in an image. For example, for an image in + which the "Eiffel Tower" entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1.types.BoundingPoly): - Image region to which this entity belongs. Not produced for + Image region to which this entity belongs. Not produced for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1.types.LocationInfo]): The location information for the detected entity. Multiple ``LocationInfo`` elements can be present because one location may indicate the location of the scene in the image, and another - location may indicate the location of the place where the - image was taken. Location information is usually present - for landmarks. + location may indicate the location of the place where the + image was taken. Location information is usually present for + landmarks. properties (MutableSequence[google.cloud.vision_v1.types.Property]): Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies + (name/value) fields, such a score or string that qualifies the entity. """ @@ -666,7 +668,7 @@ class LocalizedObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. @@ -925,21 +927,23 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to further fine-tune OCR - behavior. Current valid values are: + behavior. Current valid values are: - ``legacy_layout``: a heuristics layout detection algorithm, which - serves as an alternative to the current ML-based layout - detection algorithm. Customers can choose the best - suitable layout algorithm based on their situation. + serves as + + an alternative to the current ML-based layout detection + algorithm. Customers can choose the best suitable layout + algorithm based on their situation. """ enable_text_detection_confidence_score: bool = proto.Field( @@ -960,14 +964,14 @@ class ImageContext(proto.Message): Not used. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In rare + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it - will be a significant hindrance if the hint is wrong). Text - detection returns an error if one or more of the specified - languages is not one of the `supported languages + will be a significant hindrance if the hint is wrong). Text + detection returns an error if one or more of the specified + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1.types.CropHintsParams): Parameters for crop hints annotation request. @@ -1111,8 +1115,8 @@ class AnnotateImageResponse(proto.Message): If present, product search has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the operation. - Note that filled-in image annotations are guaranteed to be + If set, represents the error message for the operation. Note + that filled-in image annotations are guaranteed to be correct, even when ``error`` is set. context (google.cloud.vision_v1.types.ImageAnnotationContext): If present, contextual information is needed @@ -1209,9 +1213,12 @@ class BatchAnnotateImagesRequest(proto.Message): If no parent is specified, a region will be chosen automatically. - Supported location-ids: ``us``: USA country only, - ``asia``: East asia areas, like Japan, Taiwan, - ``eu``: The European Union. + Supported location-ids: + + Supported location-ids: + ``us``: USA country only, + ``asia``: East asia areas, like Japan, Taiwan, + ``eu``: The European Union. Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): @@ -1321,13 +1328,13 @@ class AnnotateFileResponse(proto.Message): response is generated. responses (MutableSequence[google.cloud.vision_v1.types.AnnotateImageResponse]): Individual responses to images found within the file. This - field will be empty if the ``error`` field is set. + field will be empty if the ``error`` field is set. total_pages (int): This field gives the total number of pages in the file. error (google.rpc.status_pb2.Status): If set, represents the error message for the failed request. - The ``responses`` field will not be set in this case. + The ``responses`` field will not be set in this case. """ input_config: "InputConfig" = proto.Field( @@ -1369,9 +1376,12 @@ class BatchAnnotateFilesRequest(proto.Message): If no parent is specified, a region will be chosen automatically. - Supported location-ids: ``us``: USA country only, - ``asia``: East asia areas, like Japan, Taiwan, - ``eu``: The European Union. + Supported location-ids: + + Supported location-ids: + ``us``: USA country only, + ``asia``: East asia areas, like Japan, Taiwan, + ``eu``: The European Union. Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): @@ -1491,9 +1501,12 @@ class AsyncBatchAnnotateImagesRequest(proto.Message): If no parent is specified, a region will be chosen automatically. - Supported location-ids: ``us``: USA country only, - ``asia``: East asia areas, like Japan, Taiwan, - ``eu``: The European Union. + Supported location-ids: + + Supported location-ids: + ``us``: USA country only, + ``asia``: East asia areas, like Japan, Taiwan, + ``eu``: The European Union. Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): @@ -1560,9 +1573,12 @@ class AsyncBatchAnnotateFilesRequest(proto.Message): If no parent is specified, a region will be chosen automatically. - Supported location-ids: ``us``: USA country only, - ``asia``: East asia areas, like Japan, Taiwan, - ``eu``: The European Union. + Supported location-ids: + + Supported location-ids: + ``us``: USA country only, + ``asia``: East asia areas, like Japan, Taiwan, + ``eu``: The European Union. Example: ``projects/project-A/locations/eu``. labels (MutableMapping[str, str]): @@ -1617,12 +1633,12 @@ class InputConfig(proto.Message): The Google Cloud Storage location to read the input from. content (bytes): - File content, represented as a stream of bytes. Note: As + File content, represented as a stream of bytes. Note: As with all ``bytes`` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateFiles - requests. It does not work for AsyncBatchAnnotateFiles + requests. It does not work for AsyncBatchAnnotateFiles requests. mime_type (str): The type of the file. Currently only @@ -1654,16 +1670,16 @@ class OutputConfig(proto.Message): the output(s) to. batch_size (int): The max number of response protos to put into each output - JSON file on Google Cloud Storage. The valid range is [1, + JSON file on Google Cloud Storage. The valid range is [1, 100]. If not specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response - protos will be generated. If ``batch_size`` = 20, then 5 json - files each containing 20 response protos will be written - under the prefix ``gcs_destination``.``uri``. + protos will be generated. If ``batch_size`` = 20, then 5 json + files each containing 20 response protos will be written + under the prefix ``gcs_destination``.``uri``. Currently, batch_size only applies to GcsDestination, with - potential future support for other output configurations. + potential future support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1701,31 +1717,33 @@ class GcsDestination(proto.Message): Attributes: uri (str): Google Cloud Storage URI prefix where the results will be - stored. Results will be in JSON format and preceded by its - corresponding input URI prefix. This field can either - represent a gcs file prefix or gcs directory. In either + stored. Results will be in JSON format and preceded by its + corresponding input URI prefix. This field can either + represent a gcs file prefix or gcs directory. In either case, the uri should be unique because in order to get all - of the output files, you will need to do a wildcard gcs - search on the uri prefix you provide. + of the output files, you will need to do a wildcard gcs + search on the uri prefix you provide. Examples: * File Prefix: gs://bucket-name/here/filenameprefix The - output files will be created in gs://bucket-name/here/ and - the names of the output files will begin with - "filenameprefix". + output files + + will be created in gs://bucket-name/here/ and the names of + the output files will begin with "filenameprefix". * Directory Prefix: gs://bucket-name/some/location/ The - output files will be created in - gs://bucket-name/some/location/ and the names of the - output files could be anything because there was no - filename prefix specified. + output files + + will be created in gs://bucket-name/some/location/ and the + names of the output files could be anything because there + was no filename prefix specified. If multiple outputs, each response is still - AnnotateFileResponse, each of which contains some subset of - the full list of AnnotateImageResponse. Multiple outputs - can happen if, for example, the output JSON is too large - and overflows into multiple sharded files. + AnnotateFileResponse, each of which contains some subset of + the full list of AnnotateImageResponse. Multiple outputs can + happen if, for example, the output JSON is too large and + overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py index f47f0fe5133c..40c81b930dee 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py @@ -41,10 +41,10 @@ class ProductSearchParams(proto.Message): system discretion will be applied. product_set (str): The resource name of a `ProductSet - `__ to be searched for + `__ to be searched for similar images. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -148,7 +148,7 @@ class ObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py index 92d9abcaf985..27ab4302676d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py @@ -69,7 +69,7 @@ class Product(proto.Message): name (str): The resource name of the product. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This field is ignored when creating a product. display_name (str): @@ -89,19 +89,19 @@ class Product(proto.Message): not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1.types.Product.KeyValue]): Key-value pairs that can be attached to a product. At query - time, constraints can be specified based on the + time, constraints can be specified based on the product_labels. Note that integer values can be provided as strings, e.g. - "1199". Only strings with integer values can match a - range-based restriction which is to be supported soon. + "1199". Only strings with integer values can match a + range-based restriction which is to be supported soon. Multiple values can be assigned to the same key. One product - may have up to 500 product_labels. + may have up to 500 product_labels. Notice that the total number of distinct product_labels over - all products in one ProductSet cannot exceed 1M, otherwise - the product search pipeline will refuse to work for that + all products in one ProductSet cannot exceed 1M, otherwise + the product search pipeline will refuse to work for that ProductSet. """ @@ -159,7 +159,7 @@ class ProductSet(proto.Message): name (str): The resource name of the ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. This field is ignored when creating a ProductSet. display_name (str): @@ -207,13 +207,13 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): r"""A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. Attributes: name (str): The resource name of the reference image. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This field is ignored when creating a reference image. uri (str): @@ -258,15 +258,15 @@ class CreateProductRequest(proto.Message): Required. The project in which the Product should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1.types.Product): Required. The product to create. product_id (str): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. """ @@ -293,7 +293,7 @@ class ListProductsRequest(proto.Message): Required. The project OR ProductSet from which Products should be listed. - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -350,7 +350,7 @@ class GetProductRequest(proto.Message): name (str): Required. Resource name of the Product to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -369,9 +369,9 @@ class UpdateProductRequest(proto.Message): immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. """ product: "Product" = proto.Field( @@ -393,7 +393,7 @@ class DeleteProductRequest(proto.Message): name (str): Required. Resource name of product to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -415,10 +415,10 @@ class CreateProductSetRequest(proto.Message): Required. The ProductSet to create. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. """ @@ -502,7 +502,7 @@ class GetProductSetRequest(proto.Message): name (str): Required. Resource name of the ProductSet to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -520,8 +520,8 @@ class UpdateProductSetRequest(proto.Message): replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid mask path is ``display_name``. """ @@ -544,7 +544,7 @@ class DeleteProductSetRequest(proto.Message): name (str): Required. Resource name of the ProductSet to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -559,19 +559,19 @@ class CreateReferenceImageRequest(proto.Message): Attributes: parent (str): Required. Resource name of the product in which to - create the reference image. + create the reference image. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. reference_image (google.cloud.vision_v1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this - value as the resource id. If it is already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters long. It cannot contain the - character ``/``. + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. """ parent: str = proto.Field( @@ -597,13 +597,13 @@ class ListReferenceImagesRequest(proto.Message): Required. Resource name of the product containing the reference images. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value of ``nextPageToken`` returned in a previous reference + is the value of ``nextPageToken`` returned in a previous reference image list request. Defaults to the first page if not specified. @@ -664,7 +664,7 @@ class GetReferenceImageRequest(proto.Message): Required. The resource name of the ReferenceImage to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. """ name: str = proto.Field( @@ -681,7 +681,7 @@ class DeleteReferenceImageRequest(proto.Message): Required. The resource name of the reference image to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` """ name: str = proto.Field( @@ -698,12 +698,12 @@ class AddProductToProductSetRequest(proto.Message): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be added to this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -724,12 +724,12 @@ class RemoveProductFromProductSetRequest(proto.Message): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be - removed from this ProductSet. + removed from this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -750,7 +750,7 @@ class ListProductsInProductSetRequest(proto.Message): Required. The ProductSet resource for which to retrieve Products. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -811,63 +811,74 @@ class ImportProductSetsGcsSource(proto.Message): The URI must start with ``gs://``. The format of the input csv file should be one image per - line. In each line, there are 8 columns. + line. In each line, there are 8 columns. + + 1. image-uri + + 2. image-id + + 3. product-set-id + + 4. product-id + + 5. product-category + + 6. product-display-name + + 7. labels - 1. image-uri 2. image-id 3. product-set-id 4. - product-id 5. product-category 6. product-display-name - 7. labels 8. bounding-poly + 8. bounding-poly - The ``image-uri``, ``product-set-id``, ``product-id``, and ``product-category`` columns + The ``image-uri``, ``product-set-id``, ``product-id``, and ``product-category`` columns are required. All other columns are optional. If the ``ProductSet`` or ``Product`` specified by the ``product-set-id`` and ``product-id`` values does not exist, then the system will create - a new ``ProductSet`` or ``Product`` for the image. In this case, - the ``product-display-name`` column refers to `display_name + a new ``ProductSet`` or ``Product`` for the image. In this case, + the ``product-display-name`` column refers to `display_name `__, the - ``product-category`` column refers to `product_category + ``product-category`` column refers to `product_category `__, and - the ``labels`` column refers to `product_labels + the ``labels`` column refers to `product_labels `__. The ``image-id`` column is optional but must be unique if - provided. If it is empty, the system will automatically + provided. If it is empty, the system will automatically assign a unique id to the image. The ``product-display-name`` column is optional. If it is empty, the system sets the `display_name - `__ field for + `__ field for the product to a space (" "). You can update the ``display_name`` - later by using the API. + later by using the API. If a ``Product`` with the specified ``product-id`` already exists, - then the system ignores the ``product-display-name``, ``product-category``, and - ``labels`` columns. + then the system ignores the ``product-display-name``, ``product-category``, and + ``labels`` columns. The ``labels`` column (optional) is a line containing a list - of comma-separated key-value pairs, in the following - format: + of comma-separated key-value pairs, in the following format: - "key_1=value_1,key_2=value_2,...,key_n=value_n" + "key_1=value_1,key_2=value_2,...,key_n=value_n" The ``bounding-poly`` column (optional) identifies one region of interest from the image in the same manner as ``CreateReferenceImage``. If you do not specify the ``bounding-poly`` column, then the system - will try to detect regions of interest automatically. + will try to detect regions of interest automatically. At most one ``bounding-poly`` column is allowed per line. If the - image contains multiple regions of interest, add a line to - the CSV file that includes the same product information, - and the ``bounding-poly`` values for each region of interest. + image contains multiple regions of interest, add a line to + the CSV file that includes the same product information, and + the ``bounding-poly`` values for each region of interest. The ``bounding-poly`` column must contain an even number of - comma-separated numbers, in the format - "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative - integers for absolute bounding polygons, and float values - in [0, 1] for normalized bounding polygons. + comma-separated numbers, in the format + "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative + integers for absolute bounding polygons, and float values in + [0, 1] for normalized bounding polygons. The system will resize the image if the image resolution is - too large to process (larger than 20MP). + too large to process (larger than 20MP). """ csv_file_uri: str = proto.Field( @@ -928,21 +939,21 @@ class ImportProductSetsResponse(proto.Message): This message is returned by the `google.longrunning.Operations.GetOperation - `__ method in the - returned `google.longrunning.Operation.response - `__ field. + `__ method in the + returned `google.longrunning.Operation.response + `__ field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1.types.ReferenceImage]): The list of reference_images that are imported successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): The rpc status for each ImportProductSet request, including - both successes and errors. + both successes and errors. The number of statuses here matches the number of lines in - the csv file, and statuses[i] stores the success or failure - status of processing the i-th line of the csv, starting - from line 0. + the csv file, and statuses[i] stores the success or failure + status of processing the i-th line of the csv, starting from + line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -961,7 +972,7 @@ class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. This is included in the ``metadata`` field of the ``Operation`` returned by - the ``GetOperation`` call of the ``google::longrunning::Operations`` service. + the ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1.types.BatchOperationMetadata.State): @@ -972,7 +983,7 @@ class BatchOperationMetadata(proto.Message): end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and `google.longrunning.Operation.done - `__ is set to true. + `__ is set to true. """ class State(proto.Enum): @@ -1027,8 +1038,8 @@ class ProductSetPurgeConfig(proto.Message): Attributes: product_set_id (str): The ProductSet that contains the Products to delete. If a - Product is a member of product_set_id in addition to other - ProductSets, the Product will still be deleted. + Product is a member of product_set_id in addition to other + ProductSets, the Product will still be deleted. """ product_set_id: str = proto.Field( @@ -1055,7 +1066,7 @@ class PurgeProductsRequest(proto.Message): This field is a member of `oneof`_ ``target``. delete_orphan_products (bool): If delete_orphan_products is true, all Products that are not - in any ProductSet will be deleted. + in any ProductSet will be deleted. This field is a member of `oneof`_ ``target``. parent (str): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py index dc4a2a637e54..69949ab2ec73 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py @@ -36,12 +36,19 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like - this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> - Symbol Each structural component, starting from Page, may further - have their own properties. Properties describe detected languages, - breaks etc.. Please refer to the `TextAnnotation.TextProperty - `__ message + text. The hierarchy of an OCR extracted text structure is like this: + + TextAnnotation contains a structured representation of OCR extracted text. + The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + + TextAnnotation contains a structured representation of OCR extracted + text. The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each + structural component, starting from Page, may further have their own + properties. Properties describe detected languages, breaks etc.. + Please refer to the `TextAnnotation.TextProperty + `__ message definition below for more detail. Attributes: @@ -57,7 +64,7 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -96,7 +103,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -209,24 +216,20 @@ class Block(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: + * when the text is horizontal it might look like: - :: + 0----1 + | | + 3----2 - 0----1 - | | - 3----2 + * when it's rotated 180 degrees around the top-left corner + it becomes: - - when it's rotated 180 degrees around the top-left corner - it becomes: + 2----3 + | | + 1----0 - :: - - 2----3 - | | - 1----0 - - and the vertex order will still be (0, 1, 2, 3). + and the vertex order will still be (0, 1, 2, 3). paragraphs (MutableSequence[google.cloud.vision_v1.types.Paragraph]): List of paragraphs in this block (if this blocks is of type text). @@ -302,11 +305,24 @@ class Paragraph(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertex order will - still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertex order will + still be (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1.types.Word]): List of all words in this paragraph. confidence (float): @@ -348,11 +364,24 @@ class Word(proto.Message): represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertex order will - still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertex order will + still be (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural @@ -396,11 +425,24 @@ class Symbol(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertex order will - still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertex order will + still be (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py index a0852ab4f637..11ce1af125ac 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py @@ -160,7 +160,7 @@ class WebLabel(proto.Message): Label for extra metadata. language_code (str): The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py index 9326456bc422..8c05c098940a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py @@ -88,9 +88,9 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""Users describe the type of Google Cloud Vision API tasks to perform - over images by using *Feature*s. Each Feature indicates a type of - image detection task to perform. Features encode the Cloud Vision - API vertical to operate on and the number of top-scoring results to + over images by using *Feature*s. Each Feature indicates a type of + image detection task to perform. Features encode the Cloud Vision + API vertical to operate on and the number of top-scoring results to return. Attributes: @@ -99,9 +99,9 @@ class Feature(proto.Message): max_results (int): Maximum number of results of this type. model (str): - Model to use for the feature. Supported values: + Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -168,21 +168,21 @@ class ImageSource(proto.Message): Attributes: gcs_image_uri (str): - NOTE: For new code ``image_uri`` below is preferred. Google + NOTE: For new code ``image_uri`` below is preferred. Google Cloud Storage image URI, which must be in the following - form: ``gs://bucket_name/object_name`` (for details, see `Google Cloud Storage - Request URIs + form: ``gs://bucket_name/object_name`` (for details, see `Google Cloud Storage + Request URIs `__). NOTE: Cloud Storage object versioning is not supported. image_uri (str): - Image URI which supports: 1) Google Cloud Storage image - URI, which must be in the following form: ``gs://bucket_name/object_name`` (for - details, see `Google Cloud Storage Request URIs + Image URI which supports: 1) Google Cloud Storage image URI, + which must be in the following form: ``gs://bucket_name/object_name`` (for details, + see `Google Cloud Storage Request URIs `__). - NOTE: Cloud Storage object versioning is not supported. 2) - Publicly accessible image HTTP/HTTPS URL. This is preferred - over the legacy ``gcs_image_uri`` above. When both ``gcs_image_uri`` and - ``image_uri`` are specified, ``image_uri`` takes precedence. + NOTE: Cloud Storage object versioning is not supported. 2) + Publicly accessible image HTTP/HTTPS URL. This is preferred + over the legacy ``gcs_image_uri`` above. When both ``gcs_image_uri`` and + ``image_uri`` are specified, ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -200,13 +200,13 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. Note: as + Image content, represented as a stream of bytes. Note: as with all ``bytes`` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p1beta1.types.ImageSource): Google Cloud Storage image location. If both ``content`` and - ``source`` are provided for an image, ``content`` takes - precedence and is used to perform the image annotation + ``source`` are provided for an image, ``content`` takes + precedence and is used to perform the image annotation request. """ @@ -228,36 +228,36 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale, as returned - in ``ImageParams``. The bounding box is computed to "frame" the - face in accordance with human expectations. It is based on - the landmarker results. Note that one or more x and/or y - coordinates may not be generated in the ``BoundingPoly`` (the - polygon will be unbounded) if only a partial face appears - in the image to be annotated. + bounding box are in the original image's scale, as returned + in ``ImageParams``. The bounding box is computed to "frame" the + face in accordance with human expectations. It is based on + the landmarker results. Note that one or more x and/or y + coordinates may not be generated in the ``BoundingPoly`` (the + polygon will be unbounded) if only a partial face appears in + the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): The ``fd_bounding_poly`` bounding polygon is tighter than the ``boundingPoly``, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p1beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the - face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the face. + Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. + the face is pointing relative to the vertical plane + perpendicular to the image. Range [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's - horizontal plane. Range [-180,180]. + that the face is pointing relative to the image's horizontal + plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -289,9 +289,9 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. Left and right are defined from the - vantage of the viewer of the image without considering mirror - projections typical of photos. So, ``LEFT_EYE``, typically, is the + r"""Face landmark (feature) type. Left and right are defined from the + vantage of the viewer of the image without considering mirror + projections typical of photos. So, ``LEFT_EYE``, typically, is the person's right eye. Values: @@ -532,8 +532,8 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API + Opaque entity ID. Some IDs may be available in `Google + Knowledge Graph Search API `__. locale (str): The language code for the locale in which the entity textual @@ -544,30 +544,30 @@ class EntityAnnotation(proto.Message): score (float): Overall score of the result. Range [0, 1]. confidence (float): - The accuracy of the entity detection in an image. For + The accuracy of the entity detection in an image. For example, for an image in which the "Eiffel Tower" entity is - detected, this field represents the confidence that there - is a tower in the query image. Range [0, 1]. + detected, this field represents the confidence that there is + a tower in the query image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): - Image region to which this entity belongs. Not produced for + Image region to which this entity belongs. Not produced for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p1beta1.types.LocationInfo]): The location information for the detected entity. Multiple ``LocationInfo`` elements can be present because one location may indicate the location of the scene in the image, and another - location may indicate the location of the place where the - image was taken. Location information is usually present - for landmarks. + location may indicate the location of the place where the + image was taken. Location information is usually present for + landmarks. properties (MutableSequence[google.cloud.vision_v1p1beta1.types.Property]): Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies + (name/value) fields, such a score or string that qualifies the entity. """ @@ -758,7 +758,7 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): The bounding polygon for the crop region. The coordinates of - the bounding box are in the original image's scale, as + the bounding box are in the original image's scale, as returned in ``ImageParams``. confidence (float): Confidence of this being a salient region. Range [0, 1]. @@ -836,13 +836,13 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -867,14 +867,14 @@ class ImageContext(proto.Message): location of the image. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In rare + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it - will be a significant hindrance if the hint is wrong). Text - detection returns an error if one or more of the specified - languages is not one of the `supported languages + will be a significant hindrance if the hint is wrong). Text + detection returns an error if one or more of the specified + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p1beta1.types.CropHintsParams): Parameters for crop hints annotation request. @@ -979,8 +979,8 @@ class AnnotateImageResponse(proto.Message): If present, web detection has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the operation. - Note that filled-in image annotations are guaranteed to be + If set, represents the error message for the operation. Note + that filled-in image annotations are guaranteed to be correct, even when ``error`` is set. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py index a11fcc15b6e0..a75a9fa65cf8 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py @@ -36,11 +36,18 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like - this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> - Symbol Each structural component, starting from Page, may further - have their own properties. Properties describe detected languages, - breaks etc.. Please refer to the `TextAnnotation.TextProperty + text. The hierarchy of an OCR extracted text structure is like this: + + TextAnnotation contains a structured representation of OCR extracted text. + The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + + TextAnnotation contains a structured representation of OCR extracted + text. The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each + structural component, starting from Page, may further have their own + properties. Properties describe detected languages, breaks etc.. + Please refer to the `TextAnnotation.TextProperty `__ message definition below for more detail. @@ -57,7 +64,7 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -96,7 +103,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -207,11 +214,24 @@ class Block(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertice order will + still be (0, 1, 2, 3). paragraphs (MutableSequence[google.cloud.vision_v1p1beta1.types.Paragraph]): List of paragraphs in this block (if this blocks is of type text). @@ -287,11 +307,24 @@ class Paragraph(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertice order will + still be (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1p1beta1.types.Word]): List of words in this paragraph. confidence (float): @@ -333,11 +366,24 @@ class Word(proto.Message): represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertice order will + still be (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1p1beta1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural @@ -381,11 +427,24 @@ class Symbol(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertice order will + still be (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py index d7733d016960..bdfaf20fc558 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py @@ -158,7 +158,7 @@ class WebLabel(proto.Message): Label for extra metadata. language_code (str): The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py index ae3958e86973..fac3e531df27 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py @@ -415,10 +415,10 @@ async def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Run async image detection and annotation for a list of generic - files (e.g. PDF) which may contain multiple pages and multiple - images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + files (e.g. PDF) which may contain multiple pages and multiple + images per page. Progress and results can be retrieved through + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -474,8 +474,8 @@ async def sample_async_batch_annotate_files(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file - annotation request. + :class:`google.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesResponse` + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py index 20b4d0cf0d5a..5c45ebfbd0da 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py @@ -833,10 +833,10 @@ def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Run async image detection and annotation for a list of generic - files (e.g. PDF) which may contain multiple pages and multiple - images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + files (e.g. PDF) which may contain multiple pages and multiple + images per page. Progress and results can be retrieved through + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -892,8 +892,8 @@ def sample_async_batch_annotate_files(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file - annotation request. + :class:`google.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesResponse` + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py index 14856d1d6389..987a634073ed 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py @@ -381,10 +381,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run async image detection and annotation for a list of generic - files (e.g. PDF) which may contain multiple pages and multiple - images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + files (e.g. PDF) which may contain multiple pages and multiple + images per page. Progress and results can be retrieved through + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py index 5ec85ee343fd..2d1bb1461b47 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py @@ -390,10 +390,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run async image detection and annotation for a list of generic - files (e.g. PDF) which may contain multiple pages and multiple - images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + files (e.g. PDF) which may contain multiple pages and multiple + images per page. Progress and results can be retrieved through + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` + (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py index 1813e6c74642..64396d3d6d6b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py @@ -100,8 +100,8 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the - maximum number of results to return for that type. Multiple - ``Feature`` objects can be specified in the ``features`` list. + maximum number of results to return for that type. Multiple + ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p2beta1.types.Feature.Type): @@ -110,9 +110,9 @@ class Feature(proto.Message): Maximum number of results of this type. Does not apply to ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): - Model to use for the feature. Supported values: + Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -133,8 +133,8 @@ class Type(proto.Enum): Run label detection. TEXT_DETECTION (5): Run text detection / optical character recognition (OCR). - Text detection is optimized for areas of text within a - larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` + Text detection is optimized for areas of text within a + larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both @@ -185,31 +185,34 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud Storage - Request URIs + The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google Cloud Storage + Request URIs `__ for more info. image_uri (str): The URI of the source image. Can be either: - 1. A Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. - Object versioning is not supported. See `Google Cloud - Storage Request URIs - `__ - for more info. + 1. A Google Cloud Storage URI of the form + + 1. A Google Cloud Storage URI of the form + ``gs://bucket_name/object_name``. Object versioning is not supported. See + `Google Cloud Storage Request + URIs `__ for more + info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from HTTP/HTTPS URLs, Google cannot guarantee - that the request will be completed. Your request may - fail if the specified host denies the request (e.g. due - to request throttling or DOS prevention), or if Google - throttles requests to the site for abuse prevention. You - should not depend on externally-hosted images for - production applications. + images from + + 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from + HTTP/HTTPS URLs, Google cannot guarantee that the request will be + completed. Your request may fail if the specified host denies the + request (e.g. due to request throttling or DOS prevention), or if Google + throttles requests to the site for abuse prevention. You should not + depend on externally-hosted images for production applications. When both ``gcs_image_uri`` and ``image_uri`` are specified, ``image_uri`` - takes precedence. + takes precedence. """ gcs_image_uri: str = proto.Field( @@ -227,13 +230,13 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. Note: As + Image content, represented as a stream of bytes. Note: As with all ``bytes`` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p2beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided for - an image, ``content`` takes precedence and is used to perform + image URL. If both ``content`` and ``source`` are provided for + an image, ``content`` takes precedence and is used to perform the image annotation request. """ @@ -255,36 +258,36 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale, as returned - in ``ImageParams``. The bounding box is computed to "frame" the - face in accordance with human expectations. It is based on - the landmarker results. Note that one or more x and/or y - coordinates may not be generated in the ``BoundingPoly`` (the - polygon will be unbounded) if only a partial face appears - in the image to be annotated. + bounding box are in the original image's scale, as returned + in ``ImageParams``. The bounding box is computed to "frame" the + face in accordance with human expectations. It is based on + the landmarker results. Note that one or more x and/or y + coordinates may not be generated in the ``BoundingPoly`` (the + polygon will be unbounded) if only a partial face appears in + the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): The ``fd_bounding_poly`` bounding polygon is tighter than the ``boundingPoly``, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p2beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the - face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the face. + Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. + the face is pointing relative to the vertical plane + perpendicular to the image. Range [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's - horizontal plane. Range [-180,180]. + that the face is pointing relative to the image's horizontal + plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -316,9 +319,9 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. Left and right are defined from the - vantage of the viewer of the image without considering mirror - projections typical of photos. So, ``LEFT_EYE``, typically, is the + r"""Face landmark (feature) type. Left and right are defined from the + vantage of the viewer of the image without considering mirror + projections typical of photos. So, ``LEFT_EYE``, typically, is the person's right eye. Values: @@ -559,8 +562,8 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API + Opaque entity ID. Some IDs may be available in `Google + Knowledge Graph Search API `__. locale (str): The language code for the locale in which the entity textual @@ -571,31 +574,31 @@ class EntityAnnotation(proto.Message): score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field + **Deprecated. Use ``score`` instead.** The accuracy of the + entity detection in an image. For example, for an image in + which the "Eiffel Tower" entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): - Image region to which this entity belongs. Not produced for + Image region to which this entity belongs. Not produced for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p2beta1.types.LocationInfo]): The location information for the detected entity. Multiple ``LocationInfo`` elements can be present because one location may indicate the location of the scene in the image, and another - location may indicate the location of the place where the - image was taken. Location information is usually present - for landmarks. + location may indicate the location of the place where the + image was taken. Location information is usually present for + landmarks. properties (MutableSequence[google.cloud.vision_v1p2beta1.types.Property]): Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies + (name/value) fields, such a score or string that qualifies the entity. """ @@ -786,7 +789,7 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): The bounding polygon for the crop region. The coordinates of - the bounding box are in the original image's scale, as + the bounding box are in the original image's scale, as returned in ``ImageParams``. confidence (float): Confidence of this being a salient region. Range [0, 1]. @@ -864,13 +867,13 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -894,14 +897,14 @@ class ImageContext(proto.Message): Not used. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In rare + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it - will be a significant hindrance if the hint is wrong). Text - detection returns an error if one or more of the specified - languages is not one of the `supported languages + will be a significant hindrance if the hint is wrong). Text + detection returns an error if one or more of the specified + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p2beta1.types.CropHintsParams): Parameters for crop hints annotation request. @@ -1030,8 +1033,8 @@ class AnnotateImageResponse(proto.Message): If present, web detection has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the operation. - Note that filled-in image annotations are guaranteed to be + If set, represents the error message for the operation. Note + that filled-in image annotations are guaranteed to be correct, even when ``error`` is set. context (google.cloud.vision_v1p2beta1.types.ImageAnnotationContext): If present, contextual information is needed @@ -1280,16 +1283,16 @@ class OutputConfig(proto.Message): the output(s) to. batch_size (int): The max number of response protos to put into each output - JSON file on GCS. The valid range is [1, 100]. If not + JSON file on GCS. The valid range is [1, 100]. If not specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response - protos will be generated. If ``batch_size`` = 20, then 5 json - files each containing 20 response protos will be written - under the prefix ``gcs_destination``.``uri``. + protos will be generated. If ``batch_size`` = 20, then 5 json + files each containing 20 response protos will be written + under the prefix ``gcs_destination``.``uri``. Currently, batch_size only applies to GcsDestination, with - potential future support for other output configurations. + potential future support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1327,23 +1330,24 @@ class GcsDestination(proto.Message): Attributes: uri (str): Google Cloud Storage URI where the results will be stored. - Results will be in JSON format and preceded by its - corresponding input URI. This field can either represent a - single file, or a prefix for multiple outputs. Prefixes - must end in a ``/``. + Results will be in JSON format and preceded by its + corresponding input URI. This field can either represent a + single file, or a prefix for multiple outputs. Prefixes must + end in a ``/``. Examples: - * File: gs://bucket-name/filename.json * Prefix: - gs://bucket-name/prefix/here/ + * File: gs://bucket-name/filename.json + + * Prefix: gs://bucket-name/prefix/here/ * File: gs://bucket-name/prefix/here If multiple outputs, each response is still - AnnotateFileResponse, each of which contains some subset of - the full list of AnnotateImageResponse. Multiple outputs - can happen if, for example, the output JSON is too large - and overflows into multiple sharded files. + AnnotateFileResponse, each of which contains some subset of + the full list of AnnotateImageResponse. Multiple outputs can + happen if, for example, the output JSON is too large and + overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py index 254596fe2167..c7e783a90df0 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py @@ -36,11 +36,18 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like - this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> - Symbol Each structural component, starting from Page, may further - have their own properties. Properties describe detected languages, - breaks etc.. Please refer to the `TextAnnotation.TextProperty + text. The hierarchy of an OCR extracted text structure is like this: + + TextAnnotation contains a structured representation of OCR extracted text. + The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + + TextAnnotation contains a structured representation of OCR extracted + text. The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each + structural component, starting from Page, may further have their own + properties. Properties describe detected languages, breaks etc.. + Please refer to the `TextAnnotation.TextProperty `__ message definition below for more detail. @@ -57,7 +64,7 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -96,7 +103,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -209,24 +216,20 @@ class Block(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: + * when the text is horizontal it might look like: - :: + 0----1 + | | + 3----2 - 0----1 - | | - 3----2 + * when it's rotated 180 degrees around the top-left corner + it becomes: - - when it's rotated 180 degrees around the top-left corner - it becomes: + 2----3 + | | + 1----0 - :: - - 2----3 - | | - 1----0 - - and the vertice order will still be (0, 1, 2, 3). + and the vertice order will still be (0, 1, 2, 3). paragraphs (MutableSequence[google.cloud.vision_v1p2beta1.types.Paragraph]): List of paragraphs in this block (if this blocks is of type text). @@ -302,11 +305,24 @@ class Paragraph(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertice order will + still be (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1p2beta1.types.Word]): List of words in this paragraph. confidence (float): @@ -348,11 +364,24 @@ class Word(proto.Message): represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertice order will + still be (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1p2beta1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural @@ -396,11 +425,24 @@ class Symbol(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertice order will + still be (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py index 3f7f7835d72b..648d4e415953 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py @@ -158,7 +158,7 @@ class WebLabel(proto.Message): Label for extra metadata. language_code (str): The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py index c82871e80464..859e3f2d75dc 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py @@ -418,10 +418,10 @@ async def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -477,8 +477,8 @@ async def sample_async_batch_annotate_files(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file - annotation request. + :class:`google.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesResponse` + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py index 27c218eb78d3..33edfcb6ee2f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py @@ -878,10 +878,10 @@ def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -937,8 +937,8 @@ def sample_async_batch_annotate_files(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file - annotation request. + :class:`google.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesResponse` + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py index fe29fa7ffd30..da3b17652595 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py @@ -381,10 +381,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py index 11205280e166..d581414a7664 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py @@ -390,10 +390,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py index 2fc414f9895a..22fd04b0aff0 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py @@ -69,12 +69,13 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups + to limit identification. In parallel, @@ -382,10 +383,10 @@ async def sample_create_product_set(): should not be set. product_set_id (:class:`str`): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field @@ -643,7 +644,7 @@ async def sample_get_product_set(): name (:class:`str`): Required. Resource name of the ProductSet to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -726,14 +727,16 @@ async def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. Only display_name can - be updated currently. + r"""Makes changes to a ProductSet resource. Only display_name can be + updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. .. code-block:: python @@ -772,8 +775,8 @@ async def sample_update_product_set(): should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field @@ -861,7 +864,7 @@ async def delete_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Permanently deletes a ProductSet. All Products and - ReferenceImages in the ProductSet will be deleted. + ReferenceImages in the ProductSet will be deleted. The actual image files are not deleted from Google Cloud Storage. @@ -899,7 +902,7 @@ async def sample_delete_product_set(): name (:class:`str`): Required. Resource name of the ProductSet to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -976,8 +979,10 @@ async def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid. @@ -1015,7 +1020,7 @@ async def sample_create_product(): Required. The project in which the Product should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1027,10 +1032,10 @@ async def sample_create_product(): should not be set. product_id (:class:`str`): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field @@ -1153,7 +1158,7 @@ async def sample_list_products(): Required. The project OR ProductSet from which Products should be listed. - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1281,7 +1286,7 @@ async def sample_get_product(): name (:class:`str`): Required. Resource name of the Product to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1359,21 +1364,24 @@ async def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. Only display_name, + r"""Makes changes to a Product resource. Only display_name, description and labels can be updated right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the Product does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1414,9 +1422,9 @@ async def sample_update_product(): should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1500,8 +1508,8 @@ async def delete_product( r"""Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right - away, but search queries against ProductSets containing the - product may still work until all related caches are refreshed. + away, but search queries against ProductSets containing the + product may still work until all related caches are refreshed. Possible errors: @@ -1536,7 +1544,7 @@ async def sample_delete_product(): name (:class:`str`): Required. Resource name of product to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1612,23 +1620,26 @@ async def create_reference_image( The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. + than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. .. code-block:: python @@ -1667,7 +1678,7 @@ async def sample_create_reference_image(): Required. Resource name of the product in which to create the reference image. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1682,11 +1693,11 @@ async def sample_create_reference_image(): should not be set. reference_image_id (:class:`str`): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this - value as the resource id. If it is already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters long. It cannot contain the - character ``/``. + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1702,7 +1713,7 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1772,8 +1783,8 @@ async def delete_reference_image( r"""Permanently deletes a reference image. The image metadata will be deleted right away, but search - queries against ProductSets containing the image may still work - until all related caches are refreshed. + queries against ProductSets containing the image may still work + until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. @@ -1888,8 +1899,9 @@ async def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. + + * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. .. code-block:: python @@ -1926,7 +1938,7 @@ async def sample_list_reference_images(): Required. Resource name of the product containing the reference images. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2075,7 +2087,7 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2140,7 +2152,7 @@ async def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -2180,7 +2192,7 @@ async def sample_add_product_to_product_set(): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2189,7 +2201,7 @@ async def sample_add_product_to_product_set(): Required. The resource name for the Product to be added to this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2302,7 +2314,7 @@ async def sample_remove_product_from_product_set(): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2311,7 +2323,7 @@ async def sample_remove_product_from_product_set(): Required. The resource name for the Product to be removed from this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2386,8 +2398,8 @@ async def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -2428,7 +2440,7 @@ async def sample_list_products_in_product_set(): Required. The ProductSet resource for which to retrieve Products. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2526,15 +2538,15 @@ async def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -2600,14 +2612,14 @@ async def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets`` + :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets` method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ method - in the returned `google.longrunning.Operation.response - `__ field. + `__ method + in the returned `google.longrunning.Operation.response + `__ field. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py index 85714bf5e432..4fbd8a8821f4 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py @@ -113,12 +113,13 @@ def get_transport_class( class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups + to limit identification. In parallel, @@ -863,10 +864,10 @@ def sample_create_product_set(): should not be set. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field @@ -1118,7 +1119,7 @@ def sample_get_product_set(): name (str): Required. Resource name of the ProductSet to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1198,14 +1199,16 @@ def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. Only display_name can - be updated currently. + r"""Makes changes to a ProductSet resource. Only display_name can be + updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. .. code-block:: python @@ -1244,8 +1247,8 @@ def sample_update_product_set(): should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field @@ -1330,7 +1333,7 @@ def delete_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Permanently deletes a ProductSet. All Products and - ReferenceImages in the ProductSet will be deleted. + ReferenceImages in the ProductSet will be deleted. The actual image files are not deleted from Google Cloud Storage. @@ -1368,7 +1371,7 @@ def sample_delete_product_set(): name (str): Required. Resource name of the ProductSet to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1442,8 +1445,10 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid. @@ -1481,7 +1486,7 @@ def sample_create_product(): Required. The project in which the Product should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1493,10 +1498,10 @@ def sample_create_product(): should not be set. product_id (str): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field @@ -1616,7 +1621,7 @@ def sample_list_products(): Required. The project OR ProductSet from which Products should be listed. - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1741,7 +1746,7 @@ def sample_get_product(): name (str): Required. Resource name of the Product to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1816,21 +1821,24 @@ def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. Only display_name, + r"""Makes changes to a Product resource. Only display_name, description and labels can be updated right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the Product does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1871,9 +1879,9 @@ def sample_update_product(): should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1954,8 +1962,8 @@ def delete_product( r"""Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right - away, but search queries against ProductSets containing the - product may still work until all related caches are refreshed. + away, but search queries against ProductSets containing the + product may still work until all related caches are refreshed. Possible errors: @@ -1990,7 +1998,7 @@ def sample_delete_product(): name (str): Required. Resource name of product to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2063,23 +2071,26 @@ def create_reference_image( The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. + than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. .. code-block:: python @@ -2118,7 +2129,7 @@ def sample_create_reference_image(): Required. Resource name of the product in which to create the reference image. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2133,11 +2144,11 @@ def sample_create_reference_image(): should not be set. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this - value as the resource id. If it is already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters long. It cannot contain the - character ``/``. + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2153,7 +2164,7 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2220,8 +2231,8 @@ def delete_reference_image( r"""Permanently deletes a reference image. The image metadata will be deleted right away, but search - queries against ProductSets containing the image may still work - until all related caches are refreshed. + queries against ProductSets containing the image may still work + until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. @@ -2333,8 +2344,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. + + * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. .. code-block:: python @@ -2371,7 +2383,7 @@ def sample_list_reference_images(): Required. Resource name of the product containing the reference images. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2517,7 +2529,7 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1p3beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2579,7 +2591,7 @@ def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -2619,7 +2631,7 @@ def sample_add_product_to_product_set(): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2628,7 +2640,7 @@ def sample_add_product_to_product_set(): Required. The resource name for the Product to be added to this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2740,7 +2752,7 @@ def sample_remove_product_from_product_set(): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2749,7 +2761,7 @@ def sample_remove_product_from_product_set(): Required. The resource name for the Product to be removed from this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2823,8 +2835,8 @@ def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -2865,7 +2877,7 @@ def sample_list_products_in_product_set(): Required. The ProductSet resource for which to retrieve Products. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2962,15 +2974,15 @@ def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -3036,14 +3048,14 @@ def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets`` + :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets` method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ method - in the returned `google.longrunning.Operation.response - `__ field. + `__ method + in the returned `google.longrunning.Operation.response + `__ field. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py index dd7c8bd28eb6..6a2bcd14428b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py @@ -113,12 +113,13 @@ class ProductSearchGrpcTransport(ProductSearchTransport): """gRPC backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups + to limit identification. In parallel, @@ -466,14 +467,16 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. Only display_name can - be updated currently. + Makes changes to a ProductSet resource. Only display_name can be + updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -500,7 +503,7 @@ def delete_product_set( r"""Return a callable for the delete product set method over gRPC. Permanently deletes a ProductSet. All Products and - ReferenceImages in the ProductSet will be deleted. + ReferenceImages in the ProductSet will be deleted. The actual image files are not deleted from Google Cloud Storage. @@ -540,8 +543,10 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid. @@ -638,21 +643,24 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. Only display_name, + Makes changes to a Product resource. Only display_name, description and labels can be updated right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the Product does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is present in update_mask. Returns: @@ -682,8 +690,8 @@ def delete_product( Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right - away, but search queries against ProductSets containing the - product may still work until all related caches are refreshed. + away, but search queries against ProductSets containing the + product may still work until all related caches are refreshed. Possible errors: @@ -720,23 +728,26 @@ def create_reference_image( The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. + than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -767,8 +778,8 @@ def delete_reference_image( Permanently deletes a reference image. The image metadata will be deleted right away, but search - queries against ProductSets containing the image may still work - until all related caches are refreshed. + queries against ProductSets containing the image may still work + until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. @@ -808,8 +819,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. + + * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. Returns: @@ -872,7 +884,7 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -947,8 +959,8 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -984,15 +996,15 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py index f7a6a1acb983..57030b23f630 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py @@ -119,12 +119,13 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): """gRPC AsyncIO backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups + to limit identification. In parallel, @@ -475,14 +476,16 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. Only display_name can - be updated currently. + Makes changes to a ProductSet resource. Only display_name can be + updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -511,7 +514,7 @@ def delete_product_set( r"""Return a callable for the delete product set method over gRPC. Permanently deletes a ProductSet. All Products and - ReferenceImages in the ProductSet will be deleted. + ReferenceImages in the ProductSet will be deleted. The actual image files are not deleted from Google Cloud Storage. @@ -552,8 +555,10 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid. @@ -652,21 +657,24 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. Only display_name, + Makes changes to a Product resource. Only display_name, description and labels can be updated right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the Product does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is present in update_mask. Returns: @@ -698,8 +706,8 @@ def delete_product( Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right - away, but search queries against ProductSets containing the - product may still work until all related caches are refreshed. + away, but search queries against ProductSets containing the + product may still work until all related caches are refreshed. Possible errors: @@ -736,23 +744,26 @@ def create_reference_image( The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. + than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -783,8 +794,8 @@ def delete_reference_image( Permanently deletes a reference image. The image metadata will be deleted right away, but search - queries against ProductSets containing the image may still work - until all related caches are refreshed. + queries against ProductSets containing the image may still work + until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. @@ -824,8 +835,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. + + * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. Returns: @@ -889,7 +901,7 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -965,8 +977,8 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -1003,15 +1015,15 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py index f4a5c1222acc..1695ffc9ea49 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py @@ -950,12 +950,13 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): """REST backend synchronous transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups + to limit identification. In parallel, @@ -1549,7 +1550,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ @@ -2325,7 +2326,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py index 0d1be5b3e8bc..a35db42c9570 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py @@ -105,8 +105,8 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the - maximum number of results to return for that type. Multiple - ``Feature`` objects can be specified in the ``features`` list. + maximum number of results to return for that type. Multiple + ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p3beta1.types.Feature.Type): @@ -115,9 +115,9 @@ class Feature(proto.Message): Maximum number of results of this type. Does not apply to ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): - Model to use for the feature. Supported values: + Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -138,8 +138,8 @@ class Type(proto.Enum): Run label detection. TEXT_DETECTION (5): Run text detection / optical character recognition (OCR). - Text detection is optimized for areas of text within a - larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` + Text detection is optimized for areas of text within a + larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both @@ -196,31 +196,34 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud Storage - Request URIs + The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google Cloud Storage + Request URIs `__ for more info. image_uri (str): The URI of the source image. Can be either: - 1. A Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. - Object versioning is not supported. See `Google Cloud - Storage Request URIs - `__ - for more info. + 1. A Google Cloud Storage URI of the form + + 1. A Google Cloud Storage URI of the form + ``gs://bucket_name/object_name``. Object versioning is not supported. See + `Google Cloud Storage Request + URIs `__ for more + info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from HTTP/HTTPS URLs, Google cannot guarantee - that the request will be completed. Your request may - fail if the specified host denies the request (e.g. due - to request throttling or DOS prevention), or if Google - throttles requests to the site for abuse prevention. You - should not depend on externally-hosted images for - production applications. + images from + + 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from + HTTP/HTTPS URLs, Google cannot guarantee that the request will be + completed. Your request may fail if the specified host denies the + request (e.g. due to request throttling or DOS prevention), or if Google + throttles requests to the site for abuse prevention. You should not + depend on externally-hosted images for production applications. When both ``gcs_image_uri`` and ``image_uri`` are specified, ``image_uri`` - takes precedence. + takes precedence. """ gcs_image_uri: str = proto.Field( @@ -238,13 +241,13 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. Note: As + Image content, represented as a stream of bytes. Note: As with all ``bytes`` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p3beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided for - an image, ``content`` takes precedence and is used to perform + image URL. If both ``content`` and ``source`` are provided for + an image, ``content`` takes precedence and is used to perform the image annotation request. """ @@ -266,36 +269,36 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale, as returned - in ``ImageParams``. The bounding box is computed to "frame" the - face in accordance with human expectations. It is based on - the landmarker results. Note that one or more x and/or y - coordinates may not be generated in the ``BoundingPoly`` (the - polygon will be unbounded) if only a partial face appears - in the image to be annotated. + bounding box are in the original image's scale, as returned + in ``ImageParams``. The bounding box is computed to "frame" the + face in accordance with human expectations. It is based on + the landmarker results. Note that one or more x and/or y + coordinates may not be generated in the ``BoundingPoly`` (the + polygon will be unbounded) if only a partial face appears in + the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): The ``fd_bounding_poly`` bounding polygon is tighter than the ``boundingPoly``, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p3beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the - face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the face. + Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. + the face is pointing relative to the vertical plane + perpendicular to the image. Range [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's - horizontal plane. Range [-180,180]. + that the face is pointing relative to the image's horizontal + plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -327,9 +330,9 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. Left and right are defined from the - vantage of the viewer of the image without considering mirror - projections typical of photos. So, ``LEFT_EYE``, typically, is the + r"""Face landmark (feature) type. Left and right are defined from the + vantage of the viewer of the image without considering mirror + projections typical of photos. So, ``LEFT_EYE``, typically, is the person's right eye. Values: @@ -570,8 +573,8 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API + Opaque entity ID. Some IDs may be available in `Google + Knowledge Graph Search API `__. locale (str): The language code for the locale in which the entity textual @@ -582,31 +585,31 @@ class EntityAnnotation(proto.Message): score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field + **Deprecated. Use ``score`` instead.** The accuracy of the + entity detection in an image. For example, for an image in + which the "Eiffel Tower" entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): - Image region to which this entity belongs. Not produced for + Image region to which this entity belongs. Not produced for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p3beta1.types.LocationInfo]): The location information for the detected entity. Multiple ``LocationInfo`` elements can be present because one location may indicate the location of the scene in the image, and another - location may indicate the location of the place where the - image was taken. Location information is usually present - for landmarks. + location may indicate the location of the place where the + image was taken. Location information is usually present for + landmarks. properties (MutableSequence[google.cloud.vision_v1p3beta1.types.Property]): Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies + (name/value) fields, such a score or string that qualifies the entity. """ @@ -660,7 +663,7 @@ class LocalizedObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. @@ -840,7 +843,7 @@ class CropHint(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): The bounding polygon for the crop region. The coordinates of - the bounding box are in the original image's scale, as + the bounding box are in the original image's scale, as returned in ``ImageParams``. confidence (float): Confidence of this being a salient region. Range [0, 1]. @@ -918,13 +921,13 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -948,14 +951,14 @@ class ImageContext(proto.Message): Not used. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In rare + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it - will be a significant hindrance if the hint is wrong). Text - detection returns an error if one or more of the specified - languages is not one of the `supported languages + will be a significant hindrance if the hint is wrong). Text + detection returns an error if one or more of the specified + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p3beta1.types.CropHintsParams): Parameters for crop hints annotation request. @@ -1098,8 +1101,8 @@ class AnnotateImageResponse(proto.Message): If present, product search has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the operation. - Note that filled-in image annotations are guaranteed to be + If set, represents the error message for the operation. Note + that filled-in image annotations are guaranteed to be correct, even when ``error`` is set. context (google.cloud.vision_v1p3beta1.types.ImageAnnotationContext): If present, contextual information is needed @@ -1360,16 +1363,16 @@ class OutputConfig(proto.Message): the output(s) to. batch_size (int): The max number of response protos to put into each output - JSON file on Google Cloud Storage. The valid range is [1, + JSON file on Google Cloud Storage. The valid range is [1, 100]. If not specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response - protos will be generated. If ``batch_size`` = 20, then 5 json - files each containing 20 response protos will be written - under the prefix ``gcs_destination``.``uri``. + protos will be generated. If ``batch_size`` = 20, then 5 json + files each containing 20 response protos will be written + under the prefix ``gcs_destination``.``uri``. Currently, batch_size only applies to GcsDestination, with - potential future support for other output configurations. + potential future support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1407,23 +1410,24 @@ class GcsDestination(proto.Message): Attributes: uri (str): Google Cloud Storage URI where the results will be stored. - Results will be in JSON format and preceded by its - corresponding input URI. This field can either represent a - single file, or a prefix for multiple outputs. Prefixes - must end in a ``/``. + Results will be in JSON format and preceded by its + corresponding input URI. This field can either represent a + single file, or a prefix for multiple outputs. Prefixes must + end in a ``/``. Examples: - * File: gs://bucket-name/filename.json * Prefix: - gs://bucket-name/prefix/here/ + * File: gs://bucket-name/filename.json + + * Prefix: gs://bucket-name/prefix/here/ * File: gs://bucket-name/prefix/here If multiple outputs, each response is still - AnnotateFileResponse, each of which contains some subset of - the full list of AnnotateImageResponse. Multiple outputs - can happen if, for example, the output JSON is too large - and overflows into multiple sharded files. + AnnotateFileResponse, each of which contains some subset of + the full list of AnnotateImageResponse. Multiple outputs can + happen if, for example, the output JSON is too large and + overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py index 7169ef05eb21..159931be2852 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py @@ -44,7 +44,7 @@ class ProductSearchParams(proto.Message): `__ to be searched for similar images. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -148,7 +148,7 @@ class ObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py index 78a03d623a91..55b9e517a16d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py @@ -67,7 +67,7 @@ class Product(proto.Message): name (str): The resource name of the product. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This field is ignored when creating a product. display_name (str): @@ -86,15 +86,15 @@ class Product(proto.Message): these should not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1p3beta1.types.Product.KeyValue]): Key-value pairs that can be attached to a product. At query - time, constraints can be specified based on the + time, constraints can be specified based on the product_labels. Note that integer values can be provided as strings, e.g. - "1199". Only strings with integer values can match a - range-based restriction which is to be supported soon. + "1199". Only strings with integer values can match a + range-based restriction which is to be supported soon. Multiple values can be assigned to the same key. One product - may have up to 100 product_labels. + may have up to 100 product_labels. """ class KeyValue(proto.Message): @@ -151,7 +151,7 @@ class ProductSet(proto.Message): name (str): The resource name of the ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. This field is ignored when creating a ProductSet. display_name (str): @@ -198,7 +198,7 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): r"""A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. Attributes: name (str): @@ -251,15 +251,15 @@ class CreateProductRequest(proto.Message): Required. The project in which the Product should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1p3beta1.types.Product): Required. The product to create. product_id (str): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. """ @@ -286,7 +286,7 @@ class ListProductsRequest(proto.Message): Required. The project OR ProductSet from which Products should be listed. - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -343,7 +343,7 @@ class GetProductRequest(proto.Message): name (str): Required. Resource name of the Product to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -362,9 +362,9 @@ class UpdateProductRequest(proto.Message): immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. """ product: "Product" = proto.Field( @@ -386,7 +386,7 @@ class DeleteProductRequest(proto.Message): name (str): Required. Resource name of product to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -408,10 +408,10 @@ class CreateProductSetRequest(proto.Message): Required. The ProductSet to create. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. """ @@ -495,7 +495,7 @@ class GetProductSetRequest(proto.Message): name (str): Required. Resource name of the ProductSet to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -513,8 +513,8 @@ class UpdateProductSetRequest(proto.Message): replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid mask path is ``display_name``. """ @@ -537,7 +537,7 @@ class DeleteProductSetRequest(proto.Message): name (str): Required. Resource name of the ProductSet to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -554,17 +554,17 @@ class CreateReferenceImageRequest(proto.Message): Required. Resource name of the product in which to create the reference image. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. reference_image (google.cloud.vision_v1p3beta1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this - value as the resource id. If it is already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters long. It cannot contain the - character ``/``. + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. """ parent: str = proto.Field( @@ -590,13 +590,13 @@ class ListReferenceImagesRequest(proto.Message): Required. Resource name of the product containing the reference images. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value of ``nextPageToken`` returned in a previous reference + is the value of ``nextPageToken`` returned in a previous reference image list request. Defaults to the first page if not specified. @@ -695,12 +695,12 @@ class AddProductToProductSetRequest(proto.Message): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be added to this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -721,12 +721,12 @@ class RemoveProductFromProductSetRequest(proto.Message): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be removed from this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -747,7 +747,7 @@ class ListProductsInProductSetRequest(proto.Message): Required. The ProductSet resource for which to retrieve Products. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -808,23 +808,32 @@ class ImportProductSetsGcsSource(proto.Message): The URI must start with ``gs://``. The format of the input csv file should be one image per - line. In each line, there are 6 columns. 1. image_uri 2, - image_id 3. product_set_id 4. product_id 5, - product_category 6, product_display_name 7, labels 8. - bounding_poly + line. In each line, there are 6 columns. + + 1. image_uri + + 2, image_id + + 3. product_set_id + + 4. product_id + + 5, product_category 6, product_display_name 7, labels + + 8. bounding_poly Columns 1, 3, 4, and 5 are required, other columns are - optional. A new ProductSet/Product with the same id will be - created on the fly if the ProductSet/Product specified by - product_set_id/product_id does not exist. + optional. A new ProductSet/Product with the same id will be + created on the fly if the ProductSet/Product specified by + product_set_id/product_id does not exist. The image_id field is optional but has to be unique if - provided. If it is empty, we will automatically assign an + provided. If it is empty, we will automatically assign an unique id to the image. The product_display_name field is optional. If it is empty, - a space (" ") is used as the place holder for the product - display_name, which can be updated later through the + a space (" ") is used as the place holder for the product + display_name, which can be updated later through the realtime API. If the Product with product_id already exists, the fields @@ -832,36 +841,37 @@ class ImportProductSetsGcsSource(proto.Message): ignored. If a Product doesn't exist and needs to be created on the - fly, the product_display_name field refers to + fly, the product_display_name field refers to `Product.display_name - `__, - the product_category field refers to - `Product.product_category + `__, the + product_category field refers to `Product.product_category `__, and the labels field refers to [Product.labels][]. Labels (optional) should be a line containing a list of - comma-separated key-value pairs, with the format - "key_1=value_1,key_2=value_2,...,key_n=value_n". + comma-separated key-value pairs, with the format + + Labels (optional) should be a line containing a list of comma-separated + key-value pairs, with the format + "key_1=value_1,key_2=value_2,...,key_n=value_n". The bounding_poly (optional) field is used to identify one - region of interest from the image in the same manner as - CreateReferenceImage. If no bounding_poly is specified, the - system will try to detect regions of interest - automatically. + region of interest from the image in the same manner as + CreateReferenceImage. If no bounding_poly is specified, the + system will try to detect regions of interest automatically. Note that the pipeline will resize the image if the image - resolution is too large to process (above 20MP). + resolution is too large to process (above 20MP). Also note that at most one bounding_poly is allowed per - line. If the image contains multiple regions of interest, - the csv should contain one line per region of interest. + line. If the image contains multiple regions of interest, + the csv should contain one line per region of interest. The bounding_poly column should contain an even number of - comma-separated numbers, with the format - "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative integers + comma-separated numbers, with the format + "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative integers should be used for absolute bounding polygons, and float - values in [0, 1] should be used for normalized bounding + values in [0, 1] should be used for normalized bounding polygons. """ @@ -923,21 +933,21 @@ class ImportProductSetsResponse(proto.Message): This message is returned by the `google.longrunning.Operations.GetOperation - `__ method in the - returned `google.longrunning.Operation.response - `__ field. + `__ method in the + returned `google.longrunning.Operation.response + `__ field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1p3beta1.types.ReferenceImage]): The list of reference_images that are imported successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): The rpc status for each ImportProductSet request, including - both successes and errors. + both successes and errors. The number of statuses here matches the number of lines in - the csv file, and statuses[i] stores the success or failure - status of processing the i-th line of the csv, starting - from line 0. + the csv file, and statuses[i] stores the success or failure + status of processing the i-th line of the csv, starting from + line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -956,7 +966,7 @@ class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. This is included in the ``metadata`` field of the ``Operation`` returned by - the ``GetOperation`` call of the ``google::longrunning::Operations`` service. + the ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1p3beta1.types.BatchOperationMetadata.State): @@ -967,7 +977,7 @@ class BatchOperationMetadata(proto.Message): end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and `google.longrunning.Operation.done - `__ is set to true. + `__ is set to true. """ class State(proto.Enum): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py index 51be9403be1d..d8909a5a9aa8 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py @@ -36,11 +36,18 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like - this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> - Symbol Each structural component, starting from Page, may further - have their own properties. Properties describe detected languages, - breaks etc.. Please refer to the `TextAnnotation.TextProperty + text. The hierarchy of an OCR extracted text structure is like this: + + TextAnnotation contains a structured representation of OCR extracted text. + The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + + TextAnnotation contains a structured representation of OCR extracted + text. The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each + structural component, starting from Page, may further have their own + properties. Properties describe detected languages, breaks etc.. + Please refer to the `TextAnnotation.TextProperty `__ message definition below for more detail. @@ -57,7 +64,7 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -96,7 +103,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -209,24 +216,20 @@ class Block(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: + * when the text is horizontal it might look like: - :: + 0----1 + | | + 3----2 - 0----1 - | | - 3----2 + * when it's rotated 180 degrees around the top-left corner + it becomes: - - when it's rotated 180 degrees around the top-left corner - it becomes: + 2----3 + | | + 1----0 - :: - - 2----3 - | | - 1----0 - - and the vertice order will still be (0, 1, 2, 3). + and the vertice order will still be (0, 1, 2, 3). paragraphs (MutableSequence[google.cloud.vision_v1p3beta1.types.Paragraph]): List of paragraphs in this block (if this blocks is of type text). @@ -302,11 +305,24 @@ class Paragraph(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertice order will + still be (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1p3beta1.types.Word]): List of words in this paragraph. confidence (float): @@ -348,11 +364,24 @@ class Word(proto.Message): represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertice order will + still be (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1p3beta1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural @@ -396,11 +425,24 @@ class Symbol(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertice order will + still be (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py index 82c8650c287f..887e53444d05 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py @@ -158,7 +158,7 @@ class WebLabel(proto.Message): Label for extra metadata. language_code (str): The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py index 9f6f078e5348..8d55489ba576 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py @@ -535,12 +535,12 @@ async def async_batch_annotate_images( r"""Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -603,8 +603,8 @@ async def sample_async_batch_annotate_images(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch image - annotation request. + :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse` + Response to an async batch image annotation request. """ # Create or coerce a protobuf request object. @@ -674,10 +674,10 @@ async def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -733,8 +733,8 @@ async def sample_async_batch_annotate_files(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file - annotation request. + :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesResponse` + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py index 1a465a27b6cb..2b13c618f704 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py @@ -992,12 +992,12 @@ def async_batch_annotate_images( r"""Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. .. code-block:: python @@ -1060,8 +1060,8 @@ def sample_async_batch_annotate_images(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse`` Response to an async batch image - annotation request. + :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesResponse` + Response to an async batch image annotation request. """ # Create or coerce a protobuf request object. @@ -1130,10 +1130,10 @@ def async_batch_annotate_files( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python @@ -1189,8 +1189,8 @@ def sample_async_batch_annotate_files(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesResponse`` Response to an async batch file - annotation request. + :class:`google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesResponse` + Response to an async batch file annotation request. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py index 57314f19c727..092400ce8822 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py @@ -420,12 +420,12 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -457,10 +457,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py index c94621ee3e7b..04ed7e953485 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py @@ -429,12 +429,12 @@ def async_batch_annotate_images( Run asynchronous image detection and annotation for a list of images. - Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` + Progress and results can be retrieved through the ``google.longrunning.Operations`` + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files - in customer GCS bucket, each json file containing + in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. Returns: @@ -467,10 +467,10 @@ def async_batch_annotate_files( r"""Return a callable for the async batch annotate files method over gRPC. Run asynchronous image detection and annotation for a list of - generic files, such as PDF files, which may contain multiple - pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + generic files, such as PDF files, which may contain multiple + pages and multiple images per page. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py index 7426c9e7b6fe..39c7e3900fb8 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py @@ -70,23 +70,26 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + - The API has a collection of + + `ProductSet `__ resources, + named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` + - The API has a collection of + + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + collection of + + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -383,10 +386,10 @@ async def sample_create_product_set(): should not be set. product_set_id (:class:`str`): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field @@ -644,7 +647,7 @@ async def sample_get_product_set(): name (:class:`str`): Required. Resource name of the ProductSet to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -727,14 +730,16 @@ async def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. Only display_name can - be updated currently. + r"""Makes changes to a ProductSet resource. Only display_name can be + updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. .. code-block:: python @@ -773,8 +778,8 @@ async def sample_update_product_set(): should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field @@ -896,7 +901,7 @@ async def sample_delete_product_set(): name (:class:`str`): Required. Resource name of the ProductSet to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -973,8 +978,10 @@ async def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid. @@ -1012,7 +1019,7 @@ async def sample_create_product(): Required. The project in which the Product should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1024,10 +1031,10 @@ async def sample_create_product(): should not be set. product_id (:class:`str`): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field @@ -1150,7 +1157,7 @@ async def sample_list_products(): Required. The project OR ProductSet from which Products should be listed. - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1278,7 +1285,7 @@ async def sample_get_product(): name (:class:`str`): Required. Resource name of the Product to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1356,21 +1363,24 @@ async def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + r"""Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the Product does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1411,9 +1421,9 @@ async def sample_update_product(): should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1530,7 +1540,7 @@ async def sample_delete_product(): name (:class:`str`): Required. Resource name of product to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1606,23 +1616,26 @@ async def create_reference_image( The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. + than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. .. code-block:: python @@ -1659,9 +1672,9 @@ async def sample_create_reference_image(): The request object. Request message for the ``CreateReferenceImage`` method. parent (:class:`str`): Required. Resource name of the product in which to - create the reference image. + create the reference image. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1676,11 +1689,11 @@ async def sample_create_reference_image(): should not be set. reference_image_id (:class:`str`): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this - value as the resource id. If it is already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters long. It cannot contain the - character ``/``. + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1696,7 +1709,7 @@ async def sample_create_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -1878,8 +1891,9 @@ async def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. + + * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. .. code-block:: python @@ -1916,7 +1930,7 @@ async def sample_list_reference_images(): Required. Resource name of the product containing the reference images. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2065,7 +2079,7 @@ async def sample_get_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2130,7 +2144,7 @@ async def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -2170,7 +2184,7 @@ async def sample_add_product_to_product_set(): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2179,7 +2193,7 @@ async def sample_add_product_to_product_set(): Required. The resource name for the Product to be added to this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2287,16 +2301,16 @@ async def sample_remove_product_from_product_set(): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (:class:`str`): Required. The resource name for the Product to be - removed from this ProductSet. + removed from this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2371,8 +2385,8 @@ async def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetAsyncPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -2413,7 +2427,7 @@ async def sample_list_products_in_product_set(): Required. The ProductSet resource for which to retrieve Products. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2511,15 +2525,15 @@ async def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -2585,14 +2599,14 @@ async def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets`` + :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets` method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ method - in the returned `google.longrunning.Operation.response - `__ field. + `__ method + in the returned `google.longrunning.Operation.response + `__ field. """ # Create or coerce a protobuf request object. @@ -2666,31 +2680,31 @@ async def purge_products( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation_async.AsyncOperation: r"""Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the - PurgeProducts operation has finished for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -2748,13 +2762,15 @@ async def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that you can - re-use to avoid defining duplicated empty messages in - your APIs. A typical example is to use it as the request - or the response type of an API method. For instance: - - service Foo { rpc Bar(google.protobuf.Empty) - returns (google.protobuf.Empty); } + :class:`google.protobuf.empty_pb2.Empty` A generic empty + message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to use + it as the request or the response type of an API method. + For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py index a664b9ec93f9..47b090e56059 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py @@ -114,23 +114,26 @@ def get_transport_class( class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + - The API has a collection of + + `ProductSet `__ resources, + named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` + - The API has a collection of + + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + collection of + + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -864,10 +867,10 @@ def sample_create_product_set(): should not be set. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. This corresponds to the ``product_set_id`` field @@ -1119,7 +1122,7 @@ def sample_get_product_set(): name (str): Required. Resource name of the ProductSet to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1199,14 +1202,16 @@ def update_product_set( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.ProductSet: - r"""Makes changes to a ProductSet resource. Only display_name can - be updated currently. + r"""Makes changes to a ProductSet resource. Only display_name can be + updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. .. code-block:: python @@ -1245,8 +1250,8 @@ def sample_update_product_set(): should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field @@ -1365,7 +1370,7 @@ def sample_delete_product_set(): name (str): Required. Resource name of the ProductSet to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1439,8 +1444,10 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid. @@ -1478,7 +1485,7 @@ def sample_create_product(): Required. The project in which the Product should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1490,10 +1497,10 @@ def sample_create_product(): should not be set. product_id (str): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. This corresponds to the ``product_id`` field @@ -1613,7 +1620,7 @@ def sample_list_products(): Required. The project OR ProductSet from which Products should be listed. - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1738,7 +1745,7 @@ def sample_get_product(): name (str): Required. Resource name of the Product to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1813,21 +1820,24 @@ def update_product( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: - r"""Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + r"""Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the Product does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is present in update_mask. .. code-block:: python @@ -1868,9 +1878,9 @@ def sample_update_product(): should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1984,7 +1994,7 @@ def sample_delete_product(): name (str): Required. Resource name of product to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2057,23 +2067,26 @@ def create_reference_image( The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. + than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. .. code-block:: python @@ -2110,9 +2123,9 @@ def sample_create_reference_image(): The request object. Request message for the ``CreateReferenceImage`` method. parent (str): Required. Resource name of the product in which to - create the reference image. + create the reference image. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2127,11 +2140,11 @@ def sample_create_reference_image(): should not be set. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this - value as the resource id. If it is already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters long. It cannot contain the - character ``/``. + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -2147,7 +2160,7 @@ def sample_create_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2323,8 +2336,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. + + * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. .. code-block:: python @@ -2361,7 +2375,7 @@ def sample_list_reference_images(): Required. Resource name of the product containing the reference images. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2507,7 +2521,7 @@ def sample_get_reference_image(): Returns: google.cloud.vision_v1p4beta1.types.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ # Create or coerce a protobuf request object. @@ -2569,7 +2583,7 @@ def add_product_to_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -2609,7 +2623,7 @@ def sample_add_product_to_product_set(): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2618,7 +2632,7 @@ def sample_add_product_to_product_set(): Required. The resource name for the Product to be added to this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2725,16 +2739,16 @@ def sample_remove_product_from_product_set(): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. product (str): Required. The resource name for the Product to be - removed from this ProductSet. + removed from this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this @@ -2808,8 +2822,8 @@ def list_products_in_product_set( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListProductsInProductSetPager: r"""Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -2850,7 +2864,7 @@ def sample_list_products_in_product_set(): Required. The ProductSet resource for which to retrieve Products. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2947,15 +2961,15 @@ def import_product_sets( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -3021,14 +3035,14 @@ def sample_import_product_sets(): An object representing a long-running operation. The result type for the operation will be - :class:``google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets`` + :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets` method. This message is returned by the `google.longrunning.Operations.GetOperation - `__ method - in the returned `google.longrunning.Operation.response - `__ field. + `__ method + in the returned `google.longrunning.Operation.response + `__ field. """ # Create or coerce a protobuf request object. @@ -3099,31 +3113,31 @@ def purge_products( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> operation.Operation: r"""Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the - PurgeProducts operation has finished for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python @@ -3181,13 +3195,15 @@ def sample_purge_products(): An object representing a long-running operation. The result type for the operation will be - :class:``google.protobuf.empty_pb2.Empty`` A generic empty message that you can - re-use to avoid defining duplicated empty messages in - your APIs. A typical example is to use it as the request - or the response type of an API method. For instance: - - service Foo { rpc Bar(google.protobuf.Empty) - returns (google.protobuf.Empty); } + :class:`google.protobuf.empty_pb2.Empty` A generic empty + message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to use + it as the request or the response type of an API method. + For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + } """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py index 9b7f63fa7fbc..ea19ada301c4 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py @@ -113,23 +113,26 @@ class ProductSearchGrpcTransport(ProductSearchTransport): """gRPC backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + - The API has a collection of + + `ProductSet `__ resources, + named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` + - The API has a collection of + + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + collection of + + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -466,14 +469,16 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. Only display_name can - be updated currently. + Makes changes to a ProductSet resource. Only display_name can be + updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -536,8 +541,10 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid. @@ -634,21 +641,24 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the Product does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is present in update_mask. Returns: @@ -713,23 +723,26 @@ def create_reference_image( The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. + than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -797,8 +810,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. + + * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. Returns: @@ -861,7 +875,7 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -931,8 +945,8 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -968,15 +982,15 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -1007,31 +1021,31 @@ def purge_products( r"""Return a callable for the purge products method over gRPC. Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the - PurgeProducts operation has finished for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py index c797e9e66c32..76eadc3d06a7 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py @@ -119,23 +119,26 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): """gRPC AsyncIO backend transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + - The API has a collection of + + `ProductSet `__ resources, + named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` + - The API has a collection of + + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + collection of + + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -475,14 +478,16 @@ def update_product_set( ]: r"""Return a callable for the update product set method over gRPC. - Makes changes to a ProductSet resource. Only display_name can - be updated currently. + Makes changes to a ProductSet resource. Only display_name can be + updated currently. Possible errors: - * Returns NOT_FOUND if the ProductSet does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the ProductSet does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but missing from the request or longer than 4096 + characters. Returns: Callable[[~.UpdateProductSetRequest], @@ -548,8 +553,10 @@ def create_product( Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if - description is longer than 4096 characters. + than 4096 characters. + + * Returns INVALID_ARGUMENT if description is longer than 4096 + characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid. @@ -648,21 +655,24 @@ def update_product( ]: r"""Return a callable for the update product method over gRPC. - Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in - queries until the next index time. + queries until the next index time. Possible errors: - * Returns NOT_FOUND if the Product does not exist. * Returns - INVALID_ARGUMENT if display_name is present in update_mask but - is missing from the request or longer than 4096 characters. + * Returns NOT_FOUND if the Product does not exist. + + * Returns INVALID_ARGUMENT if display_name is present in + update_mask but is missing from the request or longer than + 4096 characters. * Returns INVALID_ARGUMENT if description is present in - update_mask but is longer than 4096 characters. * Returns - INVALID_ARGUMENT if product_category is present in + update_mask but is longer than 4096 characters. + + * Returns INVALID_ARGUMENT if product_category is present in update_mask. Returns: @@ -729,23 +739,26 @@ def create_reference_image( The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + that are compatible with the product_category on the parent + product. If it is specified, detection is ALWAYS skipped. The + system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image - resolution is too large to process (above 50MP). + resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer - than 4096 characters. * Returns INVALID_ARGUMENT if the - product does not exist. + than 4096 characters. + + * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category - is detected. * Returns INVALID_ARGUMENT if bounding_poly - contains more than 10 polygons. + is detected. + + * Returns INVALID_ARGUMENT if bounding_poly contains more than + 10 polygons. Returns: Callable[[~.CreateReferenceImageRequest], @@ -813,8 +826,9 @@ def list_reference_images( Possible errors: - * Returns NOT_FOUND if the parent product does not exist. * - Returns INVALID_ARGUMENT if the page_size is greater than 100, + * Returns NOT_FOUND if the parent product does not exist. + + * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. Returns: @@ -878,7 +892,7 @@ def add_product_to_product_set( r"""Return a callable for the add product to product set method over gRPC. Adds a Product to the specified ProductSet. If the Product is - already present, no change is made. + already present, no change is made. One Product can be added to at most 100 ProductSets. @@ -949,8 +963,8 @@ def list_products_in_product_set( r"""Return a callable for the list products in product set method over gRPC. Lists the Products in a ProductSet, in an unspecified order. If - the ProductSet does not exist, the products field of the - response will be empty. + the ProductSet does not exist, the products field of the + response will be empty. Possible errors: @@ -987,15 +1001,15 @@ def import_product_sets( r"""Return a callable for the import product sets method over gRPC. Asynchronous API that imports a list of reference images to - specified product sets based on a list of image information. + specified product sets based on a list of image information. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) The input source of this method is a csv file on Google Cloud - Storage. For the format of the csv file please see + Storage. For the format of the csv file please see `ImportProductSetsGcsSource.csv_file_uri `__. @@ -1027,31 +1041,31 @@ def purge_products( r"""Return a callable for the purge products method over gRPC. Asynchronous API to delete all Products in a ProductSet or all - Products that are in no ProductSet. + Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition - to other ProductSets, the Product will still be deleted. + to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until - after this operation has completed. It is also recommended to - not add any of the Products involved in the batch delete to a - new ProductSet while this operation is running because those + after this operation has completed. It is also recommended to + not add any of the Products involved in the batch delete to a + new ProductSet while this operation is running because those Products may still end up deleted. It's not possible to undo the PurgeProducts operation. - Therefore, it is recommended to keep the csv files used in - ImportProductSets (if that was how you originally built the - Product Set) before starting PurgeProducts, in case you need to + Therefore, it is recommended to keep the csv files used in + ImportProductSets (if that was how you originally built the + Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet - and then re-use the empty ProductSet to re-import new Products - into the empty ProductSet, you must wait until the - PurgeProducts operation has finished for that ProductSet. + and then re-use the empty ProductSet to re-import new Products + into the empty ProductSet, you must wait until the PurgeProducts + operation has finished for that ProductSet. The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + `__ API can be used to keep track + of the progress and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py index 01851e45be2f..e37dff150130 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py @@ -1007,23 +1007,26 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): """REST backend synchronous transport for ProductSearch. Manages Products and ProductSets of reference images for use in - product search. It uses the following resource model: + product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + - The API has a collection of + + `ProductSet `__ resources, + named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - - The API has a collection of `Product - `__ resources, named - ``projects/*/locations/*/products/*`` + - The API has a collection of + + `Product `__ resources, named + ``projects/*/locations/*/products/*`` - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + collection of + + `ReferenceImage `__ + resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -1606,7 +1609,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ @@ -2382,7 +2385,7 @@ def __call__( Returns: ~.product_search_service.ReferenceImage: A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py index 7197937544ba..7a59b3ae48dd 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py @@ -34,11 +34,11 @@ class FaceRecognitionParams(proto.Message): Attributes: celebrity_set (MutableSequence[str]): - The resource names for one or more `CelebritySet + The resource names for one or more `CelebritySet `__s. A - celebrity set is preloaded and can be specified as - "builtin/default". If this is specified, the algorithm will - try to match the faces detected in the input image to the + celebrity set is preloaded and can be specified as + "builtin/default". If this is specified, the algorithm will + try to match the faces detected in the input image to the Celebrities in the CelebritySets. """ @@ -81,7 +81,7 @@ class FaceRecognitionResult(proto.Message): Attributes: celebrity (google.cloud.vision_v1p4beta1.types.Celebrity): The `Celebrity `__ - that this face was matched to. + that this face was matched to. confidence (float): Recognition confidence. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py index 11ca0e738bba..b6b32e8e7fdf 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py @@ -106,8 +106,8 @@ class Likelihood(proto.Enum): class Feature(proto.Message): r"""The type of Google Cloud Vision API detection to perform, and the - maximum number of results to return for that type. Multiple - ``Feature`` objects can be specified in the ``features`` list. + maximum number of results to return for that type. Multiple + ``Feature`` objects can be specified in the ``features`` list. Attributes: type_ (google.cloud.vision_v1p4beta1.types.Feature.Type): @@ -116,9 +116,9 @@ class Feature(proto.Message): Maximum number of results of this type. Does not apply to ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or ``CROP_HINTS``. model (str): - Model to use for the feature. Supported values: + Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support "builtin/weekly" for the bleeding edge release updated weekly. """ @@ -139,8 +139,8 @@ class Type(proto.Enum): Run label detection. TEXT_DETECTION (5): Run text detection / optical character recognition (OCR). - Text detection is optimized for areas of text within a - larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` + Text detection is optimized for areas of text within a + larger image; if the image is a document, use ``DOCUMENT_TEXT_DETECTION`` instead. DOCUMENT_TEXT_DETECTION (11): Run dense text document OCR. Takes precedence when both @@ -197,31 +197,34 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud Storage - Request URIs + The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object + versioning is not supported. See `Google Cloud Storage + Request URIs `__ for more info. image_uri (str): The URI of the source image. Can be either: - 1. A Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. - Object versioning is not supported. See `Google Cloud - Storage Request URIs - `__ - for more info. + 1. A Google Cloud Storage URI of the form + + 1. A Google Cloud Storage URI of the form + ``gs://bucket_name/object_name``. Object versioning is not supported. See + `Google Cloud Storage Request + URIs `__ for more + info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching - images from HTTP/HTTPS URLs, Google cannot guarantee - that the request will be completed. Your request may - fail if the specified host denies the request (e.g. due - to request throttling or DOS prevention), or if Google - throttles requests to the site for abuse prevention. You - should not depend on externally-hosted images for - production applications. + images from + + 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from + HTTP/HTTPS URLs, Google cannot guarantee that the request will be + completed. Your request may fail if the specified host denies the + request (e.g. due to request throttling or DOS prevention), or if Google + throttles requests to the site for abuse prevention. You should not + depend on externally-hosted images for production applications. When both ``gcs_image_uri`` and ``image_uri`` are specified, ``image_uri`` - takes precedence. + takes precedence. """ gcs_image_uri: str = proto.Field( @@ -239,13 +242,13 @@ class Image(proto.Message): Attributes: content (bytes): - Image content, represented as a stream of bytes. Note: As + Image content, represented as a stream of bytes. Note: As with all ``bytes`` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. source (google.cloud.vision_v1p4beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided for - an image, ``content`` takes precedence and is used to perform + image URL. If both ``content`` and ``source`` are provided for + an image, ``content`` takes precedence and is used to perform the image annotation request. """ @@ -267,36 +270,35 @@ class FaceAnnotation(proto.Message): Attributes: bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale. The - bounding box is computed to "frame" the face in accordance - with human expectations. It is based on the landmarker - results. Note that one or more x and/or y coordinates may - not be generated in the ``BoundingPoly`` (the polygon will be - unbounded) if only a partial face appears in the image to - be annotated. + bounding box are in the original image's scale. The bounding + box is computed to "frame" the face in accordance with human + expectations. It is based on the landmarker results. Note + that one or more x and/or y coordinates may not be generated + in the ``BoundingPoly`` (the polygon will be unbounded) if only a + partial face appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): The ``fd_bounding_poly`` bounding polygon is tighter than the ``boundingPoly``, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on - the initial face detection, hence the fd (face + Typically, it is used to eliminate the face from any image + analysis that detects the "amount of skin" visible in an + image. It is not based on the landmarker results, only on + the initial face detection, hence the fd (face detection) prefix. landmarks (MutableSequence[google.cloud.vision_v1p4beta1.types.FaceAnnotation.Landmark]): Detected face landmarks. roll_angle (float): Roll angle, which indicates the amount of - clockwise/anti-clockwise rotation of the face relative to - the image vertical about the axis perpendicular to the - face. Range [-180,180]. + clockwise/anti-clockwise rotation of the face relative to + the image vertical about the axis perpendicular to the face. + Range [-180,180]. pan_angle (float): Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. + the face is pointing relative to the vertical plane + perpendicular to the image. Range [-180,180]. tilt_angle (float): Pitch angle, which indicates the upwards/downwards angle - that the face is pointing relative to the image's - horizontal plane. Range [-180,180]. + that the face is pointing relative to the image's horizontal + plane. Range [-180,180]. detection_confidence (float): Detection confidence. Range [0, 1]. landmarking_confidence (float): @@ -318,11 +320,11 @@ class FaceAnnotation(proto.Message): recognition_result (MutableSequence[google.cloud.vision_v1p4beta1.types.FaceRecognitionResult]): Additional recognition information. Only computed if image_context.face_recognition_params is provided, **and** a - match is found to a `Celebrity + match is found to a `Celebrity `__ in the input `CelebritySet `__. This field - is sorted in order of decreasing confidence values. + is sorted in order of decreasing confidence values. """ class Landmark(proto.Message): @@ -336,9 +338,9 @@ class Landmark(proto.Message): """ class Type(proto.Enum): - r"""Face landmark (feature) type. Left and right are defined from the - vantage of the viewer of the image without considering mirror - projections typical of photos. So, ``LEFT_EYE``, typically, is the + r"""Face landmark (feature) type. Left and right are defined from the + vantage of the viewer of the image without considering mirror + projections typical of photos. So, ``LEFT_EYE``, typically, is the person's right eye. Values: @@ -586,8 +588,8 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API + Opaque entity ID. Some IDs may be available in `Google + Knowledge Graph Search API `__. locale (str): The language code for the locale in which the entity textual @@ -598,31 +600,31 @@ class EntityAnnotation(proto.Message): score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field + **Deprecated. Use ``score`` instead.** The accuracy of the + entity detection in an image. For example, for an image in + which the "Eiffel Tower" entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1]. topicality (float): The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" - than to an image containing a detected distant towering - building, even though the confidence that there is a tower + the image. For example, the relevancy of "tower" is likely + higher to an image containing the detected "Eiffel Tower" + than to an image containing a detected distant towering + building, even though the confidence that there is a tower in each image may be the same. Range [0, 1]. bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): - Image region to which this entity belongs. Not produced for + Image region to which this entity belongs. Not produced for ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p4beta1.types.LocationInfo]): The location information for the detected entity. Multiple ``LocationInfo`` elements can be present because one location may indicate the location of the scene in the image, and another - location may indicate the location of the place where the - image was taken. Location information is usually present - for landmarks. + location may indicate the location of the place where the + image was taken. Location information is usually present for + landmarks. properties (MutableSequence[google.cloud.vision_v1p4beta1.types.Property]): Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies + (name/value) fields, such a score or string that qualifies the entity. """ @@ -676,7 +678,7 @@ class LocalizedObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. @@ -934,13 +936,13 @@ class WebDetectionParams(proto.Message): class TextDetectionParams(proto.Message): r"""Parameters for text detections. This is used to control - TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. + TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. Attributes: enable_text_detection_confidence_score (bool): By default, Cloud Vision API only includes confidence score - for DOCUMENT_TEXT_DETECTION result. Set the flag to true to - include confidence score for TEXT_DETECTION as well. + for DOCUMENT_TEXT_DETECTION result. Set the flag to true to + include confidence score for TEXT_DETECTION as well. advanced_ocr_options (MutableSequence[str]): A list of advanced OCR options to fine-tune OCR behavior. @@ -964,14 +966,14 @@ class ImageContext(proto.Message): Not used. language_hints (MutableSequence[str]): List of languages to use for TEXT_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the - Latin alphabet, setting ``language_hints`` is not needed. In rare + an empty value yields the best results since it enables + automatic language detection. For languages based on the + Latin alphabet, setting ``language_hints`` is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it - will be a significant hindrance if the hint is wrong). Text - detection returns an error if one or more of the specified - languages is not one of the `supported languages + will be a significant hindrance if the hint is wrong). Text + detection returns an error if one or more of the specified + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p4beta1.types.CropHintsParams): Parameters for crop hints annotation request. @@ -1122,8 +1124,8 @@ class AnnotateImageResponse(proto.Message): If present, product search has completed successfully. error (google.rpc.status_pb2.Status): - If set, represents the error message for the operation. - Note that filled-in image annotations are guaranteed to be + If set, represents the error message for the operation. Note + that filled-in image annotations are guaranteed to be correct, even when ``error`` is set. context (google.cloud.vision_v1p4beta1.types.ImageAnnotationContext): If present, contextual information is needed @@ -1301,13 +1303,13 @@ class AnnotateFileResponse(proto.Message): response is generated. responses (MutableSequence[google.cloud.vision_v1p4beta1.types.AnnotateImageResponse]): Individual responses to images found within the file. This - field will be empty if the ``error`` field is set. + field will be empty if the ``error`` field is set. total_pages (int): This field gives the total number of pages in the file. error (google.rpc.status_pb2.Status): If set, represents the error message for the failed request. - The ``responses`` field will not be set in this case. + The ``responses`` field will not be set in this case. """ input_config: "InputConfig" = proto.Field( @@ -1504,12 +1506,12 @@ class InputConfig(proto.Message): The Google Cloud Storage location to read the input from. content (bytes): - File content, represented as a stream of bytes. Note: As + File content, represented as a stream of bytes. Note: As with all ``bytes`` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateFiles - requests. It does not work for AsyncBatchAnnotateFiles + requests. It does not work for AsyncBatchAnnotateFiles requests. mime_type (str): The type of the file. Currently only @@ -1541,16 +1543,16 @@ class OutputConfig(proto.Message): the output(s) to. batch_size (int): The max number of response protos to put into each output - JSON file on Google Cloud Storage. The valid range is [1, + JSON file on Google Cloud Storage. The valid range is [1, 100]. If not specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response - protos will be generated. If ``batch_size`` = 20, then 5 json - files each containing 20 response protos will be written - under the prefix ``gcs_destination``.``uri``. + protos will be generated. If ``batch_size`` = 20, then 5 json + files each containing 20 response protos will be written + under the prefix ``gcs_destination``.``uri``. Currently, batch_size only applies to GcsDestination, with - potential future support for other output configurations. + potential future support for other output configurations. """ gcs_destination: "GcsDestination" = proto.Field( @@ -1588,31 +1590,33 @@ class GcsDestination(proto.Message): Attributes: uri (str): Google Cloud Storage URI prefix where the results will be - stored. Results will be in JSON format and preceded by its - corresponding input URI prefix. This field can either - represent a gcs file prefix or gcs directory. In either + stored. Results will be in JSON format and preceded by its + corresponding input URI prefix. This field can either + represent a gcs file prefix or gcs directory. In either case, the uri should be unique because in order to get all - of the output files, you will need to do a wildcard gcs - search on the uri prefix you provide. + of the output files, you will need to do a wildcard gcs + search on the uri prefix you provide. Examples: * File Prefix: gs://bucket-name/here/filenameprefix The - output files will be created in gs://bucket-name/here/ and - the names of the output files will begin with - "filenameprefix". + output files + + will be created in gs://bucket-name/here/ and the names of + the output files will begin with "filenameprefix". * Directory Prefix: gs://bucket-name/some/location/ The - output files will be created in - gs://bucket-name/some/location/ and the names of the - output files could be anything because there was no - filename prefix specified. + output files + + will be created in gs://bucket-name/some/location/ and the + names of the output files could be anything because there + was no filename prefix specified. If multiple outputs, each response is still - AnnotateFileResponse, each of which contains some subset of - the full list of AnnotateImageResponse. Multiple outputs - can happen if, for example, the output JSON is too large - and overflows into multiple sharded files. + AnnotateFileResponse, each of which contains some subset of + the full list of AnnotateImageResponse. Multiple outputs can + happen if, for example, the output JSON is too large and + overflows into multiple sharded files. """ uri: str = proto.Field( diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py index 86ca50d51309..8a629bd11304 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py @@ -40,11 +40,11 @@ class ProductSearchParams(proto.Message): interest in the image. If it is not specified, system discretion will be applied. product_set (str): - The resource name of a `ProductSet + The resource name of a `ProductSet `__ to be searched - for similar images. + for similar images. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): The list of product categories to search in. Currently, we only consider the first category, @@ -148,7 +148,7 @@ class ObjectAnnotation(proto.Message): EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. name (str): Object name, expressed in its ``language_code`` language. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py index c1e0a4ab577d..2a54dc4d7b22 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py @@ -69,7 +69,7 @@ class Product(proto.Message): name (str): The resource name of the product. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. This field is ignored when creating a product. display_name (str): @@ -88,19 +88,19 @@ class Product(proto.Message): these should not be used for new products. product_labels (MutableSequence[google.cloud.vision_v1p4beta1.types.Product.KeyValue]): Key-value pairs that can be attached to a product. At query - time, constraints can be specified based on the + time, constraints can be specified based on the product_labels. Note that integer values can be provided as strings, e.g. - "1199". Only strings with integer values can match a - range-based restriction which is to be supported soon. + "1199". Only strings with integer values can match a + range-based restriction which is to be supported soon. Multiple values can be assigned to the same key. One product - may have up to 500 product_labels. + may have up to 500 product_labels. Notice that the total number of distinct product_labels over - all products in one ProductSet cannot exceed 1M, otherwise - the product search pipeline will refuse to work for that + all products in one ProductSet cannot exceed 1M, otherwise + the product search pipeline will refuse to work for that ProductSet. """ @@ -158,7 +158,7 @@ class ProductSet(proto.Message): name (str): The resource name of the ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. This field is ignored when creating a ProductSet. display_name (str): @@ -206,7 +206,7 @@ class ProductSet(proto.Message): class ReferenceImage(proto.Message): r"""A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. + associated metadata, such as bounding boxes. Attributes: name (str): @@ -259,15 +259,15 @@ class CreateProductRequest(proto.Message): Required. The project in which the Product should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. product (google.cloud.vision_v1p4beta1.types.Product): Required. The product to create. product_id (str): A user-supplied resource id for this Product. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. """ @@ -294,7 +294,7 @@ class ListProductsRequest(proto.Message): Required. The project OR ProductSet from which Products should be listed. - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + Format: ``projects/PROJECT_ID/locations/LOC_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -351,7 +351,7 @@ class GetProductRequest(proto.Message): name (str): Required. Resource name of the Product to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -370,9 +370,9 @@ class UpdateProductRequest(proto.Message): immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid + mask paths include ``product_labels``, ``display_name``, and ``description``. """ product: "Product" = proto.Field( @@ -394,7 +394,7 @@ class DeleteProductRequest(proto.Message): name (str): Required. Resource name of product to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -416,10 +416,10 @@ class CreateProductSetRequest(proto.Message): Required. The ProductSet to create. product_set_id (str): A user-supplied resource id for this ProductSet. If set, - the server will attempt to use this value as the - resource id. If it is already in use, an error is + the server will attempt to use this value as the + resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 - characters long. It cannot contain the character + characters long. It cannot contain the character ``/``. """ @@ -503,7 +503,7 @@ class GetProductSetRequest(proto.Message): name (str): Required. Resource name of the ProductSet to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -521,8 +521,8 @@ class UpdateProductSetRequest(proto.Message): replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid + specifies which fields to update. If update_mask isn't + specified, all mutable fields are to be updated. Valid mask path is ``display_name``. """ @@ -545,7 +545,7 @@ class DeleteProductSetRequest(proto.Message): name (str): Required. Resource name of the ProductSet to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` """ name: str = proto.Field( @@ -560,19 +560,19 @@ class CreateReferenceImageRequest(proto.Message): Attributes: parent (str): Required. Resource name of the product in which to - create the reference image. + create the reference image. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. reference_image (google.cloud.vision_v1p4beta1.types.ReferenceImage): Required. The reference image to create. If an image ID is specified, it is ignored. reference_image_id (str): A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this - value as the resource id. If it is already in use, an - error is returned with code ALREADY_EXISTS. Must be at - most 128 characters long. It cannot contain the - character ``/``. + added. If set, the server will attempt to use this value + as the resource id. If it is already in use, an error is + returned with code ALREADY_EXISTS. Must be at most 128 + characters long. It cannot contain the character + ``/``. """ parent: str = proto.Field( @@ -598,13 +598,13 @@ class ListReferenceImagesRequest(proto.Message): Required. Resource name of the product containing the reference images. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. page_size (int): The maximum number of items to return. Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value of ``nextPageToken`` returned in a previous reference + is the value of ``nextPageToken`` returned in a previous reference image list request. Defaults to the first page if not specified. @@ -703,12 +703,12 @@ class AddProductToProductSetRequest(proto.Message): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be added to this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -729,12 +729,12 @@ class RemoveProductFromProductSetRequest(proto.Message): Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` product (str): Required. The resource name for the Product to be - removed from this ProductSet. + removed from this ProductSet. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` """ name: str = proto.Field( @@ -755,7 +755,7 @@ class ListProductsInProductSetRequest(proto.Message): Required. The ProductSet resource for which to retrieve Products. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` page_size (int): The maximum number of items to return. Default 10, maximum 100. @@ -816,63 +816,74 @@ class ImportProductSetsGcsSource(proto.Message): The URI must start with ``gs://``. The format of the input csv file should be one image per - line. In each line, there are 8 columns. + line. In each line, there are 8 columns. + + 1. image-uri + + 2. image-id + + 3. product-set-id + + 4. product-id + + 5. product-category + + 6. product-display-name + + 7. labels - 1. image-uri 2. image-id 3. product-set-id 4. - product-id 5. product-category 6. product-display-name - 7. labels 8. bounding-poly + 8. bounding-poly - The ``image-uri``, ``product-set-id``, ``product-id``, and ``product-category`` columns + The ``image-uri``, ``product-set-id``, ``product-id``, and ``product-category`` columns are required. All other columns are optional. If the ``ProductSet`` or ``Product`` specified by the ``product-set-id`` and ``product-id`` values does not exist, then the system will create - a new ``ProductSet`` or ``Product`` for the image. In this case, - the ``product-display-name`` column refers to `display_name + a new ``ProductSet`` or ``Product`` for the image. In this case, + the ``product-display-name`` column refers to `display_name `__, the - ``product-category`` column refers to `product_category + ``product-category`` column refers to `product_category `__, - and the ``labels`` column refers to `product_labels + and the ``labels`` column refers to `product_labels `__. The ``image-id`` column is optional but must be unique if - provided. If it is empty, the system will automatically + provided. If it is empty, the system will automatically assign a unique id to the image. The ``product-display-name`` column is optional. If it is empty, the system sets the `display_name `__ field for the product to a space (" "). You can update the - ``display_name`` later by using the API. + ``display_name`` later by using the API. If a ``Product`` with the specified ``product-id`` already exists, - then the system ignores the ``product-display-name``, ``product-category``, and - ``labels`` columns. + then the system ignores the ``product-display-name``, ``product-category``, and + ``labels`` columns. The ``labels`` column (optional) is a line containing a list - of comma-separated key-value pairs, in the following - format: + of comma-separated key-value pairs, in the following format: - "key_1=value_1,key_2=value_2,...,key_n=value_n" + "key_1=value_1,key_2=value_2,...,key_n=value_n" The ``bounding-poly`` column (optional) identifies one region of interest from the image in the same manner as ``CreateReferenceImage``. If you do not specify the ``bounding-poly`` column, then the system - will try to detect regions of interest automatically. + will try to detect regions of interest automatically. At most one ``bounding-poly`` column is allowed per line. If the - image contains multiple regions of interest, add a line to - the CSV file that includes the same product information, - and the ``bounding-poly`` values for each region of interest. + image contains multiple regions of interest, add a line to + the CSV file that includes the same product information, and + the ``bounding-poly`` values for each region of interest. The ``bounding-poly`` column must contain an even number of - comma-separated numbers, in the format - "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative - integers for absolute bounding polygons, and float values - in [0, 1] for normalized bounding polygons. + comma-separated numbers, in the format + "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative + integers for absolute bounding polygons, and float values in + [0, 1] for normalized bounding polygons. The system will resize the image if the image resolution is - too large to process (larger than 20MP). + too large to process (larger than 20MP). """ csv_file_uri: str = proto.Field( @@ -933,21 +944,21 @@ class ImportProductSetsResponse(proto.Message): This message is returned by the `google.longrunning.Operations.GetOperation - `__ method in the - returned `google.longrunning.Operation.response - `__ field. + `__ method in the + returned `google.longrunning.Operation.response + `__ field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1p4beta1.types.ReferenceImage]): The list of reference_images that are imported successfully. statuses (MutableSequence[google.rpc.status_pb2.Status]): The rpc status for each ImportProductSet request, including - both successes and errors. + both successes and errors. The number of statuses here matches the number of lines in - the csv file, and statuses[i] stores the success or failure - status of processing the i-th line of the csv, starting - from line 0. + the csv file, and statuses[i] stores the success or failure + status of processing the i-th line of the csv, starting from + line 0. """ reference_images: MutableSequence["ReferenceImage"] = proto.RepeatedField( @@ -966,7 +977,7 @@ class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. This is included in the ``metadata`` field of the ``Operation`` returned by - the ``GetOperation`` call of the ``google::longrunning::Operations`` service. + the ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1p4beta1.types.BatchOperationMetadata.State): @@ -977,7 +988,7 @@ class BatchOperationMetadata(proto.Message): end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and `google.longrunning.Operation.done - `__ is set to true. + `__ is set to true. """ class State(proto.Enum): @@ -1032,8 +1043,8 @@ class ProductSetPurgeConfig(proto.Message): Attributes: product_set_id (str): The ProductSet that contains the Products to delete. If a - Product is a member of product_set_id in addition to other - ProductSets, the Product will still be deleted. + Product is a member of product_set_id in addition to other + ProductSets, the Product will still be deleted. """ product_set_id: str = proto.Field( @@ -1060,7 +1071,7 @@ class PurgeProductsRequest(proto.Message): This field is a member of `oneof`_ ``target``. delete_orphan_products (bool): If delete_orphan_products is true, all Products that are not - in any ProductSet will be deleted. + in any ProductSet will be deleted. This field is a member of `oneof`_ ``target``. parent (str): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py index 8089e029796f..077ddf8f9157 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py @@ -36,11 +36,18 @@ class TextAnnotation(proto.Message): r"""TextAnnotation contains a structured representation of OCR extracted - text. The hierarchy of an OCR extracted text structure is like - this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> - Symbol Each structural component, starting from Page, may further - have their own properties. Properties describe detected languages, - breaks etc.. Please refer to the `TextAnnotation.TextProperty + text. The hierarchy of an OCR extracted text structure is like this: + + TextAnnotation contains a structured representation of OCR extracted text. + The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + + TextAnnotation contains a structured representation of OCR extracted + text. The hierarchy of an OCR extracted text structure is like this: + TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each + structural component, starting from Page, may further have their own + properties. Properties describe detected languages, breaks etc.. + Please refer to the `TextAnnotation.TextProperty `__ message definition below for more detail. @@ -57,7 +64,7 @@ class DetectedLanguage(proto.Message): Attributes: language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see + more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. confidence (float): Confidence of detected language. Range [0, 1]. @@ -96,7 +103,7 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ @@ -209,24 +216,20 @@ class Block(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: + * when the text is horizontal it might look like: - :: + 0----1 + | | + 3----2 - 0----1 - | | - 3----2 + * when it's rotated 180 degrees around the top-left corner + it becomes: - - when it's rotated 180 degrees around the top-left corner - it becomes: + 2----3 + | | + 1----0 - :: - - 2----3 - | | - 1----0 - - and the vertex order will still be (0, 1, 2, 3). + and the vertex order will still be (0, 1, 2, 3). paragraphs (MutableSequence[google.cloud.vision_v1p4beta1.types.Paragraph]): List of paragraphs in this block (if this blocks is of type text). @@ -302,11 +305,24 @@ class Paragraph(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertex order will - still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertex order will + still be (0, 1, 2, 3). words (MutableSequence[google.cloud.vision_v1p4beta1.types.Word]): List of all words in this paragraph. confidence (float): @@ -348,11 +364,24 @@ class Word(proto.Message): represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertex order will - still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertex order will + still be (0, 1, 2, 3). symbols (MutableSequence[google.cloud.vision_v1p4beta1.types.Symbol]): List of symbols in the word. The order of the symbols follows the natural @@ -396,11 +425,24 @@ class Symbol(proto.Message): is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: 0----1 \| - \| 3----2 - - when it's rotated 180 degrees around the top-left corner - it becomes: 2----3 \| \| 1----0 and the vertex order will - still be (0, 1, 2, 3). + * when the text is horizontal it might look like: + + * when the text is horizontal it might look like: + 0----1 + | | + 3----2 + + * when it's rotated 180 degrees around the top-left corner + it becomes: + + * when it's rotated 180 degrees around the top-left corner it becomes: + 2----3 + | | + 1----0 + + * when it's rotated 180 degrees around the top-left corner + it becomes: 2----3 | | 1----0 and the vertex order will + still be (0, 1, 2, 3). text (str): The actual UTF-8 representation of the symbol. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py index e6222a155751..3bfadec02406 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py @@ -160,7 +160,7 @@ class WebLabel(proto.Message): Label for extra metadata. language_code (str): The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ From f7972f0a570306ee87d3535b8548d6d0c5ae4773 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Sat, 17 Jan 2026 00:40:15 +0000 Subject: [PATCH 9/9] version 9 --- .../services/image_annotator/async_client.py | 9 ++- .../services/image_annotator/client.py | 9 ++- .../image_annotator/transports/grpc.py | 9 ++- .../transports/grpc_asyncio.py | 9 ++- .../services/product_search/async_client.py | 63 +++++++-------- .../services/product_search/client.py | 63 +++++++-------- .../product_search/transports/grpc.py | 41 +++++----- .../product_search/transports/grpc_asyncio.py | 41 +++++----- .../product_search/transports/rest.py | 12 +-- .../cloud/vision_v1/types/image_annotator.py | 66 ++++++++------- .../cloud/vision_v1/types/product_search.py | 3 +- .../vision_v1/types/product_search_service.py | 80 +++++++++---------- .../cloud/vision_v1/types/text_annotation.py | 8 +- .../cloud/vision_v1/types/web_detection.py | 4 +- .../vision_v1p1beta1/types/image_annotator.py | 58 +++++++------- .../vision_v1p1beta1/types/text_annotation.py | 8 +- .../vision_v1p1beta1/types/web_detection.py | 4 +- .../services/image_annotator/async_client.py | 5 +- .../services/image_annotator/client.py | 5 +- .../image_annotator/transports/grpc.py | 5 +- .../transports/grpc_asyncio.py | 5 +- .../vision_v1p2beta1/types/image_annotator.py | 59 +++++++------- .../vision_v1p2beta1/types/text_annotation.py | 8 +- .../vision_v1p2beta1/types/web_detection.py | 4 +- .../services/image_annotator/async_client.py | 5 +- .../services/image_annotator/client.py | 5 +- .../image_annotator/transports/grpc.py | 5 +- .../transports/grpc_asyncio.py | 5 +- .../services/product_search/async_client.py | 59 ++++++-------- .../services/product_search/client.py | 59 ++++++-------- .../product_search/transports/grpc.py | 37 ++++----- .../product_search/transports/grpc_asyncio.py | 37 ++++----- .../product_search/transports/rest.py | 16 ++-- .../vision_v1p3beta1/types/image_annotator.py | 59 +++++++------- .../vision_v1p3beta1/types/product_search.py | 5 +- .../types/product_search_service.py | 42 ++++------ .../vision_v1p3beta1/types/text_annotation.py | 8 +- .../vision_v1p3beta1/types/web_detection.py | 4 +- .../services/image_annotator/async_client.py | 9 ++- .../services/image_annotator/client.py | 9 ++- .../image_annotator/transports/grpc.py | 9 ++- .../transports/grpc_asyncio.py | 9 ++- .../services/product_search/async_client.py | 65 +++++++-------- .../services/product_search/client.py | 65 +++++++-------- .../product_search/transports/grpc.py | 43 +++++----- .../product_search/transports/grpc_asyncio.py | 43 +++++----- .../product_search/transports/rest.py | 14 ++-- .../cloud/vision_v1p4beta1/types/face.py | 6 +- .../vision_v1p4beta1/types/image_annotator.py | 70 ++++++++-------- .../vision_v1p4beta1/types/product_search.py | 5 +- .../types/product_search_service.py | 80 +++++++++---------- .../vision_v1p4beta1/types/text_annotation.py | 8 +- .../vision_v1p4beta1/types/web_detection.py | 4 +- 53 files changed, 621 insertions(+), 742 deletions(-) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py index c41b09cedb02..2f6b52e4a5df 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py @@ -537,8 +537,8 @@ async def async_batch_annotate_images( images. Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` - contains ``AsyncBatchAnnotateImagesResponse`` (results). + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -677,8 +677,9 @@ async def async_batch_annotate_files( r"""Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` + contains ``OperationMetadata`` (metadata). ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py index d6a329ad5da4..5e6a6e287e94 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py @@ -994,8 +994,8 @@ def async_batch_annotate_images( images. Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` - contains ``AsyncBatchAnnotateImagesResponse`` (results). + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -1133,8 +1133,9 @@ def async_batch_annotate_files( r"""Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` + contains ``OperationMetadata`` (metadata). ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py index b53dd5ccdded..1d6dfda01d67 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py @@ -421,8 +421,8 @@ def async_batch_annotate_images( images. Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` - contains ``AsyncBatchAnnotateImagesResponse`` (results). + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -459,8 +459,9 @@ def async_batch_annotate_files( Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` + contains ``OperationMetadata`` (metadata). ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py index 23b4eb8f39e8..16166cfb6daa 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py @@ -430,8 +430,8 @@ def async_batch_annotate_images( images. Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` - contains ``AsyncBatchAnnotateImagesResponse`` (results). + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -469,8 +469,9 @@ def async_batch_annotate_files( Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` + contains ``OperationMetadata`` (metadata). ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py index 6d32716132f2..6dae1e4fd412 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py @@ -73,24 +73,20 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ + - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups to limit identification. In parallel, - - The API has a collection of `Product - `__ + - The API has a collection of `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a collection - of + - Each `Product `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `ReferenceImage `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -778,10 +774,9 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1365,7 +1360,8 @@ async def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + ``description``, and ``labels`` fields can be updated right + now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -1421,10 +1417,10 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include ``product_labels``, + ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1615,11 +1611,11 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, - the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -2524,15 +2520,14 @@ async def import_product_sets( r"""Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + `ImportProductSetsGcsSource.csv_file_uri `__. .. code-block:: python @@ -2599,11 +2594,8 @@ async def sample_import_product_sets(): :class:`google.cloud.vision_v1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets` method. - This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method - in the returned `google.longrunning.Operation.response - `__ field. + This message is returned by the `google.longrunning.Operations.GetOperation `__ method in + the returned `google.longrunning.Operation.response `__ field. """ # Create or coerce a protobuf request object. @@ -2699,9 +2691,8 @@ async def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py index 47af16483752..94c8bb947d15 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py @@ -117,24 +117,20 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ + - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups to limit identification. In parallel, - - The API has a collection of `Product - `__ + - The API has a collection of `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a collection - of + - Each `Product `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `ReferenceImage `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -1250,10 +1246,9 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1822,7 +1817,8 @@ def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + ``description``, and ``labels`` fields can be updated right + now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -1878,10 +1874,10 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include ``product_labels``, + ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -2066,11 +2062,11 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, - the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -2960,15 +2956,14 @@ def import_product_sets( r"""Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + `ImportProductSetsGcsSource.csv_file_uri `__. .. code-block:: python @@ -3035,11 +3030,8 @@ def sample_import_product_sets(): :class:`google.cloud.vision_v1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets` method. - This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method - in the returned `google.longrunning.Operation.response - `__ field. + This message is returned by the `google.longrunning.Operations.GetOperation `__ method in + the returned `google.longrunning.Operation.response `__ field. """ # Create or coerce a protobuf request object. @@ -3132,9 +3124,8 @@ def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py index 5b2e5bfe3b1e..dc69fe1f8d61 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc.py @@ -115,24 +115,20 @@ class ProductSearchGrpcTransport(ProductSearchTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ + - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups to limit identification. In parallel, - - The API has a collection of `Product - `__ + - The API has a collection of `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a collection - of + - Each `Product `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `ReferenceImage `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -642,7 +638,8 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + ``description``, and ``labels`` fields can be updated right + now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -721,11 +718,11 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, - the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -984,15 +981,14 @@ def import_product_sets( Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + `ImportProductSetsGcsSource.csv_file_uri `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1043,9 +1039,8 @@ def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py index 08f533bd4fef..500689e9d04c 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py @@ -121,24 +121,20 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ + - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups to limit identification. In parallel, - - The API has a collection of `Product - `__ + - The API has a collection of `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a collection - of + - Each `Product `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `ReferenceImage `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -656,7 +652,8 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + ``description``, and ``labels`` fields can be updated right + now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -737,11 +734,11 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, - the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -1003,15 +1000,14 @@ def import_product_sets( Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + `ImportProductSetsGcsSource.csv_file_uri `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1063,9 +1059,8 @@ def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py index 55616342c999..6caaf5a92aa5 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/transports/rest.py @@ -1034,24 +1034,20 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ + - The API has a collection of `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups to limit identification. In parallel, - - The API has a collection of `Product - `__ + - The API has a collection of `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a collection - of + - Each `Product `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `ReferenceImage `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py index 3db7af9dfc13..6117877784d5 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/image_annotator.py @@ -113,9 +113,9 @@ class Feature(proto.Message): model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support - "builtin/weekly" for the bleeding edge release updated - weekly. + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also + support "builtin/weekly" for the bleeding edge release + updated weekly. """ class Type(proto.Enum): @@ -192,11 +192,9 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud Storage - Request URIs - `__ - for more info. + The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. + Object versioning is not supported. See `Google Cloud Storage Request URIs `__ for + more info. image_uri (str): The URI of the source image. Can be either: @@ -218,8 +216,8 @@ class ImageSource(proto.Message): throttles requests to the site for abuse prevention. You should not depend on externally-hosted images for production applications. - When both ``gcs_image_uri`` and ``image_uri`` are specified, ``image_uri`` - takes precedence. + When both ``gcs_image_uri`` and ``image_uri`` are specified, + ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -238,17 +236,18 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. Note: As - with all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. + with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. Currently, this field only works for BatchAnnotateImages requests. It does not work for AsyncBatchAnnotateImages requests. source (google.cloud.vision_v1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided for - an image, ``content`` takes precedence and is used to perform - the image annotation request. + image URL. If both ``content`` and ``source`` are + provided for an image, ``content`` takes precedence and is + used to perform the image annotation request. """ content: bytes = proto.Field( @@ -273,8 +272,8 @@ class FaceAnnotation(proto.Message): box is computed to "frame" the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y coordinates may not be generated - in the ``BoundingPoly`` (the polygon will be unbounded) if only a - partial face appears in the image to be annotated. + in the ``BoundingPoly`` (the polygon will be unbounded) if only + a partial face appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1.types.BoundingPoly): The ``fd_bounding_poly`` bounding polygon is tighter than the ``boundingPoly``, and encloses only the skin part of the face. @@ -578,9 +577,8 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. + Opaque entity ID. Some IDs may be available in + `Google Knowledge Graph Search API `__. locale (str): The language code for the locale in which the entity textual ``description`` is expressed. @@ -590,9 +588,9 @@ class EntityAnnotation(proto.Message): score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field + **Deprecated. Use ``score`` instead.** The accuracy of + the entity detection in an image. For example, for an image + in which the "Eiffel Tower" entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1]. topicality (float): @@ -607,11 +605,11 @@ class EntityAnnotation(proto.Message): ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one location may - indicate the location of the scene in the image, and another - location may indicate the location of the place where the - image was taken. Location information is usually present for - landmarks. + ``LocationInfo`` elements can be present because one location + may indicate the location of the scene in the image, and + another location may indicate the location of the place + where the image was taken. Location information is usually + present for landmarks. properties (MutableSequence[google.cloud.vision_v1.types.Property]): Some entities may have optional user-supplied ``Property`` (name/value) fields, such a score or string that qualifies @@ -938,8 +936,8 @@ class TextDetectionParams(proto.Message): A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are: - - ``legacy_layout``: a heuristics layout detection algorithm, which - serves as + - ``legacy_layout``: a heuristics layout detection algorithm, + which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout @@ -971,8 +969,7 @@ class ImageContext(proto.Message): setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified - languages is not one of the `supported languages - `__. + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1.types.CropHintsParams): Parameters for crop hints annotation request. product_search_params (google.cloud.vision_v1.types.ProductSearchParams): @@ -1634,8 +1631,9 @@ class InputConfig(proto.Message): input from. content (bytes): File content, represented as a stream of bytes. Note: As - with all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. + with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. Currently, this field only works for BatchAnnotateFiles requests. It does not work for AsyncBatchAnnotateFiles diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py index 40c81b930dee..74fbec3e003e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search.py @@ -40,8 +40,7 @@ class ProductSearchParams(proto.Message): interest in the image. If it is not specified, system discretion will be applied. product_set (str): - The resource name of a `ProductSet - `__ to be searched for + The resource name of a `ProductSet `__ to be searched for similar images. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py index 27ab4302676d..116a5c0471c7 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/product_search_service.py @@ -368,10 +368,10 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include ``product_labels``, + ``display_name``, and ``description``. """ product: "Product" = proto.Field( @@ -519,10 +519,9 @@ class UpdateProductSetRequest(proto.Message): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. """ product_set: "ProductSet" = proto.Field( @@ -603,8 +602,8 @@ class ListReferenceImagesRequest(proto.Message): Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value of ``nextPageToken`` returned in a previous reference - image list request. + is the value of ``nextPageToken`` returned in a previous + reference image list request. Defaults to the first page if not specified. """ @@ -829,42 +828,41 @@ class ImportProductSetsGcsSource(proto.Message): 8. bounding-poly - The ``image-uri``, ``product-set-id``, ``product-id``, and ``product-category`` columns - are required. All other columns are optional. + The ``image-uri``, ``product-set-id``, ``product-id``, and + ``product-category`` columns are required. All other columns are + optional. - If the ``ProductSet`` or ``Product`` specified by the ``product-set-id`` and - ``product-id`` values does not exist, then the system will create - a new ``ProductSet`` or ``Product`` for the image. In this case, - the ``product-display-name`` column refers to `display_name - `__, the - ``product-category`` column refers to `product_category - `__, and - the ``labels`` column refers to `product_labels - `__. + If the ``ProductSet`` or ``Product`` specified by the + ``product-set-id`` and ``product-id`` values does not exist, then + the system will create a new ``ProductSet`` or ``Product`` + for the image. In this case, the ``product-display-name`` column refers + to `display_name `__, the ``product-category`` column refers to + `product_category `__, and the ``labels`` column refers to + `product_labels `__. The ``image-id`` column is optional but must be unique if provided. If it is empty, the system will automatically assign a unique id to the image. - The ``product-display-name`` column is optional. If it is empty, the system - sets the `display_name - `__ field for - the product to a space (" "). You can update the ``display_name`` - later by using the API. + The ``product-display-name`` column is optional. If it is empty, the + system sets the `display_name `__ field for the product to a + space (" "). You can update the ``display_name`` later by using + the API. - If a ``Product`` with the specified ``product-id`` already exists, - then the system ignores the ``product-display-name``, ``product-category``, and - ``labels`` columns. + If a ``Product`` with the specified ``product-id`` already + exists, then the system ignores the ``product-display-name``, + ``product-category``, and ``labels`` columns. - The ``labels`` column (optional) is a line containing a list - of comma-separated key-value pairs, in the following format: + The ``labels`` column (optional) is a line containing a + list of comma-separated key-value pairs, in the following + format: "key_1=value_1,key_2=value_2,...,key_n=value_n" The ``bounding-poly`` column (optional) identifies one region of - interest from the image in the same manner as ``CreateReferenceImage``. If - you do not specify the ``bounding-poly`` column, then the system - will try to detect regions of interest automatically. + interest from the image in the same manner as ``CreateReferenceImage``. + If you do not specify the ``bounding-poly`` column, then the + system will try to detect regions of interest automatically. At most one ``bounding-poly`` column is allowed per line. If the image contains multiple regions of interest, add a line to @@ -937,11 +935,8 @@ class ImportProductSetsRequest(proto.Message): class ImportProductSetsResponse(proto.Message): r"""Response message for the ``ImportProductSets`` method. - This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method in the - returned `google.longrunning.Operation.response - `__ field. + This message is returned by the `google.longrunning.Operations.GetOperation `__ method in the returned + `google.longrunning.Operation.response `__ field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1.types.ReferenceImage]): @@ -971,8 +966,8 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` returned by - the ``GetOperation`` call of the ``google::longrunning::Operations`` service. + This is included in the ``metadata`` field of the ``Operation`` + returned by the ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1.types.BatchOperationMetadata.State): @@ -982,8 +977,7 @@ class BatchOperationMetadata(proto.Message): to the server. end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and - `google.longrunning.Operation.done - `__ is set to true. + `google.longrunning.Operation.done `__ is set to true. """ class State(proto.Enum): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py index 69949ab2ec73..ae4ab5bffaa8 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/text_annotation.py @@ -47,9 +47,8 @@ class TextAnnotation(proto.Message): TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each structural component, starting from Page, may further have their own properties. Properties describe detected languages, breaks etc.. - Please refer to the `TextAnnotation.TextProperty - `__ message - definition below for more detail. + Please refer to the `TextAnnotation.TextProperty `__ message definition below for more + detail. Attributes: pages (MutableSequence[google.cloud.vision_v1.types.Page]): @@ -103,7 +102,8 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or + ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py index 11ce1af125ac..f01723b70bf2 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/types/web_detection.py @@ -159,8 +159,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as "en-US" + or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py index 8c05c098940a..9527b2ddcd5f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/image_annotator.py @@ -101,9 +101,9 @@ class Feature(proto.Message): model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support - "builtin/weekly" for the bleeding edge release updated - weekly. + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also + support "builtin/weekly" for the bleeding edge release + updated weekly. """ class Type(proto.Enum): @@ -170,18 +170,15 @@ class ImageSource(proto.Message): gcs_image_uri (str): NOTE: For new code ``image_uri`` below is preferred. Google Cloud Storage image URI, which must be in the following - form: ``gs://bucket_name/object_name`` (for details, see `Google Cloud Storage - Request URIs - `__). - NOTE: Cloud Storage object versioning is not supported. + form: ``gs://bucket_name/object_name`` (for details, see `Google Cloud Storage Request URIs `__). NOTE: + Cloud Storage object versioning is not supported. image_uri (str): Image URI which supports: 1) Google Cloud Storage image URI, - which must be in the following form: ``gs://bucket_name/object_name`` (for details, - see `Google Cloud Storage Request URIs - `__). - NOTE: Cloud Storage object versioning is not supported. 2) - Publicly accessible image HTTP/HTTPS URL. This is preferred - over the legacy ``gcs_image_uri`` above. When both ``gcs_image_uri`` and + which must be in the following form: ``gs://bucket_name/object_name`` (for + details, see `Google Cloud Storage Request URIs `__). NOTE: Cloud Storage object + versioning is not supported. 2) Publicly accessible image + HTTP/HTTPS URL. This is preferred over the legacy + ``gcs_image_uri`` above. When both ``gcs_image_uri`` and ``image_uri`` are specified, ``image_uri`` takes precedence. """ @@ -201,12 +198,13 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. Note: as - with all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. + with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. source (google.cloud.vision_v1p1beta1.types.ImageSource): - Google Cloud Storage image location. If both ``content`` and - ``source`` are provided for an image, ``content`` takes - precedence and is used to perform the image annotation + Google Cloud Storage image location. If both ``content`` + and ``source`` are provided for an image, ``content`` + takes precedence and is used to perform the image annotation request. """ @@ -229,9 +227,9 @@ class FaceAnnotation(proto.Message): bounding_poly (google.cloud.vision_v1p1beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale, as returned - in ``ImageParams``. The bounding box is computed to "frame" the - face in accordance with human expectations. It is based on - the landmarker results. Note that one or more x and/or y + in ``ImageParams``. The bounding box is computed to "frame" + the face in accordance with human expectations. It is based + on the landmarker results. Note that one or more x and/or y coordinates may not be generated in the ``BoundingPoly`` (the polygon will be unbounded) if only a partial face appears in the image to be annotated. @@ -532,9 +530,8 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. + Opaque entity ID. Some IDs may be available in + `Google Knowledge Graph Search API `__. locale (str): The language code for the locale in which the entity textual ``description`` is expressed. @@ -560,11 +557,11 @@ class EntityAnnotation(proto.Message): ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p1beta1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one location may - indicate the location of the scene in the image, and another - location may indicate the location of the place where the - image was taken. Location information is usually present for - landmarks. + ``LocationInfo`` elements can be present because one location + may indicate the location of the scene in the image, and + another location may indicate the location of the place + where the image was taken. Location information is usually + present for landmarks. properties (MutableSequence[google.cloud.vision_v1p1beta1.types.Property]): Some entities may have optional user-supplied ``Property`` (name/value) fields, such a score or string that qualifies @@ -874,8 +871,7 @@ class ImageContext(proto.Message): setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified - languages is not one of the `supported languages - `__. + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p1beta1.types.CropHintsParams): Parameters for crop hints annotation request. web_detection_params (google.cloud.vision_v1p1beta1.types.WebDetectionParams): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py index a75a9fa65cf8..4c1d6a21dc94 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py @@ -47,9 +47,8 @@ class TextAnnotation(proto.Message): TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each structural component, starting from Page, may further have their own properties. Properties describe detected languages, breaks etc.. - Please refer to the `TextAnnotation.TextProperty - `__ - message definition below for more detail. + Please refer to the `TextAnnotation.TextProperty `__ message definition below for more + detail. Attributes: pages (MutableSequence[google.cloud.vision_v1p1beta1.types.Page]): @@ -103,7 +102,8 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or + ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py index bdfaf20fc558..2429d18853ed 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/web_detection.py @@ -157,8 +157,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as "en-US" + or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py index fac3e531df27..7f5fd23412f2 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py @@ -417,8 +417,9 @@ async def async_batch_annotate_files( r"""Run async image detection and annotation for a list of generic files (e.g. PDF) which may contain multiple pages and multiple images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` + (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py index 5c45ebfbd0da..a830e582b85e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/client.py @@ -835,8 +835,9 @@ def async_batch_annotate_files( r"""Run async image detection and annotation for a list of generic files (e.g. PDF) which may contain multiple pages and multiple images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` + (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py index 987a634073ed..a185836675c9 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py @@ -383,8 +383,9 @@ def async_batch_annotate_files( Run async image detection and annotation for a list of generic files (e.g. PDF) which may contain multiple pages and multiple images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` + (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py index 2d1bb1461b47..acd2bda2b145 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py @@ -392,8 +392,9 @@ def async_batch_annotate_files( Run async image detection and annotation for a list of generic files (e.g. PDF) which may contain multiple pages and multiple images per page. Progress and results can be retrieved through - the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains ``OperationMetadata`` - (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains + ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` + (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py index 64396d3d6d6b..cbcef9fab858 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py @@ -112,9 +112,9 @@ class Feature(proto.Message): model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support - "builtin/weekly" for the bleeding edge release updated - weekly. + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also + support "builtin/weekly" for the bleeding edge release + updated weekly. """ class Type(proto.Enum): @@ -185,11 +185,9 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud Storage - Request URIs - `__ - for more info. + The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. + Object versioning is not supported. See `Google Cloud Storage Request URIs `__ for + more info. image_uri (str): The URI of the source image. Can be either: @@ -211,8 +209,8 @@ class ImageSource(proto.Message): throttles requests to the site for abuse prevention. You should not depend on externally-hosted images for production applications. - When both ``gcs_image_uri`` and ``image_uri`` are specified, ``image_uri`` - takes precedence. + When both ``gcs_image_uri`` and ``image_uri`` are specified, + ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -231,13 +229,14 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. Note: As - with all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. + with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. source (google.cloud.vision_v1p2beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided for - an image, ``content`` takes precedence and is used to perform - the image annotation request. + image URL. If both ``content`` and ``source`` are + provided for an image, ``content`` takes precedence and is + used to perform the image annotation request. """ content: bytes = proto.Field( @@ -259,9 +258,9 @@ class FaceAnnotation(proto.Message): bounding_poly (google.cloud.vision_v1p2beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale, as returned - in ``ImageParams``. The bounding box is computed to "frame" the - face in accordance with human expectations. It is based on - the landmarker results. Note that one or more x and/or y + in ``ImageParams``. The bounding box is computed to "frame" + the face in accordance with human expectations. It is based + on the landmarker results. Note that one or more x and/or y coordinates may not be generated in the ``BoundingPoly`` (the polygon will be unbounded) if only a partial face appears in the image to be annotated. @@ -562,9 +561,8 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. + Opaque entity ID. Some IDs may be available in + `Google Knowledge Graph Search API `__. locale (str): The language code for the locale in which the entity textual ``description`` is expressed. @@ -574,9 +572,9 @@ class EntityAnnotation(proto.Message): score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field + **Deprecated. Use ``score`` instead.** The accuracy of + the entity detection in an image. For example, for an image + in which the "Eiffel Tower" entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1]. topicality (float): @@ -591,11 +589,11 @@ class EntityAnnotation(proto.Message): ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p2beta1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one location may - indicate the location of the scene in the image, and another - location may indicate the location of the place where the - image was taken. Location information is usually present for - landmarks. + ``LocationInfo`` elements can be present because one location + may indicate the location of the scene in the image, and + another location may indicate the location of the place + where the image was taken. Location information is usually + present for landmarks. properties (MutableSequence[google.cloud.vision_v1p2beta1.types.Property]): Some entities may have optional user-supplied ``Property`` (name/value) fields, such a score or string that qualifies @@ -904,8 +902,7 @@ class ImageContext(proto.Message): setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified - languages is not one of the `supported languages - `__. + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p2beta1.types.CropHintsParams): Parameters for crop hints annotation request. web_detection_params (google.cloud.vision_v1p2beta1.types.WebDetectionParams): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py index c7e783a90df0..8224c0280cb0 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/text_annotation.py @@ -47,9 +47,8 @@ class TextAnnotation(proto.Message): TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each structural component, starting from Page, may further have their own properties. Properties describe detected languages, breaks etc.. - Please refer to the `TextAnnotation.TextProperty - `__ - message definition below for more detail. + Please refer to the `TextAnnotation.TextProperty `__ message definition below for more + detail. Attributes: pages (MutableSequence[google.cloud.vision_v1p2beta1.types.Page]): @@ -103,7 +102,8 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or + ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py index 648d4e415953..84e3baa931e7 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/web_detection.py @@ -157,8 +157,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as "en-US" + or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py index 859e3f2d75dc..a1af5bceafd7 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py @@ -420,8 +420,9 @@ async def async_batch_annotate_files( r"""Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` + contains ``OperationMetadata`` (metadata). ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py index 33edfcb6ee2f..66e862558066 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/client.py @@ -880,8 +880,9 @@ def async_batch_annotate_files( r"""Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` + contains ``OperationMetadata`` (metadata). ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py index da3b17652595..72737925b3e5 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py @@ -383,8 +383,9 @@ def async_batch_annotate_files( Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` + contains ``OperationMetadata`` (metadata). ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py index d581414a7664..7b91a85d5429 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py @@ -392,8 +392,9 @@ def async_batch_annotate_files( Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` + contains ``OperationMetadata`` (metadata). ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py index 22fd04b0aff0..aa9baaf295d6 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py @@ -71,22 +71,18 @@ class ProductSearchAsyncClient: """Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named + - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups - to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - - The API has a collection of `Product - `__ resources, named + - The API has a collection of `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - Each `Product `__ has a collection of `ReferenceImage `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -774,10 +770,9 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1421,10 +1416,10 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include ``product_labels``, + ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1618,11 +1613,11 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, - the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -2540,15 +2535,14 @@ async def import_product_sets( r"""Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + `ImportProductSetsGcsSource.csv_file_uri `__. .. code-block:: python @@ -2615,11 +2609,8 @@ async def sample_import_product_sets(): :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets` method. - This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method - in the returned `google.longrunning.Operation.response - `__ field. + This message is returned by the `google.longrunning.Operations.GetOperation `__ method in + the returned `google.longrunning.Operation.response `__ field. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py index 4fbd8a8821f4..ec540bbb000e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/client.py @@ -115,22 +115,18 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): """Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named + - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups - to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - - The API has a collection of `Product - `__ resources, named + - The API has a collection of `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - Each `Product `__ has a collection of `ReferenceImage `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -1246,10 +1242,9 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1878,10 +1873,10 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include ``product_labels``, + ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -2069,11 +2064,11 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, - the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -2976,15 +2971,14 @@ def import_product_sets( r"""Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + `ImportProductSetsGcsSource.csv_file_uri `__. .. code-block:: python @@ -3051,11 +3045,8 @@ def sample_import_product_sets(): :class:`google.cloud.vision_v1p3beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets` method. - This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method - in the returned `google.longrunning.Operation.response - `__ field. + This message is returned by the `google.longrunning.Operations.GetOperation `__ method in + the returned `google.longrunning.Operation.response `__ field. """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py index 6a2bcd14428b..12a294d5fc63 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py @@ -115,22 +115,18 @@ class ProductSearchGrpcTransport(ProductSearchTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named + - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups - to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - - The API has a collection of `Product - `__ resources, named + - The API has a collection of `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - Each `Product `__ has a collection of `ReferenceImage `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -726,11 +722,11 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, - the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -998,15 +994,14 @@ def import_product_sets( Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + `ImportProductSetsGcsSource.csv_file_uri `__. Returns: Callable[[~.ImportProductSetsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py index 57030b23f630..94bd5be87e8b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py @@ -121,22 +121,18 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named + - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups - to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - - The API has a collection of `Product - `__ resources, named + - The API has a collection of `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - Each `Product `__ has a collection of `ReferenceImage `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -742,11 +738,11 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, - the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -1017,15 +1013,14 @@ def import_product_sets( Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + `ImportProductSetsGcsSource.csv_file_uri `__. Returns: Callable[[~.ImportProductSetsRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py index 1695ffc9ea49..4154063e864c 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/transports/rest.py @@ -952,22 +952,18 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): Manages Products and ProductSets of reference images for use in product search. It uses the following resource model: - - The API has a collection of `ProductSet - `__ resources, named + - The API has a collection of `ProductSet `__ resources, named - ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into groups - to limit identification. + ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into + groups to limit identification. In parallel, - - The API has a collection of `Product - `__ resources, named + - The API has a collection of `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of `ReferenceImage - `__ resources, named - ``projects/*/locations/*/products/*/referenceImages/*`` + - Each `Product `__ has a collection of `ReferenceImage `__ resources, + named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py index a35db42c9570..b0341e4c042a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/image_annotator.py @@ -117,9 +117,9 @@ class Feature(proto.Message): model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support - "builtin/weekly" for the bleeding edge release updated - weekly. + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also + support "builtin/weekly" for the bleeding edge release + updated weekly. """ class Type(proto.Enum): @@ -196,11 +196,9 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud Storage - Request URIs - `__ - for more info. + The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. + Object versioning is not supported. See `Google Cloud Storage Request URIs `__ for + more info. image_uri (str): The URI of the source image. Can be either: @@ -222,8 +220,8 @@ class ImageSource(proto.Message): throttles requests to the site for abuse prevention. You should not depend on externally-hosted images for production applications. - When both ``gcs_image_uri`` and ``image_uri`` are specified, ``image_uri`` - takes precedence. + When both ``gcs_image_uri`` and ``image_uri`` are specified, + ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -242,13 +240,14 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. Note: As - with all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. + with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. source (google.cloud.vision_v1p3beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided for - an image, ``content`` takes precedence and is used to perform - the image annotation request. + image URL. If both ``content`` and ``source`` are + provided for an image, ``content`` takes precedence and is + used to perform the image annotation request. """ content: bytes = proto.Field( @@ -270,9 +269,9 @@ class FaceAnnotation(proto.Message): bounding_poly (google.cloud.vision_v1p3beta1.types.BoundingPoly): The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale, as returned - in ``ImageParams``. The bounding box is computed to "frame" the - face in accordance with human expectations. It is based on - the landmarker results. Note that one or more x and/or y + in ``ImageParams``. The bounding box is computed to "frame" + the face in accordance with human expectations. It is based + on the landmarker results. Note that one or more x and/or y coordinates may not be generated in the ``BoundingPoly`` (the polygon will be unbounded) if only a partial face appears in the image to be annotated. @@ -573,9 +572,8 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. + Opaque entity ID. Some IDs may be available in + `Google Knowledge Graph Search API `__. locale (str): The language code for the locale in which the entity textual ``description`` is expressed. @@ -585,9 +583,9 @@ class EntityAnnotation(proto.Message): score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field + **Deprecated. Use ``score`` instead.** The accuracy of + the entity detection in an image. For example, for an image + in which the "Eiffel Tower" entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1]. topicality (float): @@ -602,11 +600,11 @@ class EntityAnnotation(proto.Message): ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p3beta1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one location may - indicate the location of the scene in the image, and another - location may indicate the location of the place where the - image was taken. Location information is usually present for - landmarks. + ``LocationInfo`` elements can be present because one location + may indicate the location of the scene in the image, and + another location may indicate the location of the place + where the image was taken. Location information is usually + present for landmarks. properties (MutableSequence[google.cloud.vision_v1p3beta1.types.Property]): Some entities may have optional user-supplied ``Property`` (name/value) fields, such a score or string that qualifies @@ -958,8 +956,7 @@ class ImageContext(proto.Message): setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified - languages is not one of the `supported languages - `__. + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p3beta1.types.CropHintsParams): Parameters for crop hints annotation request. product_search_params (google.cloud.vision_v1p3beta1.types.ProductSearchParams): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py index 159931be2852..f260c79d8ade 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search.py @@ -40,9 +40,8 @@ class ProductSearchParams(proto.Message): interest in the image. If it is not specified, system discretion will be applied. product_set (str): - The resource name of a `ProductSet - `__ to be searched - for similar images. + The resource name of a `ProductSet `__ to be searched for + similar images. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py index 55b9e517a16d..3982fa338548 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/product_search_service.py @@ -361,10 +361,10 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include ``product_labels``, + ``display_name``, and ``description``. """ product: "Product" = proto.Field( @@ -512,10 +512,9 @@ class UpdateProductSetRequest(proto.Message): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. """ product_set: "ProductSet" = proto.Field( @@ -596,8 +595,8 @@ class ListReferenceImagesRequest(proto.Message): Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value of ``nextPageToken`` returned in a previous reference - image list request. + is the value of ``nextPageToken`` returned in a previous + reference image list request. Defaults to the first page if not specified. """ @@ -841,12 +840,9 @@ class ImportProductSetsGcsSource(proto.Message): ignored. If a Product doesn't exist and needs to be created on the - fly, the product_display_name field refers to - `Product.display_name - `__, the - product_category field refers to `Product.product_category - `__, - and the labels field refers to [Product.labels][]. + fly, the product_display_name field refers to `Product.display_name `__, + the product_category field refers to `Product.product_category `__, and the + labels field refers to [Product.labels][]. Labels (optional) should be a line containing a list of comma-separated key-value pairs, with the format @@ -931,11 +927,8 @@ class ImportProductSetsRequest(proto.Message): class ImportProductSetsResponse(proto.Message): r"""Response message for the ``ImportProductSets`` method. - This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method in the - returned `google.longrunning.Operation.response - `__ field. + This message is returned by the `google.longrunning.Operations.GetOperation `__ method in the returned + `google.longrunning.Operation.response `__ field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1p3beta1.types.ReferenceImage]): @@ -965,8 +958,8 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` returned by - the ``GetOperation`` call of the ``google::longrunning::Operations`` service. + This is included in the ``metadata`` field of the ``Operation`` + returned by the ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1p3beta1.types.BatchOperationMetadata.State): @@ -976,8 +969,7 @@ class BatchOperationMetadata(proto.Message): to the server. end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and - `google.longrunning.Operation.done - `__ is set to true. + `google.longrunning.Operation.done `__ is set to true. """ class State(proto.Enum): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py index d8909a5a9aa8..683e7556c71a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/text_annotation.py @@ -47,9 +47,8 @@ class TextAnnotation(proto.Message): TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each structural component, starting from Page, may further have their own properties. Properties describe detected languages, breaks etc.. - Please refer to the `TextAnnotation.TextProperty - `__ - message definition below for more detail. + Please refer to the `TextAnnotation.TextProperty `__ message definition below for more + detail. Attributes: pages (MutableSequence[google.cloud.vision_v1p3beta1.types.Page]): @@ -103,7 +102,8 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or + ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py index 887e53444d05..1c408f107189 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/types/web_detection.py @@ -157,8 +157,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as "en-US" + or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py index 8d55489ba576..6295f6a002ef 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py @@ -536,8 +536,8 @@ async def async_batch_annotate_images( images. Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` - contains ``AsyncBatchAnnotateImagesResponse`` (results). + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -676,8 +676,9 @@ async def async_batch_annotate_files( r"""Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` + contains ``OperationMetadata`` (metadata). ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py index 2b13c618f704..e9b57cae422a 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/client.py @@ -993,8 +993,8 @@ def async_batch_annotate_images( images. Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` - contains ``AsyncBatchAnnotateImagesResponse`` (results). + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -1132,8 +1132,9 @@ def async_batch_annotate_files( r"""Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` + contains ``OperationMetadata`` (metadata). ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py index 092400ce8822..6caee99b1f70 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py @@ -421,8 +421,8 @@ def async_batch_annotate_images( images. Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` - contains ``AsyncBatchAnnotateImagesResponse`` (results). + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -459,8 +459,9 @@ def async_batch_annotate_files( Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` + contains ``OperationMetadata`` (metadata). ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py index 04ed7e953485..1c13d03f1ad7 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py @@ -430,8 +430,8 @@ def async_batch_annotate_images( images. Progress and results can be retrieved through the ``google.longrunning.Operations`` - interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). ``Operation.response`` - contains ``AsyncBatchAnnotateImagesResponse`` (results). + interface. ``Operation.metadata`` contains ``OperationMetadata`` (metadata). + ``Operation.response`` contains ``AsyncBatchAnnotateImagesResponse`` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing @@ -469,8 +469,9 @@ def async_batch_annotate_files( Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` contains - ``OperationMetadata`` (metadata). ``Operation.response`` contains ``AsyncBatchAnnotateFilesResponse`` (results). + retrieved through the ``google.longrunning.Operations`` interface. ``Operation.metadata`` + contains ``OperationMetadata`` (metadata). ``Operation.response`` contains + ``AsyncBatchAnnotateFilesResponse`` (results). Returns: Callable[[~.AsyncBatchAnnotateFilesRequest], diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py index 39c7e3900fb8..a23c6f8c901e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py @@ -74,22 +74,18 @@ class ProductSearchAsyncClient: - The API has a collection of - `ProductSet `__ resources, - named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` + `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of + - Each `Product `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `ReferenceImage `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ _client: ProductSearchClient @@ -777,10 +773,9 @@ async def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1364,7 +1359,8 @@ async def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + ``description``, and ``labels`` fields can be updated right + now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -1420,10 +1416,10 @@ async def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include ``product_labels``, + ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1614,11 +1610,11 @@ async def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, - the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -2527,15 +2523,14 @@ async def import_product_sets( r"""Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + `ImportProductSetsGcsSource.csv_file_uri `__. .. code-block:: python @@ -2602,11 +2597,8 @@ async def sample_import_product_sets(): :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets` method. - This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method - in the returned `google.longrunning.Operation.response - `__ field. + This message is returned by the `google.longrunning.Operations.GetOperation `__ method in + the returned `google.longrunning.Operation.response `__ field. """ # Create or coerce a protobuf request object. @@ -2702,9 +2694,8 @@ async def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py index 47b090e56059..e471e68c0431 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/client.py @@ -118,22 +118,18 @@ class ProductSearchClient(metaclass=ProductSearchClientMeta): - The API has a collection of - `ProductSet `__ resources, - named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` + `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of + - Each `Product `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `ReferenceImage `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` """ @staticmethod @@ -1249,10 +1245,9 @@ def sample_update_product_set(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1821,7 +1816,8 @@ def update_product( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> product_search_service.Product: r"""Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + ``description``, and ``labels`` fields can be updated right + now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -1877,10 +1873,10 @@ def sample_update_product(): on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include ``product_labels``, + ``display_name``, and ``description``. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -2065,11 +2061,11 @@ def create_reference_image( ) -> product_search_service.ReferenceImage: r"""Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, - the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -2963,15 +2959,14 @@ def import_product_sets( r"""Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + `ImportProductSetsGcsSource.csv_file_uri `__. .. code-block:: python @@ -3038,11 +3033,8 @@ def sample_import_product_sets(): :class:`google.cloud.vision_v1p4beta1.types.ImportProductSetsResponse`` Response message for the ``ImportProductSets` method. - This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method - in the returned `google.longrunning.Operation.response - `__ field. + This message is returned by the `google.longrunning.Operations.GetOperation `__ method in + the returned `google.longrunning.Operation.response `__ field. """ # Create or coerce a protobuf request object. @@ -3135,9 +3127,8 @@ def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) .. code-block:: python diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py index ea19ada301c4..1436872bc649 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py @@ -117,22 +117,18 @@ class ProductSearchGrpcTransport(ProductSearchTransport): - The API has a collection of - `ProductSet `__ resources, - named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` + `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of + - Each `Product `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `ReferenceImage `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -642,7 +638,8 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + ``description``, and ``labels`` fields can be updated right + now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -721,11 +718,11 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, - the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -984,15 +981,14 @@ def import_product_sets( Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + `ImportProductSetsGcsSource.csv_file_uri `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1043,9 +1039,8 @@ def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py index 76eadc3d06a7..3dd935a52d34 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py @@ -123,22 +123,18 @@ class ProductSearchGrpcAsyncIOTransport(ProductSearchTransport): - The API has a collection of - `ProductSet `__ resources, - named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` + `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of + - Each `Product `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `ReferenceImage `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -656,7 +652,8 @@ def update_product( r"""Return a callable for the update product method over gRPC. Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + ``description``, and ``labels`` fields can be updated right + now. If labels are updated, the change will not be reflected in queries until the next index time. @@ -737,11 +734,11 @@ def create_reference_image( Creates and returns a new ReferenceImage resource. - The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, - the system will try to detect regions of interest in the image - that are compatible with the product_category on the parent - product. If it is specified, detection is ALWAYS skipped. The - system converts polygons into non-rotated rectangles. + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not + specified, the system will try to detect regions of interest in + the image that are compatible with the product_category on the + parent product. If it is specified, detection is ALWAYS skipped. + The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). @@ -1003,15 +1000,14 @@ def import_product_sets( Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. (results) + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains + ``BatchOperationMetadata``. (progress) ``Operation.response`` contains ``ImportProductSetsResponse``. + (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see - `ImportProductSetsGcsSource.csv_file_uri - `__. + `ImportProductSetsGcsSource.csv_file_uri `__. Returns: Callable[[~.ImportProductSetsRequest], @@ -1063,9 +1059,8 @@ def purge_products( into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. - The `google.longrunning.Operation - `__ API can be used to keep track - of the progress and results of the request. ``Operation.metadata`` contains + The `google.longrunning.Operation `__ API can be used to keep track of the progress + and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadata``. (progress) Returns: diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py index e37dff150130..727072328535 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/transports/rest.py @@ -1011,22 +1011,18 @@ class ProductSearchRestTransport(_BaseProductSearchRestTransport): - The API has a collection of - `ProductSet `__ resources, - named ``projects/*/locations/*/productSets/*``, which acts as a way to put different products into - groups to limit identification. + `ProductSet `__ resources, named ``projects/*/locations/*/productSets/*``, which acts as a way to + put different products into groups to limit identification. In parallel, - The API has a collection of - `Product `__ resources, named - ``projects/*/locations/*/products/*`` + `Product `__ resources, named ``projects/*/locations/*/products/*`` - - Each `Product `__ has a - collection of + - Each `Product `__ has a collection of - `ReferenceImage `__ - resources, named ``projects/*/locations/*/products/*/referenceImages/*`` + `ReferenceImage `__ resources, named ``projects/*/locations/*/products/*/referenceImages/*`` This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py index 7a59b3ae48dd..4943eb8e09e8 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/face.py @@ -34,8 +34,7 @@ class FaceRecognitionParams(proto.Message): Attributes: celebrity_set (MutableSequence[str]): - The resource names for one or more `CelebritySet - `__s. A + The resource names for one or more `CelebritySet `__s. A celebrity set is preloaded and can be specified as "builtin/default". If this is specified, the algorithm will try to match the faces detected in the input image to the @@ -80,8 +79,7 @@ class FaceRecognitionResult(proto.Message): Attributes: celebrity (google.cloud.vision_v1p4beta1.types.Celebrity): - The `Celebrity `__ - that this face was matched to. + The `Celebrity `__ that this face was matched to. confidence (float): Recognition confidence. Range [0, 1]. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py index b6b32e8e7fdf..1d90ab22d33f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/image_annotator.py @@ -118,9 +118,9 @@ class Feature(proto.Message): model (str): Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and - "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also support - "builtin/weekly" for the bleeding edge release updated - weekly. + "builtin/latest". ``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` also + support "builtin/weekly" for the bleeding edge release + updated weekly. """ class Type(proto.Enum): @@ -197,11 +197,9 @@ class ImageSource(proto.Message): gcs_image_uri (str): **Use ``image_uri`` instead.** - The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud Storage - Request URIs - `__ - for more info. + The Google Cloud Storage URI of the form ``gs://bucket_name/object_name``. + Object versioning is not supported. See `Google Cloud Storage Request URIs `__ for + more info. image_uri (str): The URI of the source image. Can be either: @@ -223,8 +221,8 @@ class ImageSource(proto.Message): throttles requests to the site for abuse prevention. You should not depend on externally-hosted images for production applications. - When both ``gcs_image_uri`` and ``image_uri`` are specified, ``image_uri`` - takes precedence. + When both ``gcs_image_uri`` and ``image_uri`` are specified, + ``image_uri`` takes precedence. """ gcs_image_uri: str = proto.Field( @@ -243,13 +241,14 @@ class Image(proto.Message): Attributes: content (bytes): Image content, represented as a stream of bytes. Note: As - with all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. + with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. source (google.cloud.vision_v1p4beta1.types.ImageSource): Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided for - an image, ``content`` takes precedence and is used to perform - the image annotation request. + image URL. If both ``content`` and ``source`` are + provided for an image, ``content`` takes precedence and is + used to perform the image annotation request. """ content: bytes = proto.Field( @@ -274,8 +273,8 @@ class FaceAnnotation(proto.Message): box is computed to "frame" the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y coordinates may not be generated - in the ``BoundingPoly`` (the polygon will be unbounded) if only a - partial face appears in the image to be annotated. + in the ``BoundingPoly`` (the polygon will be unbounded) if only + a partial face appears in the image to be annotated. fd_bounding_poly (google.cloud.vision_v1p4beta1.types.BoundingPoly): The ``fd_bounding_poly`` bounding polygon is tighter than the ``boundingPoly``, and encloses only the skin part of the face. @@ -320,11 +319,9 @@ class FaceAnnotation(proto.Message): recognition_result (MutableSequence[google.cloud.vision_v1p4beta1.types.FaceRecognitionResult]): Additional recognition information. Only computed if image_context.face_recognition_params is provided, **and** a - match is found to a `Celebrity - `__ in the input - `CelebritySet - `__. This field - is sorted in order of decreasing confidence values. + match is found to a `Celebrity `__ in the input + `CelebritySet `__. This field is sorted in order of decreasing + confidence values. """ class Landmark(proto.Message): @@ -588,9 +585,8 @@ class EntityAnnotation(proto.Message): Attributes: mid (str): - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. + Opaque entity ID. Some IDs may be available in + `Google Knowledge Graph Search API `__. locale (str): The language code for the locale in which the entity textual ``description`` is expressed. @@ -600,9 +596,9 @@ class EntityAnnotation(proto.Message): score (float): Overall score of the result. Range [0, 1]. confidence (float): - **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field + **Deprecated. Use ``score`` instead.** The accuracy of + the entity detection in an image. For example, for an image + in which the "Eiffel Tower" entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1]. topicality (float): @@ -617,11 +613,11 @@ class EntityAnnotation(proto.Message): ``LABEL_DETECTION`` features. locations (MutableSequence[google.cloud.vision_v1p4beta1.types.LocationInfo]): The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one location may - indicate the location of the scene in the image, and another - location may indicate the location of the place where the - image was taken. Location information is usually present for - landmarks. + ``LocationInfo`` elements can be present because one location + may indicate the location of the scene in the image, and + another location may indicate the location of the place + where the image was taken. Location information is usually + present for landmarks. properties (MutableSequence[google.cloud.vision_v1p4beta1.types.Property]): Some entities may have optional user-supplied ``Property`` (name/value) fields, such a score or string that qualifies @@ -973,8 +969,7 @@ class ImageContext(proto.Message): setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified - languages is not one of the `supported languages - `__. + languages is not one of the `supported languages `__. crop_hints_params (google.cloud.vision_v1p4beta1.types.CropHintsParams): Parameters for crop hints annotation request. face_recognition_params (google.cloud.vision_v1p4beta1.types.FaceRecognitionParams): @@ -1507,8 +1502,9 @@ class InputConfig(proto.Message): input from. content (bytes): File content, represented as a stream of bytes. Note: As - with all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. + with all ``bytes`` fields, protobuffers use a pure + binary representation, whereas JSON representations use + base64. Currently, this field only works for BatchAnnotateFiles requests. It does not work for AsyncBatchAnnotateFiles diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py index 8a629bd11304..4e8a4aef9ad8 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search.py @@ -40,9 +40,8 @@ class ProductSearchParams(proto.Message): interest in the image. If it is not specified, system discretion will be applied. product_set (str): - The resource name of a `ProductSet - `__ to be searched - for similar images. + The resource name of a `ProductSet `__ to be searched for + similar images. Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. product_categories (MutableSequence[str]): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py index 2a54dc4d7b22..e4e5bf138b98 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/product_search_service.py @@ -369,10 +369,10 @@ class UpdateProductRequest(proto.Message): the one on the server. product.name is immutable. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask paths include ``product_labels``, ``display_name``, and ``description``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask paths include ``product_labels``, + ``display_name``, and ``description``. """ product: "Product" = proto.Field( @@ -520,10 +520,9 @@ class UpdateProductSetRequest(proto.Message): Required. The ProductSet resource which replaces the one on the server. update_mask (google.protobuf.field_mask_pb2.FieldMask): - The `FieldMask `__ that - specifies which fields to update. If update_mask isn't - specified, all mutable fields are to be updated. Valid - mask path is ``display_name``. + The `FieldMask `__ that specifies which fields to update. + If update_mask isn't specified, all mutable fields are + to be updated. Valid mask path is ``display_name``. """ product_set: "ProductSet" = proto.Field( @@ -604,8 +603,8 @@ class ListReferenceImagesRequest(proto.Message): Default 10, maximum 100. page_token (str): A token identifying a page of results to be returned. This - is the value of ``nextPageToken`` returned in a previous reference - image list request. + is the value of ``nextPageToken`` returned in a previous + reference image list request. Defaults to the first page if not specified. """ @@ -834,42 +833,41 @@ class ImportProductSetsGcsSource(proto.Message): 8. bounding-poly - The ``image-uri``, ``product-set-id``, ``product-id``, and ``product-category`` columns - are required. All other columns are optional. + The ``image-uri``, ``product-set-id``, ``product-id``, and + ``product-category`` columns are required. All other columns are + optional. - If the ``ProductSet`` or ``Product`` specified by the ``product-set-id`` and - ``product-id`` values does not exist, then the system will create - a new ``ProductSet`` or ``Product`` for the image. In this case, - the ``product-display-name`` column refers to `display_name - `__, the - ``product-category`` column refers to `product_category - `__, - and the ``labels`` column refers to `product_labels - `__. + If the ``ProductSet`` or ``Product`` specified by the + ``product-set-id`` and ``product-id`` values does not exist, then + the system will create a new ``ProductSet`` or ``Product`` + for the image. In this case, the ``product-display-name`` column refers + to `display_name `__, the ``product-category`` column refers to + `product_category `__, and the ``labels`` column refers to + `product_labels `__. The ``image-id`` column is optional but must be unique if provided. If it is empty, the system will automatically assign a unique id to the image. - The ``product-display-name`` column is optional. If it is empty, the system - sets the `display_name - `__ - field for the product to a space (" "). You can update the - ``display_name`` later by using the API. + The ``product-display-name`` column is optional. If it is empty, the + system sets the `display_name `__ field for the product to a + space (" "). You can update the ``display_name`` later by using + the API. - If a ``Product`` with the specified ``product-id`` already exists, - then the system ignores the ``product-display-name``, ``product-category``, and - ``labels`` columns. + If a ``Product`` with the specified ``product-id`` already + exists, then the system ignores the ``product-display-name``, + ``product-category``, and ``labels`` columns. - The ``labels`` column (optional) is a line containing a list - of comma-separated key-value pairs, in the following format: + The ``labels`` column (optional) is a line containing a + list of comma-separated key-value pairs, in the following + format: "key_1=value_1,key_2=value_2,...,key_n=value_n" The ``bounding-poly`` column (optional) identifies one region of - interest from the image in the same manner as ``CreateReferenceImage``. If - you do not specify the ``bounding-poly`` column, then the system - will try to detect regions of interest automatically. + interest from the image in the same manner as ``CreateReferenceImage``. + If you do not specify the ``bounding-poly`` column, then the + system will try to detect regions of interest automatically. At most one ``bounding-poly`` column is allowed per line. If the image contains multiple regions of interest, add a line to @@ -942,11 +940,8 @@ class ImportProductSetsRequest(proto.Message): class ImportProductSetsResponse(proto.Message): r"""Response message for the ``ImportProductSets`` method. - This message is returned by the - `google.longrunning.Operations.GetOperation - `__ method in the - returned `google.longrunning.Operation.response - `__ field. + This message is returned by the `google.longrunning.Operations.GetOperation `__ method in the returned + `google.longrunning.Operation.response `__ field. Attributes: reference_images (MutableSequence[google.cloud.vision_v1p4beta1.types.ReferenceImage]): @@ -976,8 +971,8 @@ class ImportProductSetsResponse(proto.Message): class BatchOperationMetadata(proto.Message): r"""Metadata for the batch operations such as the current state. - This is included in the ``metadata`` field of the ``Operation`` returned by - the ``GetOperation`` call of the ``google::longrunning::Operations`` service. + This is included in the ``metadata`` field of the ``Operation`` + returned by the ``GetOperation`` call of the ``google::longrunning::Operations`` service. Attributes: state (google.cloud.vision_v1p4beta1.types.BatchOperationMetadata.State): @@ -987,8 +982,7 @@ class BatchOperationMetadata(proto.Message): to the server. end_time (google.protobuf.timestamp_pb2.Timestamp): The time when the batch request is finished and - `google.longrunning.Operation.done - `__ is set to true. + `google.longrunning.Operation.done `__ is set to true. """ class State(proto.Enum): diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py index 077ddf8f9157..4d3134cc3205 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/text_annotation.py @@ -47,9 +47,8 @@ class TextAnnotation(proto.Message): TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each structural component, starting from Page, may further have their own properties. Properties describe detected languages, breaks etc.. - Please refer to the `TextAnnotation.TextProperty - `__ - message definition below for more detail. + Please refer to the `TextAnnotation.TextProperty `__ message definition below for more + detail. Attributes: pages (MutableSequence[google.cloud.vision_v1p4beta1.types.Page]): @@ -103,7 +102,8 @@ class BreakType(proto.Enum): Line-wrapping break. HYPHEN (4): End-line hyphen that is not present in text; does not - co-occur with ``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``. + co-occur with ``SPACE``, ``LEADER_SPACE``, or + ``LINE_BREAK``. LINE_BREAK (5): Line break that ends a paragraph. """ diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py index 3bfadec02406..97298e71619f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/types/web_detection.py @@ -159,8 +159,8 @@ class WebLabel(proto.Message): label (str): Label for extra metadata. language_code (str): - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see + The BCP-47 language code for ``label``, such as "en-US" + or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. """