Class ProductSearchGrpc.ProductSearchImplBase (3.1.1)

Stay organized with collections Save and categorize content based on your preferences.
public abstract static class ProductSearchGrpc.ProductSearchImplBase implements BindableService

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 > ProductSearchGrpc.ProductSearchImplBase

Implements

io.grpc.BindableService

Constructors

ProductSearchImplBase()

public ProductSearchImplBase()

Methods

addProductToProductSet(AddProductToProductSetRequest request, StreamObserver<Empty> responseObserver)

public void addProductToProductSet(AddProductToProductSetRequest request, StreamObserver<Empty> responseObserver)

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
NameDescription
requestAddProductToProductSetRequest
responseObserverio.grpc.stub.StreamObserver<Empty>

bindService()

public final ServerServiceDefinition bindService()
Returns
TypeDescription
io.grpc.ServerServiceDefinition

createProduct(CreateProductRequest request, StreamObserver<Product> responseObserver)

public void createProduct(CreateProductRequest request, StreamObserver<Product> responseObserver)

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
NameDescription
requestCreateProductRequest
responseObserverio.grpc.stub.StreamObserver<Product>

createProductSet(CreateProductSetRequest request, StreamObserver<ProductSet> responseObserver)

public void createProductSet(CreateProductSetRequest request, StreamObserver<ProductSet> responseObserver)

Creates and returns a new ProductSet resource. Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
Parameters
NameDescription
requestCreateProductSetRequest
responseObserverio.grpc.stub.StreamObserver<ProductSet>

createReferenceImage(CreateReferenceImageRequest request, StreamObserver<ReferenceImage> responseObserver)

public void createReferenceImage(CreateReferenceImageRequest request, StreamObserver<ReferenceImage> responseObserver)

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
NameDescription
requestCreateReferenceImageRequest
responseObserverio.grpc.stub.StreamObserver<ReferenceImage>

deleteProduct(DeleteProductRequest request, StreamObserver<Empty> responseObserver)

public void deleteProduct(DeleteProductRequest request, StreamObserver<Empty> responseObserver)

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.
Parameters
NameDescription
request