Class ProductSearchGrpc.ProductSearchBlockingStub (3.20.0)

public static final class ProductSearchGrpc.ProductSearchBlockingStub extends AbstractBlockingStub<ProductSearchGrpc.ProductSearchBlockingStub>

A stub to allow clients to do synchronous rpc calls to service ProductSearch.

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/*

Inheritance

java.lang.Object > io.grpc.stub.AbstractStub > io.grpc.stub.AbstractBlockingStub > ProductSearchGrpc.ProductSearchBlockingStub

Methods

addProductToProductSet(AddProductToProductSetRequest request)

public Empty addProductToProductSet(AddProductToProductSetRequest request)

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.
Parameter
NameDescription
requestAddProductToProductSetRequest
Returns
TypeDescription
Empty

build(Channel channel, CallOptions callOptions)

protected ProductSearchGrpc.ProductSearchBlockingStub build(Channel channel, CallOptions callOptions)
Parameters
NameDescription
channelio.grpc.Channel
callOptionsio.grpc.CallOptions
Returns
TypeDescription
ProductSearchGrpc.ProductSearchBlockingStub
Overrides
io.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions)

createProduct(CreateProductRequest request)

public Product createProduct(CreateProductRequest request)

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.
Parameter
NameDescription
requestCreateProductRequest
Returns
TypeDescription
Product

createProductSet(CreateProductSetRequest request)

public ProductSet createProductSet(CreateProductSetRequest request)

Creates and returns a new ProductSet resource. Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
Parameter
NameDescription
requestCreateProductSetRequest
Returns
TypeDescription
ProductSet

createReferenceImage(CreateReferenceImageRequest request)

public ReferenceImage createReferenceImage(CreateReferenceImageRequest request)

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.
Parameter
NameDescription
requestCreateReferenceImageRequest
Returns
TypeDescription
ReferenceImage

deleteProduct(DeleteProductRequest request)

public Empty deleteProduct(DeleteProductRequest request)

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.

Parameter
NameDescription
requestDeleteProductRequest
Returns
TypeDescription
Empty

deleteProductSet(DeleteProductSetRequest request)

public Empty deleteProductSet(DeleteProductSetRequest request)

Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted. The actual image files are not deleted from Google Cloud Storage.

Parameter
NameDescription
requestDeleteProductSetRequest
Returns
TypeDescription
Empty

deleteReferenceImage(DeleteReferenceImageRequest request)

public Empty deleteReferenceImage(DeleteReferenceImageRequest request)

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.

Parameter
NameDescription
requestDeleteReferenceImageRequest
Returns
TypeDescription
Empty

getProduct(GetProductRequest request)

public Product getProduct(GetProductRequest request)

Gets information associated with a Product. Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
Parameter
NameDescription
requestGetProductRequest
Returns
TypeDescription
Product

getProductSet(GetProductSetRequest request)

public ProductSet getProductSet(GetProductSetRequest request)

Gets information associated with a ProductSet. Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
Parameter
NameDescription
requestGetProductSetRequest
Returns
TypeDescription
ProductSet

getReferenceImage(GetReferenceImageRequest request)

public ReferenceImage getReferenceImage(GetReferenceImageRequest request)

Gets information associated with a ReferenceImage. Possible errors:

  • Returns NOT_FOUND if the specified image does not exist.
Parameter
NameDescription
requestGetReferenceImageRequest
Returns
TypeDescription
ReferenceImage

importProductSets(ImportProductSetsRequest request)

public Operation importProductSets(ImportProductSetsRequest request)

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.

Parameter
NameDescription
requestImportProductSetsRequest
Returns
TypeDescription
Operation

listProductSets(ListProductSetsRequest request)

public ListProductSetsResponse listProductSets(ListProductSetsRequest request)

Lists ProductSets in an unspecified order. Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
Parameter
NameDescription
requestListProductSetsRequest
Returns
TypeDescription
ListProductSetsResponse

listProducts(ListProductsRequest request)

public ListProductsResponse listProducts(ListProductsRequest request)

Lists products in an unspecified order. Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameter
NameDescription
requestListProductsRequest
Returns
TypeDescription
ListProductsResponse

listProductsInProductSet(ListProductsInProductSetRequest request)

public ListProductsInProductSetResponse listProductsInProductSet(ListProductsInProductSetRequest request)

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.
Parameter
NameDescription
requestListProductsInProductSetRequest
Returns
TypeDescription
ListProductsInProductSetResponse

listReferenceImages(ListReferenceImagesRequest request)

public ListReferenceImagesResponse listReferenceImages(ListReferenceImagesRequest request)

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.
Parameter
NameDescription
requestListReferenceImagesRequest
Returns
TypeDescription
ListReferenceImagesResponse

purgeProducts(PurgeProductsRequest request)

public Operation purgeProducts(PurgeProductsRequest request)

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)

Parameter
NameDescription
requestPurgeProductsRequest
Returns
TypeDescription
Operation

removeProductFromProductSet(RemoveProductFromProductSetRequest request)

public Empty removeProductFromProductSet(RemoveProductFromProductSetRequest request)

Removes a Product from the specified ProductSet.

Parameter
NameDescription
requestRemoveProductFromProductSetRequest
Returns
TypeDescription
Empty

updateProduct(UpdateProductRequest request)

public Product updateProduct(UpdateProductRequest request)

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.
Parameter
NameDescription
requestUpdateProductRequest
Returns
TypeDescription
Product

updateProductSet(UpdateProductSetRequest request)

public ProductSet updateProductSet(UpdateProductSetRequest request)

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.
Parameter
NameDescription
requestUpdateProductSetRequest
Returns
TypeDescription
ProductSet