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
defavailable_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=
defavailable_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
defcurrency_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=
defcurrency_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
defdisplay_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=
defdisplay_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
defid()->::String
Returns
(::String) — Required. Catalog item ID. UTF-8 encoded string with a length limit of 128
characters.
#id=
defid=(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.
(::Float) — Optional. Original price of the product. If provided, this will override
the original price in Catalog for this product.
#original_price=
deforiginal_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
defquantity()->::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=
defquantity=(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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Recommendations AI V1beta1 API - Class Google::Cloud::RecommendationEngine::V1beta1::ProductDetail (v0.13.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.13.0 (latest)](/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-ProductDetail)\n- [0.12.1](/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/0.12.1/Google-Cloud-RecommendationEngine-V1beta1-ProductDetail)\n- [0.11.0](/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/0.11.0/Google-Cloud-RecommendationEngine-V1beta1-ProductDetail)\n- [0.10.0](/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/0.10.0/Google-Cloud-RecommendationEngine-V1beta1-ProductDetail)\n- [0.9.2](/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/0.9.2/Google-Cloud-RecommendationEngine-V1beta1-ProductDetail)\n- [0.8.2](/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/0.8.2/Google-Cloud-RecommendationEngine-V1beta1-ProductDetail)\n- [0.7.0](/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/0.7.0/Google-Cloud-RecommendationEngine-V1beta1-ProductDetail)\n- [0.6.1](/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/0.6.1/Google-Cloud-RecommendationEngine-V1beta1-ProductDetail)\n- [0.5.0](/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/0.5.0/Google-Cloud-RecommendationEngine-V1beta1-ProductDetail)\n- [0.4.1](/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/0.4.1/Google-Cloud-RecommendationEngine-V1beta1-ProductDetail)\n- [0.3.7](/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/0.3.7/Google-Cloud-RecommendationEngine-V1beta1-ProductDetail) \nReference documentation and code samples for the Recommendations AI V1beta1 API class Google::Cloud::RecommendationEngine::V1beta1::ProductDetail.\n\nDetailed product information associated with a user event. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #available_quantity\n\n def available_quantity() -\u003e ::Integer\n\n**Returns**\n\n- (::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`.\n\n\n Note that if an item is out of stock, you must set the `stock_state` field\n to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not\n sufficient to mark the item out of stock.\n\n### #available_quantity=\n\n def available_quantity=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **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`.\n\n\n Note that if an item is out of stock, you must set the `stock_state` field\n to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not\nsufficient to mark the item out of stock. \n**Returns**\n\n- (::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`.\n\n\n Note that if an item is out of stock, you must set the `stock_state` field\n to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not\n sufficient to mark the item out of stock.\n\n### #currency_code\n\n def currency_code() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. Currency code for price/costs. Use three-character ISO-4217 code. Required only if originalPrice or displayPrice is set.\n\n### #currency_code=\n\n def currency_code=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Optional. Currency code for price/costs. Use three-character ISO-4217 code. Required only if originalPrice or displayPrice is set. \n**Returns**\n\n- (::String) --- Optional. Currency code for price/costs. Use three-character ISO-4217 code. Required only if originalPrice or displayPrice is set.\n\n### #display_price\n\n def display_price() -\u003e ::Float\n\n**Returns**\n\n- (::Float) --- Optional. Display price of the product (e.g. discounted price). If provided, this will override the display price in Catalog for this product.\n\n### #display_price=\n\n def display_price=(value) -\u003e ::Float\n\n**Parameter**\n\n- **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. \n**Returns**\n\n- (::Float) --- Optional. Display price of the product (e.g. discounted price). If provided, this will override the display price in Catalog for this product.\n\n### #id\n\n def id() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.\n\n### #id=\n\n def id=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters. \n**Returns**\n\n- (::String) --- Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.\n\n### #item_attributes\n\n def item_attributes() -\u003e ::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap\n\n**Returns**\n\n- ([::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap](./Google-Cloud-RecommendationEngine-V1beta1-FeatureMap)) --- Optional. Extra features associated with a product in the user event.\n\n### #item_attributes=\n\n def item_attributes=(value) -\u003e ::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap\n\n**Parameter**\n\n- **value** ([::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap](./Google-Cloud-RecommendationEngine-V1beta1-FeatureMap)) --- Optional. Extra features associated with a product in the user event. \n**Returns**\n\n- ([::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap](./Google-Cloud-RecommendationEngine-V1beta1-FeatureMap)) --- Optional. Extra features associated with a product in the user event.\n\n### #original_price\n\n def original_price() -\u003e ::Float\n\n**Returns**\n\n- (::Float) --- Optional. Original price of the product. If provided, this will override the original price in Catalog for this product.\n\n### #original_price=\n\n def original_price=(value) -\u003e ::Float\n\n**Parameter**\n\n- **value** (::Float) --- Optional. Original price of the product. If provided, this will override the original price in Catalog for this product. \n**Returns**\n\n- (::Float) --- Optional. Original price of the product. If provided, this will override the original price in Catalog for this product.\n\n### #quantity\n\n def quantity() -\u003e ::Integer\n\n**Returns**\n\n- (::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.\n\n### #quantity=\n\n def quantity=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **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. \n**Returns**\n\n- (::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.\n\n### #stock_state\n\n def stock_state() -\u003e ::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState\n\n**Returns**\n\n- ([::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState](./Google-Cloud-RecommendationEngine-V1beta1-ProductCatalogItem-StockState)) --- Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event.\n\n### #stock_state=\n\n def stock_state=(value) -\u003e ::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState\n\n**Parameter**\n\n- **value** ([::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState](./Google-Cloud-RecommendationEngine-V1beta1-ProductCatalogItem-StockState)) --- Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event. \n**Returns**\n\n- ([::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState](./Google-Cloud-RecommendationEngine-V1beta1-ProductCatalogItem-StockState)) --- Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event."]]