diff --git a/.generator/cli.py b/.generator/cli.py index a9491a400e25..1b566ad2cc56 100644 --- a/.generator/cli.py +++ b/.generator/cli.py @@ -52,7 +52,7 @@ INPUT_DIR = "input" LIBRARIAN_DIR = "librarian" -OUTPUT_DIR = "output" +OUTPUT_DIR = "/usr/local/google/home/omairn/git/googleapis/google-cloud-python/output" REPO_DIR = "repo" SOURCE_DIR = "source" _GITHUB_BASE = "https://github.com" @@ -343,7 +343,9 @@ def _run_post_processor(output: str, library_id: str, is_mono_repo: bool): # If this file exists, run those customizations instead of `owlbot_main` if Path(f"{output}/librarian.py").exists(): subprocess.run(["python3.14", f"{output}/librarian.py"]) + print("subproces for python 3.14 main") else: + print("owl_bot main") python.owlbot_main() else: raise SYNTHTOOL_IMPORT_ERROR # pragma: NO COVER @@ -713,13 +715,19 @@ def handle_generate( _generate_api( api_path, library_id, source, output, version, is_mono_repo ) + print("copy files") _copy_files_needed_for_post_processing(output, input, library_id, is_mono_repo) + print("_generate_repo_metadata_file") _generate_repo_metadata_file( output, library_id, source, apis_to_generate, is_mono_repo ) + print("_run_post_processor") _run_post_processor(output, library_id, is_mono_repo) + print("_copy_readme_to_docs") _copy_readme_to_docs(output, library_id, is_mono_repo) + print("_clean_up_files_after_post_processing") _clean_up_files_after_post_processing(output, library_id, is_mono_repo) + print("cleaned") except Exception as e: raise ValueError("Generation failed.") from e logger.info("'generate' command executed.") 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_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/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py index bf2a1db0a73a..a6cc7cd7b7d6 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][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/*`` + - 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/*`` + - 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 @@ -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 @@ -476,8 +477,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 @@ -609,7 +610,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 @@ -732,10 +733,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 @@ -974,12 +975,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 @@ -1114,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 @@ -1245,7 +1246,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 @@ -1366,14 +1367,14 @@ async def update_product( 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 @@ -1620,14 +1621,14 @@ 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. + - 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 @@ -1882,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 @@ -2017,7 +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 @@ -2140,8 +2141,8 @@ async def add_product_to_product_set( 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 @@ -2386,8 +2387,8 @@ async def list_products_in_product_set( 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 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..38f27419ccaa 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][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/*`` + - 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/*`` + - Each [Product][google.cloud.vision.v1.Product] has a collection + of [ReferenceImage][google.cloud.vision.v1.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 @@ -954,8 +955,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 @@ -1084,7 +1085,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 @@ -1204,10 +1205,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 @@ -1440,12 +1441,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 @@ -1577,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 @@ -1705,7 +1706,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 @@ -1823,14 +1824,14 @@ def update_product( 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 @@ -2071,14 +2072,14 @@ 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. + - 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 @@ -2327,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 @@ -2459,7 +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 @@ -2579,8 +2580,8 @@ def add_product_to_product_set( 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 @@ -2823,8 +2824,8 @@ def list_products_in_product_set( 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 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..49c1d67ea8d5 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][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/*`` + - 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/*`` + - 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 @@ -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], @@ -470,10 +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], @@ -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], @@ -642,14 +643,14 @@ def update_product( 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], @@ -723,14 +724,14 @@ 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. + - 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 +799,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 +834,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], @@ -868,8 +869,8 @@ def add_product_to_product_set( 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], @@ -937,8 +938,8 @@ def list_products_in_product_set( 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], 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..87b77594741f 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][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/*`` + - 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/*`` + - 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 @@ -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], @@ -479,10 +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], @@ -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], @@ -656,14 +657,14 @@ def update_product( 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], @@ -739,14 +740,14 @@ 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. + - 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 +815,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 +850,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], @@ -885,8 +886,8 @@ def add_product_to_product_set( 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], @@ -955,8 +956,8 @@ def list_products_in_product_set( 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], 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..989ee3b46bf8 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][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/*`` + - 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/*`` + - 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 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..0f90a80edc54 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 @@ -937,11 +937,11 @@ 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( @@ -1712,16 +1712,16 @@ class GcsDestination(proto.Message): 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 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..147882ede09f 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 @@ -210,24 +210,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). @@ -303,11 +303,11 @@ 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: 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): @@ -349,11 +349,11 @@ 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: 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 @@ -397,11 +397,11 @@ 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: 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. 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/text_annotation.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/types/text_annotation.py index 6a1893ff64f2..12cb85899494 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 @@ -208,11 +208,11 @@ 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: 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). @@ -288,11 +288,11 @@ 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: 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): @@ -334,11 +334,11 @@ 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: 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 @@ -382,11 +382,11 @@ 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: 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. 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/types/image_annotator.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/types/image_annotator.py index 89143e766721..abf117453d06 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 @@ -1336,9 +1336,9 @@ class GcsDestination(proto.Message): 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 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..2e6841a82cc9 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 @@ -210,24 +210,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). @@ -303,11 +303,11 @@ 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: 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): @@ -349,11 +349,11 @@ 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: 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 @@ -397,11 +397,11 @@ 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: 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. 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/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py index 5902002a7d3d..57223ffcf011 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,23 @@ 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][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/*`` + - 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/*`` + - 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,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 @@ -476,8 +477,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 @@ -609,7 +610,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 @@ -732,10 +733,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 @@ -870,7 +871,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 @@ -978,12 +979,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 @@ -1118,8 +1119,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 @@ -1249,7 +1250,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 @@ -1370,14 +1371,14 @@ async def update_product( 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 @@ -1509,7 +1510,7 @@ async def delete_product( Possible errors: - - Returns NOT_FOUND if the product does not exist. + - Returns NOT_FOUND if the product does not exist. .. code-block:: python @@ -1627,14 +1628,14 @@ 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. + - 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 @@ -1786,7 +1787,7 @@ async def delete_reference_image( 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 @@ -1894,9 +1895,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 @@ -2029,7 +2030,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 @@ -2153,8 +2154,8 @@ async def add_product_to_product_set( 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 @@ -2278,8 +2279,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 @@ -2404,8 +2405,8 @@ async def list_products_in_product_set( 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 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..cc6e794c1d7e 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,23 @@ 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][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/*`` + - 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/*`` + - 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,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 @@ -954,8 +955,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 @@ -1084,7 +1085,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 @@ -1204,10 +1205,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 @@ -1339,7 +1340,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 @@ -1444,12 +1445,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 @@ -1581,8 +1582,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 @@ -1709,7 +1710,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 @@ -1827,14 +1828,14 @@ def update_product( 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 @@ -1963,7 +1964,7 @@ def delete_product( Possible errors: - - Returns NOT_FOUND if the product does not exist. + - Returns NOT_FOUND if the product does not exist. .. code-block:: python @@ -2078,14 +2079,14 @@ 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. + - 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 @@ -2234,7 +2235,7 @@ def delete_reference_image( 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 @@ -2339,9 +2340,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 @@ -2471,7 +2472,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 @@ -2592,8 +2593,8 @@ def add_product_to_product_set( 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 @@ -2716,8 +2717,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 @@ -2841,8 +2842,8 @@ def list_products_in_product_set( 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 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..db88bf679df7 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,23 @@ 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][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/*`` + - 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/*`` + - 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,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], @@ -472,10 +473,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], @@ -509,7 +510,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 +542,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 +580,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 +613,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,14 +649,14 @@ def update_product( 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], @@ -689,7 +690,7 @@ def delete_product( Possible errors: - - Returns NOT_FOUND if the product does not exist. + - Returns NOT_FOUND if the product does not exist. Returns: Callable[[~.DeleteProductRequest], @@ -732,14 +733,14 @@ 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. + - 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], @@ -778,7 +779,7 @@ def delete_reference_image( 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 +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], @@ -846,7 +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], @@ -881,8 +882,8 @@ def add_product_to_product_set( 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 +918,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], @@ -955,8 +956,8 @@ def list_products_in_product_set( 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], 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..85218f735144 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,23 @@ 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][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/*`` + - 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/*`` + - 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,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], @@ -481,10 +482,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], @@ -520,7 +521,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 +554,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 +592,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 +626,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], @@ -662,14 +663,14 @@ def update_product( 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], @@ -705,7 +706,7 @@ def delete_product( Possible errors: - - Returns NOT_FOUND if the product does not exist. + - Returns NOT_FOUND if the product does not exist. Returns: Callable[[~.DeleteProductRequest], @@ -748,14 +749,14 @@ 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. + - 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], @@ -794,7 +795,7 @@ def delete_reference_image( 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 +828,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 +863,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], @@ -898,8 +899,8 @@ def add_product_to_product_set( 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 +936,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], @@ -973,8 +974,8 @@ def list_products_in_product_set( 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], 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..ad609bc2c895 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,23 @@ 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][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/*`` + - 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/*`` + - 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 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..734b2ad94e99 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 @@ -1416,9 +1416,9 @@ class GcsDestination(proto.Message): 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 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..9644b8cc253b 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 @@ -210,24 +210,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). @@ -303,11 +303,11 @@ 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: 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): @@ -349,11 +349,11 @@ 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: 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 @@ -397,11 +397,11 @@ 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: 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. 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/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py index 25cfb5dfc83e..8229d75a88e4 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 @@ -72,22 +72,23 @@ 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.v1p4beta1.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.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][google.cloud.vision.v1p4beta1.Product] resources, named - ``projects/*/locations/*/products/*`` + - The API has a collection of + [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/*`` + - 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,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 @@ -477,8 +478,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 @@ -610,7 +611,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 @@ -733,10 +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 @@ -975,12 +976,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 @@ -1115,8 +1116,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 @@ -1246,7 +1247,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 @@ -1367,14 +1368,14 @@ async def update_product( 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 @@ -1621,14 +1622,14 @@ 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. + - 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 @@ -1884,9 +1885,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 @@ -2019,7 +2020,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 @@ -2143,8 +2144,8 @@ async def add_product_to_product_set( 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 @@ -2389,8 +2390,8 @@ async def list_products_in_product_set( 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 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..e8663f4cb61a 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 @@ -116,22 +116,23 @@ 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.v1p4beta1.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.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][google.cloud.vision.v1p4beta1.Product] resources, named - ``projects/*/locations/*/products/*`` + - The API has a collection of + [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/*`` + - 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,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 @@ -955,8 +956,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 @@ -1085,7 +1086,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 @@ -1205,10 +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 @@ -1441,12 +1442,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 @@ -1578,8 +1579,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 @@ -1706,7 +1707,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 @@ -1824,14 +1825,14 @@ def update_product( 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 @@ -2072,14 +2073,14 @@ 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. + - 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 @@ -2329,9 +2330,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 @@ -2461,7 +2462,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 @@ -2582,8 +2583,8 @@ def add_product_to_product_set( 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 @@ -2826,8 +2827,8 @@ def list_products_in_product_set( 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 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..4a912eae2d12 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 @@ -115,22 +115,23 @@ 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.v1p4beta1.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.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][google.cloud.vision.v1p4beta1.Product] resources, named - ``projects/*/locations/*/products/*`` + - The API has a collection of + [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/*`` + - 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,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], @@ -472,10 +473,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], @@ -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], @@ -644,14 +645,14 @@ def update_product( 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], @@ -725,14 +726,14 @@ 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. + - 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 +801,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 +836,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], @@ -870,8 +871,8 @@ def add_product_to_product_set( 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,8 +940,8 @@ def list_products_in_product_set( 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], 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..e6ad8d4adf23 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 @@ -121,22 +121,23 @@ 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.v1p4beta1.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.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][google.cloud.vision.v1p4beta1.Product] resources, named - ``projects/*/locations/*/products/*`` + - The API has a collection of + [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/*`` + - 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,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], @@ -481,10 +482,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], @@ -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], @@ -658,14 +659,14 @@ def update_product( 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], @@ -741,14 +742,14 @@ 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. + - 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 +817,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 +852,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], @@ -887,8 +888,8 @@ def add_product_to_product_set( 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,8 +958,8 @@ def list_products_in_product_set( 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], 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..d9d4658227e9 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 @@ -1009,22 +1009,23 @@ 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.v1p4beta1.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.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][google.cloud.vision.v1p4beta1.Product] resources, named - ``projects/*/locations/*/products/*`` + - The API has a collection of + [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/*`` + - 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 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..086301d205dc 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 @@ -1599,16 +1599,16 @@ class GcsDestination(proto.Message): 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 - filename prefix specified. + - 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 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..7a4b2b99529c 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 @@ -210,24 +210,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). @@ -303,11 +303,11 @@ 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: 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): @@ -349,11 +349,11 @@ 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: 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 @@ -397,11 +397,11 @@ 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: 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. 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