Class CatalogItem

  • All Implemented Interfaces:
    CatalogItemOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class CatalogItem
    extends com.google.protobuf.GeneratedMessageV3
    implements CatalogItemOrBuilder
     CatalogItem captures all metadata information of items to be recommended.
     
    Protobuf type google.cloud.recommendationengine.v1beta1.CatalogItem
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • 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 order for the user events
         to be joined with the Catalog.
         
        string id = 1 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getId in interface CatalogItemOrBuilder
        Returns:
        The id.
      • getIdBytes

        public com.google.protobuf.ByteString getIdBytes()
         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];
        Specified by:
        getIdBytes in interface CatalogItemOrBuilder
        Returns:
        The bytes for id.
      • 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 & Accessories", "Shoes"]},
                { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
              ]
         
        repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getCategoryHierarchiesList in interface CatalogItemOrBuilder
      • 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 & Accessories", "Shoes"]},
                { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
              ]
         
        repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getCategoryHierarchiesOrBuilderList in interface CatalogItemOrBuilder
      • 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 & Accessories", "Shoes"]},
                { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
              ]
         
        repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getCategoryHierarchiesCount in interface CatalogItemOrBuilder
      • getCategoryHierarchies

        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 & Accessories", "Shoes"]},
                { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
              ]
         
        repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getCategoryHierarchies in interface CatalogItemOrBuilder
      • getCategoryHierarchiesOrBuilder

        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 & Accessories", "Shoes"]},
                { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
              ]
         
        repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getCategoryHierarchiesOrBuilder in interface CatalogItemOrBuilder
      • getTitle

        public String getTitle()
         Required. Catalog item title. UTF-8 encoded string with a length limit of 1
         KiB.
         
        string title = 3 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getTitle in interface CatalogItemOrBuilder
        Returns:
        The title.
      • getTitleBytes

        public com.google.protobuf.ByteString getTitleBytes()
         Required. Catalog item title. UTF-8 encoded string with a length limit of 1
         KiB.
         
        string title = 3 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getTitleBytes in interface CatalogItemOrBuilder
        Returns:
        The bytes for title.
      • 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];
        Specified by:
        getDescription in interface CatalogItemOrBuilder
        Returns:
        The description.
      • getDescriptionBytes

        public com.google.protobuf.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];
        Specified by:
        getDescriptionBytes in interface CatalogItemOrBuilder
        Returns:
        The bytes for description.
      • hasItemAttributes

        public boolean hasItemAttributes()
         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];
        Specified by:
        hasItemAttributes in interface CatalogItemOrBuilder
        Returns:
        Whether the itemAttributes field is set.
      • getItemAttributes

        public FeatureMap 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.
         
        .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getItemAttributes in interface CatalogItemOrBuilder
        Returns:
        The itemAttributes.
      • getItemAttributesOrBuilder

        public FeatureMapOrBuilder getItemAttributesOrBuilder()
         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];
        Specified by:
        getItemAttributesOrBuilder in interface CatalogItemOrBuilder
      • getLanguageCode

        public String 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.
         
        string language_code = 6 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getLanguageCode in interface CatalogItemOrBuilder
        Returns:
        The languageCode.
      • getLanguageCodeBytes

        public com.google.protobuf.ByteString getLanguageCodeBytes()
         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];
        Specified by:
        getLanguageCodeBytes in interface CatalogItemOrBuilder
        Returns:
        The bytes for languageCode.
      • getTagsList

        public com.google.protobuf.ProtocolStringList getTagsList()
         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];
        Specified by:
        getTagsList in interface CatalogItemOrBuilder
        Returns:
        A list containing the tags.
      • getTagsCount

        public int getTagsCount()
         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];
        Specified by:
        getTagsCount in interface CatalogItemOrBuilder
        Returns:
        The count of tags.
      • getTags

        public String getTags​(int index)
         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];
        Specified by:
        getTags in interface CatalogItemOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The tags at the given index.
      • getTagsBytes

        public com.google.protobuf.ByteString getTagsBytes​(int index)
         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];
        Specified by:
        getTagsBytes in interface CatalogItemOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the tags at the given index.
      • getItemGroupId

        public String 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](/recommendations-ai/docs/catalog#item-group-id).
         
        string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getItemGroupId in interface CatalogItemOrBuilder
        Returns:
        The itemGroupId.
      • getItemGroupIdBytes

        public com.google.protobuf.ByteString getItemGroupIdBytes()
         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](/recommendations-ai/docs/catalog#item-group-id).
         
        string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getItemGroupIdBytes in interface CatalogItemOrBuilder
        Returns:
        The bytes for itemGroupId.
      • hasProductMetadata

        public boolean hasProductMetadata()
         Optional. Metadata specific to retail products.
         
        .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        hasProductMetadata in interface CatalogItemOrBuilder
        Returns:
        Whether the productMetadata field is set.
      • getProductMetadata

        public ProductCatalogItem getProductMetadata()
         Optional. Metadata specific to retail products.
         
        .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getProductMetadata in interface CatalogItemOrBuilder
        Returns:
        The productMetadata.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static CatalogItem parseFrom​(ByteBuffer data)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static CatalogItem parseFrom​(ByteBuffer data,
                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static CatalogItem parseFrom​(com.google.protobuf.ByteString data)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static CatalogItem parseFrom​(com.google.protobuf.ByteString data,
                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static CatalogItem parseFrom​(byte[] data)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static CatalogItem parseFrom​(byte[] data,
                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static CatalogItem parseFrom​(com.google.protobuf.CodedInputStream input,
                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                     throws IOException
        Throws:
        IOException
      • newBuilderForType

        public CatalogItem.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public CatalogItem.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected CatalogItem.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static CatalogItem getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<CatalogItem> parser()
      • getParserForType

        public com.google.protobuf.Parser<CatalogItem> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public CatalogItem getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder