# Cloud Vision V1p4beta1 API - Class Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client (v0.16.0)

0.16.0 (latest) 0.15.1 0.14.1 0.13.0 0.12.1 0.11.1 0.10.0 0.9.0 0.8.1 0.7.2 0.6.0 0.5.1 0.4.0 0.3.0 0.2.0 0.1.2 Reference documentation and code samples for the Cloud Vision V1p4beta1 API class Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.

REST client for the ProductSearch service.

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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSet "Google::Cloud::Vision::V1p4beta1::ProductSet (class)") 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-Product "Google::Cloud::Vision::V1p4beta1::Product (class)") resources, named
  `projects//locations//products/`

- Each [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-Product "Google::Cloud::Vision::V1p4beta1::Product (class)") has a collection of
  [ReferenceImage](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ReferenceImage "Google::Cloud::Vision::V1p4beta1::ReferenceImage (class)") resources,
  named
  `projects//locations//products//referenceImages/*`

## Inherits

- Object

## Includes

- [Google::Cloud::Vision::V1p4beta1::ProductSearch::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSearch-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the ProductSearch Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSearch-Rest-Client-Configuration "Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSearch-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSearch-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all ProductSearch clients
::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #add_product_to_product_set

    def add_product_to_product_set(request, options = nil) -> ::Google::Protobuf::Empty
    def add_product_to_product_set(name: nil, product: nil) -> ::Google::Protobuf::Empty

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.
**Overloads**

    def add_product_to_product_set(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `add_product_to_product_set` via a request object, either of type [AddProductToProductSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-AddProductToProductSetRequest "Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-AddProductToProductSetRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def add_product_to_product_set(name: nil, product: nil) -> ::Google::Protobuf::Empty

Pass arguments to `add_product_to_product_set` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The resource name for the ProductSet to modify.


  Format is:
  `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
- **product** (::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`
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Protobuf-Empty))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new

# Call the add_product_to_product_set method.
result = client.add_product_to_product_set request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the ProductSearch Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSearch-Rest-Client#Google__Cloud__Vision__V1p4beta1__ProductSearch__Rest__Client_configure_class_ "Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSearch-Rest-Client-Configuration "Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSearch-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSearch-Rest-Client-Configuration))

### #create_product

    def create_product(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::Product
    def create_product(parent: nil, product: nil, product_id: nil) -> ::Google::Cloud::Vision::V1p4beta1::Product

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.
**Overloads**

    def create_product(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::Product

Pass arguments to `create_product` via a request object, either of type [CreateProductRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-CreateProductRequest "Google::Cloud::Vision::V1p4beta1::CreateProductRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::CreateProductRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-CreateProductRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def create_product(parent: nil, product: nil, product_id: nil) -> ::Google::Cloud::Vision::V1p4beta1::Product

Pass arguments to `create_product` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The project in which the Product should be created.


  Format is
  `projects/PROJECT_ID/locations/LOC_ID`.
- **product** ([::Google::Cloud::Vision::V1p4beta1::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-Product), ::Hash) --- Required. The product to create.
- **product_id** (::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 `/`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Vision::V1p4beta1::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-Product))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Vision::V1p4beta1::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-Product))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new

# Call the create_product method.
result = client.create_product request

# The returned object is of type Google::Cloud::Vision::V1p4beta1::Product.
p result
```

### #create_product_set

    def create_product_set(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::ProductSet
    def create_product_set(parent: nil, product_set: nil, product_set_id: nil) -> ::Google::Cloud::Vision::V1p4beta1::ProductSet

Creates and returns a new ProductSet resource.

Possible errors:

- Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
**Overloads**

    def create_product_set(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::ProductSet

Pass arguments to `create_product_set` via a request object, either of type [CreateProductSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-CreateProductSetRequest "Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-CreateProductSetRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def create_product_set(parent: nil, product_set: nil, product_set_id: nil) -> ::Google::Cloud::Vision::V1p4beta1::ProductSet

Pass arguments to `create_product_set` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The project in which the ProductSet should be created.


  Format is `projects/PROJECT_ID/locations/LOC_ID`.
- **product_set** ([::Google::Cloud::Vision::V1p4beta1::ProductSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSet), ::Hash) --- Required. The ProductSet to create.
- **product_set_id** (::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 `/`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Vision::V1p4beta1::ProductSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSet))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Vision::V1p4beta1::ProductSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSet))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new

# Call the create_product_set method.
result = client.create_product_set request

# The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet.
p result
```

### #create_reference_image

    def create_reference_image(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::ReferenceImage
    def create_reference_image(parent: nil, reference_image: nil, reference_image_id: nil) -> ::Google::Cloud::Vision::V1p4beta1::ReferenceImage

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.
**Overloads**

    def create_reference_image(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::ReferenceImage

Pass arguments to `create_reference_image` via a request object, either of type [CreateReferenceImageRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-CreateReferenceImageRequest "Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-CreateReferenceImageRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def create_reference_image(parent: nil, reference_image: nil, reference_image_id: nil) -> ::Google::Cloud::Vision::V1p4beta1::ReferenceImage

Pass arguments to `create_reference_image` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::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`.
- **reference_image** ([::Google::Cloud::Vision::V1p4beta1::ReferenceImage](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ReferenceImage), ::Hash) --- Required. The reference image to create. If an image ID is specified, it is ignored.
- **reference_image_id** (::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 `/`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Vision::V1p4beta1::ReferenceImage](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ReferenceImage))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Vision::V1p4beta1::ReferenceImage](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ReferenceImage))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new

# Call the create_reference_image method.
result = client.create_reference_image request

# The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage.
p result
```

### #delete_product

    def delete_product(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_product(name: nil) -> ::Google::Protobuf::Empty

Permanently deletes a product and its reference images.


<br />

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.
**Overloads**

    def delete_product(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_product` via a request object, either of type [DeleteProductRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-DeleteProductRequest "Google::Cloud::Vision::V1p4beta1::DeleteProductRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-DeleteProductRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def delete_product(name: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_product` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. Resource name of product to delete.


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

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Protobuf-Empty))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new

# Call the delete_product method.
result = client.delete_product request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #delete_product_set

    def delete_product_set(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_product_set(name: nil) -> ::Google::Protobuf::Empty

Permanently deletes a ProductSet. Products and ReferenceImages in the
ProductSet are not deleted.


<br />

The actual image files are not deleted from Google Cloud Storage.
**Overloads**

    def delete_product_set(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_product_set` via a request object, either of type [DeleteProductSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-DeleteProductSetRequest "Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-DeleteProductSetRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def delete_product_set(name: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_product_set` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. Resource name of the ProductSet to delete.


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

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Protobuf-Empty))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new

# Call the delete_product_set method.
result = client.delete_product_set request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #delete_reference_image

    def delete_reference_image(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_reference_image(name: nil) -> ::Google::Protobuf::Empty

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.

<br />

The actual image files are not deleted from Google Cloud Storage.
**Overloads**

    def delete_reference_image(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_reference_image` via a request object, either of type [DeleteReferenceImageRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-DeleteReferenceImageRequest "Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-DeleteReferenceImageRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def delete_reference_image(name: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_reference_image` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::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`
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Protobuf-Empty))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new

# Call the delete_reference_image method.
result = client.delete_reference_image request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #get_product

    def get_product(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::Product
    def get_product(name: nil) -> ::Google::Cloud::Vision::V1p4beta1::Product

Gets information associated with a Product.

Possible errors:

- Returns NOT_FOUND if the Product does not exist.
**Overloads**

    def get_product(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::Product

Pass arguments to `get_product` via a request object, either of type [GetProductRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-GetProductRequest "Google::Cloud::Vision::V1p4beta1::GetProductRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::GetProductRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-GetProductRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_product(name: nil) -> ::Google::Cloud::Vision::V1p4beta1::Product

Pass arguments to `get_product` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. Resource name of the Product to get.


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

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Vision::V1p4beta1::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-Product))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Vision::V1p4beta1::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-Product))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::GetProductRequest.new

# Call the get_product method.
result = client.get_product request

# The returned object is of type Google::Cloud::Vision::V1p4beta1::Product.
p result
```

### #get_product_set

    def get_product_set(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::ProductSet
    def get_product_set(name: nil) -> ::Google::Cloud::Vision::V1p4beta1::ProductSet

Gets information associated with a ProductSet.

Possible errors:

- Returns NOT_FOUND if the ProductSet does not exist.
**Overloads**

    def get_product_set(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::ProductSet

Pass arguments to `get_product_set` via a request object, either of type [GetProductSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-GetProductSetRequest "Google::Cloud::Vision::V1p4beta1::GetProductSetRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-GetProductSetRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_product_set(name: nil) -> ::Google::Cloud::Vision::V1p4beta1::ProductSet

Pass arguments to `get_product_set` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. Resource name of the ProductSet to get.


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

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Vision::V1p4beta1::ProductSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSet))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Vision::V1p4beta1::ProductSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSet))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new

# Call the get_product_set method.
result = client.get_product_set request

# The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet.
p result
```

### #get_reference_image

    def get_reference_image(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::ReferenceImage
    def get_reference_image(name: nil) -> ::Google::Cloud::Vision::V1p4beta1::ReferenceImage

Gets information associated with a ReferenceImage.

Possible errors:

- Returns NOT_FOUND if the specified image does not exist.
**Overloads**

    def get_reference_image(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::ReferenceImage

Pass arguments to `get_reference_image` via a request object, either of type [GetReferenceImageRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-GetReferenceImageRequest "Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-GetReferenceImageRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_reference_image(name: nil) -> ::Google::Cloud::Vision::V1p4beta1::ReferenceImage

Pass arguments to `get_reference_image` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The resource name of the ReferenceImage to get.


  Format is:

  `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Vision::V1p4beta1::ReferenceImage](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ReferenceImage))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Vision::V1p4beta1::ReferenceImage](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ReferenceImage))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new

# Call the get_reference_image method.
result = client.get_reference_image request

# The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage.
p result
```

### #import_product_sets

    def import_product_sets(request, options = nil) -> ::Gapic::Operation
    def import_product_sets(parent: nil, input_config: nil) -> ::Gapic::Operation

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


The [google.longrunning.Operation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Longrunning-Operation "Google::Longrunning::Operation (class)") 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)

<br />

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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ImportProductSetsGcsSource#Google__Cloud__Vision__V1p4beta1__ImportProductSetsGcsSource_csv_file_uri_instance_ "Google::Cloud::Vision::V1p4beta1::ImportProductSetsGcsSource#csv_file_uri (method)").
**Overloads**

    def import_product_sets(request, options = nil) -> ::Gapic::Operation

Pass arguments to `import_product_sets` via a request object, either of type [ImportProductSetsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ImportProductSetsRequest "Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ImportProductSetsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def import_product_sets(parent: nil, input_config: nil) -> ::Gapic::Operation

Pass arguments to `import_product_sets` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The project in which the ProductSets should be imported.


  Format is `projects/PROJECT_ID/locations/LOC_ID`.
- **input_config** ([::Google::Cloud::Vision::V1p4beta1::ImportProductSetsInputConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ImportProductSetsInputConfig), ::Hash) --- Required. The input content for the list of requests.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new

# Call the import_product_sets method.
result = client.import_product_sets request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new ProductSearch REST client object.
**Yields**

- (config) --- Configure the ProductSearch client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSearch-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSearch-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_product_sets

    def list_product_sets(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ProductSet>
    def list_product_sets(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ProductSet>

Lists ProductSets in an unspecified order.

Possible errors:

- Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
**Overloads**

    def list_product_sets(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ProductSet>

Pass arguments to `list_product_sets` via a request object, either of type [ListProductSetsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ListProductSetsRequest "Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ListProductSetsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_product_sets(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ProductSet>

Pass arguments to `list_product_sets` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The project from which ProductSets should be listed.


  Format is `projects/PROJECT_ID/locations/LOC_ID`.
- **page_size** (::Integer) --- The maximum number of items to return. Default 10, maximum 100.
- **page_token** (::String) --- The next_page_token returned from a previous List request, if any.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Vision::V1p4beta1::ProductSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSet)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Vision::V1p4beta1::ProductSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSet)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.new

# Call the list_product_sets method.
result = client.list_product_sets request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Vision::V1p4beta1::ProductSet.
  p item
end
```

### #list_products

    def list_products(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>
    def list_products(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>

Lists products in an unspecified order.

Possible errors:

- Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
**Overloads**

    def list_products(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>

Pass arguments to `list_products` via a request object, either of type [ListProductsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ListProductsRequest "Google::Cloud::Vision::V1p4beta1::ListProductsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::ListProductsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ListProductsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_products(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>

Pass arguments to `list_products` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The project OR ProductSet from which Products should be listed.


  Format:
  `projects/PROJECT_ID/locations/LOC_ID`
- **page_size** (::Integer) --- The maximum number of items to return. Default 10, maximum 100.
- **page_token** (::String) --- The next_page_token returned from a previous List request, if any.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Vision::V1p4beta1::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-Product)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Vision::V1p4beta1::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-Product)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::ListProductsRequest.new

# Call the list_products method.
result = client.list_products request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Vision::V1p4beta1::Product.
  p item
end
```

### #list_products_in_product_set

    def list_products_in_product_set(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>
    def list_products_in_product_set(name: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>

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.
**Overloads**

    def list_products_in_product_set(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>

Pass arguments to `list_products_in_product_set` via a request object, either of type [ListProductsInProductSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ListProductsInProductSetRequest "Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ListProductsInProductSetRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_products_in_product_set(name: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>

Pass arguments to `list_products_in_product_set` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The ProductSet resource for which to retrieve Products.


  Format is:
  `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
- **page_size** (::Integer) --- The maximum number of items to return. Default 10, maximum 100.
- **page_token** (::String) --- The next_page_token returned from a previous List request, if any.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Vision::V1p4beta1::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-Product)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Vision::V1p4beta1::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-Product)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new

# Call the list_products_in_product_set method.
result = client.list_products_in_product_set request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Vision::V1p4beta1::Product.
  p item
end
```

### #list_reference_images

    def list_reference_images(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>
    def list_reference_images(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>

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.
**Overloads**

    def list_reference_images(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>

Pass arguments to `list_reference_images` via a request object, either of type [ListReferenceImagesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ListReferenceImagesRequest "Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ListReferenceImagesRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_reference_images(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>

Pass arguments to `list_reference_images` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. Resource name of the product containing the reference images.


  Format is
  `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
- **page_size** (::Integer) --- The maximum number of items to return. Default 10, maximum 100.
- **page_token** (::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.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Vision::V1p4beta1::ReferenceImage](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ReferenceImage)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Vision::V1p4beta1::ReferenceImage](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ReferenceImage)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.new

