# Recommendations AI V1beta1 API - Class Google::Cloud::RecommendationEngine::V1beta1::ProductDetail (v0.18.0)

0.18.0 (latest) 0.17.1 0.16.0 0.15.1 0.14.0 0.13.0 0.12.1 0.11.0 0.10.0 0.9.2 0.8.2 0.7.0 0.6.1 0.5.0 0.4.1 0.3.7 Reference documentation and code samples for the Recommendations AI V1beta1 API class Google::Cloud::RecommendationEngine::V1beta1::ProductDetail.

Detailed product information associated with a user event.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #available_quantity

    def available_quantity() -> ::Integer

**Returns**

- (::Integer) --- Optional. Quantity of the products in stock when a user event happens. Optional. If provided, this overrides the available quantity in Catalog for this event. and can only be set if `stock_status` is set to `IN_STOCK`.


  Note that if an item is out of stock, you must set the `stock_state` field
  to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not
  sufficient to mark the item out of stock.

### #available_quantity=

    def available_quantity=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Optional. Quantity of the products in stock when a user event happens. Optional. If provided, this overrides the available quantity in Catalog for this event. and can only be set if `stock_status` is set to `IN_STOCK`.


  Note that if an item is out of stock, you must set the `stock_state` field
  to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not
  sufficient to mark the item out of stock.
**Returns**

- (::Integer) --- Optional. Quantity of the products in stock when a user event happens. Optional. If provided, this overrides the available quantity in Catalog for this event. and can only be set if `stock_status` is set to `IN_STOCK`.


  Note that if an item is out of stock, you must set the `stock_state` field
  to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not
  sufficient to mark the item out of stock.

### #currency_code

    def currency_code() -> ::String

**Returns**

- (::String) --- Optional. Currency code for price/costs. Use three-character ISO-4217 code. Required only if originalPrice or displayPrice is set.

### #currency_code=

    def currency_code=(value) -> ::String

**Parameter**

- **value** (::String) --- Optional. Currency code for price/costs. Use three-character ISO-4217 code. Required only if originalPrice or displayPrice is set.
**Returns**

- (::String) --- Optional. Currency code for price/costs. Use three-character ISO-4217 code. Required only if originalPrice or displayPrice is set.

### #display_price

    def display_price() -> ::Float

**Returns**

- (::Float) --- Optional. Display price of the product (e.g. discounted price). If provided, this will override the display price in Catalog for this product.

### #display_price=

    def display_price=(value) -> ::Float

**Parameter**

- **value** (::Float) --- Optional. Display price of the product (e.g. discounted price). If provided, this will override the display price in Catalog for this product.
**Returns**

- (::Float) --- Optional. Display price of the product (e.g. discounted price). If provided, this will override the display price in Catalog for this product.

### #id

    def id() -> ::String

**Returns**

- (::String) --- Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.

### #id=

    def id=(value) -> ::String

**Parameter**

- **value** (::String) --- Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.
**Returns**

- (::String) --- Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.

### #item_attributes

    def item_attributes() -> ::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap

**Returns**

- ([::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-FeatureMap)) --- Optional. Extra features associated with a product in the user event.

### #item_attributes=

    def item_attributes=(value) -> ::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap

**Parameter**

- **value** ([::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-FeatureMap)) --- Optional. Extra features associated with a product in the user event.
**Returns**

- ([::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-FeatureMap)) --- Optional. Extra features associated with a product in the user event.

### #original_price

    def original_price() -> ::Float

**Returns**

- (::Float) --- Optional. Original price of the product. If provided, this will override the original price in Catalog for this product.

### #original_price=

    def original_price=(value) -> ::Float

**Parameter**

- **value** (::Float) --- Optional. Original price of the product. If provided, this will override the original price in Catalog for this product.
**Returns**

- (::Float) --- Optional. Original price of the product. If provided, this will override the original price in Catalog for this product.

### #quantity

    def quantity() -> ::Integer

**Returns**

- (::Integer) --- Optional. 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 `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event types.

### #quantity=

    def quantity=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Optional. 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 `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event types.
**Returns**

- (::Integer) --- Optional. 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 `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event types.

### #stock_state

    def stock_state() -> ::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState

**Returns**

- ([::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-ProductCatalogItem-StockState)) --- Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event.

### #stock_state=

    def stock_state=(value) -> ::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState

**Parameter**

- **value** ([::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-ProductCatalogItem-StockState)) --- Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event.
**Returns**

- ([::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-ProductCatalogItem-StockState)) --- Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event.