Service Client: Google::Cloud::Vision::V1::ProductSearchService::ProductSearchClient

Client stub representing the remote ProductSearch gRPC service. Delegates call dispatching to Google::gRPC::Client.

target

The endpoint target address. Defaults to vision.googleapis.com:443.

credentials

The authentication credentials provider. Defaults to application default credentials via Google::Auth.

NAME

Google::Cloud::Vision::V1::ProductSearchService - Compiled Protocol Buffers messages for google/cloud/vision/v1/product_search_service.proto

SYNOPSIS

use Google::Cloud::Vision::V1::ProductSearchService;

my $msg = Google::Cloud::Vision::V1::ProductSearchService::Product->new({
    name => $name,
    display_name => $display_name,
    description => $description,
    product_category => $product_category,
});

# Read or update a field
my $val = $msg->name();

# Binary wire-format roundtrip
my $bytes   = $msg->serialize();
my $decoded = Google::Cloud::Vision::V1::ProductSearchService::Product->parse($bytes);

# Canonical ProtoJSON
my $json = $msg->to_json();

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/cloud/vision/v1/product_search_service.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().

MESSAGES

Google::Cloud::Vision::V1::ProductSearchService::Product

A Product contains ReferenceImages.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    The resource name of the product.

    Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.

    This field is ignored when creating a product.

  • $msg->display_name() / $msg->display_name($value)

    Type: String

    The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long.

  • $msg->description() / $msg->description($value)

    Type: String

    User-provided metadata to be stored with this product. Must be at most 4096 characters long.

  • $msg->product_category() / $msg->product_category($value)

    Type: String

    Immutable. The category for the product identified by the reference image. This should be one of "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". The legacy categories "homegoods", "apparel", and "toys" are still supported, but these should not be used for new products.

  • $msg->product_labels() / $msg->product_labels($value)

    Type: Message (Google::Cloud::Vision::V1::ProductSearchService::Product::KeyValue)

    Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

    Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

    Multiple values can be assigned to the same key. One product may have up to 500 product_labels.

    Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

Google::Cloud::Vision::V1::ProductSearchService::ProductSet

A ProductSet contains Products. A ProductSet can contain a maximum of 1 million reference images. If the limit is exceeded, periodic indexing will fail.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    The resource name of the ProductSet.

    Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.

    This field is ignored when creating a ProductSet.

  • $msg->display_name() / $msg->display_name($value)

    Type: String

    The user-provided name for this ProductSet. Must not be empty. Must be at most 4096 characters long.

  • $msg->index_time() / $msg->index_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Output only. The time at which this ProductSet was last indexed. Query results will reflect all updates before this time. If this ProductSet has never been indexed, this timestamp is the default value "1970-01-01T00:00:00Z".

    This field is ignored when creating a ProductSet.

  • $msg->index_error() / $msg->index_error($value)

    Type: Message (Google::Rpc::Status::Status)

    Output only. If there was an error with indexing the product set, the field is populated.

    This field is ignored when creating a ProductSet.

Google::Cloud::Vision::V1::ProductSearchService::ReferenceImage

A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    The resource name of the reference image.

    Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.

    This field is ignored when creating a reference image.

  • $msg->uri() / $msg->uri($value)

    Type: String

    Required. The Google Cloud Storage URI of the reference image.

    The URI must start with `gs://`.

  • $msg->bounding_polys() / $msg->bounding_polys($value)

    Type: Message (Google::Cloud::Vision::V1::Geometry::BoundingPoly)

    Optional. Bounding polygons around the areas of interest in the reference image. If this field is empty, the system will try to detect regions of interest. At most 10 bounding polygons will be used.

    The provided shape is converted into a non-rotated rectangle. Once converted, the small edge of the rectangle must be greater than or equal to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not).

Google::Cloud::Vision::V1::ProductSearchService::CreateProductRequest