# Call the list_reference_images method.
result = client.list_reference_images request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Vision::V1p4beta1::ReferenceImage.
  p item
end
```

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #operations_client

    def operations_client() -> ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Operations

Get the associated client for long-running operations.
**Returns**

- ([::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSearch-Rest-Operations))

### #purge_products

    def purge_products(request, options = nil) -> ::Gapic::Operation
    def purge_products(product_set_purge_config: nil, delete_orphan_products: nil, parent: nil, force: nil) -> ::Gapic::Operation

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.

<br />

The [google.longrunning.Operation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Longrunning-Operation "Google::Longrunning::Operation (class)") API can be
used to keep track of the progress and results of the request.
`Operation.metadata` contains `BatchOperationMetadata`. (progress)
**Overloads**

    def purge_products(request, options = nil) -> ::Gapic::Operation

Pass arguments to `purge_products` via a request object, either of type [Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-PurgeProductsRequest "Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-PurgeProductsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def purge_products(product_set_purge_config: nil, delete_orphan_products: nil, parent: nil, force: nil) -> ::Gapic::Operation

Pass arguments to `purge_products` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **product_set_purge_config** ([::Google::Cloud::Vision::V1p4beta1::ProductSetPurgeConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSetPurgeConfig), ::Hash) --- Specify which ProductSet contains the Products to be deleted.


  Note: The following parameters are mutually exclusive: `product_set_purge_config`, `delete_orphan_products`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **delete_orphan_products** (::Boolean) --- If delete_orphan_products is true, all Products that are not in any ProductSet will be deleted.


  Note: The following parameters are mutually exclusive: `delete_orphan_products`, `product_set_purge_config`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **parent** (::String) --- Required. The project and location in which the Products should be deleted.


  Format is `projects/PROJECT_ID/locations/LOC_ID`.
- **force** (::Boolean) --- The default value is false. Override this value to true to actually perform the purge.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new

# Call the purge_products method.
result = client.purge_products request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #remove_product_from_product_set

    def remove_product_from_product_set(request, options = nil) -> ::Google::Protobuf::Empty
    def remove_product_from_product_set(name: nil, product: nil) -> ::Google::Protobuf::Empty

Removes a Product from the specified ProductSet.
**Overloads**

    def remove_product_from_product_set(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `remove_product_from_product_set` via a request object, either of type [RemoveProductFromProductSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-RemoveProductFromProductSetRequest "Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-RemoveProductFromProductSetRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def remove_product_from_product_set(name: nil, product: nil) -> ::Google::Protobuf::Empty

Pass arguments to `remove_product_from_product_set` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The resource name for the ProductSet to modify.


  Format is:
  `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
