Google Cloud Recommendation Engine V1beta1 Client - Class ProductDetail (0.5.0)

Reference documentation and code samples for the Google Cloud Recommendation Engine V1beta1 Client class ProductDetail.

Detailed product information associated with a user event.

Generated from protobuf message google.cloud.recommendationengine.v1beta1.ProductDetail

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ id string

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

↳ currency_code string

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

↳ original_price float

Optional. Original price of the product. If provided, this will override the original price in Catalog for this product.

↳ display_price float

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

↳ stock_state int

Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event.

↳ quantity int

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.

↳ available_quantity int

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.

↳ item_attributes Google\Cloud\RecommendationEngine\V1beta1\FeatureMap

Optional. Extra features associated with a product in the user event.

getId

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

Returns
TypeDescription
string

setId

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getCurrencyCode

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

Returns
TypeDescription
string

setCurrencyCode

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getOriginalPrice

Optional. Original price of the product. If provided, this will override the original price in Catalog for this product.

Returns
TypeDescription
float

setOriginalPrice

Optional. Original price of the product. If provided, this will override the original price in Catalog for this product.

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getDisplayPrice

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

Returns
TypeDescription
float

setDisplayPrice

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

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getStockState

Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event.

Returns
TypeDescription
int

setStockState

Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getQuantity

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
TypeDescription
int

setQuantity

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.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getAvailableQuantity

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
TypeDescription
int

setAvailableQuantity

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.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getItemAttributes

Optional. Extra features associated with a product in the user event.

Returns
TypeDescription
Google\Cloud\RecommendationEngine\V1beta1\FeatureMap|null

hasItemAttributes

clearItemAttributes

setItemAttributes

Optional. Extra features associated with a product in the user event.

Parameter
NameDescription
var Google\Cloud\RecommendationEngine\V1beta1\FeatureMap
Returns
TypeDescription
$this