Request message for the `CreateProduct` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The project in which the Product should be created.

    Format is `projects/PROJECT_ID/locations/LOC_ID`.

  • $msg->product() / $msg->product($value)

    Type: Message (Google::Cloud::Vision::V1::ProductSearchService::Product)

    Required. The product to create.

  • $msg->product_id() / $msg->product_id($value)

    Type: String

    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 `/`.

Google::Cloud::Vision::V1::ProductSearchService::ListProductsRequest

Request message for the `ListProducts` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The project OR ProductSet from which Products should be listed.

    Format: `projects/PROJECT_ID/locations/LOC_ID`

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    The maximum number of items to return. Default 10, maximum 100.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    The next_page_token returned from a previous List request, if any.

Google::Cloud::Vision::V1::ProductSearchService::ListProductsResponse

Response message for the `ListProducts` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->products() / $msg->products($value)

    Type: Message (Google::Cloud::Vision::V1::ProductSearchService::Product)

    List of products.

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    Token to retrieve the next page of results, or empty if there are no more results in the list.

Google::Cloud::Vision::V1::ProductSearchService::GetProductRequest

Request message for the `GetProduct` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. Resource name of the Product to get.

    Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`

Google::Cloud::Vision::V1::ProductSearchService::UpdateProductRequest

Request message for the `UpdateProduct` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->product() / $msg->product($value)

    Type: Message (Google::Cloud::Vision::V1::ProductSearchService::Product)

    Required. The Product resource which replaces the one on the server. product.name is immutable.

  • $msg->update_mask() / $msg->update_mask($value)

    Type: Message (Google::Protobuf::FieldMask::FieldMask)

    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 `product_labels`, `display_name`, and `description`.

Google::Cloud::Vision::V1::ProductSearchService::DeleteProductRequest

Request message for the `DeleteProduct` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. Resource name of product to delete.

    Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`

Google::Cloud::Vision::V1::ProductSearchService::CreateProductSetRequest

Request message for the `CreateProductSet` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The project in which the ProductSet should be created.

    Format is `projects/PROJECT_ID/locations/LOC_ID`.

  • $msg->product_set() / $msg->product_set($value)

    Type: Message (Google::Cloud::Vision::V1::ProductSearchService::ProductSet)

    Required. The ProductSet to create.

  • $msg->product_set_id() / $msg->product_set_id($value)

    Type: String

    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 `/`.

Google::Cloud::Vision::V1::ProductSearchService::ListProductSetsRequest

Request message for the `ListProductSets` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The project from which ProductSets should be listed.

    Format is `projects/PROJECT_ID/locations/LOC_ID`.

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    The maximum number of items to return. Default 10, maximum 100.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    The next_page_token returned from a previous List request, if any.

Google::Cloud::Vision::V1::ProductSearchService::ListProductSetsResponse

Response message for the `ListProductSets` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->product_sets() / $msg->product_sets($value)

    Type: Message (Google::Cloud::Vision::V1::ProductSearchService::ProductSet)

    List of ProductSets.

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    Token to retrieve the next page of results, or empty if there are no more results in the list.

Google::Cloud::Vision::V1::ProductSearchService::GetProductSetRequest

Request message for the `GetProductSet` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. Resource name of the ProductSet to get.

    Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`

Google::Cloud::Vision::V1::ProductSearchService::UpdateProductSetRequest

Request message for the `UpdateProductSet` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->product_set() / $msg->product_set($value)

    Type: Message (Google::Cloud::Vision::V1::ProductSearchService::ProductSet)

    Required. The ProductSet resource which replaces the one on the server.

  • $msg->update_mask() / $msg->update_mask($value)

    Type: Message (Google::Protobuf::FieldMask::FieldMask)

    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 `display_name`.

Google::Cloud::Vision::V1::ProductSearchService::DeleteProductSetRequest

Request message for the `DeleteProductSet` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. Resource name of the ProductSet to delete.

    Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`

Google::Cloud::Vision::V1::ProductSearchService::CreateReferenceImageRequest