- **product** (::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`
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Protobuf-Empty))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new

# Call the remove_product_from_product_set method.
result = client.remove_product_from_product_set request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_product

    def update_product(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::Product
    def update_product(product: nil, update_mask: nil) -> ::Google::Cloud::Vision::V1p4beta1::Product

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.
**Overloads**

    def update_product(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::Product

Pass arguments to `update_product` via a request object, either of type [UpdateProductRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-UpdateProductRequest "Google::Cloud::Vision::V1p4beta1::UpdateProductRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-UpdateProductRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def update_product(product: nil, update_mask: nil) -> ::Google::Cloud::Vision::V1p4beta1::Product

Pass arguments to `update_product` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **product** ([::Google::Cloud::Vision::V1p4beta1::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-Product), ::Hash) --- Required. The Product resource which replaces the one on the server. product.name is immutable.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Protobuf-FieldMask), ::Hash) --- The [FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Protobuf-FieldMask "Google::Protobuf::FieldMask (class)") 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`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Vision::V1p4beta1::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-Product))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Vision::V1p4beta1::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-Product))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new

# Call the update_product method.
result = client.update_product request

# The returned object is of type Google::Cloud::Vision::V1p4beta1::Product.
p result
```

### #update_product_set

    def update_product_set(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::ProductSet
    def update_product_set(product_set: nil, update_mask: nil) -> ::Google::Cloud::Vision::V1p4beta1::ProductSet

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.
**Overloads**

    def update_product_set(request, options = nil) -> ::Google::Cloud::Vision::V1p4beta1::ProductSet

Pass arguments to `update_product_set` via a request object, either of type [UpdateProductSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-UpdateProductSetRequest "Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-UpdateProductSetRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def update_product_set(product_set: nil, update_mask: nil) -> ::Google::Cloud::Vision::V1p4beta1::ProductSet

Pass arguments to `update_product_set` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **product_set** ([::Google::Cloud::Vision::V1p4beta1::ProductSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSet), ::Hash) --- Required. The ProductSet resource which replaces the one on the server.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Protobuf-FieldMask), ::Hash) --- The [FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Protobuf-FieldMask "Google::Protobuf::FieldMask (class)") 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`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Vision::V1p4beta1::ProductSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSet))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Vision::V1p4beta1::ProductSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest/Google-Cloud-Vision-V1p4beta1-ProductSet))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/vision/v1p4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new

# Call the update_product_set method.
result = client.update_product_set request

# The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet.
p result
```