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

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

Methods

__construct

Constructor.

Parameters
NameDescription
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<Google\Cloud\RecommendationEngine\V1beta1\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 Google\Cloud\RecommendationEngine\V1beta1\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 Google\Cloud\RecommendationEngine\V1beta1\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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
Google\Protobuf\Internal\RepeatedField

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
NameDescription
var array<Google\Cloud\RecommendationEngine\V1beta1\CatalogItem\CategoryHierarchy>
Returns
TypeDescription
$this

getTitle

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

Returns
TypeDescription
string

setTitle

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDescription

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

Returns
TypeDescription
string

setDescription

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

Parameter
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
Google\Cloud\RecommendationEngine\V1beta1\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
NameDescription
var Google\Cloud\RecommendationEngine\V1beta1\FeatureMap
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
Google\Protobuf\Internal\RepeatedField

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
NameDescription
var string[]
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$this

getProductMetadata

Optional. Metadata specific to retail products.

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

hasProductMetadata

setProductMetadata

Optional. Metadata specific to retail products.

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

getRecommendationType

Returns
TypeDescription
string