ProductSearchClient(
transport=None,
channel=None,
credentials=None,
client_config=None,
client_info=None,
client_options=None,
)
Manages Products and ProductSets of reference images for use in product search. It uses the following resource model:
- The API has a collection of
ProductSet
resources, namedprojects/*/locations/*/productSets/*
, which acts as a way to put different products into groups to limit identification.
In parallel,
The API has a collection of
Product
resources, namedprojects/*/locations/*/products/*
Each
Product
has a collection ofReferenceImage
resources, namedprojects/*/locations/*/products/*/referenceImages/*
Inheritance
builtins.object > google.cloud.vision_v1p3beta1.gapic.product_search_client.ProductSearchClient > ProductSearchClientMethods
ProductSearchClient
ProductSearchClient(
transport=None,
channel=None,
credentials=None,
client_config=None,
client_info=None,
client_options=None,
)
Constructor.
Name | Description |
channel |
grpc.Channel
DEPRECATED. A |
credentials |
google.auth.credentials.Credentials
The authorization credentials to attach to requests. These credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment. This argument is mutually exclusive with providing a transport instance to |
client_config |
dict
DEPRECATED. A dictionary of call options for each method. If not specified, the default configuration is used. |
client_info |
google.api_core.gapic_v1.client_info.ClientInfo
The client info used to send a user-agent string along with API requests. If |
client_options |
Union[dict, google.api_core.client_options.ClientOptions]
Client options used to set user options on the client. API Endpoint should be set through client_options. |
add_product_to_product_set
add_product_to_product_set(name, product, retry=<object object>, timeout=<object object>, metadata=None)
Adds a Product to the specified ProductSet. If the Product is already present, no change is made.
One Product can be added to at most 100 ProductSets.
Possible errors:
- Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]')
TODO: Initialize
product
:product = ''
client.add_product_to_product_set(name, product)
Name | Description |
name |
str
The resource name for the ProductSet to modify. Format is: |
product |
str
The resource name for the Product to be added to this ProductSet. Format is: |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
create_product
create_product(parent, product, product_id, retry=<object object>, timeout=<object object>, metadata=None)
Creates and returns a new product resource.
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.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
parent = client.location_path('[PROJECT]', '[LOCATION]')
TODO: Initialize
product
:product = {}
TODO: Initialize
product_id
:product_id = ''
response = client.create_product(parent, product, product_id)
Name | Description |
parent |
str
The project in which the Product should be created. Format is |
product |
Union[dict, Product]
The product to create. If a dict is provided, it must be of the same form as the protobuf message Product |
product_id |
str
A user-supplied resource id for this Product. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
create_product_set
create_product_set(parent, product_set, product_set_id, retry=<object object>, timeout=<object object>, metadata=None)
Creates and returns a new ProductSet resource.
Possible errors:
- Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
parent = client.location_path('[PROJECT]', '[LOCATION]')
TODO: Initialize
product_set
:product_set = {}
TODO: Initialize
product_set_id
:product_set_id = ''
response = client.create_product_set(parent, product_set, product_set_id)
Name | Description |
parent |
str
The project in which the ProductSet should be created. Format is |
product_set |
Union[dict, ProductSet]
The ProductSet to create. If a dict is provided, it must be of the same form as the protobuf message ProductSet |
product_set_id |
str
A user-supplied resource id for this ProductSet. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
create_reference_image
create_reference_image(parent, reference_image, reference_image_id, retry=<object object>, timeout=<object object>, metadata=None)
Creates and returns a new ReferenceImage resource.
The bounding_poly
field is optional. If bounding_poly
is not
specified, the system will try to detect regions of interest in the
image that are compatible with the product_category on the parent
product. If it is specified, detection is ALWAYS skipped. The system
converts polygons into non-rotated rectangles.
Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP).
Possible errors:
- Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters.
- Returns INVALID_ARGUMENT if the product does not exist.
- Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected.
- Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
parent = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]')
TODO: Initialize
reference_image
:reference_image = {}
TODO: Initialize
reference_image_id
:reference_image_id = ''
response = client.create_reference_image(parent, reference_image, reference_image_id)
Name | Description |
parent |
str
Resource name of the product in which to create the reference image. Format is |
reference_image |
Union[dict, ReferenceImage]
The reference image to create. If an image ID is specified, it is ignored. If a dict is provided, it must be of the same form as the protobuf message ReferenceImage |
reference_image_id |
str
A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
delete_product
delete_product(name, retry=<object object>, timeout=<object object>, metadata=None)
Permanently deletes a product and its reference images.
Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.
Possible errors:
- Returns NOT_FOUND if the product does not exist.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
name = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]')
client.delete_product(name)
Name | Description |
name |
str
Resource name of product to delete. Format is: |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
delete_product_set
delete_product_set(name, retry=<object object>, timeout=<object object>, metadata=None)
Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be deleted.
The actual image files are not deleted from Google Cloud Storage.
Possible errors:
- Returns NOT_FOUND if the ProductSet does not exist.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]')
client.delete_product_set(name)
Name | Description |
name |
str
Resource name of the ProductSet to delete. Format is: |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
delete_reference_image
delete_reference_image(name, retry=<object object>, timeout=<object object>, metadata=None)
Permanently deletes a reference image.
The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed.
The actual image files are not deleted from Google Cloud Storage.
Possible errors:
- Returns NOT_FOUND if the reference image does not exist.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
name = client.reference_image_path('[PROJECT]', '[LOCATION]', '[PRODUCT]', '[REFERENCE_IMAGE]')
client.delete_reference_image(name)
Name | Description |
name |
str
The resource name of the reference image to delete. Format is: |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
from_service_account_file
from_service_account_file(filename, *args, **kwargs)
Creates an instance of this client using the provided credentials file.
Name | Description |
filename |
str
The path to the service account private key json file. |
Type | Description |
ProductSearchClient | The constructed client. |
from_service_account_json
from_service_account_json(filename, *args, **kwargs)
Creates an instance of this client using the provided credentials file.
Name | Description |
filename |
str
The path to the service account private key json file. |
Type | Description |
ProductSearchClient | The constructed client. |
get_product
get_product(name, retry=<object object>, timeout=<object object>, metadata=None)
Gets information associated with a Product.
Possible errors:
- Returns NOT_FOUND if the Product does not exist.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
name = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]')
response = client.get_product(name)
Name | Description |
name |
str
Resource name of the Product to get. Format is: |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
get_product_set
get_product_set(name, retry=<object object>, timeout=<object object>, metadata=None)
Gets information associated with a ProductSet.
Possible errors:
- Returns NOT_FOUND if the ProductSet does not exist.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]')
response = client.get_product_set(name)
Name | Description |
name |
str
Resource name of the ProductSet to get. Format is: |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
get_reference_image
get_reference_image(name, retry=<object object>, timeout=<object object>, metadata=None)
Gets information associated with a ReferenceImage.
Possible errors:
- Returns NOT_FOUND if the specified image does not exist.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
name = client.reference_image_path('[PROJECT]', '[LOCATION]', '[PRODUCT]', '[REFERENCE_IMAGE]')
response = client.get_reference_image(name)
Name | Description |
name |
str
The resource name of the ReferenceImage to get. Format is: |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
import_product_sets
import_product_sets(parent, input_config, retry=<object object>, timeout=<object object>, metadata=None)
Asynchronous API that imports a list of reference images to specified product sets based on a list of image information.
The google.longrunning.Operation
API can be used to keep track of
the progress and results of the request. Operation.metadata
contains
BatchOperationMetadata
. (progress) Operation.response
contains
ImportProductSetsResponse
. (results)
The input source of this method is a csv file on Google Cloud Storage.
For the format of the csv file please see
ImportProductSetsGcsSource.csv_file_uri
.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
parent = client.location_path('[PROJECT]', '[LOCATION]')
TODO: Initialize
input_config
:input_config = {}
response = client.import_product_sets(parent, input_config)
def callback(operation_future): ... # Handle result. ... result = operation_future.result()
response.add_done_callback(callback)
Handle metadata.
metadata = response.metadata()
Name | Description |
parent |
str
The project in which the ProductSets should be imported. Format is |
input_config |
Union[dict, ImportProductSetsInputConfig]
The input content for the list of requests. If a dict is provided, it must be of the same form as the protobuf message ImportProductSetsInputConfig |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
list_product_sets
list_product_sets(parent, page_size=None, retry=<object object>, timeout=<object object>, metadata=None)
Lists ProductSets in an unspecified order.
Possible errors:
- Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
parent = client.location_path('[PROJECT]', '[LOCATION]')
Iterate over all results
for element in client.list_product_sets(parent): ... # process element ... pass
Alternatively:
Iterate over results one page at a time
for page in client.list_product_sets(parent).pages: ... for element in page: ... # process element ... pass
Name | Description |
parent |
str
The project from which ProductSets should be listed. Format is |
page_size |
int
The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
list_products
list_products(parent, page_size=None, retry=<object object>, timeout=<object object>, metadata=None)
Lists products in an unspecified order.
Possible errors:
- Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
parent = client.location_path('[PROJECT]', '[LOCATION]')
Iterate over all results
for element in client.list_products(parent): ... # process element ... pass
Alternatively:
Iterate over results one page at a time
for page in client.list_products(parent).pages: ... for element in page: ... # process element ... pass
Name | Description |
parent |
str
The project OR ProductSet from which Products should be listed. Format: |
page_size |
int
The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
list_products_in_product_set
list_products_in_product_set(name, page_size=None, retry=<object object>, timeout=<object object>, metadata=None)
Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, the products field of the response will be empty.
Possible errors:
- Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]')
Iterate over all results
for element in client.list_products_in_product_set(name): ... # process element ... pass
Alternatively:
Iterate over results one page at a time
for page in client.list_products_in_product_set(name).pages: ... for element in page: ... # process element ... pass
Name | Description |
name |
str
The ProductSet resource for which to retrieve Products. Format is: |
page_size |
int
The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
list_reference_images
list_reference_images(parent, page_size=None, retry=<object object>, timeout=<object object>, metadata=None)
Lists 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.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
parent = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]')
Iterate over all results
for element in client.list_reference_images(parent): ... # process element ... pass
Alternatively:
Iterate over results one page at a time
for page in client.list_reference_images(parent).pages: ... for element in page: ... # process element ... pass
Name | Description |
parent |
str
Resource name of the product containing the reference images. Format is |
page_size |
int
The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
location_path
location_path(project, location)
Return a fully-qualified location string.
product_path
product_path(project, location, product)
Return a fully-qualified product string.
product_set_path
product_set_path(project, location, product_set)
Return a fully-qualified product_set string.
reference_image_path
reference_image_path(project, location, product, reference_image)
Return a fully-qualified reference_image string.
remove_product_from_product_set
remove_product_from_product_set(name, product, retry=<object object>, timeout=<object object>, metadata=None)
Removes a Product from the specified ProductSet.
Possible errors:
- Returns NOT_FOUND If the Product is not found under the ProductSet.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]')
TODO: Initialize
product
:product = ''
client.remove_product_from_product_set(name, product)
Name | Description |
name |
str
The resource name for the ProductSet to modify. Format is: |
product |
str
The resource name for the Product to be removed from this ProductSet. Format is: |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
update_product
update_product(product, update_mask, retry=<object object>, timeout=<object object>, metadata=None)
Makes changes to a Product resource. Only display_name, description and labels can be updated right now.
If labels are updated, the change will not be reflected in queries until the next index time.
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.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
TODO: Initialize
product
:product = {}
TODO: Initialize
update_mask
:update_mask = {}
response = client.update_product(product, update_mask)
Name | Description |
product |
Union[dict, Product]
The Product resource which replaces the one on the server. product.name is immutable. If a dict is provided, it must be of the same form as the protobuf message Product |
update_mask |
Union[dict, FieldMask]
The |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
update_product_set
update_product_set(product_set, update_mask, retry=<object object>, timeout=<object object>, metadata=None)
Makes changes to a ProductSet resource. Only display_name can be updated currently.
Possible errors:
- Returns NOT_FOUND if the ProductSet does not exist.
- Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.
.. rubric:: Example
from google.cloud import vision_v1p3beta1
client = vision_v1p3beta1.ProductSearchClient()
TODO: Initialize
product_set
:product_set = {}
TODO: Initialize
update_mask
:update_mask = {}
response = client.update_product_set(product_set, update_mask)
Name | Description |
product_set |
Union[dict, ProductSet]
The ProductSet resource which replaces the one on the server. If a dict is provided, it must be of the same form as the protobuf message ProductSet |
update_mask |
Union[dict, FieldMask]
The |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |