# Retail V2 API - Class Google::Cloud::Retail::V2::ProductDetail (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::ProductDetail.

Detailed product information associated with a user event.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #product

    def product() -> ::Google::Cloud::Retail::V2::Product

**Returns**

- ([::Google::Cloud::Retail::V2::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product)) --- Required. [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.


  Required field(s):
  - [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)")

  Optional override field(s):
  - [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)")

  If any supported optional fields are provided, we will treat them as a full
  override when looking up product information from the catalog. Thus, it is
  important to ensure that the overriding fields are accurate and
  complete.

  All other product fields are ignored and instead populated via catalog
  lookup after event ingestion.

### #product=

    def product=(value) -> ::Google::Cloud::Retail::V2::Product

**Parameter**

- **value** ([::Google::Cloud::Retail::V2::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product)) --- Required. [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.


  Required field(s):
  - [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)")

  Optional override field(s):
  - [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)")

  If any supported optional fields are provided, we will treat them as a full
  override when looking up product information from the catalog. Thus, it is
  important to ensure that the overriding fields are accurate and
  complete.

  All other product fields are ignored and instead populated via catalog
  lookup after event ingestion.
**Returns**

- ([::Google::Cloud::Retail::V2::Product](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product)) --- Required. [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.


  Required field(s):
  - [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)")

  Optional override field(s):
  - [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)")

  If any supported optional fields are provided, we will treat them as a full
  override when looking up product information from the catalog. Thus, it is
  important to ensure that the overriding fields are accurate and
  complete.

  All other product fields are ignored and instead populated via catalog
  lookup after event ingestion.

### #quantity

    def quantity() -> ::Google::Protobuf::Int32Value

**Returns**

- ([::Google::Protobuf::Int32Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-Int32Value)) --- Quantity of the product associated with the user event.


  For example, this field will be 2 if two products are added to the shopping
  cart for `purchase-complete` event. Required for `add-to-cart` and
  `purchase-complete` event types.

### #quantity=

    def quantity=(value) -> ::Google::Protobuf::Int32Value

**Parameter**

- **value** ([::Google::Protobuf::Int32Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-Int32Value)) --- Quantity of the product associated with the user event.


  For example, this field will be 2 if two products are added to the shopping
  cart for `purchase-complete` event. Required for `add-to-cart` and
  `purchase-complete` event types.
**Returns**

- ([::Google::Protobuf::Int32Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-Int32Value)) --- Quantity of the product associated with the user event.


  For example, this field will be 2 if two products are added to the shopping
  cart for `purchase-complete` event. Required for `add-to-cart` and
  `purchase-complete` event types.