# Retail V2 API - Class Google::Cloud::Retail::V2::ProductService::Rest::Client (v2.9.0)

2.9.0 (latest) 2.8.1 2.7.0 2.6.1 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.3.0 1.2.0 1.1.0 1.0.1 0.21.0 0.20.0 0.19.0 0.18.2 0.17.0 0.16.1 0.15.0 0.14.0 0.13.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.0 0.6.4 Reference documentation and code samples for the Retail V2 API class Google::Cloud::Retail::V2::ProductService::Rest::Client.

REST client for the ProductService service.


<br />

Service for ingesting [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") information
of the customer's website.

## Inherits

- Object

## Includes

- [Google::Cloud::Retail::V2::ProductService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Paths)

## Methods

### .configure

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

Configure the ProductService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client-Configuration "Google::Cloud::Retail::V2::ProductService::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-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all ProductService clients
::Google::Cloud::Retail::V2::ProductService::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #add_fulfillment_places

    def add_fulfillment_places(request, options = nil) -> ::Gapic::Operation
    def add_fulfillment_places(product: nil, type: nil, place_ids: nil, add_time: nil, allow_missing: nil) -> ::Gapic::Operation

We recommend that you use the
[ProductService.AddLocalInventories](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_add_local_inventories_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#add_local_inventories (method)")
method instead of the
[ProductService.AddFulfillmentPlaces](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_add_fulfillment_places_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#add_fulfillment_places (method)")
method.
[ProductService.AddLocalInventories](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_add_local_inventories_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#add_local_inventories (method)")
achieves the same results but provides more fine-grained control over
ingesting local inventory data.


Incrementally adds place IDs to
[Product.fulfillment_info.place_ids](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-FulfillmentInfo#Google__Cloud__Retail__V2__FulfillmentInfo_place_ids_instance_ "Google::Cloud::Retail::V2::FulfillmentInfo#place_ids (method)").

This process is asynchronous and does not require the
[Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") to exist before updating
fulfillment information. If the request is valid, the update will be
enqueued and processed downstream. As a consequence, when a response is
returned, the added place IDs are not immediately manifested in the
[Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") queried by
[ProductService.GetProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_get_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product (method)")
or
[ProductService.ListProducts](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_list_products_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products (method)").

The returned [Operation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Longrunning-Operation "Google::Longrunning::Operation (class)")s will be obsolete
after 1 day, and GetOperation
API will return NOT_FOUND afterwards.

<br />

If conflicting updates are issued, the
{::Google::Longrunning::Operation Operation}s associated with the stale
updates will not be marked as [done](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Longrunning-Operation#Google__Longrunning__Operation_done_instance_ "Google::Longrunning::Operation#done (method)")
until being obsolete.
**Overloads**

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

Pass arguments to `add_fulfillment_places` via a request object, either of type [AddFulfillmentPlacesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AddFulfillmentPlacesRequest "Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AddFulfillmentPlacesRequest), ::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_fulfillment_places(product: nil, type: nil, place_ids: nil, add_time: nil, allow_missing: nil) -> ::Gapic::Operation

Pass arguments to `add_fulfillment_places` 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** (::String) --- Required. Full resource name of [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.


  If the caller does not have permission to access the
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), regardless of whether or not it
  exists, a PERMISSION_DENIED error is returned.
- **type** (::String) --- Required. The fulfillment type, including commonly used types (such as pickup in store and same day delivery), and custom types.


  Supported values:
  - "pickup-in-store"
  - "ship-to-store"
  - "same-day-delivery"
  - "next-day-delivery"
  - "custom-type-1"
  - "custom-type-2"
  - "custom-type-3"
  - "custom-type-4"
  - "custom-type-5"

  If this field is set to an invalid value other than these, an
  INVALID_ARGUMENT error is returned.

  This field directly corresponds to
  [Product.fulfillment_info.type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-FulfillmentInfo#Google__Cloud__Retail__V2__FulfillmentInfo_type_instance_ "Google::Cloud::Retail::V2::FulfillmentInfo#type (method)").
- **place_ids** (::Array\<::String\>) --- Required. The IDs for this [type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AddFulfillmentPlacesRequest#Google__Cloud__Retail__V2__AddFulfillmentPlacesRequest_type_instance_ "Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type (method)"), such as the store IDs for "pickup-in-store" or the region IDs for "same-day-delivery" to be added for this [type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AddFulfillmentPlacesRequest#Google__Cloud__Retail__V2__AddFulfillmentPlacesRequest_type_instance_ "Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type (method)"). Duplicate IDs will be automatically ignored.


  At least 1 value is required, and a maximum of 2000 values are allowed.
  Each value must be a string with a length limit of 10 characters, matching
  the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
  INVALID_ARGUMENT error is returned.

  If the total number of place IDs exceeds 2000 for this
  [type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AddFulfillmentPlacesRequest#Google__Cloud__Retail__V2__AddFulfillmentPlacesRequest_type_instance_ "Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type (method)") after
  adding, then the update will be rejected.
- **add_time** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-Timestamp), ::Hash) --- The time when the fulfillment updates are issued, used to prevent out-of-order updates on fulfillment information. If not provided, the internal system time will be used.
- **allow_missing** (::Boolean) --- If set to true, and the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is not found, the fulfillment information will still be processed and retained for at most 1 day and processed once the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is created. If set to false, a NOT_FOUND error is returned if the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is not found.
**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/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new

# Call the add_fulfillment_places method.
result = client.add_fulfillment_places 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
```

### #add_local_inventories

    def add_local_inventories(request, options = nil) -> ::Gapic::Operation
    def add_local_inventories(product: nil, local_inventories: nil, add_mask: nil, add_time: nil, allow_missing: nil) -> ::Gapic::Operation

Updates local inventory information for a
[Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") at a list of places, while
respecting the last update timestamps of each inventory field.


This process is asynchronous and does not require the
[Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") to exist before updating
inventory information. If the request is valid, the update will be enqueued
and processed downstream. As a consequence, when a response is returned,
updates are not immediately manifested in the
[Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") queried by
[ProductService.GetProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_get_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product (method)")
or
[ProductService.ListProducts](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_list_products_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products (method)").

Local inventory information can only be modified using this method.
[ProductService.CreateProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_create_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#create_product (method)")
and
[ProductService.UpdateProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_update_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product (method)")
has no effect on local inventories.

The returned [Operation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Longrunning-Operation "Google::Longrunning::Operation (class)")s will be obsolete
after 1 day, and GetOperation
API will return NOT_FOUND afterwards.

<br />

If conflicting updates are issued, the
{::Google::Longrunning::Operation Operation}s associated with the stale
updates will not be marked as [done](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Longrunning-Operation#Google__Longrunning__Operation_done_instance_ "Google::Longrunning::Operation#done (method)")
until being obsolete.
**Overloads**

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

Pass arguments to `add_local_inventories` via a request object, either of type [AddLocalInventoriesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AddLocalInventoriesRequest "Google::Cloud::Retail::V2::AddLocalInventoriesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Retail::V2::AddLocalInventoriesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AddLocalInventoriesRequest), ::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_local_inventories(product: nil, local_inventories: nil, add_mask: nil, add_time: nil, allow_missing: nil) -> ::Gapic::Operation

Pass arguments to `add_local_inventories` 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** (::String) --- Required. Full resource name of [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.


  If the caller does not have permission to access the
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), regardless of whether or not it
  exists, a PERMISSION_DENIED error is returned.
- **local_inventories** (::Array\<[::Google::Cloud::Retail::V2::LocalInventory](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-LocalInventory), ::Hash\>) --- Required. A list of inventory information at difference places. Each place is identified by its place ID. At most 3000 inventories are allowed per request.
- **add_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- Indicates which inventory fields in the provided list of [LocalInventory](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-LocalInventory "Google::Cloud::Retail::V2::LocalInventory (class)") to update. The field is updated to the provided value.


  If a field is set while the place does not have a previous local inventory,
  the local inventory at that store is created.

  If a field is set while the value of that field is not provided, the
  original field value, if it exists, is deleted.

  If the mask is not set or set with empty paths, all inventory fields will
  be updated.

  If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
  is returned and the entire update will be ignored.
- **add_time** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-Timestamp), ::Hash) --- The time when the inventory updates are issued. Used to prevent out-of-order updates on local inventory fields. If not provided, the internal system time will be used.
- **allow_missing** (::Boolean) --- If set to true, and the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is not found, the local inventory will still be processed and retained for at most 1 day and processed once the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is created. If set to false, a NOT_FOUND error is returned if the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is not found.
**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/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new

# Call the add_local_inventories method.
result = client.add_local_inventories 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
```

### #configure

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

Configure the ProductService 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-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_configure_class_ "Google::Cloud::Retail::V2::ProductService::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client-Configuration "Google::Cloud::Retail::V2::ProductService::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-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client-Configuration))

### #create_product

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

Creates a [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)").
**Overloads**

    def create_product(request, options = nil) -> ::Google::Cloud::Retail::V2::Product

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

- **request** ([::Google::Cloud::Retail::V2::CreateProductRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-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::Retail::V2::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 parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
- **product** ([::Google::Cloud::Retail::V2::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product), ::Hash) --- Required. The [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") to create.
- **product_id** (::String) --- Required. The ID to use for the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), which will become the final component of the [Product.name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_name_instance_ "Google::Cloud::Retail::V2::Product#name (method)").


  If the caller does not have permission to create the
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), regardless of whether or not it
  exists, a PERMISSION_DENIED error is returned.

  This field must be unique among all
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)")s with the same
  [parent](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CreateProductRequest#Google__Cloud__Retail__V2__CreateProductRequest_parent_instance_ "Google::Cloud::Retail::V2::CreateProductRequest#parent (method)"). Otherwise, an
  ALREADY_EXISTS error is returned.

  This field must be a UTF-8 encoded string with a length limit of 128
  characters. Otherwise, an INVALID_ARGUMENT error is returned.
**Yields**

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

- **result** ([::Google::Cloud::Retail::V2::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Retail::V2::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product))
**Raises**

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

Basic example

```ruby
require "google/cloud/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new

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

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

# The returned object is of type Google::Cloud::Retail::V2::Product.
p result
```

### #delete_product

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

Deletes a [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)").
**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-retail-v2/latest/Google-Cloud-Retail-V2-DeleteProductRequest "Google::Cloud::Retail::V2::DeleteProductRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Retail::V2::DeleteProductRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-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. Full resource name of [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.


  If the caller does not have permission to delete the
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), regardless of whether or not it
  exists, a PERMISSION_DENIED error is returned.

  If the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") to delete does not exist,
  a NOT_FOUND error is returned.

  The [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") to delete can neither be a
  [Product.Type.COLLECTION](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product-Type#Google__Cloud__Retail__V2__Product__Type__COLLECTION "Google::Cloud::Retail::V2::Product::Type::COLLECTION (constant)")
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") member nor a
  [Product.Type.PRIMARY](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product-Type#Google__Cloud__Retail__V2__Product__Type__PRIMARY "Google::Cloud::Retail::V2::Product::Type::PRIMARY (constant)")
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") with more than one
  [variants](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product-Type#Google__Cloud__Retail__V2__Product__Type__VARIANT "Google::Cloud::Retail::V2::Product::Type::VARIANT (constant)"). Otherwise, an
  INVALID_ARGUMENT error is returned.

  All inventory information for the named
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") will be deleted.
**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-retail-v2/latest/Google-Protobuf-Empty))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

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

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

Basic example

```ruby
require "google/cloud/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new

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

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

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

### #get_product

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

Gets a [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)").
**Overloads**

    def get_product(request, options = nil) -> ::Google::Cloud::Retail::V2::Product

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

- **request** ([::Google::Cloud::Retail::V2::GetProductRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-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::Retail::V2::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. Full resource name of [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.


  If the caller does not have permission to access the
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), regardless of whether or not it
  exists, a PERMISSION_DENIED error is returned.

  If the requested [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") does not exist,
  a NOT_FOUND error is returned.
**Yields**

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

- **result** ([::Google::Cloud::Retail::V2::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Retail::V2::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product))
**Raises**

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

Basic example

```ruby
require "google/cloud/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new

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

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

# The returned object is of type Google::Cloud::Retail::V2::Product.
p result
```

### #import_products

    def import_products(request, options = nil) -> ::Gapic::Operation
    def import_products(parent: nil, request_id: nil, input_config: nil, errors_config: nil, update_mask: nil, reconciliation_mode: nil, notification_pubsub_topic: nil) -> ::Gapic::Operation

Bulk import of multiple [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)")s.


Request processing may be synchronous.
Non-existing items are created.

<br />

Note that it is possible for a subset of the
{::Google::Cloud::Retail::V2::Product Product}s to be successfully updated.
**Overloads**

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

Pass arguments to `import_products` via a request object, either of type [ImportProductsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ImportProductsRequest "Google::Cloud::Retail::V2::ImportProductsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Retail::V2::ImportProductsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ImportProductsRequest), ::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_products(parent: nil, request_id: nil, input_config: nil, errors_config: nil, update_mask: nil, reconciliation_mode: nil, notification_pubsub_topic: nil) -> ::Gapic::Operation

Pass arguments to `import_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. `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`


  If no updateMask is specified, requires products.create permission.
  If updateMask is specified, requires products.update permission.
- **request_id** (::String) --- Deprecated. This field has no effect.
- **input_config** ([::Google::Cloud::Retail::V2::ProductInputConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductInputConfig), ::Hash) --- Required. The desired input location of the data.
- **errors_config** ([::Google::Cloud::Retail::V2::ImportErrorsConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ImportErrorsConfig), ::Hash) --- The desired location of errors incurred during the Import.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- Indicates which fields in the provided imported `products` to update. If not set, all fields are updated. If provided, only the existing product fields are updated. Missing products will not be created.
- **reconciliation_mode** ([::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ImportProductsRequest-ReconciliationMode)) --- The mode of reconciliation between existing products and the products to be imported. Defaults to [ReconciliationMode.INCREMENTAL](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ImportProductsRequest-ReconciliationMode#Google__Cloud__Retail__V2__ImportProductsRequest__ReconciliationMode__INCREMENTAL "Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode::INCREMENTAL (constant)").
- **notification_pubsub_topic** (::String) --- Full Pub/Sub topic name for receiving notification. If this field is set, when the import is finished, a notification is sent to specified Pub/Sub topic. The message data is JSON string of a [Operation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Longrunning-Operation "Google::Longrunning::Operation (class)").


  Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
  to be within the same project as
  [ImportProductsRequest.parent](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ImportProductsRequest#Google__Cloud__Retail__V2__ImportProductsRequest_parent_instance_ "Google::Cloud::Retail::V2::ImportProductsRequest#parent (method)").
  Make sure that both
  `cloud-retail-customer-data-access@system.gserviceaccount.com` and
  `service-<project number>@gcp-sa-retail.iam.gserviceaccount.com`
  have the `pubsub.topics.publish` IAM permission on the topic.

  Only supported when
  [ImportProductsRequest.reconciliation_mode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ImportProductsRequest#Google__Cloud__Retail__V2__ImportProductsRequest_reconciliation_mode_instance_ "Google::Cloud::Retail::V2::ImportProductsRequest#reconciliation_mode (method)")
  is set to `FULL`.
**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/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Retail::V2::ImportProductsRequest.new

# Call the import_products method.
result = client.import_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
```

### #initialize

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

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

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

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_products

    def list_products(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Product>
    def list_products(parent: nil, page_size: nil, page_token: nil, filter: nil, read_mask: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Product>

Gets a list of {::Google::Cloud::Retail::V2::Product Product}s.
**Overloads**

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

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

- **request** ([::Google::Cloud::Retail::V2::ListProductsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-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, filter: nil, read_mask: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::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 parent branch resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use `default_branch` as the branch ID, to list products under the default branch.


  If the caller does not have permission to list
  {::Google::Cloud::Retail::V2::Product Product}s under this branch, regardless of
  whether or not this branch exists, a PERMISSION_DENIED error is returned.
- **page_size** (::Integer) --- Maximum number of [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)")s to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000.


  If this field is negative, an INVALID_ARGUMENT error is returned.
- **page_token** (::String) --- A page token [ListProductsResponse.next_page_token](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ListProductsResponse#Google__Cloud__Retail__V2__ListProductsResponse_next_page_token_instance_ "Google::Cloud::Retail::V2::ListProductsResponse#next_page_token (method)"), received from a previous [ProductService.ListProducts](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_list_products_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products (method)") call. Provide this to retrieve the subsequent page.


  When paginating, all other parameters provided to
  [ProductService.ListProducts](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_list_products_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products (method)")
  must match the call that provided the page token. Otherwise, an
  INVALID_ARGUMENT error is returned.
- **filter** (::String) --- A filter to apply on the list results. Supported features:


  - List all the products under the parent branch if [filter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ListProductsRequest#Google__Cloud__Retail__V2__ListProductsRequest_filter_instance_ "Google::Cloud::Retail::V2::ListProductsRequest#filter (method)") is unset.
  - List [Product.Type.VARIANT](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product-Type#Google__Cloud__Retail__V2__Product__Type__VARIANT "Google::Cloud::Retail::V2::Product::Type::VARIANT (constant)") [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)")s sharing the same [Product.Type.PRIMARY](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product-Type#Google__Cloud__Retail__V2__Product__Type__PRIMARY "Google::Cloud::Retail::V2::Product::Type::PRIMARY (constant)") [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"). For example: `primary_product_id = "some_product_id"`
  - List [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)")s bundled in a [Product.Type.COLLECTION](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product-Type#Google__Cloud__Retail__V2__Product__Type__COLLECTION "Google::Cloud::Retail::V2::Product::Type::COLLECTION (constant)") [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"). For example: `collection_product_id = "some_product_id"`
  - List [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)")s with a partibular type. For example: `type = "PRIMARY"` `type = "VARIANT"` `type = "COLLECTION"`

  If the field is unrecognizable, an INVALID_ARGUMENT error is returned.

  If the specified
  [Product.Type.PRIMARY](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product-Type#Google__Cloud__Retail__V2__Product__Type__PRIMARY "Google::Cloud::Retail::V2::Product::Type::PRIMARY (constant)")
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") or
  [Product.Type.COLLECTION](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product-Type#Google__Cloud__Retail__V2__Product__Type__COLLECTION "Google::Cloud::Retail::V2::Product::Type::COLLECTION (constant)")
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") does not exist, a NOT_FOUND error
  is returned.
- **read_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- The fields of [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") to return in the responses. If not set or empty, the following fields are returned:


  - [Product.name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_name_instance_ "Google::Cloud::Retail::V2::Product#name (method)")
  - [Product.id](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_id_instance_ "Google::Cloud::Retail::V2::Product#id (method)")
  - [Product.title](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_title_instance_ "Google::Cloud::Retail::V2::Product#title (method)")
  - [Product.uri](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_uri_instance_ "Google::Cloud::Retail::V2::Product#uri (method)")
  - [Product.images](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_images_instance_ "Google::Cloud::Retail::V2::Product#images (method)")
  - [Product.price_info](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_price_info_instance_ "Google::Cloud::Retail::V2::Product#price_info (method)")
  - [Product.brands](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_brands_instance_ "Google::Cloud::Retail::V2::Product#brands (method)")

  If "\*" is provided, all fields are returned.
  [Product.name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_name_instance_ "Google::Cloud::Retail::V2::Product#name (method)") is always returned no
  matter what mask is set.

  If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
  is returned.
**Yields**

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

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Retail::V2::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Retail::V2::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product)\>)
**Raises**

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

Basic example

```ruby
require "google/cloud/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Retail::V2::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::Retail::V2::Product.
  p item
end
```

### #location_client

    def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.
**Returns**

- (Google::Cloud::Location::Locations::Rest::Client)

### #logger

    def logger() -> Logger

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

- (Logger)

### #operations_client

    def operations_client() -> ::Google::Cloud::Retail::V2::ProductService::Rest::Operations

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

- ([::Google::Cloud::Retail::V2::ProductService::Rest::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Operations))

### #purge_products

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

Permanently deletes all selected [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)")s
under a branch.


This process is asynchronous. If the request is valid, the removal will be
enqueued and processed offline. Depending on the number of
[Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)")s, this operation could take hours
to complete. Before the operation completes, some
[Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)")s may still be returned by
[ProductService.GetProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_get_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product (method)")
or
[ProductService.ListProducts](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_list_products_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products (method)").

<br />

Depending on the number of {::Google::Cloud::Retail::V2::Product Product}s, this
operation could take hours to complete. To get a sample of
{::Google::Cloud::Retail::V2::Product Product}s that would be deleted, set
[PurgeProductsRequest.force](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-PurgeProductsRequest#Google__Cloud__Retail__V2__PurgeProductsRequest_force_instance_ "Google::Cloud::Retail::V2::PurgeProductsRequest#force (method)")
to false.
**Overloads**

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

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

- **request** ([::Google::Cloud::Retail::V2::PurgeProductsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-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(parent: nil, filter: 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**

- **parent** (::String) --- Required. The resource name of the branch under which the products are created. The format is `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}`
- **filter** (::String) ---

  Required. The filter string to specify the products to be deleted with a
  length limit of 5,000 characters.

  Empty string filter is not allowed. "\*" implies delete all items in a
  branch.

  The eligible fields for filtering are:
  - `availability`: Double quoted [Product.availability](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_availability_instance_ "Google::Cloud::Retail::V2::Product#availability (method)") string.
  - `create_time` : in ISO 8601 "zulu" format.

  Supported syntax:
  - Comparators ("\>", "\<", "\>=", "\<=", "=").
    Examples:

    - create_time \<= "2015-02-13T17:05:46Z"
    - availability = "IN_STOCK"
  - Conjunctions ("AND")
    Examples:

    - create_time \<= "2015-02-13T17:05:46Z" AND availability = "PREORDER"
  - Disjunctions ("OR")
    Examples:

    - create_time \<= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK"
  - Can support nested queries.
    Examples:

    - (create_time \<= "2015-02-13T17:05:46Z" AND availability = "PREORDER") OR (create_time \>= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK")
  - Filter Limits:

    - Filter should not contain more than 6 conditions.
    - Max nesting depth should not exceed 2 levels.

  Examples queries:
  - Delete back order products created before a timestamp. create_time \<= "2015-02-13T17:05:46Z" OR availability = "BACKORDER"
- **force** (::Boolean) --- Actually perform the purge. If `force` is set to false, the method will return the expected purge count without deleting any products.
**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/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Retail::V2::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_fulfillment_places

    def remove_fulfillment_places(request, options = nil) -> ::Gapic::Operation
    def remove_fulfillment_places(product: nil, type: nil, place_ids: nil, remove_time: nil, allow_missing: nil) -> ::Gapic::Operation

We recommend that you use the
[ProductService.RemoveLocalInventories](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_remove_local_inventories_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#remove_local_inventories (method)")
method instead of the
[ProductService.RemoveFulfillmentPlaces](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_remove_fulfillment_places_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#remove_fulfillment_places (method)")
method.
[ProductService.RemoveLocalInventories](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_remove_local_inventories_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#remove_local_inventories (method)")
achieves the same results but provides more fine-grained control over
ingesting local inventory data.


Incrementally removes place IDs from a
[Product.fulfillment_info.place_ids](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-FulfillmentInfo#Google__Cloud__Retail__V2__FulfillmentInfo_place_ids_instance_ "Google::Cloud::Retail::V2::FulfillmentInfo#place_ids (method)").

This process is asynchronous and does not require the
[Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") to exist before updating
fulfillment information. If the request is valid, the update will be
enqueued and processed downstream. As a consequence, when a response is
returned, the removed place IDs are not immediately manifested in the
[Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") queried by
[ProductService.GetProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_get_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product (method)")
or
[ProductService.ListProducts](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_list_products_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products (method)").

The returned [Operation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Longrunning-Operation "Google::Longrunning::Operation (class)")s will be obsolete
after 1 day, and GetOperation
API will return NOT_FOUND afterwards.

<br />

If conflicting updates are issued, the
{::Google::Longrunning::Operation Operation}s associated with the stale
updates will not be marked as [done](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Longrunning-Operation#Google__Longrunning__Operation_done_instance_ "Google::Longrunning::Operation#done (method)")
until being obsolete.
**Overloads**

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

Pass arguments to `remove_fulfillment_places` via a request object, either of type [RemoveFulfillmentPlacesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-RemoveFulfillmentPlacesRequest "Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-RemoveFulfillmentPlacesRequest), ::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_fulfillment_places(product: nil, type: nil, place_ids: nil, remove_time: nil, allow_missing: nil) -> ::Gapic::Operation

Pass arguments to `remove_fulfillment_places` 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** (::String) --- Required. Full resource name of [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.


  If the caller does not have permission to access the
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), regardless of whether or not it
  exists, a PERMISSION_DENIED error is returned.
- **type** (::String) --- Required. The fulfillment type, including commonly used types (such as pickup in store and same day delivery), and custom types.


  Supported values:
  - "pickup-in-store"
  - "ship-to-store"
  - "same-day-delivery"
  - "next-day-delivery"
  - "custom-type-1"
  - "custom-type-2"
  - "custom-type-3"
  - "custom-type-4"
  - "custom-type-5"

  If this field is set to an invalid value other than these, an
  INVALID_ARGUMENT error is returned.

  This field directly corresponds to
  [Product.fulfillment_info.type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-FulfillmentInfo#Google__Cloud__Retail__V2__FulfillmentInfo_type_instance_ "Google::Cloud::Retail::V2::FulfillmentInfo#type (method)").
- **place_ids** (::Array\<::String\>) --- Required. The IDs for this [type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-RemoveFulfillmentPlacesRequest#Google__Cloud__Retail__V2__RemoveFulfillmentPlacesRequest_type_instance_ "Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type (method)"), such as the store IDs for "pickup-in-store" or the region IDs for "same-day-delivery", to be removed for this [type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-RemoveFulfillmentPlacesRequest#Google__Cloud__Retail__V2__RemoveFulfillmentPlacesRequest_type_instance_ "Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type (method)").


  At least 1 value is required, and a maximum of 2000 values are allowed.
  Each value must be a string with a length limit of 10 characters, matching
  the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
  INVALID_ARGUMENT error is returned.
- **remove_time** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-Timestamp), ::Hash) --- The time when the fulfillment updates are issued, used to prevent out-of-order updates on fulfillment information. If not provided, the internal system time will be used.
- **allow_missing** (::Boolean) --- If set to true, and the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is not found, the fulfillment information will still be processed and retained for at most 1 day and processed once the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is created. If set to false, a NOT_FOUND error is returned if the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is not found.
**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/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new

# Call the remove_fulfillment_places method.
result = client.remove_fulfillment_places 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_local_inventories

    def remove_local_inventories(request, options = nil) -> ::Gapic::Operation
    def remove_local_inventories(product: nil, place_ids: nil, remove_time: nil, allow_missing: nil) -> ::Gapic::Operation

Remove local inventory information for a
[Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") at a list of places at a removal
timestamp.


This process is asynchronous. If the request is valid, the removal will be
enqueued and processed downstream. As a consequence, when a response is
returned, removals are not immediately manifested in the
[Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") queried by
[ProductService.GetProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_get_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product (method)")
or
[ProductService.ListProducts](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_list_products_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products (method)").

Local inventory information can only be removed using this method.
[ProductService.CreateProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_create_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#create_product (method)")
and
[ProductService.UpdateProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_update_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product (method)")
has no effect on local inventories.

The returned [Operation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Longrunning-Operation "Google::Longrunning::Operation (class)")s will be obsolete
after 1 day, and GetOperation
API will return NOT_FOUND afterwards.

<br />

If conflicting updates are issued, the
{::Google::Longrunning::Operation Operation}s associated with the stale
updates will not be marked as [done](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Longrunning-Operation#Google__Longrunning__Operation_done_instance_ "Google::Longrunning::Operation#done (method)")
until being obsolete.
**Overloads**

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

Pass arguments to `remove_local_inventories` via a request object, either of type [RemoveLocalInventoriesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-RemoveLocalInventoriesRequest "Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-RemoveLocalInventoriesRequest), ::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_local_inventories(product: nil, place_ids: nil, remove_time: nil, allow_missing: nil) -> ::Gapic::Operation

Pass arguments to `remove_local_inventories` 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** (::String) --- Required. Full resource name of [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.


  If the caller does not have permission to access the
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), regardless of whether or not it
  exists, a PERMISSION_DENIED error is returned.
- **place_ids** (::Array\<::String\>) --- Required. A list of place IDs to have their inventory deleted. At most 3000 place IDs are allowed per request.
- **remove_time** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-Timestamp), ::Hash) --- The time when the inventory deletions are issued. Used to prevent out-of-order updates and deletions on local inventory fields. If not provided, the internal system time will be used.
- **allow_missing** (::Boolean) --- If set to true, and the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is not found, the local inventory removal request will still be processed and retained for at most 1 day and processed once the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is created. If set to false, a NOT_FOUND error is returned if the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is not found.
**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/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new

# Call the remove_local_inventories method.
result = client.remove_local_inventories 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
```

### #set_inventory

    def set_inventory(request, options = nil) -> ::Gapic::Operation
    def set_inventory(inventory: nil, set_mask: nil, set_time: nil, allow_missing: nil) -> ::Gapic::Operation

Updates inventory information for a
[Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") while respecting the last update
timestamps of each inventory field.


This process is asynchronous and does not require the
[Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") to exist before updating
fulfillment information. If the request is valid, the update is enqueued
and processed downstream. As a consequence, when a response is returned,
updates are not immediately manifested in the
[Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") queried by
[ProductService.GetProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_get_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product (method)")
or
[ProductService.ListProducts](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_list_products_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products (method)").

When inventory is updated with
[ProductService.CreateProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_create_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#create_product (method)")
and
[ProductService.UpdateProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_update_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product (method)"),
the specified inventory field value(s) overwrite any existing value(s)
while ignoring the last update time for this field. Furthermore, the last
update times for the specified inventory fields are overwritten by the
times of the
[ProductService.CreateProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_create_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#create_product (method)")
or
[ProductService.UpdateProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_update_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product (method)")
request.

If no inventory fields are set in
[CreateProductRequest.product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CreateProductRequest#Google__Cloud__Retail__V2__CreateProductRequest_product_instance_ "Google::Cloud::Retail::V2::CreateProductRequest#product (method)"),
then any pre-existing inventory information for this product is used.

If no inventory fields are set in
[SetInventoryRequest.set_mask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SetInventoryRequest#Google__Cloud__Retail__V2__SetInventoryRequest_set_mask_instance_ "Google::Cloud::Retail::V2::SetInventoryRequest#set_mask (method)"),
then any existing inventory information is preserved.

Pre-existing inventory information can only be updated with
[ProductService.SetInventory](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_set_inventory_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#set_inventory (method)"),
[ProductService.AddFulfillmentPlaces](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_add_fulfillment_places_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#add_fulfillment_places (method)"),
and
[ProductService.RemoveFulfillmentPlaces](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_remove_fulfillment_places_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#remove_fulfillment_places (method)").

The returned [Operation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Longrunning-Operation "Google::Longrunning::Operation (class)")s is obsolete after
one day, and the GetOperation
API returns `NOT_FOUND` afterwards.

<br />

If conflicting updates are issued, the
{::Google::Longrunning::Operation Operation}s associated with the stale
updates are not marked as [done](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Longrunning-Operation#Google__Longrunning__Operation_done_instance_ "Google::Longrunning::Operation#done (method)") until
they are obsolete.
**Overloads**

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

Pass arguments to `set_inventory` via a request object, either of type [SetInventoryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SetInventoryRequest "Google::Cloud::Retail::V2::SetInventoryRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Retail::V2::SetInventoryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SetInventoryRequest), ::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 set_inventory(inventory: nil, set_mask: nil, set_time: nil, allow_missing: nil) -> ::Gapic::Operation

Pass arguments to `set_inventory` 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**

- **inventory** ([::Google::Cloud::Retail::V2::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product), ::Hash) --- Required. The inventory information to update. The allowable fields to update are:


  - [Product.price_info](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_price_info_instance_ "Google::Cloud::Retail::V2::Product#price_info (method)")
  - [Product.availability](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_availability_instance_ "Google::Cloud::Retail::V2::Product#availability (method)")
  - [Product.available_quantity](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_available_quantity_instance_ "Google::Cloud::Retail::V2::Product#available_quantity (method)")
  - [Product.fulfillment_info](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_fulfillment_info_instance_ "Google::Cloud::Retail::V2::Product#fulfillment_info (method)") The updated inventory fields must be specified in [SetInventoryRequest.set_mask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SetInventoryRequest#Google__Cloud__Retail__V2__SetInventoryRequest_set_mask_instance_ "Google::Cloud::Retail::V2::SetInventoryRequest#set_mask (method)").

  If
  [SetInventoryRequest.inventory.name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_name_instance_ "Google::Cloud::Retail::V2::Product#name (method)")
  is empty or invalid, an INVALID_ARGUMENT error is returned.

  If the caller does not have permission to update the
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") named in
  [Product.name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_name_instance_ "Google::Cloud::Retail::V2::Product#name (method)"), regardless of whether
  or not it exists, a PERMISSION_DENIED error is returned.

  If the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") to update does not have
  existing inventory information, the provided inventory information will be
  inserted.

  If the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") to update has existing
  inventory information, the provided inventory information will be merged
  while respecting the last update time for each inventory field, using the
  provided or default value for
  [SetInventoryRequest.set_time](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SetInventoryRequest#Google__Cloud__Retail__V2__SetInventoryRequest_set_time_instance_ "Google::Cloud::Retail::V2::SetInventoryRequest#set_time (method)").

  The caller can replace place IDs for a subset of fulfillment types in the
  following ways:
  - Adds "fulfillment_info" in [SetInventoryRequest.set_mask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SetInventoryRequest#Google__Cloud__Retail__V2__SetInventoryRequest_set_mask_instance_ "Google::Cloud::Retail::V2::SetInventoryRequest#set_mask (method)")
  - Specifies only the desired fulfillment types and corresponding place IDs to update in [SetInventoryRequest.inventory.fulfillment_info](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_fulfillment_info_instance_ "Google::Cloud::Retail::V2::Product#fulfillment_info (method)")

  The caller can clear all place IDs from a subset of fulfillment types in
  the following ways:
  - Adds "fulfillment_info" in [SetInventoryRequest.set_mask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SetInventoryRequest#Google__Cloud__Retail__V2__SetInventoryRequest_set_mask_instance_ "Google::Cloud::Retail::V2::SetInventoryRequest#set_mask (method)")
  - Specifies only the desired fulfillment types to clear in [SetInventoryRequest.inventory.fulfillment_info](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_fulfillment_info_instance_ "Google::Cloud::Retail::V2::Product#fulfillment_info (method)")
  - Checks that only the desired fulfillment info types have empty [SetInventoryRequest.inventory.fulfillment_info.place_ids](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-FulfillmentInfo#Google__Cloud__Retail__V2__FulfillmentInfo_place_ids_instance_ "Google::Cloud::Retail::V2::FulfillmentInfo#place_ids (method)")

  The last update time is recorded for the following inventory fields:
  - [Product.price_info](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_price_info_instance_ "Google::Cloud::Retail::V2::Product#price_info (method)")
  - [Product.availability](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_availability_instance_ "Google::Cloud::Retail::V2::Product#availability (method)")
  - [Product.available_quantity](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_available_quantity_instance_ "Google::Cloud::Retail::V2::Product#available_quantity (method)")
  - [Product.fulfillment_info](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_fulfillment_info_instance_ "Google::Cloud::Retail::V2::Product#fulfillment_info (method)")

  If a full overwrite of inventory information while ignoring timestamps is
  needed,
  [ProductService.UpdateProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Rest-Client#Google__Cloud__Retail__V2__ProductService__Rest__Client_update_product_instance_ "Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product (method)")
  should be invoked instead.
- **set_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- Indicates which inventory fields in the provided [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") to update.


  At least one field must be provided.

  If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
  is returned and the entire update will be ignored.
- **set_time** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-Timestamp), ::Hash) --- The time when the request is issued, used to prevent out-of-order updates on inventory fields with the last update time recorded. If not provided, the internal system time will be used.
- **allow_missing** (::Boolean) --- If set to true, and the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") with name [Product.name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_name_instance_ "Google::Cloud::Retail::V2::Product#name (method)") is not found, the inventory update will still be processed and retained for at most 1 day until the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is created. If set to false, a NOT_FOUND error is returned if the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is not found.
**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/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Retail::V2::SetInventoryRequest.new

# Call the set_inventory method.
result = client.set_inventory 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
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_product

    def update_product(request, options = nil) -> ::Google::Cloud::Retail::V2::Product
    def update_product(product: nil, update_mask: nil, allow_missing: nil) -> ::Google::Cloud::Retail::V2::Product

Updates a [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)").
**Overloads**

    def update_product(request, options = nil) -> ::Google::Cloud::Retail::V2::Product

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

- **request** ([::Google::Cloud::Retail::V2::UpdateProductRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-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, allow_missing: nil) -> ::Google::Cloud::Retail::V2::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::Retail::V2::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product), ::Hash) --- Required. The product to update/create.


  If the caller does not have permission to update the
  [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)"), regardless of whether or not it
  exists, a PERMISSION_DENIED error is returned.

  If the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") to update does not exist
  and
  [allow_missing](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-UpdateProductRequest#Google__Cloud__Retail__V2__UpdateProductRequest_allow_missing_instance_ "Google::Cloud::Retail::V2::UpdateProductRequest#allow_missing (method)")
  is not set, a NOT_FOUND error is returned.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- Indicates which fields in the provided [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") to update. The immutable and output only fields are NOT supported. If not set, all supported fields (the fields that are neither immutable nor output only) are updated.


  If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
  is returned.

  The attribute key can be updated by setting the mask path as
  "attributes.${key_name}". If a key name is present in the mask but not in
  the patching product from the request, this key will be deleted after the
  update.
- **allow_missing** (::Boolean) --- If set to true, and the [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") is not found, a new [Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product "Google::Cloud::Retail::V2::Product (class)") will be created. In this situation, `update_mask` is ignored.
**Yields**

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

- **result** ([::Google::Cloud::Retail::V2::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Retail::V2::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product))
**Raises**

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

Basic example

```ruby
require "google/cloud/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new

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

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

# The returned object is of type Google::Cloud::Retail::V2::Product.
p result
```