Request message for the `CreateReferenceImage` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. Resource name of the product in which to create the reference image.

    Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.

  • $msg->reference_image() / $msg->reference_image($value)

    Type: Message (Google::Cloud::Vision::V1::ProductSearchService::ReferenceImage)

    Required. The reference image to create. If an image ID is specified, it is ignored.

  • $msg->reference_image_id() / $msg->reference_image_id($value)

    Type: String

    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 `/`.

Google::Cloud::Vision::V1::ProductSearchService::ListReferenceImagesRequest

Request message for the `ListReferenceImages` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. Resource name of the product containing the reference images.

    Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    The maximum number of items to return. Default 10, maximum 100.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    A token identifying a page of results to be returned. This is the value of `nextPageToken` returned in a previous reference image list request.

    Defaults to the first page if not specified.

Google::Cloud::Vision::V1::ProductSearchService::ListReferenceImagesResponse

Response message for the `ListReferenceImages` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->reference_images() / $msg->reference_images($value)

    Type: Message (Google::Cloud::Vision::V1::ProductSearchService::ReferenceImage)

    The list of reference images.

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    The maximum number of items to return. Default 10, maximum 100.

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    The next_page_token returned from a previous List request, if any.

Google::Cloud::Vision::V1::ProductSearchService::GetReferenceImageRequest

Request message for the `GetReferenceImage` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The resource name of the ReferenceImage to get.

    Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.

Google::Cloud::Vision::V1::ProductSearchService::DeleteReferenceImageRequest

Request message for the `DeleteReferenceImage` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The resource name of the reference image to delete.

    Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`

Google::Cloud::Vision::V1::ProductSearchService::AddProductToProductSetRequest

Request message for the `AddProductToProductSet` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The resource name for the ProductSet to modify.

    Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`

  • $msg->product() / $msg->product($value)

    Type: String

    Required. The resource name for the Product to be added to this ProductSet.

    Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`

Google::Cloud::Vision::V1::ProductSearchService::RemoveProductFromProductSetRequest

Request message for the `RemoveProductFromProductSet` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The resource name for the ProductSet to modify.

    Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`

  • $msg->product() / $msg->product($value)

    Type: String

    Required. The resource name for the Product to be removed from this ProductSet.

    Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`

Google::Cloud::Vision::V1::ProductSearchService::ListProductsInProductSetRequest

Request message for the `ListProductsInProductSet` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The ProductSet resource for which to retrieve Products.

    Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    The maximum number of items to return. Default 10, maximum 100.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    The next_page_token returned from a previous List request, if any.

Google::Cloud::Vision::V1::ProductSearchService::ListProductsInProductSetResponse

Response message for the `ListProductsInProductSet` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->products() / $msg->products($value)

    Type: Message (Google::Cloud::Vision::V1::ProductSearchService::Product)

    The list of Products.

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    Token to retrieve the next page of results, or empty if there are no more results in the list.

Google::Cloud::Vision::V1::ProductSearchService::ImportProductSetsGcsSource

The Google Cloud Storage location for a csv file which preserves a list of ImportProductSetRequests in each line.

Inherits from Protobuf::Message.

Accessors

  • $msg->csv_file_uri() / $msg->csv_file_uri($value)

    Type: String

    The Google Cloud Storage URI of the input csv file.

    The URI must start with `gs://`.

    The format of the input csv file should be one image per line. In each line, there are 8 columns.

    1. image-uri 2. image-id 3. product-set-id 4. product-id 5. product-category 6. product-display-name 7. labels 8. bounding-poly

    The `image-uri`, `product-set-id`, `product-id`, and `product-category` columns are required. All other columns are optional.

    If the `ProductSet` or `Product` specified by the `product-set-id` and `product-id` values does not exist, then the system will create a new `ProductSet` or `Product` for the image. In this case, the `product-display-name` column refers to [display_name][google.cloud.vision.v1.Product.display_name], the `product-category` column refers to [product_category][google.cloud.vision.v1.Product.product_category], and the `labels` column refers to [product_labels][google.cloud.vision.v1.Product.product_labels].

    The `image-id` column is optional but must be unique if provided. If it is empty, the system will automatically assign a unique id to the image.

    The `product-display-name` column is optional. If it is empty, the system sets the [display_name][google.cloud.vision.v1.Product.display_name] field for the product to a space (" "). You can update the `display_name` later by using the API.

    If a `Product` with the specified `product-id` already exists, then the system ignores the `product-display-name`, `product-category`, and `labels` columns.

    The `labels` column (optional) is a line containing a list of comma-separated key-value pairs, in the following format:

    "key_1=value_1,key_2=value_2,...,key_n=value_n"

    The `bounding-poly` column (optional) identifies one region of interest from the image in the same manner as `CreateReferenceImage`. If you do not specify the `bounding-poly` column, then the system will try to detect regions of interest automatically.

    At most one `bounding-poly` column is allowed per line. If the image contains multiple regions of interest, add a line to the CSV file that includes the same product information, and the `bounding-poly` values for each region of interest.

    The `bounding-poly` column must contain an even number of comma-separated numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use non-negative integers for absolute bounding polygons, and float values in [0, 1] for normalized bounding polygons.

    The system will resize the image if the image resolution is too large to process (larger than 20MP).

