Class CatalogItem.Builder (0.37.0)

public static final class CatalogItem.Builder extends GeneratedMessageV3.Builder<CatalogItem.Builder> implements CatalogItemOrBuilder

CatalogItem captures all metadata information of items to be recommended.

Protobuf type google.cloud.recommendationengine.v1beta1.CatalogItem

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllCategoryHierarchies(Iterable<? extends CatalogItem.CategoryHierarchy> values)

public CatalogItem.Builder addAllCategoryHierarchies(Iterable<? extends CatalogItem.CategoryHierarchy> values)

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy>
Returns
TypeDescription
CatalogItem.Builder

addAllTags(Iterable<String> values)

public CatalogItem.Builder addAllTags(Iterable<String> values)

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.

repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuesIterable<String>

The tags to add.

Returns
TypeDescription
CatalogItem.Builder

This builder for chaining.

addCategoryHierarchies(CatalogItem.CategoryHierarchy value)

public CatalogItem.Builder addCategoryHierarchies(CatalogItem.CategoryHierarchy value)

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueCatalogItem.CategoryHierarchy
Returns
TypeDescription
CatalogItem.Builder

addCategoryHierarchies(CatalogItem.CategoryHierarchy.Builder builderForValue)

public CatalogItem.Builder addCategoryHierarchies(CatalogItem.CategoryHierarchy.Builder builderForValue)

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
builderForValueCatalogItem.CategoryHierarchy.Builder
Returns
TypeDescription
CatalogItem.Builder

addCategoryHierarchies(int index, CatalogItem.CategoryHierarchy value)

public CatalogItem.Builder addCategoryHierarchies(int index, CatalogItem.CategoryHierarchy value)

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
valueCatalogItem.CategoryHierarchy
Returns
TypeDescription
CatalogItem.Builder

addCategoryHierarchies(int index, CatalogItem.CategoryHierarchy.Builder builderForValue)

public CatalogItem.Builder addCategoryHierarchies(int index, CatalogItem.CategoryHierarchy.Builder builderForValue)

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
builderForValueCatalogItem.CategoryHierarchy.Builder
Returns
TypeDescription
CatalogItem.Builder

addCategoryHierarchiesBuilder()

public CatalogItem.CategoryHierarchy.Builder addCategoryHierarchiesBuilder()

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
CatalogItem.CategoryHierarchy.Builder

addCategoryHierarchiesBuilder(int index)

public CatalogItem.CategoryHierarchy.Builder addCategoryHierarchiesBuilder(int index)

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
CatalogItem.CategoryHierarchy.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public CatalogItem.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
CatalogItem.Builder
Overrides

addTags(String value)

public CatalogItem.Builder addTags(String value)

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.

repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueString

The tags to add.

Returns
TypeDescription
CatalogItem.Builder

This builder for chaining.

addTagsBytes(ByteString value)

public CatalogItem.Builder addTagsBytes(ByteString value)

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.

repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueByteString

The bytes of the tags to add.

Returns
TypeDescription
CatalogItem.Builder

This builder for chaining.

build()

public CatalogItem build()
Returns
TypeDescription
CatalogItem

buildPartial()

public CatalogItem buildPartial()
Returns
TypeDescription
CatalogItem

clear()

public CatalogItem.Builder clear()
Returns
TypeDescription
CatalogItem.Builder
Overrides

clearCategoryHierarchies()

public CatalogItem.Builder clearCategoryHierarchies()

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
CatalogItem.Builder

clearDescription()

public CatalogItem.Builder clearDescription()

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

string description = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
CatalogItem.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public CatalogItem.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
CatalogItem.Builder
Overrides

clearId()

public CatalogItem.Builder clearId()

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.

string id = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
CatalogItem.Builder

This builder for chaining.

clearItemAttributes()

public CatalogItem.Builder clearItemAttributes()

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.

.google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
CatalogItem.Builder

clearItemGroupId()

public CatalogItem.Builder clearItemGroupId()

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.

string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
CatalogItem.Builder

This builder for chaining.

clearLanguageCode()

public CatalogItem.Builder clearLanguageCode()

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.

string language_code = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
CatalogItem.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public CatalogItem.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
CatalogItem.Builder
Overrides

clearProductMetadata()

public CatalogItem.Builder clearProductMetadata()

Optional. Metadata specific to retail products.

.google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
CatalogItem.Builder

clearRecommendationType()

public CatalogItem.Builder clearRecommendationType()
Returns
TypeDescription
CatalogItem.Builder

clearTags()

public CatalogItem.Builder clearTags()

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.

repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
CatalogItem.Builder

This builder for chaining.

clearTitle()

public CatalogItem.Builder clearTitle()

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

string title = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
CatalogItem.Builder

This builder for chaining.

clone()

public CatalogItem.Builder clone()
Returns
TypeDescription
CatalogItem.Builder
Overrides

getCategoryHierarchies(int index)

public CatalogItem.CategoryHierarchy getCategoryHierarchies(int index)

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
CatalogItem.CategoryHierarchy

getCategoryHierarchiesBuilder(int index)

public CatalogItem.CategoryHierarchy.Builder getCategoryHierarchiesBuilder(int index)

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
CatalogItem.CategoryHierarchy.Builder

getCategoryHierarchiesBuilderList()

public List<CatalogItem.CategoryHierarchy.Builder> getCategoryHierarchiesBuilderList()

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
List<Builder>

getCategoryHierarchiesCount()

public int getCategoryHierarchiesCount()

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
int

getCategoryHierarchiesList()

public List<CatalogItem.CategoryHierarchy> getCategoryHierarchiesList()

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
List<CategoryHierarchy>

getCategoryHierarchiesOrBuilder(int index)

public CatalogItem.CategoryHierarchyOrBuilder getCategoryHierarchiesOrBuilder(int index)

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
CatalogItem.CategoryHierarchyOrBuilder

getCategoryHierarchiesOrBuilderList()

public List<? extends CatalogItem.CategoryHierarchyOrBuilder> getCategoryHierarchiesOrBuilderList()

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 &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
List<? extends com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder>

getDefaultInstanceForType()

public CatalogItem getDefaultInstanceForType()
Returns
TypeDescription
CatalogItem

getDescription()

public String getDescription()

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

string description = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

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

string description = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ByteString

The bytes for description.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getId()

public String 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 or