[][src]Struct gcp_client::google::cloud::vision::v1p3beta1::product_search_client::ProductSearchClient

pub struct ProductSearchClient<T> { /* fields omitted */ }

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][google.cloud.vision.v1p3beta1.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][google.cloud.vision.v1p3beta1.Product] resources, named projects/*/locations/*/products/*

  • Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, named projects/*/locations/*/products/*/referenceImages/*

Implementations

impl<T> ProductSearchClient<T> where
    T: GrpcService<BoxBody>,
    T::ResponseBody: Body + HttpBody + Send + 'static,
    T::Error: Into<StdError>,
    <T::ResponseBody as HttpBody>::Error: Into<StdError> + Send
[src]

pub fn new(inner: T) -> Self[src]

pub fn with_interceptor(inner: T, interceptor: impl Into<Interceptor>) -> Self[src]

pub async fn create_product_set<'_>(
    &'_ mut self,
    request: impl IntoRequest<CreateProductSetRequest>
) -> Result<Response<ProductSet>, Status>
[src]

Creates and returns a new ProductSet resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.

pub async fn list_product_sets<'_>(
    &'_ mut self,
    request: impl IntoRequest<ListProductSetsRequest>
) -> Result<Response<ListProductSetsResponse>, Status>
[src]

Lists ProductSets in an unspecified order.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.

pub async fn get_product_set<'_>(
    &'_ mut self,
    request: impl IntoRequest<GetProductSetRequest>
) -> Result<Response<ProductSet>, Status>
[src]

Gets information associated with a ProductSet.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.

pub async fn update_product_set<'_>(
    &'_ mut self,
    request: impl IntoRequest<UpdateProductSetRequest>
) -> Result<Response<ProductSet>, Status>
[src]

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.

pub async fn delete_product_set<'_>(
    &'_ mut self,
    request: impl IntoRequest<DeleteProductSetRequest>
) -> Result<Response<()>, Status>
[src]

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.

pub async fn create_product<'_>(
    &'_ mut self,
    request: impl IntoRequest<CreateProductRequest>
) -> Result<Response<Product>, Status>
[src]

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.

pub async fn list_products<'_>(
    &'_ mut self,
    request: impl IntoRequest<ListProductsRequest>
) -> Result<Response<ListProductsResponse>, Status>
[src]

Lists products in an unspecified order.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.

pub async fn get_product<'_>(
    &'_ mut self,
    request: impl IntoRequest<GetProductRequest>
) -> Result<Response<Product>, Status>
[src]

Gets information associated with a Product.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.

pub async fn update_product<'_>(
    &'_ mut self,
    request: impl IntoRequest<UpdateProductRequest>
) -> Result<Response<Product>, Status>
[src]

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.

pub async fn delete_product<'_>(
    &'_ mut self,
    request: impl IntoRequest<DeleteProductRequest>
) -> Result<Response<()>, Status>
[src]

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.

pub async fn create_reference_image<'_>(
    &'_ mut self,
    request: impl IntoRequest<CreateReferenceImageRequest>
) -> Result<Response<ReferenceImage>, Status>
[src]

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.

pub async fn delete_reference_image<'_>(
    &'_ mut self,
    request: impl IntoRequest<DeleteReferenceImageRequest>
) -> Result<Response<()>, Status>
[src]

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.

pub async fn list_reference_images<'_>(
    &'_ mut self,
    request: impl IntoRequest<ListReferenceImagesRequest>
) -> Result<Response<ListReferenceImagesResponse>, Status>
[src]

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.

pub async fn get_reference_image<'_>(
    &'_ mut self,
    request: impl IntoRequest<GetReferenceImageRequest>
) -> Result<Response<ReferenceImage>, Status>
[src]

Gets information associated with a ReferenceImage.

Possible errors:

  • Returns NOT_FOUND if the specified image does not exist.

pub async fn add_product_to_product_set<'_>(
    &'_ mut self,
    request: impl IntoRequest<AddProductToProductSetRequest>
) -> Result<Response<()>, Status>
[src]

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.

pub async fn remove_product_from_product_set<'_>(
    &'_ mut self,
    request: impl IntoRequest<RemoveProductFromProductSetRequest>
) -> Result<Response<()>, Status>
[src]

Removes a Product from the specified ProductSet.

Possible errors:

  • Returns NOT_FOUND If the Product is not found under the ProductSet.

pub async fn list_products_in_product_set<'_>(
    &'_ mut self,
    request: impl IntoRequest<ListProductsInProductSetRequest>
) -> Result<Response<ListProductsInProductSetResponse>, Status>
[src]

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.

pub async fn import_product_sets<'_>(
    &'_ mut self,
    request: impl IntoRequest<ImportProductSetsRequest>
) -> Result<Response<Operation>, Status>
[src]

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.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri].

Trait Implementations

impl<T: Clone> Clone for ProductSearchClient<T>[src]

impl<T> Debug for ProductSearchClient<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for ProductSearchClient<T>

impl<T> Send for ProductSearchClient<T> where
    T: Send

impl<T> Sync for ProductSearchClient<T> where
    T: Sync

impl<T> Unpin for ProductSearchClient<T> where
    T: Unpin

impl<T> !UnwindSafe for ProductSearchClient<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]