Google::Cloud::Vision::V1::ProductSearchService::ImportProductSetsInputConfig

The input content for the `ImportProductSets` method.

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Vision::V1::ProductSearchService::ImportProductSetsRequest

Request message for the `ImportProductSets` method.

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Vision::V1::ProductSearchService::ImportProductSetsResponse

Response message for the `ImportProductSets` method.

This message is returned by the [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned [google.longrunning.Operation.response][google.longrunning.Operation.response] field.

Inherits from Protobuf::Message.

Accessors

  • $msg->reference_images() / $msg->reference_images($value)

    Type: Message (Google::Cloud::Vision::V1::ProductSearchService::ReferenceImage)

    The list of reference_images that are imported successfully.

  • $msg->statuses() / $msg->statuses($value)

    Type: Message (Google::Rpc::Status::Status)

    The rpc status for each ImportProductSet request, including both successes and errors.

    The number of statuses here matches the number of lines in the csv file, and statuses[i] stores the success or failure status of processing the i-th line of the csv, starting from line 0.

Google::Cloud::Vision::V1::ProductSearchService::BatchOperationMetadata

Metadata for the batch operations such as the current state.

This is included in the `metadata` field of the `Operation` returned by the `GetOperation` call of the `google::longrunning::Operations` service.

Inherits from Protobuf::Message.

Accessors

Enum: BatchOperationMetadata::State

  • STATE_UNSPECIFIED => 0

  • PROCESSING => 1

  • SUCCESSFUL => 2

  • FAILED => 3

  • CANCELLED => 4

Google::Cloud::Vision::V1::ProductSearchService::ProductSetPurgeConfig

Config to control which ProductSet contains the Products to be deleted.

Inherits from Protobuf::Message.

Accessors

  • $msg->product_set_id() / $msg->product_set_id($value)

    Type: String

    The ProductSet that contains the Products to delete. If a Product is a member of product_set_id in addition to other ProductSets, the Product will still be deleted.

Google::Cloud::Vision::V1::ProductSearchService::PurgeProductsRequest

Request message for the `PurgeProducts` method.

Inherits from Protobuf::Message.

Accessors

  • $msg->product_set_purge_config() / $msg->product_set_purge_config($value)

    Type: Message (Google::Cloud::Vision::V1::ProductSearchService::ProductSetPurgeConfig)

    Specify which ProductSet contains the Products to be deleted.

  • $msg->delete_orphan_products() / $msg->delete_orphan_products($value)

    Type: Bool

    If delete_orphan_products is true, all Products that are not in any ProductSet will be deleted.

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The project and location in which the Products should be deleted.

    Format is `projects/PROJECT_ID/locations/LOC_ID`.

  • $msg->force() / $msg->force($value)

    Type: Bool

    The default value is false. Override this value to true to actually perform the purge.

SEE ALSO

Protobuf, Protobuf::Message, Google::Cloud::Vision::V1::ProductSearchService::Types, https://protobuf.dev/

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.