Manages Products and ProductSets of reference images for use in product search.
It uses the following resource model:
- The API has a collection of ProductSet resources, named
projects/*/locations/*/productSets/*
, which acts as a way to put different products into groups to limit identification.
In parallel,
- The API has a collection of Product resources, named
projects/*/locations/*/products/*
- Each Product has a collection of ReferenceImage resources, named
projects/*/locations/*/products/*/referenceImages/*
Equality
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
Constructors
ProductSearchClient(ProductSearchClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ProductSearchClient const &
|
ProductSearchClient(ProductSearchClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ProductSearchClient &&
|
ProductSearchClient(std::shared_ptr< ProductSearchConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< ProductSearchConnection >
|
opts |
Options
|
Operators
operator=(ProductSearchClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ProductSearchClient const &
|
Returns | |
---|---|
Type | Description |
ProductSearchClient & |
operator=(ProductSearchClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ProductSearchClient &&
|
Returns | |
---|---|
Type | Description |
ProductSearchClient & |
Functions
CreateProductSet(std::string const &, google::cloud::vision::v1::ProductSet const &, std::string const &, Options)
Creates and returns a new ProductSet resource.
Possible errors:
- Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The project in which the ProductSet should be created. |
product_set |
google::cloud::vision::v1::ProductSet const &
Required. The ProductSet to create. |
product_set_id |
std::string const &
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 |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::ProductSet > |
the result of the RPC. The response message type (google.cloud.vision.v1.ProductSet) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateProductSet(google::cloud::vision::v1::CreateProductSetRequest const &, Options)
Creates and returns a new ProductSet resource.
Possible errors:
- Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::CreateProductSetRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::ProductSet > |
the result of the RPC. The response message type (google.cloud.vision.v1.ProductSet) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListProductSets(std::string const &, Options)
Lists ProductSets in an unspecified order.
Possible errors:
- Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The project from which ProductSets should be listed. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::vision::v1::ProductSet > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListProductSets(google::cloud::vision::v1::ListProductSetsRequest, Options)
Lists ProductSets in an unspecified order.
Possible errors:
- Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::ListProductSetsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::vision::v1::ProductSet > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetProductSet(std::string const &, Options)
Gets information associated with a ProductSet.
Possible errors:
- Returns NOT_FOUND if the ProductSet does not exist.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. Resource name of the ProductSet to get. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::ProductSet > |
the result of the RPC. The response message type (google.cloud.vision.v1.ProductSet) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetProductSet(google::cloud::vision::v1::GetProductSetRequest const &, Options)
Gets information associated with a ProductSet.
Possible errors:
- Returns NOT_FOUND if the ProductSet does not exist.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::GetProductSetRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::ProductSet > |
the result of the RPC. The response message type (google.cloud.vision.v1.ProductSet) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateProductSet(google::cloud::vision::v1::ProductSet const &, google::protobuf::FieldMask const &, Options)
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.
Parameters | |
---|---|
Name | Description |
product_set |
google::cloud::vision::v1::ProductSet const &
Required. The ProductSet resource which replaces the one on the server. |
update_mask |
google::protobuf::FieldMask const &
The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask path is |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::ProductSet > |
the result of the RPC. The response message type (google.cloud.vision.v1.ProductSet) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateProductSet(google::cloud::vision::v1::UpdateProductSetRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::UpdateProductSetRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::ProductSet > |
the result of the RPC. The response message type (google.cloud.vision.v1.ProductSet) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteProductSet(std::string const &, Options)
Permanently deletes a ProductSet.
Products and ReferenceImages in the ProductSet are not deleted.
The actual image files are not deleted from Google Cloud Storage.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. Resource name of the ProductSet to delete. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteProductSet(google::cloud::vision::v1::DeleteProductSetRequest const &, Options)
Permanently deletes a ProductSet.
Products and ReferenceImages in the ProductSet are not deleted.
The actual image files are not deleted from Google Cloud Storage.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::DeleteProductSetRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
CreateProduct(std::string const &, google::cloud::vision::v1::Product const &, std::string const &, Options)
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.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The project in which the Product should be created. |
product |
google::cloud::vision::v1::Product const &
Required. The product to create. |
product_id |
std::string const &
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 |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::Product > |
the result of the RPC. The response message type (google.cloud.vision.v1.Product) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateProduct(google::cloud::vision::v1::CreateProductRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::CreateProductRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::Product > |
the result of the RPC. The response message type (google.cloud.vision.v1.Product) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListProducts(std::string const &, Options)
Lists products in an unspecified order.
Possible errors:
- Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The project OR ProductSet from which Products should be listed. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::vision::v1::Product > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListProducts(google::cloud::vision::v1::ListProductsRequest, Options)
Lists products in an unspecified order.
Possible errors:
- Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::ListProductsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::vision::v1::Product > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetProduct(std::string const &, Options)
Gets information associated with a Product.
Possible errors:
- Returns NOT_FOUND if the Product does not exist.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. Resource name of the Product to get. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::Product > |
the result of the RPC. The response message type (google.cloud.vision.v1.Product) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetProduct(google::cloud::vision::v1::GetProductRequest const &, Options)
Gets information associated with a Product.
Possible errors:
- Returns NOT_FOUND if the Product does not exist.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::GetProductRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::Product > |
the result of the RPC. The response message type (google.cloud.vision.v1.Product) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateProduct(google::cloud::vision::v1::Product const &, google::protobuf::FieldMask const &, Options)
Makes changes to a Product resource.
Only the display_name
, description
, and labels
fields can be updated right now.
If labels are updated, the change will not be reflected in queries until the next index time.
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.
Parameters | |
---|---|
Name | Description |
product |
google::cloud::vision::v1::Product const &
Required. The Product resource which replaces the one on the server. product.name is immutable. |
update_mask |
google::protobuf::FieldMask const &
The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::Product > |
the result of the RPC. The response message type (google.cloud.vision.v1.Product) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateProduct(google::cloud::vision::v1::UpdateProductRequest const &, Options)
Makes changes to a Product resource.
Only the display_name
, description
, and labels
fields can be updated right now.
If labels are updated, the change will not be reflected in queries until the next index time.
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::UpdateProductRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::Product > |
the result of the RPC. The response message type (google.cloud.vision.v1.Product) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteProduct(std::string const &, Options)
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.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. Resource name of product to delete. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteProduct(google::cloud::vision::v1::DeleteProductRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::DeleteProductRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
CreateReferenceImage(std::string const &, google::cloud::vision::v1::ReferenceImage const &, std::string const &, Options)
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.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. Resource name of the product in which to create the reference image. |
reference_image |
google::cloud::vision::v1::ReferenceImage const &
Required. The reference image to create. If an image ID is specified, it is ignored. |
reference_image_id |
std::string const &
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 |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::ReferenceImage > |
the result of the RPC. The response message type (google.cloud.vision.v1.ReferenceImage) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateReferenceImage(google::cloud::vision::v1::CreateReferenceImageRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::CreateReferenceImageRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::ReferenceImage > |
the result of the RPC. The response message type (google.cloud.vision.v1.ReferenceImage) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteReferenceImage(std::string const &, Options)
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.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of the reference image to delete. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteReferenceImage(google::cloud::vision::v1::DeleteReferenceImageRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::DeleteReferenceImageRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
ListReferenceImages(std::string const &, Options)
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.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. Resource name of the product containing the reference images. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::vision::v1::ReferenceImage > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListReferenceImages(google::cloud::vision::v1::ListReferenceImagesRequest, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::ListReferenceImagesRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::vision::v1::ReferenceImage > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetReferenceImage(std::string const &, Options)
Gets information associated with a ReferenceImage.
Possible errors:
- Returns NOT_FOUND if the specified image does not exist.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of the ReferenceImage to get. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::ReferenceImage > |
the result of the RPC. The response message type (google.cloud.vision.v1.ReferenceImage) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetReferenceImage(google::cloud::vision::v1::GetReferenceImageRequest const &, Options)
Gets information associated with a ReferenceImage.
Possible errors:
- Returns NOT_FOUND if the specified image does not exist.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::GetReferenceImageRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::vision::v1::ReferenceImage > |
the result of the RPC. The response message type (google.cloud.vision.v1.ReferenceImage) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
AddProductToProductSet(std::string const &, std::string const &, Options)
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.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name for the ProductSet to modify. |
product |
std::string const &
Required. The resource name for the Product to be added to this ProductSet. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
AddProductToProductSet(google::cloud::vision::v1::AddProductToProductSetRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::AddProductToProductSetRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
RemoveProductFromProductSet(std::string const &, std::string const &, Options)
Removes a Product from the specified ProductSet.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name for the ProductSet to modify. |
product |
std::string const &
Required. The resource name for the Product to be removed from this ProductSet. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
RemoveProductFromProductSet(google::cloud::vision::v1::RemoveProductFromProductSetRequest const &, Options)
Removes a Product from the specified ProductSet.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::RemoveProductFromProductSetRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
ListProductsInProductSet(std::string const &, Options)
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.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The ProductSet resource for which to retrieve Products. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::vision::v1::Product > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListProductsInProductSet(google::cloud::vision::v1::ListProductsInProductSetRequest, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::ListProductsInProductSetRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::vision::v1::Product > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ImportProductSets(std::string const &, google::cloud::vision::v1::ImportProductSetsInputConfig const &, Options)
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.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The project in which the ProductSets should be imported. |
input_config |
google::cloud::vision::v1::ImportProductSetsInputConfig const &
Required. The input content for the list of requests. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::vision::v1::ImportProductSetsResponse > > |
A |
ImportProductSets(google::cloud::vision::v1::ImportProductSetsRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::ImportProductSetsRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::vision::v1::ImportProductSetsResponse > > |
A |
PurgeProducts(std::string const &, Options)
Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.
If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.
It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.
It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion.
If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet.
The google.longrunning.Operation API can be used to keep track of the progress and results of the request. Operation.metadata
contains BatchOperationMetadata
. (progress)
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The project and location in which the Products should be deleted. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::vision::v1::BatchOperationMetadata > > |
A |
PurgeProducts(google::cloud::vision::v1::PurgeProductsRequest const &, Options)
Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.
If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.
It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.
It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion.
If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet.
The google.longrunning.Operation API can be used to keep track of the progress and results of the request. Operation.metadata
contains BatchOperationMetadata
. (progress)
Parameters | |
---|---|
Name | Description |
request |
google::cloud::vision::v1::PurgeProductsRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::vision::v1::BatchOperationMetadata > > |
A |