Google Cloud Vision v1 API - Class ProductSearch.ProductSearchBase (3.7.0)

[BindServiceMethod(typeof(ProductSearch), "BindService")]
public abstract class ProductSearch.ProductSearchBase

Reference documentation and code samples for the Google Cloud Vision v1 API class ProductSearch.ProductSearchBase.

Base class for server-side implementations of ProductSearch

Inheritance

object > ProductSearch.ProductSearchBase

Namespace

Google.Cloud.Vision.V1

Assembly

Google.Cloud.Vision.V1.dll

Methods

AddProductToProductSet(AddProductToProductSetRequest, ServerCallContext)

public virtual Task<Empty> AddProductToProductSet(AddProductToProductSetRequest request, ServerCallContext context)

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 AddProductToProductSetRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskEmpty

The response to send back to the client (wrapped by a task).

CreateProduct(CreateProductRequest, ServerCallContext)

public virtual Task<Product> CreateProduct(CreateProductRequest request, ServerCallContext context)

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 CreateProductRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskProduct

The response to send back to the client (wrapped by a task).

CreateProductSet(CreateProductSetRequest, ServerCallContext)

public virtual Task<ProductSet> CreateProductSet(CreateProductSetRequest request, ServerCallContext context)

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 CreateProductSetRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskProductSet

The response to send back to the client (wrapped by a task).

CreateReferenceImage(CreateReferenceImageRequest, ServerCallContext)

public virtual Task<ReferenceImage> CreateReferenceImage(CreateReferenceImageRequest request, ServerCallContext context)

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 CreateReferenceImageRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskReferenceImage

The response to send back to the client (wrapped by a task).

DeleteProduct(DeleteProductRequest, ServerCallContext)

public virtual Task<Empty> DeleteProduct(DeleteProductRequest request, ServerCallContext context)

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 DeleteProductRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskEmpty

The response to send back to the client (wrapped by a task).

DeleteProductSet(DeleteProductSetRequest, ServerCallContext)

public virtual Task<Empty> DeleteProductSet(DeleteProductSetRequest request, ServerCallContext context)

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 DeleteProductSetRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskEmpty

The response to send back to the client (wrapped by a task).

DeleteReferenceImage(DeleteReferenceImageRequest, ServerCallContext)

public virtual Task<Empty> DeleteReferenceImage(DeleteReferenceImageRequest request, ServerCallContext context)

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 DeleteReferenceImageRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskEmpty

The response to send back to the client (wrapped by a task).

GetProduct(GetProductRequest, ServerCallContext)

public virtual Task<Product> GetProduct(GetProductRequest request, ServerCallContext context)

Gets information associated with a Product.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
Parameters
Name Description
request GetProductRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskProduct

The response to send back to the client (wrapped by a task).

GetProductSet(GetProductSetRequest, ServerCallContext)

public virtual Task<ProductSet> GetProductSet(GetProductSetRequest request, ServerCallContext context)

Gets information associated with a ProductSet.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
Parameters
Name Description
request GetProductSetRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskProductSet

The response to send back to the client (wrapped by a task).

GetReferenceImage(GetReferenceImageRequest, ServerCallContext)

public virtual Task<ReferenceImage> GetReferenceImage(GetReferenceImageRequest request, ServerCallContext context)

Gets information associated with a ReferenceImage.

Possible errors:

  • Returns NOT_FOUND if the specified image does not exist.
Parameters
Name Description
request GetReferenceImageRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskReferenceImage

The response to send back to the client (wrapped by a task).

ImportProductSets(ImportProductSetsRequest, ServerCallContext)

public virtual Task<Operation> ImportProductSets(ImportProductSetsRequest request, ServerCallContext context)

Asynchronous API that imports a list of reference images to specified product sets based on a list of image information.

The [google.longrunning.Operation][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][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].

Parameters
Name Description
request ImportProductSetsRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskOperation

The response to send back to the client (wrapped by a task).

ListProductSets(ListProductSetsRequest, ServerCallContext)

public virtual Task<ListProductSetsResponse> ListProductSets(ListProductSetsRequest request, ServerCallContext context)

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 ListProductSetsRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskListProductSetsResponse

The response to send back to the client (wrapped by a task).

ListProducts(ListProductsRequest, ServerCallContext)

public virtual Task<ListProductsResponse> ListProducts(ListProductsRequest request, ServerCallContext context)

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 ListProductsRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskListProductsResponse

The response to send back to the client (wrapped by a task).

ListProductsInProductSet(ListProductsInProductSetRequest, ServerCallContext)

public virtual Task<ListProductsInProductSetResponse> ListProductsInProductSet(ListProductsInProductSetRequest request, ServerCallContext context)

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 ListProductsInProductSetRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskListProductsInProductSetResponse

The response to send back to the client (wrapped by a task).

ListReferenceImages(ListReferenceImagesRequest, ServerCallContext)

public virtual Task<ListReferenceImagesResponse> ListReferenceImages(ListReferenceImagesRequest request, ServerCallContext context)

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 ListReferenceImagesRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskListReferenceImagesResponse

The response to send back to the client (wrapped by a task).

PurgeProducts(PurgeProductsRequest, ServerCallContext)

public virtual Task<Operation> PurgeProducts(PurgeProductsRequest request, ServerCallContext context)

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][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 PurgeProductsRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskOperation

The response to send back to the client (wrapped by a task).

RemoveProductFromProductSet(RemoveProductFromProductSetRequest, ServerCallContext)

public virtual Task<Empty> RemoveProductFromProductSet(RemoveProductFromProductSetRequest request, ServerCallContext context)

Removes a Product from the specified ProductSet.

Parameters
Name Description
request RemoveProductFromProductSetRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskEmpty

The response to send back to the client (wrapped by a task).

UpdateProduct(UpdateProductRequest, ServerCallContext)

public virtual Task<Product> UpdateProduct(UpdateProductRequest request, ServerCallContext context)

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 UpdateProductRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskProduct

The response to send back to the client (wrapped by a task).

UpdateProductSet(UpdateProductSetRequest, ServerCallContext)

public virtual Task<ProductSet> UpdateProductSet(UpdateProductSetRequest request, ServerCallContext context)

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 UpdateProductSetRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskProductSet

The response to send back to the client (wrapped by a task).