Class: Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1CatalogItem

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/recommendationengine_v1beta1/classes.rb,
lib/google/apis/recommendationengine_v1beta1/representations.rb,
lib/google/apis/recommendationengine_v1beta1/representations.rb

Overview

CatalogItem captures all metadata information of items to be recommended.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRecommendationengineV1beta1CatalogItem

Returns a new instance of GoogleCloudRecommendationengineV1beta1CatalogItem.



319
320
321
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 319

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#category_hierarchiesArray<Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1CatalogItemCategoryHierarchy>

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"] ] Corresponds to the JSON property categoryHierarchies



263
264
265
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 263

def category_hierarchies
  @category_hierarchies
end

#descriptionString

Optional. Catalog item description. UTF-8 encoded string with a length limit of 5 KiB. Corresponds to the JSON property description

Returns:

  • (String)


269
270
271
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 269

def description
  @description
end

#idString

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. Corresponds to the JSON property id

Returns:

  • (String)


277
278
279
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 277

def id
  @id
end

#item_attributesGoogle::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1FeatureMap

FeatureMap represents extra features that customers want to include in the recommendation model for catalogs/user events as categorical/numerical features. Corresponds to the JSON property itemAttributes



284
285
286
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 284

def item_attributes
  @item_attributes
end

#item_group_idString

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. Corresponds to the JSON property itemGroupId

Returns:

  • (String)


291
292
293
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 291

def item_group_id
  @item_group_id
end

#language_codeString

Optional. Deprecated. The model automatically detects the text language. Your catalog can include text in different languages, but duplicating catalog items to provide text in multiple languages can result in degraded model performance. Corresponds to the JSON property languageCode

Returns:

  • (String)


298
299
300
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 298

def language_code
  @language_code
end

#product_metadataGoogle::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1ProductCatalogItem

ProductCatalogItem captures item metadata specific to retail products. Corresponds to the JSON property productMetadata



303
304
305
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 303

def 
  @product_metadata
end

#tagsArray<String>

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. Corresponds to the JSON property tags

Returns:

  • (Array<String>)


311
312
313
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 311

def tags
  @tags
end

#titleString

Required. Catalog item title. UTF-8 encoded string with a length limit of 1 KiB. Corresponds to the JSON property title

Returns:

  • (String)


317
318
319
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 317

def title
  @title
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



324
325
326
327
328
329
330
331
332
333
334
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 324

def update!(**args)
  @category_hierarchies = args[:category_hierarchies] if args.key?(:category_hierarchies)
  @description = args[:description] if args.key?(:description)
  @id = args[:id] if args.key?(:id)
  @item_attributes = args[:item_attributes] if args.key?(:item_attributes)
  @item_group_id = args[:item_group_id] if args.key?(:item_group_id)
  @language_code = args[:language_code] if args.key?(:language_code)
  @product_metadata = args[:product_metadata] if args.key?(:product_metadata)
  @tags = args[:tags] if args.key?(:tags)
  @title = args[:title] if args.key?(:title)
end