Google Cloud Recommendation Engine V1beta1 Client - Class CatalogItem (0.8.1)

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

CatalogItem captures all metadata information of items to be recommended.

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

Namespace

Google \ Cloud \ RecommendationEngine \ V1beta1

Methods

__construct

Constructor.

Parameters
Name
Description
data
array

Optional. Data for populating the Message object.

↳ id
string

Required. Catalog item identifier. UTF-8 encoded string with a length limit of 128 bytes. This id must be unique among all catalog items within the same catalog. It should also be used when logging user events in order for the user events to be joined with the Catalog.

↳ category_hierarchies
array< CatalogItem\CategoryHierarchy >

Required. Catalog item categories. This field is repeated for supporting one catalog item belonging to several parallel category hierarchies. For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as: "categoryHierarchies": [ { "categories": ["Shoes & Accessories", "Shoes"]}, { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } ]

↳ title
string

Required. Catalog item title. UTF-8 encoded string with a length limit of 1 KiB.

↳ description
string

Optional. Catalog item description. UTF-8 encoded string with a length limit of 5 KiB.

↳ item_attributes
FeatureMap

Optional. Highly encouraged. Extra catalog item attributes to be included in the recommendation model. For example, for retail products, this could include the store name, vendor, style, color, etc. These are very strong signals for recommendation model, thus we highly recommend providing the item attributes here.

↳ language_code
string

Optional. Language of the title/description/item_attributes. Use language tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt . Our supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact your Google account manager.

↳ tags
array

Optional. Filtering tags associated with the catalog item. Each tag should be a UTF-8 encoded string with a length limit of 1 KiB. This tag can be used for filtering recommendation results by passing the tag as part of the predict request filter.

↳ item_group_id
string

Optional. Variant group identifier for prediction results. UTF-8 encoded string with a length limit of 128 bytes. This field must be enabled before it can be used. Learn more .

↳ product_metadata
ProductCatalogItem

Optional. Metadata specific to retail products.

getId

Required. Catalog item identifier. UTF-8 encoded string with a length limit of 128 bytes.

This id must be unique among all catalog items within the same catalog. It should also be used when logging user events in order for the user events to be joined with the Catalog.

Returns
Type
Description
string

setId

Required. Catalog item identifier. UTF-8 encoded string with a length limit of 128 bytes.

This id must be unique among all catalog items within the same catalog. It should also be used when logging user events in order for the user events to be joined with the Catalog.

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getCategoryHierarchies

Required. Catalog item categories. This field is repeated for supporting one catalog item belonging to several parallel category hierarchies.

For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as: "categoryHierarchies": [ { "categories": ["Shoes & Accessories", "Shoes"]}, { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } ]

Returns
Type
Description

setCategoryHierarchies

Required. Catalog item categories. This field is repeated for supporting one catalog item belonging to several parallel category hierarchies.

For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as: "categoryHierarchies": [ { "categories": ["Shoes & Accessories", "Shoes"]}, { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } ]

Parameter
Name
Description
Returns
Type
Description
$this

getTitle

Required. Catalog item title. UTF-8 encoded string with a length limit of 1 KiB.

Returns
Type
Description
string

setTitle

Required. Catalog item title. UTF-8 encoded string with a length limit of 1 KiB.

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getDescription

Optional. Catalog item description. UTF-8 encoded string with a length limit of 5 KiB.

Returns
Type
Description
string

setDescription

Optional. Catalog item description. UTF-8 encoded string with a length limit of 5 KiB.

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getItemAttributes

Optional. Highly encouraged. Extra catalog item attributes to be included in the recommendation model. For example, for retail products, this could include the store name, vendor, style, color, etc. These are very strong signals for recommendation model, thus we highly recommend providing the item attributes here.

Returns
Type
Description
FeatureMap |null

hasItemAttributes

clearItemAttributes

setItemAttributes

Optional. Highly encouraged. Extra catalog item attributes to be included in the recommendation model. For example, for retail products, this could include the store name, vendor, style, color, etc. These are very strong signals for recommendation model, thus we highly recommend providing the item attributes here.

Parameter
Name
Description
Returns
Type
Description
$this

getLanguageCode

Optional. Language of the title/description/item_attributes. Use language tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt . Our supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact your Google account manager.

Returns
Type
Description
string

setLanguageCode

Optional. Language of the title/description/item_attributes. Use language tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt . Our supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact your Google account manager.

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getTags

Optional. Filtering tags associated with the catalog item. Each tag should be a UTF-8 encoded string with a length limit of 1 KiB.

This tag can be used for filtering recommendation results by passing the tag as part of the predict request filter.

Returns
Type
Description

setTags

Optional. Filtering tags associated with the catalog item. Each tag should be a UTF-8 encoded string with a length limit of 1 KiB.

This tag can be used for filtering recommendation results by passing the tag as part of the predict request filter.

Parameter
Name
Description
var
string[]
Returns
Type
Description
$this

getItemGroupId

Optional. Variant group identifier for prediction results. UTF-8 encoded string with a length limit of 128 bytes.

This field must be enabled before it can be used. Learn more .

Returns
Type
Description
string

setItemGroupId

Optional. Variant group identifier for prediction results. UTF-8 encoded string with a length limit of 128 bytes.

This field must be enabled before it can be used. Learn more .

Parameter
Name
Description
var
string
Returns
Type
Description
$this

Optional. Metadata specific to retail products.

Returns
Type
Description

Optional. Metadata specific to retail products.

Parameter
Name
Description
Returns
Type
Description
$this

getRecommendationType

Returns
Type
Description
string
Design a Mobile Site
View Site in Mobile | Classic
Share by: