- 2.49.0 (latest)
- 2.48.0
- 2.47.0
- 2.46.0
- 2.45.0
- 2.44.0
- 2.43.0
- 2.42.0
- 2.41.0
- 2.39.0
- 2.38.0
- 2.37.0
- 2.36.0
- 2.35.0
- 2.34.0
- 2.33.0
- 2.32.0
- 2.31.0
- 2.30.0
- 2.29.0
- 2.26.0
- 2.25.0
- 2.24.0
- 2.23.0
- 2.22.0
- 2.21.0
- 2.20.0
- 2.19.0
- 2.18.0
- 2.17.0
- 2.16.0
- 2.15.0
- 2.14.0
- 2.13.0
- 2.11.0
- 2.10.0
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.1
- 2.4.0
- 2.3.0
- 2.2.3
- 2.1.0
- 2.0.19
public static final class Product.Builder extends GeneratedMessageV3.Builder<Product.Builder> implements ProductOrBuilder
Product captures all metadata information of items to be recommended or searched.
Protobuf type google.cloud.retail.v2.Product
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > Product.BuilderImplements
ProductOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Type | Description |
Descriptor |
Methods
addAllBrands(Iterable<String> values)
public Product.Builder addAllBrands(Iterable<String> values)
The brands of the product. A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property brand. Schema.org property Product.brand.
repeated string brands = 9;
Name | Description |
values | Iterable<String> The brands to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addAllCategories(Iterable<String> values)
public Product.Builder addAllCategories(Iterable<String> values)
Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, please replace it with other character(s). For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property Product.category. [mc_google_product_category]: https://support.google.com/merchants/answer/6324436
repeated string categories = 7;
Name | Description |
values | Iterable<String> The categories to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addAllCollectionMemberIds(Iterable<String> values)
public Product.Builder addAllCollectionMemberIds(Iterable<String> values)
The id of the collection members when type is Type.COLLECTION. Non-existent product ids are allowed. The type of the members must be either Type.PRIMARY or Type.VARIANT otherwise and INVALID_ARGUMENT error is thrown. Should not set it for other types. A maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is return.
repeated string collection_member_ids = 5;
Name | Description |
values | Iterable<String> The collectionMemberIds to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addAllConditions(Iterable<String> values)
public Product.Builder addAllConditions(Iterable<String> values)
The condition of the product. Strongly encouraged to use the standard values: "new", "refurbished", "used". A maximum of 1 value is allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property condition. Schema.org property Offer.itemCondition.
repeated string conditions = 29;
Name | Description |
values | Iterable<String> The conditions to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addAllFulfillmentInfo(Iterable<? extends FulfillmentInfo> values)
public Product.Builder addAllFulfillmentInfo(Iterable<? extends FulfillmentInfo> values)
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Name | Description |
values | Iterable<? extends com.google.cloud.retail.v2.FulfillmentInfo> |
Type | Description |
Product.Builder |
addAllImages(Iterable<? extends Image> values)
public Product.Builder addAllImages(Iterable<? extends Image> values)
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Name | Description |
values | Iterable<? extends com.google.cloud.retail.v2.Image> |
Type | Description |
Product.Builder |
addAllMaterials(Iterable<String> values)
public Product.Builder addAllMaterials(Iterable<String> values)
The material of the product. For example, "leather", "wooden". A maximum of 20 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property material. Schema.org property Product.material.
repeated string materials = 27;
Name | Description |
values | Iterable<String> The materials to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addAllPatterns(Iterable<String> values)
public Product.Builder addAllPatterns(Iterable<String> values)
The pattern or graphic print of the product. For example, "striped", "polka dot", "paisley". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property pattern. Schema.org property Product.pattern.
repeated string patterns = 28;
Name | Description |
values | Iterable<String> The patterns to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addAllPromotions(Iterable<? extends Promotion> values)
public Product.Builder addAllPromotions(Iterable<? extends Promotion> values)
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Name | Description |
values | Iterable<? extends com.google.cloud.retail.v2.Promotion> |
Type | Description |
Product.Builder |
addAllSizes(Iterable<String> values)
public Product.Builder addAllSizes(Iterable<String> values)
The size of the product. To represent different size systems or size types, consider using this format: [[[size_system:]size_type:]size_value]. For example, in "US:MENS:M", "US" represents size system; "MENS" represents size type; "M" represents size value. In "GIRLS:27", size system is empty; "GIRLS" represents size type; "27" represents size value. In "32 inches", both size system and size type are empty, while size value is "32 inches". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property size, size_type, and size_system. Schema.org property Product.size.
repeated string sizes = 26;
Name | Description |
values | Iterable<String> The sizes to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addAllTags(Iterable<String> values)
public Product.Builder addAllTags(Iterable<String> values)
Custom tags associated with the product. At most 250 values are allowed per Product. This value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. This tag can be used for filtering recommendation results by passing the tag as part of the PredictRequest.filter. Corresponding properties: Google Merchant Center property custom_label_0\u20134.
repeated string tags = 13;
Name | Description |
values | Iterable<String> The tags to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addAllVariants(Iterable<? extends Product> values)
public Product.Builder addAllVariants(Iterable<? extends Product> values)
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Name | Description |
values | Iterable<? extends com.google.cloud.retail.v2.Product> |
Type | Description |
Product.Builder |
addBrands(String value)
public Product.Builder addBrands(String value)
The brands of the product. A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property brand. Schema.org property Product.brand.
repeated string brands = 9;
Name | Description |
value | String The brands to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addBrandsBytes(ByteString value)
public Product.Builder addBrandsBytes(ByteString value)
The brands of the product. A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property brand. Schema.org property Product.brand.
repeated string brands = 9;
Name | Description |
value | ByteString The bytes of the brands to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addCategories(String value)
public Product.Builder addCategories(String value)
Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, please replace it with other character(s). For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property Product.category. [mc_google_product_category]: https://support.google.com/merchants/answer/6324436
repeated string categories = 7;
Name | Description |
value | String The categories to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addCategoriesBytes(ByteString value)
public Product.Builder addCategoriesBytes(ByteString value)
Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, please replace it with other character(s). For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property Product.category. [mc_google_product_category]: https://support.google.com/merchants/answer/6324436
repeated string categories = 7;
Name | Description |
value | ByteString The bytes of the categories to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addCollectionMemberIds(String value)
public Product.Builder addCollectionMemberIds(String value)
The id of the collection members when type is Type.COLLECTION. Non-existent product ids are allowed. The type of the members must be either Type.PRIMARY or Type.VARIANT otherwise and INVALID_ARGUMENT error is thrown. Should not set it for other types. A maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is return.
repeated string collection_member_ids = 5;
Name | Description |
value | String The collectionMemberIds to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addCollectionMemberIdsBytes(ByteString value)
public Product.Builder addCollectionMemberIdsBytes(ByteString value)
The id of the collection members when type is Type.COLLECTION. Non-existent product ids are allowed. The type of the members must be either Type.PRIMARY or Type.VARIANT otherwise and INVALID_ARGUMENT error is thrown. Should not set it for other types. A maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is return.
repeated string collection_member_ids = 5;
Name | Description |
value | ByteString The bytes of the collectionMemberIds to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addConditions(String value)
public Product.Builder addConditions(String value)
The condition of the product. Strongly encouraged to use the standard values: "new", "refurbished", "used". A maximum of 1 value is allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property condition. Schema.org property Offer.itemCondition.
repeated string conditions = 29;
Name | Description |
value | String The conditions to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addConditionsBytes(ByteString value)
public Product.Builder addConditionsBytes(ByteString value)
The condition of the product. Strongly encouraged to use the standard values: "new", "refurbished", "used". A maximum of 1 value is allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property condition. Schema.org property Offer.itemCondition.
repeated string conditions = 29;
Name | Description |
value | ByteString The bytes of the conditions to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addFulfillmentInfo(FulfillmentInfo value)
public Product.Builder addFulfillmentInfo(FulfillmentInfo value)
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Name | Description |
value | FulfillmentInfo |
Type | Description |
Product.Builder |
addFulfillmentInfo(FulfillmentInfo.Builder builderForValue)
public Product.Builder addFulfillmentInfo(FulfillmentInfo.Builder builderForValue)
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Name | Description |
builderForValue | FulfillmentInfo.Builder |
Type | Description |
Product.Builder |
addFulfillmentInfo(int index, FulfillmentInfo value)
public Product.Builder addFulfillmentInfo(int index, FulfillmentInfo value)
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Name | Description |
index | int |
value | FulfillmentInfo |
Type | Description |
Product.Builder |
addFulfillmentInfo(int index, FulfillmentInfo.Builder builderForValue)
public Product.Builder addFulfillmentInfo(int index, FulfillmentInfo.Builder builderForValue)
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Name | Description |
index | int |
builderForValue | FulfillmentInfo.Builder |
Type | Description |
Product.Builder |
addFulfillmentInfoBuilder()
public FulfillmentInfo.Builder addFulfillmentInfoBuilder()
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Type | Description |
FulfillmentInfo.Builder |
addFulfillmentInfoBuilder(int index)
public FulfillmentInfo.Builder addFulfillmentInfoBuilder(int index)
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Name | Description |
index | int |
Type | Description |
FulfillmentInfo.Builder |
addImages(Image value)
public Product.Builder addImages(Image value)
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Name | Description |
value | Image |
Type | Description |
Product.Builder |
addImages(Image.Builder builderForValue)
public Product.Builder addImages(Image.Builder builderForValue)
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Name | Description |
builderForValue | Image.Builder |
Type | Description |
Product.Builder |
addImages(int index, Image value)
public Product.Builder addImages(int index, Image value)
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Name | Description |
index | int |
value | Image |
Type | Description |
Product.Builder |
addImages(int index, Image.Builder builderForValue)
public Product.Builder addImages(int index, Image.Builder builderForValue)
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Name | Description |
index | int |
builderForValue | Image.Builder |
Type | Description |
Product.Builder |
addImagesBuilder()
public Image.Builder addImagesBuilder()
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Type | Description |
Image.Builder |
addImagesBuilder(int index)
public Image.Builder addImagesBuilder(int index)
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Name | Description |
index | int |
Type | Description |
Image.Builder |
addMaterials(String value)
public Product.Builder addMaterials(String value)
The material of the product. For example, "leather", "wooden". A maximum of 20 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property material. Schema.org property Product.material.
repeated string materials = 27;
Name | Description |
value | String The materials to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addMaterialsBytes(ByteString value)
public Product.Builder addMaterialsBytes(ByteString value)
The material of the product. For example, "leather", "wooden". A maximum of 20 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property material. Schema.org property Product.material.
repeated string materials = 27;
Name | Description |
value | ByteString The bytes of the materials to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addPatterns(String value)
public Product.Builder addPatterns(String value)
The pattern or graphic print of the product. For example, "striped", "polka dot", "paisley". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property pattern. Schema.org property Product.pattern.
repeated string patterns = 28;
Name | Description |
value | String The patterns to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addPatternsBytes(ByteString value)
public Product.Builder addPatternsBytes(ByteString value)
The pattern or graphic print of the product. For example, "striped", "polka dot", "paisley". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property pattern. Schema.org property Product.pattern.
repeated string patterns = 28;
Name | Description |
value | ByteString The bytes of the patterns to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addPromotions(Promotion value)
public Product.Builder addPromotions(Promotion value)
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Name | Description |
value | Promotion |
Type | Description |
Product.Builder |
addPromotions(Promotion.Builder builderForValue)
public Product.Builder addPromotions(Promotion.Builder builderForValue)
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Name | Description |
builderForValue | Promotion.Builder |
Type | Description |
Product.Builder |
addPromotions(int index, Promotion value)
public Product.Builder addPromotions(int index, Promotion value)
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Name | Description |
index | int |
value | Promotion |
Type | Description |
Product.Builder |
addPromotions(int index, Promotion.Builder builderForValue)
public Product.Builder addPromotions(int index, Promotion.Builder builderForValue)
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Name | Description |
index | int |
builderForValue | Promotion.Builder |
Type | Description |
Product.Builder |
addPromotionsBuilder()
public Promotion.Builder addPromotionsBuilder()
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Type | Description |
Promotion.Builder |
addPromotionsBuilder(int index)
public Promotion.Builder addPromotionsBuilder(int index)
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Name | Description |
index | int |
Type | Description |
Promotion.Builder |
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public Product.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Name | Description |
field | FieldDescriptor |
value | Object |
Type | Description |
Product.Builder |
addSizes(String value)
public Product.Builder addSizes(String value)
The size of the product. To represent different size systems or size types, consider using this format: [[[size_system:]size_type:]size_value]. For example, in "US:MENS:M", "US" represents size system; "MENS" represents size type; "M" represents size value. In "GIRLS:27", size system is empty; "GIRLS" represents size type; "27" represents size value. In "32 inches", both size system and size type are empty, while size value is "32 inches". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property size, size_type, and size_system. Schema.org property Product.size.
repeated string sizes = 26;
Name | Description |
value | String The sizes to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addSizesBytes(ByteString value)
public Product.Builder addSizesBytes(ByteString value)
The size of the product. To represent different size systems or size types, consider using this format: [[[size_system:]size_type:]size_value]. For example, in "US:MENS:M", "US" represents size system; "MENS" represents size type; "M" represents size value. In "GIRLS:27", size system is empty; "GIRLS" represents size type; "27" represents size value. In "32 inches", both size system and size type are empty, while size value is "32 inches". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property size, size_type, and size_system. Schema.org property Product.size.
repeated string sizes = 26;
Name | Description |
value | ByteString The bytes of the sizes to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addTags(String value)
public Product.Builder addTags(String value)
Custom tags associated with the product. At most 250 values are allowed per Product. This value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. This tag can be used for filtering recommendation results by passing the tag as part of the PredictRequest.filter. Corresponding properties: Google Merchant Center property custom_label_0\u20134.
repeated string tags = 13;
Name | Description |
value | String The tags to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addTagsBytes(ByteString value)
public Product.Builder addTagsBytes(ByteString value)
Custom tags associated with the product. At most 250 values are allowed per Product. This value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. This tag can be used for filtering recommendation results by passing the tag as part of the PredictRequest.filter. Corresponding properties: Google Merchant Center property custom_label_0\u20134.
repeated string tags = 13;
Name | Description |
value | ByteString The bytes of the tags to add. |
Type | Description |
Product.Builder | This builder for chaining. |
addVariants(Product value)
public Product.Builder addVariants(Product value)
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Name | Description |
value | Product |
Type | Description |
Product.Builder |
addVariants(Product.Builder builderForValue)
public Product.Builder addVariants(Product.Builder builderForValue)
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Name | Description |
builderForValue | Product.Builder |
Type | Description |
Product.Builder |
addVariants(int index, Product value)
public Product.Builder addVariants(int index, Product value)
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Name | Description |
index | int |
value | Product |
Type | Description |
Product.Builder |
addVariants(int index, Product.Builder builderForValue)
public Product.Builder addVariants(int index, Product.Builder builderForValue)
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Name | Description |
index | int |
builderForValue | Product.Builder |
Type | Description |
Product.Builder |
addVariantsBuilder()
public Product.Builder addVariantsBuilder()
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Type | Description |
Product.Builder |
addVariantsBuilder(int index)
public Product.Builder addVariantsBuilder(int index)
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Name | Description |
index | int |
Type | Description |
Product.Builder |
build()
public Product build()
Type | Description |
Product |
buildPartial()
public Product buildPartial()
Type | Description |
Product |
clear()
public Product.Builder clear()
Type | Description |
Product.Builder |
clearAttributes()
public Product.Builder clearAttributes()
Type | Description |
Product.Builder |
clearAudience()
public Product.Builder clearAudience()
The target group associated with a given audience (e.g. male, veterans, car owners, musicians, etc.) of the product.
.google.cloud.retail.v2.Audience audience = 24;
Type | Description |
Product.Builder |
clearAvailability()
public Product.Builder clearAvailability()
The online availability of the Product. Default to Availability.IN_STOCK. Corresponding properties: Google Merchant Center property availability. Schema.org property Offer.availability.
.google.cloud.retail.v2.Product.Availability availability = 19;
Type | Description |
Product.Builder | This builder for chaining. |
clearAvailableQuantity()
public Product.Builder clearAvailableQuantity()
The available quantity of the item.
.google.protobuf.Int32Value available_quantity = 20;
Type | Description |
Product.Builder |
clearAvailableTime()
public Product.Builder clearAvailableTime()
The timestamp when this Product becomes available for SearchService.Search.
.google.protobuf.Timestamp available_time = 18;
Type | Description |
Product.Builder |
clearBrands()
public Product.Builder clearBrands()
The brands of the product. A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property brand. Schema.org property Product.brand.
repeated string brands = 9;
Type | Description |
Product.Builder | This builder for chaining. |
clearCategories()
public Product.Builder clearCategories()
Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, please replace it with other character(s). For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property Product.category. [mc_google_product_category]: https://support.google.com/merchants/answer/6324436
repeated string categories = 7;
Type | Description |
Product.Builder | This builder for chaining. |
clearCollectionMemberIds()
public Product.Builder clearCollectionMemberIds()
The id of the collection members when type is Type.COLLECTION. Non-existent product ids are allowed. The type of the members must be either Type.PRIMARY or Type.VARIANT otherwise and INVALID_ARGUMENT error is thrown. Should not set it for other types. A maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is return.
repeated string collection_member_ids = 5;
Type | Description |
Product.Builder | This builder for chaining. |
clearColorInfo()
public Product.Builder clearColorInfo()
The color of the product. Corresponding properties: Google Merchant Center property color. Schema.org property Product.color.
.google.cloud.retail.v2.ColorInfo color_info = 25;
Type | Description |
Product.Builder |
clearConditions()
public Product.Builder clearConditions()
The condition of the product. Strongly encouraged to use the standard values: "new", "refurbished", "used". A maximum of 1 value is allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property condition. Schema.org property Offer.itemCondition.
repeated string conditions = 29;
Type | Description |
Product.Builder | This builder for chaining. |
clearDescription()
public Product.Builder clearDescription()
Product description. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property description. Schema.org property Product.description.
string description = 10;
Type | Description |
Product.Builder | This builder for chaining. |
clearExpiration()
public Product.Builder clearExpiration()
Type | Description |
Product.Builder |
clearExpireTime()
public Product.Builder clearExpireTime()
The timestamp when this product becomes unavailable for SearchService.Search. If it is set, the Product is not available for SearchService.Search after expire_time. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts. expire_time must be later than available_time and publish_time, otherwise an INVALID_ARGUMENT error is thrown. Corresponding properties: Google Merchant Center property expiration_date.
.google.protobuf.Timestamp expire_time = 16;
Type | Description |
Product.Builder |
clearField(Descriptors.FieldDescriptor field)
public Product.Builder clearField(Descriptors.FieldDescriptor field)
Name | Description |
field | FieldDescriptor |
Type | Description |
Product.Builder |
clearFulfillmentInfo()
public Product.Builder clearFulfillmentInfo()
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Type | Description |
Product.Builder |
clearGtin()
public Product.Builder clearGtin()
The Global Trade Item Number (GTIN) of the product. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property gtin. Schema.org property Product.isbn, Product.gtin8, Product.gtin12, Product.gtin13, or Product.gtin14. If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
string gtin = 6;
Type | Description |
Product.Builder | This builder for chaining. |
clearId()
public Product.Builder clearId()
Immutable. Product identifier, which is
the final component of name. For
example, this field is "id_1", if
name is
projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1
.
This field must be a UTF-8 encoded string with a length limit of 128
characters. Otherwise, an INVALID_ARGUMENT error is returned.
Corresponding properties: Google Merchant Center property
id. Schema.org
property Product.sku.
string id = 2 [(.google.api.field_behavior) = IMMUTABLE];
Type | Description |
Product.Builder | This builder for chaining. |
clearImages()
public Product.Builder clearImages()
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Type | Description |
Product.Builder |
clearLanguageCode()
public Product.Builder clearLanguageCode()
Language of the title/description and other string attributes. Use language tags defined by BCP 47. For product prediction, this field is ignored and the model automatically detects the text language. The Product can include text in different languages, but duplicating Products to provide text in multiple languages can result in degraded model performance. For product search this field is in use. It defaults to "en-US" if unset.
string language_code = 11;
Type | Description |
Product.Builder | This builder for chaining. |
clearMaterials()
public Product.Builder clearMaterials()
The material of the product. For example, "leather", "wooden". A maximum of 20 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property material. Schema.org property Product.material.
repeated string materials = 27;
Type | Description |
Product.Builder | This builder for chaining. |
clearName()
public Product.Builder clearName()
Immutable. Full resource name of the product, such as
projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id
.
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
Type | Description |
Product.Builder | This builder for chaining. |
clearOneof(Descriptors.OneofDescriptor oneof)
public Product.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Name | Description |
oneof | OneofDescriptor |
Type | Description |
Product.Builder |
clearPatterns()
public Product.Builder clearPatterns()
The pattern or graphic print of the product. For example, "striped", "polka dot", "paisley". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property pattern. Schema.org property Product.pattern.
repeated string patterns = 28;
Type | Description |
Product.Builder | This builder for chaining. |
clearPriceInfo()
public Product.Builder clearPriceInfo()
Product price and cost information. Corresponding properties: Google Merchant Center property price.
.google.cloud.retail.v2.PriceInfo price_info = 14;
Type | Description |
Product.Builder |
clearPrimaryProductId()
public Product.Builder clearPrimaryProductId()
Variant group identifier. Must be an id, with the same parent branch with this product. Otherwise, an error is thrown. For Type.PRIMARY Products, this field can only be empty or set to the same value as id. For VARIANT Products, this field cannot be empty. A maximum of 2,000 products are allowed to share the same Type.PRIMARY Product. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property item_group_id. Schema.org property Product.inProductGroupWithID.
string primary_product_id = 4;
Type | Description |
Product.Builder | This builder for chaining. |
clearPromotions()
public Product.Builder clearPromotions()
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Type | Description |
Product.Builder |
clearPublishTime()
public Product.Builder clearPublishTime()
The timestamp when the product is published by the retailer for the first time, which indicates the freshness of the products. Note that this field is different from available_time, given it purely describes product freshness regardless of when it is available on search and recommendation.
.google.protobuf.Timestamp publish_time = 33;
Type | Description |
Product.Builder |
clearRating()
public Product.Builder clearRating()
The rating of this product.
.google.cloud.retail.v2.Rating rating = 15;
Type | Description |
Product.Builder |
clearRetrievableFields()
public Product.Builder clearRetrievableFields()
Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types:
- audience
- availability
- brands
- color_info
- conditions
- gtin
- materials
- name
- patterns
- price_info
- rating
- sizes
- title
- uri Supported fields only for Type.PRIMARY and Type.COLLECTION:
- categories
- description
- images Supported fields only for Type.VARIANT:
- Only the first image in images To mark attributes as retrievable, include paths of the form "attributes.key" where "key" is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default:
- name For Type.VARIANT, the following fields are always returned in by default:
- name
- color_info The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse can increase response payload size and serving latency.
.google.protobuf.FieldMask retrievable_fields = 30;
Type | Description |
Product.Builder |
clearSizes()
public Product.Builder clearSizes()
The size of the product. To represent different size systems or size types, consider using this format: [[[size_system:]size_type:]size_value]. For example, in "US:MENS:M", "US" represents size system; "MENS" represents size type; "M" represents size value. In "GIRLS:27", size system is empty; "GIRLS" represents size type; "27" represents size value. In "32 inches", both size system and size type are empty, while size value is "32 inches". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property size, size_type, and size_system. Schema.org property Product.size.
repeated string sizes = 26;
Type | Description |
Product.Builder | This builder for chaining. |
clearTags()
public Product.Builder clearTags()
Custom tags associated with the product. At most 250 values are allowed per Product. This value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. This tag can be used for filtering recommendation results by passing the tag as part of the PredictRequest.filter. Corresponding properties: Google Merchant Center property custom_label_0\u20134.
repeated string tags = 13;
Type | Description |
Product.Builder | This builder for chaining. |
clearTitle()
public Product.Builder clearTitle()
Required. Product title. This field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property title. Schema.org property Product.name.
string title = 8 [(.google.api.field_behavior) = REQUIRED];
Type | Description |
Product.Builder | This builder for chaining. |
clearTtl()
public Product.Builder clearTtl()
Input only. The TTL (time to live) of the product. If it is set, it must be a non-negative value, and expire_time is set as current timestamp plus ttl. The derived expire_time is returned in the output and ttl is left blank when retrieving the Product. If it is set, the product is not available for SearchService.Search after current timestamp plus ttl. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts.
.google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY];
Type | Description |
Product.Builder |
clearType()
public Product.Builder clearType()
Immutable. The type of the product. Default to Catalog.product_level_config.ingestion_product_type if unset.
.google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE];
Type | Description |
Product.Builder | This builder for chaining. |
clearUri()
public Product.Builder clearUri()
Canonical URL directly linking to the product detail page. It is strongly recommended to provide a valid uri for the product, otherwise the service performance could be significantly degraded. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property link. Schema.org property Offer.url.
string uri = 22;
Type | Description |
Product.Builder | This builder for chaining. |
clearVariants()
public Product.Builder clearVariants()
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Type | Description |
Product.Builder |
clone()
public Product.Builder clone()
Type | Description |
Product.Builder |
containsAttributes(String key)
public boolean containsAttributes(String key)
Highly encouraged. Extra product attributes to be included. For example,
for 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 attributes here.
Features that can take on one of a limited number of possible values. Two
types of features can be set are:
Textual features. some examples would be the brand/maker of a product, or
country of a customer. Numerical features. Some examples would be the
height/weight of a product, or age of a customer.
For example: { "vendor": {"text": ["vendor123", "vendor456"]},
"lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
}
.
This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
error is returned:
- Max entries count: 200.
- The key must be a UTF-8 encoded string with a length limit of 128 characters.
- For indexable attribute, the key must match the pattern:
a-zA-Z0-9*
. For example,key0LikeThis
orKEY_1_LIKE_THIS
. - For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a non-empty UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed.
map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12;
Name | Description |
key | String |
Type | Description |
boolean |
getAttributes()
public Map<String,CustomAttribute> getAttributes()
Use #getAttributesMap() instead.
Type | Description |
Map<String,CustomAttribute> |
getAttributesCount()
public int getAttributesCount()
Highly encouraged. Extra product attributes to be included. For example,
for 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 attributes here.
Features that can take on one of a limited number of possible values. Two
types of features can be set are:
Textual features. some examples would be the brand/maker of a product, or
country of a customer. Numerical features. Some examples would be the
height/weight of a product, or age of a customer.
For example: { "vendor": {"text": ["vendor123", "vendor456"]},
"lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
}
.
This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
error is returned:
- Max entries count: 200.
- The key must be a UTF-8 encoded string with a length limit of 128 characters.
- For indexable attribute, the key must match the pattern:
a-zA-Z0-9*
. For example,key0LikeThis
orKEY_1_LIKE_THIS
. - For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a non-empty UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed.
map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12;
Type | Description |
int |
getAttributesMap()
public Map<String,CustomAttribute> getAttributesMap()
Highly encouraged. Extra product attributes to be included. For example,
for 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 attributes here.
Features that can take on one of a limited number of possible values. Two
types of features can be set are:
Textual features. some examples would be the brand/maker of a product, or
country of a customer. Numerical features. Some examples would be the
height/weight of a product, or age of a customer.
For example: { "vendor": {"text": ["vendor123", "vendor456"]},
"lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
}
.
This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
error is returned:
- Max entries count: 200.
- The key must be a UTF-8 encoded string with a length limit of 128 characters.
- For indexable attribute, the key must match the pattern:
a-zA-Z0-9*
. For example,key0LikeThis
orKEY_1_LIKE_THIS
. - For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a non-empty UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed.
map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12;
Type | Description |
Map<String,CustomAttribute> |
getAttributesOrDefault(String key, CustomAttribute defaultValue)
public CustomAttribute getAttributesOrDefault(String key, CustomAttribute defaultValue)
Highly encouraged. Extra product attributes to be included. For example,
for 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 attributes here.
Features that can take on one of a limited number of possible values. Two
types of features can be set are:
Textual features. some examples would be the brand/maker of a product, or
country of a customer. Numerical features. Some examples would be the
height/weight of a product, or age of a customer.
For example: { "vendor": {"text": ["vendor123", "vendor456"]},
"lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
}
.
This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
error is returned:
- Max entries count: 200.
- The key must be a UTF-8 encoded string with a length limit of 128 characters.
- For indexable attribute, the key must match the pattern:
a-zA-Z0-9*
. For example,key0LikeThis
orKEY_1_LIKE_THIS
. - For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a non-empty UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed.
map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12;
Name | Description |
key | String |
defaultValue | CustomAttribute |
Type | Description |
CustomAttribute |
getAttributesOrThrow(String key)
public CustomAttribute getAttributesOrThrow(String key)
Highly encouraged. Extra product attributes to be included. For example,
for 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 attributes here.
Features that can take on one of a limited number of possible values. Two
types of features can be set are:
Textual features. some examples would be the brand/maker of a product, or
country of a customer. Numerical features. Some examples would be the
height/weight of a product, or age of a customer.
For example: { "vendor": {"text": ["vendor123", "vendor456"]},
"lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
}
.
This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
error is returned:
- Max entries count: 200.
- The key must be a UTF-8 encoded string with a length limit of 128 characters.
- For indexable attribute, the key must match the pattern:
a-zA-Z0-9*
. For example,key0LikeThis
orKEY_1_LIKE_THIS
. - For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a non-empty UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed.
map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12;
Name | Description |
key | String |
Type | Description |
CustomAttribute |
getAudience()
public Audience getAudience()
The target group associated with a given audience (e.g. male, veterans, car owners, musicians, etc.) of the product.
.google.cloud.retail.v2.Audience audience = 24;
Type | Description |
Audience | The audience. |
getAudienceBuilder()
public Audience.Builder getAudienceBuilder()
The target group associated with a given audience (e.g. male, veterans, car owners, musicians, etc.) of the product.
.google.cloud.retail.v2.Audience audience = 24;
Type | Description |
Audience.Builder |
getAudienceOrBuilder()
public AudienceOrBuilder getAudienceOrBuilder()
The target group associated with a given audience (e.g. male, veterans, car owners, musicians, etc.) of the product.
.google.cloud.retail.v2.Audience audience = 24;
Type | Description |
AudienceOrBuilder |
getAvailability()
public Product.Availability getAvailability()
The online availability of the Product. Default to Availability.IN_STOCK. Corresponding properties: Google Merchant Center property availability. Schema.org property Offer.availability.
.google.cloud.retail.v2.Product.Availability availability = 19;
Type | Description |
Product.Availability | The availability. |
getAvailabilityValue()
public int getAvailabilityValue()
The online availability of the Product. Default to Availability.IN_STOCK. Corresponding properties: Google Merchant Center property availability. Schema.org property Offer.availability.
.google.cloud.retail.v2.Product.Availability availability = 19;
Type | Description |
int | The enum numeric value on the wire for availability. |
getAvailableQuantity()
public Int32Value getAvailableQuantity()
The available quantity of the item.
.google.protobuf.Int32Value available_quantity = 20;
Type | Description |
Int32Value | The availableQuantity. |
getAvailableQuantityBuilder()
public Int32Value.Builder getAvailableQuantityBuilder()
The available quantity of the item.
.google.protobuf.Int32Value available_quantity = 20;
Type | Description |
Builder |
getAvailableQuantityOrBuilder()
public Int32ValueOrBuilder getAvailableQuantityOrBuilder()
The available quantity of the item.
.google.protobuf.Int32Value available_quantity = 20;
Type | Description |
Int32ValueOrBuilder |
getAvailableTime()
public Timestamp getAvailableTime()
The timestamp when this Product becomes available for SearchService.Search.
.google.protobuf.Timestamp available_time = 18;
Type | Description |
Timestamp | The availableTime. |
getAvailableTimeBuilder()
public Timestamp.Builder getAvailableTimeBuilder()
The timestamp when this Product becomes available for SearchService.Search.
.google.protobuf.Timestamp available_time = 18;
Type | Description |
Builder |
getAvailableTimeOrBuilder()
public TimestampOrBuilder getAvailableTimeOrBuilder()
The timestamp when this Product becomes available for SearchService.Search.
.google.protobuf.Timestamp available_time = 18;
Type | Description |
TimestampOrBuilder |
getBrands(int index)
public String getBrands(int index)
The brands of the product. A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property brand. Schema.org property Product.brand.
repeated string brands = 9;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The brands at the given index. |
getBrandsBytes(int index)
public ByteString getBrandsBytes(int index)
The brands of the product. A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property brand. Schema.org property Product.brand.
repeated string brands = 9;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the brands at the given index. |
getBrandsCount()
public int getBrandsCount()
The brands of the product. A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property brand. Schema.org property Product.brand.
repeated string brands = 9;
Type | Description |
int | The count of brands. |
getBrandsList()
public ProtocolStringList getBrandsList()
The brands of the product. A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property brand. Schema.org property Product.brand.
repeated string brands = 9;
Type | Description |
ProtocolStringList | A list containing the brands. |
getCategories(int index)
public String getCategories(int index)
Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, please replace it with other character(s). For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property Product.category. [mc_google_product_category]: https://support.google.com/merchants/answer/6324436
repeated string categories = 7;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The categories at the given index. |
getCategoriesBytes(int index)
public ByteString getCategoriesBytes(int index)
Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, please replace it with other character(s). For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property Product.category. [mc_google_product_category]: https://support.google.com/merchants/answer/6324436
repeated string categories = 7;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the categories at the given index. |
getCategoriesCount()
public int getCategoriesCount()
Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, please replace it with other character(s). For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property Product.category. [mc_google_product_category]: https://support.google.com/merchants/answer/6324436
repeated string categories = 7;
Type | Description |
int | The count of categories. |
getCategoriesList()
public ProtocolStringList getCategoriesList()
Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, please replace it with other character(s). For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property Product.category. [mc_google_product_category]: https://support.google.com/merchants/answer/6324436
repeated string categories = 7;
Type | Description |
ProtocolStringList | A list containing the categories. |
getCollectionMemberIds(int index)
public String getCollectionMemberIds(int index)
The id of the collection members when type is Type.COLLECTION. Non-existent product ids are allowed. The type of the members must be either Type.PRIMARY or Type.VARIANT otherwise and INVALID_ARGUMENT error is thrown. Should not set it for other types. A maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is return.
repeated string collection_member_ids = 5;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The collectionMemberIds at the given index. |
getCollectionMemberIdsBytes(int index)
public ByteString getCollectionMemberIdsBytes(int index)
The id of the collection members when type is Type.COLLECTION. Non-existent product ids are allowed. The type of the members must be either Type.PRIMARY or Type.VARIANT otherwise and INVALID_ARGUMENT error is thrown. Should not set it for other types. A maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is return.
repeated string collection_member_ids = 5;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the collectionMemberIds at the given index. |
getCollectionMemberIdsCount()
public int getCollectionMemberIdsCount()
The id of the collection members when type is Type.COLLECTION. Non-existent product ids are allowed. The type of the members must be either Type.PRIMARY or Type.VARIANT otherwise and INVALID_ARGUMENT error is thrown. Should not set it for other types. A maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is return.
repeated string collection_member_ids = 5;
Type | Description |
int | The count of collectionMemberIds. |
getCollectionMemberIdsList()
public ProtocolStringList getCollectionMemberIdsList()
The id of the collection members when type is Type.COLLECTION. Non-existent product ids are allowed. The type of the members must be either Type.PRIMARY or Type.VARIANT otherwise and INVALID_ARGUMENT error is thrown. Should not set it for other types. A maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is return.
repeated string collection_member_ids = 5;
Type | Description |
ProtocolStringList | A list containing the collectionMemberIds. |
getColorInfo()
public ColorInfo getColorInfo()
The color of the product. Corresponding properties: Google Merchant Center property color. Schema.org property Product.color.
.google.cloud.retail.v2.ColorInfo color_info = 25;
Type | Description |
ColorInfo | The colorInfo. |
getColorInfoBuilder()
public ColorInfo.Builder getColorInfoBuilder()
The color of the product. Corresponding properties: Google Merchant Center property color. Schema.org property Product.color.
.google.cloud.retail.v2.ColorInfo color_info = 25;
Type | Description |
ColorInfo.Builder |
getColorInfoOrBuilder()
public ColorInfoOrBuilder getColorInfoOrBuilder()
The color of the product. Corresponding properties: Google Merchant Center property color. Schema.org property Product.color.
.google.cloud.retail.v2.ColorInfo color_info = 25;
Type | Description |
ColorInfoOrBuilder |
getConditions(int index)
public String getConditions(int index)
The condition of the product. Strongly encouraged to use the standard values: "new", "refurbished", "used". A maximum of 1 value is allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property condition. Schema.org property Offer.itemCondition.
repeated string conditions = 29;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The conditions at the given index. |
getConditionsBytes(int index)
public ByteString getConditionsBytes(int index)
The condition of the product. Strongly encouraged to use the standard values: "new", "refurbished", "used". A maximum of 1 value is allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property condition. Schema.org property Offer.itemCondition.
repeated string conditions = 29;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the conditions at the given index. |
getConditionsCount()
public int getConditionsCount()
The condition of the product. Strongly encouraged to use the standard values: "new", "refurbished", "used". A maximum of 1 value is allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property condition. Schema.org property Offer.itemCondition.
repeated string conditions = 29;
Type | Description |
int | The count of conditions. |
getConditionsList()
public ProtocolStringList getConditionsList()
The condition of the product. Strongly encouraged to use the standard values: "new", "refurbished", "used". A maximum of 1 value is allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property condition. Schema.org property Offer.itemCondition.
repeated string conditions = 29;
Type | Description |
ProtocolStringList | A list containing the conditions. |
getDefaultInstanceForType()
public Product getDefaultInstanceForType()
Type | Description |
Product |
getDescription()
public String getDescription()
Product description. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property description. Schema.org property Product.description.
string description = 10;
Type | Description |
String | The description. |
getDescriptionBytes()
public ByteString getDescriptionBytes()
Product description. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property description. Schema.org property Product.description.
string description = 10;
Type | Description |
ByteString | The bytes for description. |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Type | Description |
Descriptor |
getExpirationCase()
public Product.ExpirationCase getExpirationCase()
Type | Description |
Product.ExpirationCase |
getExpireTime()
public Timestamp getExpireTime()
The timestamp when this product becomes unavailable for SearchService.Search. If it is set, the Product is not available for SearchService.Search after expire_time. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts. expire_time must be later than available_time and publish_time, otherwise an INVALID_ARGUMENT error is thrown. Corresponding properties: Google Merchant Center property expiration_date.
.google.protobuf.Timestamp expire_time = 16;
Type | Description |
Timestamp | The expireTime. |
getExpireTimeBuilder()
public Timestamp.Builder getExpireTimeBuilder()
The timestamp when this product becomes unavailable for SearchService.Search. If it is set, the Product is not available for SearchService.Search after expire_time. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts. expire_time must be later than available_time and publish_time, otherwise an INVALID_ARGUMENT error is thrown. Corresponding properties: Google Merchant Center property expiration_date.
.google.protobuf.Timestamp expire_time = 16;
Type | Description |
Builder |
getExpireTimeOrBuilder()
public TimestampOrBuilder getExpireTimeOrBuilder()
The timestamp when this product becomes unavailable for SearchService.Search. If it is set, the Product is not available for SearchService.Search after expire_time. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts. expire_time must be later than available_time and publish_time, otherwise an INVALID_ARGUMENT error is thrown. Corresponding properties: Google Merchant Center property expiration_date.
.google.protobuf.Timestamp expire_time = 16;
Type | Description |
TimestampOrBuilder |
getFulfillmentInfo(int index)
public FulfillmentInfo getFulfillmentInfo(int index)
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Name | Description |
index | int |
Type | Description |
FulfillmentInfo |
getFulfillmentInfoBuilder(int index)
public FulfillmentInfo.Builder getFulfillmentInfoBuilder(int index)
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Name | Description |
index | int |
Type | Description |
FulfillmentInfo.Builder |
getFulfillmentInfoBuilderList()
public List<FulfillmentInfo.Builder> getFulfillmentInfoBuilderList()
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Type | Description |
List<Builder> |
getFulfillmentInfoCount()
public int getFulfillmentInfoCount()
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Type | Description |
int |
getFulfillmentInfoList()
public List<FulfillmentInfo> getFulfillmentInfoList()
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Type | Description |
List<FulfillmentInfo> |
getFulfillmentInfoOrBuilder(int index)
public FulfillmentInfoOrBuilder getFulfillmentInfoOrBuilder(int index)
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Name | Description |
index | int |
Type | Description |
FulfillmentInfoOrBuilder |
getFulfillmentInfoOrBuilderList()
public List<? extends FulfillmentInfoOrBuilder> getFulfillmentInfoOrBuilderList()
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Type | Description |
List<? extends com.google.cloud.retail.v2.FulfillmentInfoOrBuilder> |
getGtin()
public String getGtin()
The Global Trade Item Number (GTIN) of the product. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property gtin. Schema.org property Product.isbn, Product.gtin8, Product.gtin12, Product.gtin13, or Product.gtin14. If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
string gtin = 6;
Type | Description |
String | The gtin. |
getGtinBytes()
public ByteString getGtinBytes()
The Global Trade Item Number (GTIN) of the product. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property gtin. Schema.org property Product.isbn, Product.gtin8, Product.gtin12, Product.gtin13, or Product.gtin14. If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
string gtin = 6;
Type | Description |
ByteString | The bytes for gtin. |
getId()
public String getId()
Immutable. Product identifier, which is
the final component of name. For
example, this field is "id_1", if
name is
projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1
.
This field must be a UTF-8 encoded string with a length limit of 128
characters. Otherwise, an INVALID_ARGUMENT error is returned.
Corresponding properties: Google Merchant Center property
id. Schema.org
property Product.sku.
string id = 2 [(.google.api.field_behavior) = IMMUTABLE];
Type | Description |
String | The id. |
getIdBytes()
public ByteString getIdBytes()
Immutable. Product identifier, which is
the final component of name. For
example, this field is "id_1", if
name is
projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1
.
This field must be a UTF-8 encoded string with a length limit of 128
characters. Otherwise, an INVALID_ARGUMENT error is returned.
Corresponding properties: Google Merchant Center property
id. Schema.org
property Product.sku.
string id = 2 [(.google.api.field_behavior) = IMMUTABLE];
Type | Description |
ByteString | The bytes for id. |
getImages(int index)
public Image getImages(int index)
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Name | Description |
index | int |
Type | Description |
Image |
getImagesBuilder(int index)
public Image.Builder getImagesBuilder(int index)
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Name | Description |
index | int |
Type | Description |
Image.Builder |
getImagesBuilderList()
public List<Image.Builder> getImagesBuilderList()
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Type | Description |
List<Builder> |
getImagesCount()
public int getImagesCount()
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Type | Description |
int |
getImagesList()
public List<Image> getImagesList()
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Type | Description |
List<Image> |
getImagesOrBuilder(int index)
public ImageOrBuilder getImagesOrBuilder(int index)
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Name | Description |
index | int |
Type | Description |
ImageOrBuilder |
getImagesOrBuilderList()
public List<? extends ImageOrBuilder> getImagesOrBuilderList()
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Type | Description |
List<? extends com.google.cloud.retail.v2.ImageOrBuilder> |
getLanguageCode()
public String getLanguageCode()
Language of the title/description and other string attributes. Use language tags defined by BCP 47. For product prediction, this field is ignored and the model automatically detects the text language. The Product can include text in different languages, but duplicating Products to provide text in multiple languages can result in degraded model performance. For product search this field is in use. It defaults to "en-US" if unset.
string language_code = 11;
Type | Description |
String | The languageCode. |
getLanguageCodeBytes()
public ByteString getLanguageCodeBytes()
Language of the title/description and other string attributes. Use language tags defined by BCP 47. For product prediction, this field is ignored and the model automatically detects the text language. The Product can include text in different languages, but duplicating Products to provide text in multiple languages can result in degraded model performance. For product search this field is in use. It defaults to "en-US" if unset.
string language_code = 11;
Type | Description |
ByteString | The bytes for languageCode. |
getMaterials(int index)
public String getMaterials(int index)
The material of the product. For example, "leather", "wooden". A maximum of 20 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property material. Schema.org property Product.material.
repeated string materials = 27;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The materials at the given index. |
getMaterialsBytes(int index)
public ByteString getMaterialsBytes(int index)
The material of the product. For example, "leather", "wooden". A maximum of 20 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property material. Schema.org property Product.material.
repeated string materials = 27;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the materials at the given index. |
getMaterialsCount()
public int getMaterialsCount()
The material of the product. For example, "leather", "wooden". A maximum of 20 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property material. Schema.org property Product.material.
repeated string materials = 27;
Type | Description |
int | The count of materials. |
getMaterialsList()
public ProtocolStringList getMaterialsList()
The material of the product. For example, "leather", "wooden". A maximum of 20 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property material. Schema.org property Product.material.
repeated string materials = 27;
Type | Description |
ProtocolStringList | A list containing the materials. |
getMutableAttributes()
public Map<String,CustomAttribute> getMutableAttributes()
Use alternate mutation accessors instead.
Type | Description |
Map<String,CustomAttribute> |
getName()
public String getName()
Immutable. Full resource name of the product, such as
projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id
.
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
Type | Description |
String | The name. |
getNameBytes()
public ByteString getNameBytes()
Immutable. Full resource name of the product, such as
projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id
.
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
Type | Description |
ByteString | The bytes for name. |
getPatterns(int index)
public String getPatterns(int index)
The pattern or graphic print of the product. For example, "striped", "polka dot", "paisley". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property pattern. Schema.org property Product.pattern.
repeated string patterns = 28;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The patterns at the given index. |
getPatternsBytes(int index)
public ByteString getPatternsBytes(int index)
The pattern or graphic print of the product. For example, "striped", "polka dot", "paisley". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property pattern. Schema.org property Product.pattern.
repeated string patterns = 28;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the patterns at the given index. |
getPatternsCount()
public int getPatternsCount()
The pattern or graphic print of the product. For example, "striped", "polka dot", "paisley". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property pattern. Schema.org property Product.pattern.
repeated string patterns = 28;
Type | Description |
int | The count of patterns. |
getPatternsList()
public ProtocolStringList getPatternsList()
The pattern or graphic print of the product. For example, "striped", "polka dot", "paisley". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property pattern. Schema.org property Product.pattern.
repeated string patterns = 28;
Type | Description |
ProtocolStringList | A list containing the patterns. |
getPriceInfo()
public PriceInfo getPriceInfo()
Product price and cost information. Corresponding properties: Google Merchant Center property price.
.google.cloud.retail.v2.PriceInfo price_info = 14;
Type | Description |
PriceInfo | The priceInfo. |
getPriceInfoBuilder()
public PriceInfo.Builder getPriceInfoBuilder()
Product price and cost information. Corresponding properties: Google Merchant Center property price.
.google.cloud.retail.v2.PriceInfo price_info = 14;
Type | Description |
PriceInfo.Builder |
getPriceInfoOrBuilder()
public PriceInfoOrBuilder getPriceInfoOrBuilder()
Product price and cost information. Corresponding properties: Google Merchant Center property price.
.google.cloud.retail.v2.PriceInfo price_info = 14;
Type | Description |
PriceInfoOrBuilder |
getPrimaryProductId()
public String getPrimaryProductId()
Variant group identifier. Must be an id, with the same parent branch with this product. Otherwise, an error is thrown. For Type.PRIMARY Products, this field can only be empty or set to the same value as id. For VARIANT Products, this field cannot be empty. A maximum of 2,000 products are allowed to share the same Type.PRIMARY Product. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property item_group_id. Schema.org property Product.inProductGroupWithID.
string primary_product_id = 4;
Type | Description |
String | The primaryProductId. |
getPrimaryProductIdBytes()
public ByteString getPrimaryProductIdBytes()
Variant group identifier. Must be an id, with the same parent branch with this product. Otherwise, an error is thrown. For Type.PRIMARY Products, this field can only be empty or set to the same value as id. For VARIANT Products, this field cannot be empty. A maximum of 2,000 products are allowed to share the same Type.PRIMARY Product. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property item_group_id. Schema.org property Product.inProductGroupWithID.
string primary_product_id = 4;
Type | Description |
ByteString | The bytes for primaryProductId. |
getPromotions(int index)
public Promotion getPromotions(int index)
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Name | Description |
index | int |
Type | Description |
Promotion |
getPromotionsBuilder(int index)
public Promotion.Builder getPromotionsBuilder(int index)
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Name | Description |
index | int |
Type | Description |
Promotion.Builder |
getPromotionsBuilderList()
public List<Promotion.Builder> getPromotionsBuilderList()
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Type | Description |
List<Builder> |
getPromotionsCount()
public int getPromotionsCount()
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Type | Description |
int |
getPromotionsList()
public List<Promotion> getPromotionsList()
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Type | Description |
List<Promotion> |
getPromotionsOrBuilder(int index)
public PromotionOrBuilder getPromotionsOrBuilder(int index)
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Name | Description |
index | int |
Type | Description |
PromotionOrBuilder |
getPromotionsOrBuilderList()
public List<? extends PromotionOrBuilder> getPromotionsOrBuilderList()
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Type | Description |
List<? extends com.google.cloud.retail.v2.PromotionOrBuilder> |
getPublishTime()
public Timestamp getPublishTime()
The timestamp when the product is published by the retailer for the first time, which indicates the freshness of the products. Note that this field is different from available_time, given it purely describes product freshness regardless of when it is available on search and recommendation.
.google.protobuf.Timestamp publish_time = 33;
Type | Description |
Timestamp | The publishTime. |
getPublishTimeBuilder()
public Timestamp.Builder getPublishTimeBuilder()
The timestamp when the product is published by the retailer for the first time, which indicates the freshness of the products. Note that this field is different from available_time, given it purely describes product freshness regardless of when it is available on search and recommendation.
.google.protobuf.Timestamp publish_time = 33;
Type | Description |
Builder |
getPublishTimeOrBuilder()
public TimestampOrBuilder getPublishTimeOrBuilder()
The timestamp when the product is published by the retailer for the first time, which indicates the freshness of the products. Note that this field is different from available_time, given it purely describes product freshness regardless of when it is available on search and recommendation.
.google.protobuf.Timestamp publish_time = 33;
Type | Description |
TimestampOrBuilder |
getRating()
public Rating getRating()
The rating of this product.
.google.cloud.retail.v2.Rating rating = 15;
Type | Description |
Rating | The rating. |
getRatingBuilder()
public Rating.Builder getRatingBuilder()
The rating of this product.
.google.cloud.retail.v2.Rating rating = 15;
Type | Description |
Rating.Builder |
getRatingOrBuilder()
public RatingOrBuilder getRatingOrBuilder()
The rating of this product.
.google.cloud.retail.v2.Rating rating = 15;
Type | Description |
RatingOrBuilder |
getRetrievableFields()
public FieldMask getRetrievableFields()
Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types:
- audience
- availability
- brands
- color_info
- conditions
- gtin
- materials
- name
- patterns
- price_info
- rating
- sizes
- title
- uri Supported fields only for Type.PRIMARY and Type.COLLECTION:
- categories
- description
- images Supported fields only for Type.VARIANT:
- Only the first image in images To mark attributes as retrievable, include paths of the form "attributes.key" where "key" is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default:
- name For Type.VARIANT, the following fields are always returned in by default:
- name
- color_info The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse can increase response payload size and serving latency.
.google.protobuf.FieldMask retrievable_fields = 30;
Type | Description |
FieldMask | The retrievableFields. |
getRetrievableFieldsBuilder()
public FieldMask.Builder getRetrievableFieldsBuilder()
Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types:
- audience
- availability
- brands
- color_info
- conditions
- gtin
- materials
- name
- patterns
- price_info
- rating
- sizes
- title
- uri Supported fields only for Type.PRIMARY and Type.COLLECTION:
- categories
- description
- images Supported fields only for Type.VARIANT:
- Only the first image in images To mark attributes as retrievable, include paths of the form "attributes.key" where "key" is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default:
- name For Type.VARIANT, the following fields are always returned in by default:
- name
- color_info The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse can increase response payload size and serving latency.
.google.protobuf.FieldMask retrievable_fields = 30;
Type | Description |
Builder |
getRetrievableFieldsOrBuilder()
public FieldMaskOrBuilder getRetrievableFieldsOrBuilder()
Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types:
- audience
- availability
- brands
- color_info
- conditions
- gtin
- materials
- name
- patterns
- price_info
- rating
- sizes
- title
- uri Supported fields only for Type.PRIMARY and Type.COLLECTION:
- categories
- description
- images Supported fields only for Type.VARIANT:
- Only the first image in images To mark attributes as retrievable, include paths of the form "attributes.key" where "key" is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default:
- name For Type.VARIANT, the following fields are always returned in by default:
- name
- color_info The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse can increase response payload size and serving latency.
.google.protobuf.FieldMask retrievable_fields = 30;
Type | Description |
FieldMaskOrBuilder |
getSizes(int index)
public String getSizes(int index)
The size of the product. To represent different size systems or size types, consider using this format: [[[size_system:]size_type:]size_value]. For example, in "US:MENS:M", "US" represents size system; "MENS" represents size type; "M" represents size value. In "GIRLS:27", size system is empty; "GIRLS" represents size type; "27" represents size value. In "32 inches", both size system and size type are empty, while size value is "32 inches". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property size, size_type, and size_system. Schema.org property Product.size.
repeated string sizes = 26;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The sizes at the given index. |
getSizesBytes(int index)
public ByteString getSizesBytes(int index)
The size of the product. To represent different size systems or size types, consider using this format: [[[size_system:]size_type:]size_value]. For example, in "US:MENS:M", "US" represents size system; "MENS" represents size type; "M" represents size value. In "GIRLS:27", size system is empty; "GIRLS" represents size type; "27" represents size value. In "32 inches", both size system and size type are empty, while size value is "32 inches". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property size, size_type, and size_system. Schema.org property Product.size.
repeated string sizes = 26;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the sizes at the given index. |
getSizesCount()
public int getSizesCount()
The size of the product. To represent different size systems or size types, consider using this format: [[[size_system:]size_type:]size_value]. For example, in "US:MENS:M", "US" represents size system; "MENS" represents size type; "M" represents size value. In "GIRLS:27", size system is empty; "GIRLS" represents size type; "27" represents size value. In "32 inches", both size system and size type are empty, while size value is "32 inches". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property size, size_type, and size_system. Schema.org property Product.size.
repeated string sizes = 26;
Type | Description |
int | The count of sizes. |
getSizesList()
public ProtocolStringList getSizesList()
The size of the product. To represent different size systems or size types, consider using this format: [[[size_system:]size_type:]size_value]. For example, in "US:MENS:M", "US" represents size system; "MENS" represents size type; "M" represents size value. In "GIRLS:27", size system is empty; "GIRLS" represents size type; "27" represents size value. In "32 inches", both size system and size type are empty, while size value is "32 inches". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property size, size_type, and size_system. Schema.org property Product.size.
repeated string sizes = 26;
Type | Description |
ProtocolStringList | A list containing the sizes. |
getTags(int index)
public String getTags(int index)
Custom tags associated with the product. At most 250 values are allowed per Product. This value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. This tag can be used for filtering recommendation results by passing the tag as part of the PredictRequest.filter. Corresponding properties: Google Merchant Center property custom_label_0\u20134.
repeated string tags = 13;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The tags at the given index. |
getTagsBytes(int index)
public ByteString getTagsBytes(int index)
Custom tags associated with the product. At most 250 values are allowed per Product. This value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. This tag can be used for filtering recommendation results by passing the tag as part of the PredictRequest.filter. Corresponding properties: Google Merchant Center property custom_label_0\u20134.
repeated string tags = 13;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the tags at the given index. |
getTagsCount()
public int getTagsCount()
Custom tags associated with the product. At most 250 values are allowed per Product. This value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. This tag can be used for filtering recommendation results by passing the tag as part of the PredictRequest.filter. Corresponding properties: Google Merchant Center property custom_label_0\u20134.
repeated string tags = 13;
Type | Description |
int | The count of tags. |
getTagsList()
public ProtocolStringList getTagsList()
Custom tags associated with the product. At most 250 values are allowed per Product. This value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. This tag can be used for filtering recommendation results by passing the tag as part of the PredictRequest.filter. Corresponding properties: Google Merchant Center property custom_label_0\u20134.
repeated string tags = 13;
Type | Description |
ProtocolStringList | A list containing the tags. |
getTitle()
public String getTitle()
Required. Product title. This field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property title. Schema.org property Product.name.
string title = 8 [(.google.api.field_behavior) = REQUIRED];
Type | Description |
String | The title. |
getTitleBytes()
public ByteString getTitleBytes()
Required. Product title. This field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property title. Schema.org property Product.name.
string title = 8 [(.google.api.field_behavior) = REQUIRED];
Type | Description |
ByteString | The bytes for title. |
getTtl()
public Duration getTtl()
Input only. The TTL (time to live) of the product. If it is set, it must be a non-negative value, and expire_time is set as current timestamp plus ttl. The derived expire_time is returned in the output and ttl is left blank when retrieving the Product. If it is set, the product is not available for SearchService.Search after current timestamp plus ttl. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts.
.google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY];
Type | Description |
Duration | The ttl. |
getTtlBuilder()
public Duration.Builder getTtlBuilder()
Input only. The TTL (time to live) of the product. If it is set, it must be a non-negative value, and expire_time is set as current timestamp plus ttl. The derived expire_time is returned in the output and ttl is left blank when retrieving the Product. If it is set, the product is not available for SearchService.Search after current timestamp plus ttl. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts.
.google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY];
Type | Description |
Builder |
getTtlOrBuilder()
public DurationOrBuilder getTtlOrBuilder()
Input only. The TTL (time to live) of the product. If it is set, it must be a non-negative value, and expire_time is set as current timestamp plus ttl. The derived expire_time is returned in the output and ttl is left blank when retrieving the Product. If it is set, the product is not available for SearchService.Search after current timestamp plus ttl. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts.
.google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY];
Type | Description |
DurationOrBuilder |
getType()
public Product.Type getType()
Immutable. The type of the product. Default to Catalog.product_level_config.ingestion_product_type if unset.
.google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE];
Type | Description |
Product.Type | The type. |
getTypeValue()
public int getTypeValue()
Immutable. The type of the product. Default to Catalog.product_level_config.ingestion_product_type if unset.
.google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE];
Type | Description |
int | The enum numeric value on the wire for type. |
getUri()
public String getUri()
Canonical URL directly linking to the product detail page. It is strongly recommended to provide a valid uri for the product, otherwise the service performance could be significantly degraded. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property link. Schema.org property Offer.url.
string uri = 22;
Type | Description |
String | The uri. |
getUriBytes()
public ByteString getUriBytes()
Canonical URL directly linking to the product detail page. It is strongly recommended to provide a valid uri for the product, otherwise the service performance could be significantly degraded. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property link. Schema.org property Offer.url.
string uri = 22;
Type | Description |
ByteString | The bytes for uri. |
getVariants(int index)
public Product getVariants(int index)
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Name | Description |
index | int |
Type | Description |
Product |
getVariantsBuilder(int index)
public Product.Builder getVariantsBuilder(int index)
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Name | Description |
index | int |
Type | Description |
Product.Builder |
getVariantsBuilderList()
public List<Product.Builder> getVariantsBuilderList()
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Type | Description |
List<Builder> |
getVariantsCount()
public int getVariantsCount()
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Type | Description |
int |
getVariantsList()
public List<Product> getVariantsList()
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Type | Description |
List<Product> |
getVariantsOrBuilder(int index)
public ProductOrBuilder getVariantsOrBuilder(int index)
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Name | Description |
index | int |
Type | Description |
ProductOrBuilder |
getVariantsOrBuilderList()
public List<? extends ProductOrBuilder> getVariantsOrBuilderList()
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Type | Description |
List<? extends com.google.cloud.retail.v2.ProductOrBuilder> |
hasAudience()
public boolean hasAudience()
The target group associated with a given audience (e.g. male, veterans, car owners, musicians, etc.) of the product.
.google.cloud.retail.v2.Audience audience = 24;
Type | Description |
boolean | Whether the audience field is set. |
hasAvailableQuantity()
public boolean hasAvailableQuantity()
The available quantity of the item.
.google.protobuf.Int32Value available_quantity = 20;
Type | Description |
boolean | Whether the availableQuantity field is set. |
hasAvailableTime()
public boolean hasAvailableTime()
The timestamp when this Product becomes available for SearchService.Search.
.google.protobuf.Timestamp available_time = 18;
Type | Description |
boolean | Whether the availableTime field is set. |
hasColorInfo()
public boolean hasColorInfo()
The color of the product. Corresponding properties: Google Merchant Center property color. Schema.org property Product.color.
.google.cloud.retail.v2.ColorInfo color_info = 25;
Type | Description |
boolean | Whether the colorInfo field is set. |
hasExpireTime()
public boolean hasExpireTime()
The timestamp when this product becomes unavailable for SearchService.Search. If it is set, the Product is not available for SearchService.Search after expire_time. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts. expire_time must be later than available_time and publish_time, otherwise an INVALID_ARGUMENT error is thrown. Corresponding properties: Google Merchant Center property expiration_date.
.google.protobuf.Timestamp expire_time = 16;
Type | Description |
boolean | Whether the expireTime field is set. |
hasPriceInfo()
public boolean hasPriceInfo()
Product price and cost information. Corresponding properties: Google Merchant Center property price.
.google.cloud.retail.v2.PriceInfo price_info = 14;
Type | Description |
boolean | Whether the priceInfo field is set. |
hasPublishTime()
public boolean hasPublishTime()
The timestamp when the product is published by the retailer for the first time, which indicates the freshness of the products. Note that this field is different from available_time, given it purely describes product freshness regardless of when it is available on search and recommendation.
.google.protobuf.Timestamp publish_time = 33;
Type | Description |
boolean | Whether the publishTime field is set. |
hasRating()
public boolean hasRating()
The rating of this product.
.google.cloud.retail.v2.Rating rating = 15;
Type | Description |
boolean | Whether the rating field is set. |
hasRetrievableFields()
public boolean hasRetrievableFields()
Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types:
- audience
- availability
- brands
- color_info
- conditions
- gtin
- materials
- name
- patterns
- price_info
- rating
- sizes
- title
- uri Supported fields only for Type.PRIMARY and Type.COLLECTION:
- categories
- description
- images Supported fields only for Type.VARIANT:
- Only the first image in images To mark attributes as retrievable, include paths of the form "attributes.key" where "key" is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default:
- name For Type.VARIANT, the following fields are always returned in by default:
- name
- color_info The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse can increase response payload size and serving latency.
.google.protobuf.FieldMask retrievable_fields = 30;
Type | Description |
boolean | Whether the retrievableFields field is set. |
hasTtl()
public boolean hasTtl()
Input only. The TTL (time to live) of the product. If it is set, it must be a non-negative value, and expire_time is set as current timestamp plus ttl. The derived expire_time is returned in the output and ttl is left blank when retrieving the Product. If it is set, the product is not available for SearchService.Search after current timestamp plus ttl. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts.
.google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY];
Type | Description |
boolean | Whether the ttl field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Type | Description |
FieldAccessorTable |
internalGetMapField(int number)
protected MapField internalGetMapField(int number)
Name | Description |
number | int |
Type | Description |
MapField |
internalGetMutableMapField(int number)
protected MapField internalGetMutableMapField(int number)
Name | Description |
number | int |
Type | Description |
MapField |
isInitialized()
public final boolean isInitialized()
Type | Description |
boolean |
mergeAudience(Audience value)
public Product.Builder mergeAudience(Audience value)
The target group associated with a given audience (e.g. male, veterans, car owners, musicians, etc.) of the product.
.google.cloud.retail.v2.Audience audience = 24;
Name | Description |
value | Audience |
Type | Description |
Product.Builder |
mergeAvailableQuantity(Int32Value value)
public Product.Builder mergeAvailableQuantity(Int32Value value)
The available quantity of the item.
.google.protobuf.Int32Value available_quantity = 20;
Name | Description |
value | Int32Value |
Type | Description |
Product.Builder |
mergeAvailableTime(Timestamp value)
public Product.Builder mergeAvailableTime(Timestamp value)
The timestamp when this Product becomes available for SearchService.Search.
.google.protobuf.Timestamp available_time = 18;
Name | Description |
value | Timestamp |
Type | Description |
Product.Builder |
mergeColorInfo(ColorInfo value)
public Product.Builder mergeColorInfo(ColorInfo value)
The color of the product. Corresponding properties: Google Merchant Center property color. Schema.org property Product.color.
.google.cloud.retail.v2.ColorInfo color_info = 25;
Name | Description |
value | ColorInfo |
Type | Description |
Product.Builder |
mergeExpireTime(Timestamp value)
public Product.Builder mergeExpireTime(Timestamp value)
The timestamp when this product becomes unavailable for SearchService.Search. If it is set, the Product is not available for SearchService.Search after expire_time. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts. expire_time must be later than available_time and publish_time, otherwise an INVALID_ARGUMENT error is thrown. Corresponding properties: Google Merchant Center property expiration_date.
.google.protobuf.Timestamp expire_time = 16;
Name | Description |
value | Timestamp |
Type | Description |
Product.Builder |
mergeFrom(Product other)
public Product.Builder mergeFrom(Product other)
Name | Description |
other | Product |
Type | Description |
Product.Builder |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public Product.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Name | Description |
input | CodedInputStream |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
Product.Builder |
Type | Description |
IOException |
mergeFrom(Message other)
public Product.Builder mergeFrom(Message other)
Name | Description |
other | Message |
Type | Description |
Product.Builder |
mergePriceInfo(PriceInfo value)
public Product.Builder mergePriceInfo(PriceInfo value)
Product price and cost information. Corresponding properties: Google Merchant Center property price.
.google.cloud.retail.v2.PriceInfo price_info = 14;
Name | Description |
value | PriceInfo |
Type | Description |
Product.Builder |
mergePublishTime(Timestamp value)
public Product.Builder mergePublishTime(Timestamp value)
The timestamp when the product is published by the retailer for the first time, which indicates the freshness of the products. Note that this field is different from available_time, given it purely describes product freshness regardless of when it is available on search and recommendation.
.google.protobuf.Timestamp publish_time = 33;
Name | Description |
value | Timestamp |
Type | Description |
Product.Builder |
mergeRating(Rating value)
public Product.Builder mergeRating(Rating value)
The rating of this product.
.google.cloud.retail.v2.Rating rating = 15;
Name | Description |
value | Rating |
Type | Description |
Product.Builder |
mergeRetrievableFields(FieldMask value)
public Product.Builder mergeRetrievableFields(FieldMask value)
Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types:
- audience
- availability
- brands
- color_info
- conditions
- gtin
- materials
- name
- patterns
- price_info
- rating
- sizes
- title
- uri Supported fields only for Type.PRIMARY and Type.COLLECTION:
- categories
- description
- images Supported fields only for Type.VARIANT:
- Only the first image in images To mark attributes as retrievable, include paths of the form "attributes.key" where "key" is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default:
- name For Type.VARIANT, the following fields are always returned in by default:
- name
- color_info The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse can increase response payload size and serving latency.
.google.protobuf.FieldMask retrievable_fields = 30;
Name | Description |
value | FieldMask |
Type | Description |
Product.Builder |
mergeTtl(Duration value)
public Product.Builder mergeTtl(Duration value)
Input only. The TTL (time to live) of the product. If it is set, it must be a non-negative value, and expire_time is set as current timestamp plus ttl. The derived expire_time is returned in the output and ttl is left blank when retrieving the Product. If it is set, the product is not available for SearchService.Search after current timestamp plus ttl. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts.
.google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY];
Name | Description |
value | Duration |
Type | Description |
Product.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final Product.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Name | Description |
unknownFields | UnknownFieldSet |
Type | Description |
Product.Builder |
putAllAttributes(Map<String,CustomAttribute> values)
public Product.Builder putAllAttributes(Map<String,CustomAttribute> values)
Highly encouraged. Extra product attributes to be included. For example,
for 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 attributes here.
Features that can take on one of a limited number of possible values. Two
types of features can be set are:
Textual features. some examples would be the brand/maker of a product, or
country of a customer. Numerical features. Some examples would be the
height/weight of a product, or age of a customer.
For example: { "vendor": {"text": ["vendor123", "vendor456"]},
"lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
}
.
This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
error is returned:
- Max entries count: 200.
- The key must be a UTF-8 encoded string with a length limit of 128 characters.
- For indexable attribute, the key must match the pattern:
a-zA-Z0-9*
. For example,key0LikeThis
orKEY_1_LIKE_THIS
. - For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a non-empty UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed.
map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12;
Name | Description |
values | Map<String,CustomAttribute> |
Type | Description |
Product.Builder |
putAttributes(String key, CustomAttribute value)
public Product.Builder putAttributes(String key, CustomAttribute value)
Highly encouraged. Extra product attributes to be included. For example,
for 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 attributes here.
Features that can take on one of a limited number of possible values. Two
types of features can be set are:
Textual features. some examples would be the brand/maker of a product, or
country of a customer. Numerical features. Some examples would be the
height/weight of a product, or age of a customer.
For example: { "vendor": {"text": ["vendor123", "vendor456"]},
"lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
}
.
This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
error is returned:
- Max entries count: 200.
- The key must be a UTF-8 encoded string with a length limit of 128 characters.
- For indexable attribute, the key must match the pattern:
a-zA-Z0-9*
. For example,key0LikeThis
orKEY_1_LIKE_THIS
. - For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a non-empty UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed.
map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12;
Name | Description |
key | String |
value | CustomAttribute |
Type | Description |
Product.Builder |
removeAttributes(String key)
public Product.Builder removeAttributes(String key)
Highly encouraged. Extra product attributes to be included. For example,
for 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 attributes here.
Features that can take on one of a limited number of possible values. Two
types of features can be set are:
Textual features. some examples would be the brand/maker of a product, or
country of a customer. Numerical features. Some examples would be the
height/weight of a product, or age of a customer.
For example: { "vendor": {"text": ["vendor123", "vendor456"]},
"lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
}
.
This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
error is returned:
- Max entries count: 200.
- The key must be a UTF-8 encoded string with a length limit of 128 characters.
- For indexable attribute, the key must match the pattern:
a-zA-Z0-9*
. For example,key0LikeThis
orKEY_1_LIKE_THIS
. - For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a non-empty UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed.
map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 12;
Name | Description |
key | String |
Type | Description |
Product.Builder |
removeFulfillmentInfo(int index)
public Product.Builder removeFulfillmentInfo(int index)
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Name | Description |
index | int |
Type | Description |
Product.Builder |
removeImages(int index)
public Product.Builder removeImages(int index)
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Name | Description |
index | int |
Type | Description |
Product.Builder |
removePromotions(int index)
public Product.Builder removePromotions(int index)
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Name | Description |
index | int |
Type | Description |
Product.Builder |
removeVariants(int index)
public Product.Builder removeVariants(int index)
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Name | Description |
index | int |
Type | Description |
Product.Builder |
setAudience(Audience value)
public Product.Builder setAudience(Audience value)
The target group associated with a given audience (e.g. male, veterans, car owners, musicians, etc.) of the product.
.google.cloud.retail.v2.Audience audience = 24;
Name | Description |
value | Audience |
Type | Description |
Product.Builder |
setAudience(Audience.Builder builderForValue)
public Product.Builder setAudience(Audience.Builder builderForValue)
The target group associated with a given audience (e.g. male, veterans, car owners, musicians, etc.) of the product.
.google.cloud.retail.v2.Audience audience = 24;
Name | Description |
builderForValue | Audience.Builder |
Type | Description |
Product.Builder |
setAvailability(Product.Availability value)
public Product.Builder setAvailability(Product.Availability value)
The online availability of the Product. Default to Availability.IN_STOCK. Corresponding properties: Google Merchant Center property availability. Schema.org property Offer.availability.
.google.cloud.retail.v2.Product.Availability availability = 19;
Name | Description |
value | Product.Availability The availability to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setAvailabilityValue(int value)
public Product.Builder setAvailabilityValue(int value)
The online availability of the Product. Default to Availability.IN_STOCK. Corresponding properties: Google Merchant Center property availability. Schema.org property Offer.availability.
.google.cloud.retail.v2.Product.Availability availability = 19;
Name | Description |
value | int The enum numeric value on the wire for availability to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setAvailableQuantity(Int32Value value)
public Product.Builder setAvailableQuantity(Int32Value value)
The available quantity of the item.
.google.protobuf.Int32Value available_quantity = 20;
Name | Description |
value | Int32Value |
Type | Description |
Product.Builder |
setAvailableQuantity(Int32Value.Builder builderForValue)
public Product.Builder setAvailableQuantity(Int32Value.Builder builderForValue)
The available quantity of the item.
.google.protobuf.Int32Value available_quantity = 20;
Name | Description |
builderForValue | Builder |
Type | Description |
Product.Builder |
setAvailableTime(Timestamp value)
public Product.Builder setAvailableTime(Timestamp value)
The timestamp when this Product becomes available for SearchService.Search.
.google.protobuf.Timestamp available_time = 18;
Name | Description |
value | Timestamp |
Type | Description |
Product.Builder |
setAvailableTime(Timestamp.Builder builderForValue)
public Product.Builder setAvailableTime(Timestamp.Builder builderForValue)
The timestamp when this Product becomes available for SearchService.Search.
.google.protobuf.Timestamp available_time = 18;
Name | Description |
builderForValue | Builder |
Type | Description |
Product.Builder |
setBrands(int index, String value)
public Product.Builder setBrands(int index, String value)
The brands of the product. A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property brand. Schema.org property Product.brand.
repeated string brands = 9;
Name | Description |
index | int The index to set the value at. |
value | String The brands to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setCategories(int index, String value)
public Product.Builder setCategories(int index, String value)
Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, please replace it with other character(s). For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property Product.category. [mc_google_product_category]: https://support.google.com/merchants/answer/6324436
repeated string categories = 7;
Name | Description |
index | int The index to set the value at. |
value | String The categories to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setCollectionMemberIds(int index, String value)
public Product.Builder setCollectionMemberIds(int index, String value)
The id of the collection members when type is Type.COLLECTION. Non-existent product ids are allowed. The type of the members must be either Type.PRIMARY or Type.VARIANT otherwise and INVALID_ARGUMENT error is thrown. Should not set it for other types. A maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is return.
repeated string collection_member_ids = 5;
Name | Description |
index | int The index to set the value at. |
value | String The collectionMemberIds to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setColorInfo(ColorInfo value)
public Product.Builder setColorInfo(ColorInfo value)
The color of the product. Corresponding properties: Google Merchant Center property color. Schema.org property Product.color.
.google.cloud.retail.v2.ColorInfo color_info = 25;
Name | Description |
value | ColorInfo |
Type | Description |
Product.Builder |
setColorInfo(ColorInfo.Builder builderForValue)
public Product.Builder setColorInfo(ColorInfo.Builder builderForValue)
The color of the product. Corresponding properties: Google Merchant Center property color. Schema.org property Product.color.
.google.cloud.retail.v2.ColorInfo color_info = 25;
Name | Description |
builderForValue | ColorInfo.Builder |
Type | Description |
Product.Builder |
setConditions(int index, String value)
public Product.Builder setConditions(int index, String value)
The condition of the product. Strongly encouraged to use the standard values: "new", "refurbished", "used". A maximum of 1 value is allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property condition. Schema.org property Offer.itemCondition.
repeated string conditions = 29;
Name | Description |
index | int The index to set the value at. |
value | String The conditions to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setDescription(String value)
public Product.Builder setDescription(String value)
Product description. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property description. Schema.org property Product.description.
string description = 10;
Name | Description |
value | String The description to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setDescriptionBytes(ByteString value)
public Product.Builder setDescriptionBytes(ByteString value)
Product description. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property description. Schema.org property Product.description.
string description = 10;
Name | Description |
value | ByteString The bytes for description to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setExpireTime(Timestamp value)
public Product.Builder setExpireTime(Timestamp value)
The timestamp when this product becomes unavailable for SearchService.Search. If it is set, the Product is not available for SearchService.Search after expire_time. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts. expire_time must be later than available_time and publish_time, otherwise an INVALID_ARGUMENT error is thrown. Corresponding properties: Google Merchant Center property expiration_date.
.google.protobuf.Timestamp expire_time = 16;
Name | Description |
value | Timestamp |
Type | Description |
Product.Builder |
setExpireTime(Timestamp.Builder builderForValue)
public Product.Builder setExpireTime(Timestamp.Builder builderForValue)
The timestamp when this product becomes unavailable for SearchService.Search. If it is set, the Product is not available for SearchService.Search after expire_time. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts. expire_time must be later than available_time and publish_time, otherwise an INVALID_ARGUMENT error is thrown. Corresponding properties: Google Merchant Center property expiration_date.
.google.protobuf.Timestamp expire_time = 16;
Name | Description |
builderForValue | Builder |
Type | Description |
Product.Builder |
setField(Descriptors.FieldDescriptor field, Object value)
public Product.Builder setField(Descriptors.FieldDescriptor field, Object value)
Name | Description |
field | FieldDescriptor |
value | Object |
Type | Description |
Product.Builder |
setFulfillmentInfo(int index, FulfillmentInfo value)
public Product.Builder setFulfillmentInfo(int index, FulfillmentInfo value)
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Name | Description |
index | int |
value | FulfillmentInfo |
Type | Description |
Product.Builder |
setFulfillmentInfo(int index, FulfillmentInfo.Builder builderForValue)
public Product.Builder setFulfillmentInfo(int index, FulfillmentInfo.Builder builderForValue)
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
repeated .google.cloud.retail.v2.FulfillmentInfo fulfillment_info = 21;
Name | Description |
index | int |
builderForValue | FulfillmentInfo.Builder |
Type | Description |
Product.Builder |
setGtin(String value)
public Product.Builder setGtin(String value)
The Global Trade Item Number (GTIN) of the product. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property gtin. Schema.org property Product.isbn, Product.gtin8, Product.gtin12, Product.gtin13, or Product.gtin14. If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
string gtin = 6;
Name | Description |
value | String The gtin to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setGtinBytes(ByteString value)
public Product.Builder setGtinBytes(ByteString value)
The Global Trade Item Number (GTIN) of the product. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property gtin. Schema.org property Product.isbn, Product.gtin8, Product.gtin12, Product.gtin13, or Product.gtin14. If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
string gtin = 6;
Name | Description |
value | ByteString The bytes for gtin to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setId(String value)
public Product.Builder setId(String value)
Immutable. Product identifier, which is
the final component of name. For
example, this field is "id_1", if
name is
projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1
.
This field must be a UTF-8 encoded string with a length limit of 128
characters. Otherwise, an INVALID_ARGUMENT error is returned.
Corresponding properties: Google Merchant Center property
id. Schema.org
property Product.sku.
string id = 2 [(.google.api.field_behavior) = IMMUTABLE];
Name | Description |
value | String The id to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setIdBytes(ByteString value)
public Product.Builder setIdBytes(ByteString value)
Immutable. Product identifier, which is
the final component of name. For
example, this field is "id_1", if
name is
projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1
.
This field must be a UTF-8 encoded string with a length limit of 128
characters. Otherwise, an INVALID_ARGUMENT error is returned.
Corresponding properties: Google Merchant Center property
id. Schema.org
property Product.sku.
string id = 2 [(.google.api.field_behavior) = IMMUTABLE];
Name | Description |
value | ByteString The bytes for id to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setImages(int index, Image value)
public Product.Builder setImages(int index, Image value)
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Name | Description |
index | int |
value | Image |
Type | Description |
Product.Builder |
setImages(int index, Image.Builder builderForValue)
public Product.Builder setImages(int index, Image.Builder builderForValue)
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image.
repeated .google.cloud.retail.v2.Image images = 23;
Name | Description |
index | int |
builderForValue | Image.Builder |
Type | Description |
Product.Builder |
setLanguageCode(String value)
public Product.Builder setLanguageCode(String value)
Language of the title/description and other string attributes. Use language tags defined by BCP 47. For product prediction, this field is ignored and the model automatically detects the text language. The Product can include text in different languages, but duplicating Products to provide text in multiple languages can result in degraded model performance. For product search this field is in use. It defaults to "en-US" if unset.
string language_code = 11;
Name | Description |
value | String The languageCode to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setLanguageCodeBytes(ByteString value)
public Product.Builder setLanguageCodeBytes(ByteString value)
Language of the title/description and other string attributes. Use language tags defined by BCP 47. For product prediction, this field is ignored and the model automatically detects the text language. The Product can include text in different languages, but duplicating Products to provide text in multiple languages can result in degraded model performance. For product search this field is in use. It defaults to "en-US" if unset.
string language_code = 11;
Name | Description |
value | ByteString The bytes for languageCode to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setMaterials(int index, String value)
public Product.Builder setMaterials(int index, String value)
The material of the product. For example, "leather", "wooden". A maximum of 20 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property material. Schema.org property Product.material.
repeated string materials = 27;
Name | Description |
index | int The index to set the value at. |
value | String The materials to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setName(String value)
public Product.Builder setName(String value)
Immutable. Full resource name of the product, such as
projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id
.
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
Name | Description |
value | String The name to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setNameBytes(ByteString value)
public Product.Builder setNameBytes(ByteString value)
Immutable. Full resource name of the product, such as
projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id
.
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
Name | Description |
value | ByteString The bytes for name to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setPatterns(int index, String value)
public Product.Builder setPatterns(int index, String value)
The pattern or graphic print of the product. For example, "striped", "polka dot", "paisley". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property pattern. Schema.org property Product.pattern.
repeated string patterns = 28;
Name | Description |
index | int The index to set the value at. |
value | String The patterns to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setPriceInfo(PriceInfo value)
public Product.Builder setPriceInfo(PriceInfo value)
Product price and cost information. Corresponding properties: Google Merchant Center property price.
.google.cloud.retail.v2.PriceInfo price_info = 14;
Name | Description |
value | PriceInfo |
Type | Description |
Product.Builder |
setPriceInfo(PriceInfo.Builder builderForValue)
public Product.Builder setPriceInfo(PriceInfo.Builder builderForValue)
Product price and cost information. Corresponding properties: Google Merchant Center property price.
.google.cloud.retail.v2.PriceInfo price_info = 14;
Name | Description |
builderForValue | PriceInfo.Builder |
Type | Description |
Product.Builder |
setPrimaryProductId(String value)
public Product.Builder setPrimaryProductId(String value)
Variant group identifier. Must be an id, with the same parent branch with this product. Otherwise, an error is thrown. For Type.PRIMARY Products, this field can only be empty or set to the same value as id. For VARIANT Products, this field cannot be empty. A maximum of 2,000 products are allowed to share the same Type.PRIMARY Product. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property item_group_id. Schema.org property Product.inProductGroupWithID.
string primary_product_id = 4;
Name | Description |
value | String The primaryProductId to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setPrimaryProductIdBytes(ByteString value)
public Product.Builder setPrimaryProductIdBytes(ByteString value)
Variant group identifier. Must be an id, with the same parent branch with this product. Otherwise, an error is thrown. For Type.PRIMARY Products, this field can only be empty or set to the same value as id. For VARIANT Products, this field cannot be empty. A maximum of 2,000 products are allowed to share the same Type.PRIMARY Product. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property item_group_id. Schema.org property Product.inProductGroupWithID.
string primary_product_id = 4;
Name | Description |
value | ByteString The bytes for primaryProductId to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setPromotions(int index, Promotion value)
public Product.Builder setPromotions(int index, Promotion value)
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Name | Description |
index | int |
value | Promotion |
Type | Description |
Product.Builder |
setPromotions(int index, Promotion.Builder builderForValue)
public Product.Builder setPromotions(int index, Promotion.Builder builderForValue)
The promotions applied to the product. A maximum of 10 values are allowed per Product. Only Promotion.promotion_id will be used, other fields will be ignored if set.
repeated .google.cloud.retail.v2.Promotion promotions = 34;
Name | Description |
index | int |
builderForValue | Promotion.Builder |
Type | Description |
Product.Builder |
setPublishTime(Timestamp value)
public Product.Builder setPublishTime(Timestamp value)
The timestamp when the product is published by the retailer for the first time, which indicates the freshness of the products. Note that this field is different from available_time, given it purely describes product freshness regardless of when it is available on search and recommendation.
.google.protobuf.Timestamp publish_time = 33;
Name | Description |
value | Timestamp |
Type | Description |
Product.Builder |
setPublishTime(Timestamp.Builder builderForValue)
public Product.Builder setPublishTime(Timestamp.Builder builderForValue)
The timestamp when the product is published by the retailer for the first time, which indicates the freshness of the products. Note that this field is different from available_time, given it purely describes product freshness regardless of when it is available on search and recommendation.
.google.protobuf.Timestamp publish_time = 33;
Name | Description |
builderForValue | Builder |
Type | Description |
Product.Builder |
setRating(Rating value)
public Product.Builder setRating(Rating value)
The rating of this product.
.google.cloud.retail.v2.Rating rating = 15;
Name | Description |
value | Rating |
Type | Description |
Product.Builder |
setRating(Rating.Builder builderForValue)
public Product.Builder setRating(Rating.Builder builderForValue)
The rating of this product.
.google.cloud.retail.v2.Rating rating = 15;
Name | Description |
builderForValue | Rating.Builder |
Type | Description |
Product.Builder |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public Product.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Name | Description |
field | FieldDescriptor |
index | int |
value | Object |
Type | Description |
Product.Builder |
setRetrievableFields(FieldMask value)
public Product.Builder setRetrievableFields(FieldMask value)
Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types:
- audience
- availability
- brands
- color_info
- conditions
- gtin
- materials
- name
- patterns
- price_info
- rating
- sizes
- title
- uri Supported fields only for Type.PRIMARY and Type.COLLECTION:
- categories
- description
- images Supported fields only for Type.VARIANT:
- Only the first image in images To mark attributes as retrievable, include paths of the form "attributes.key" where "key" is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default:
- name For Type.VARIANT, the following fields are always returned in by default:
- name
- color_info The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse can increase response payload size and serving latency.
.google.protobuf.FieldMask retrievable_fields = 30;
Name | Description |
value | FieldMask |
Type | Description |
Product.Builder |
setRetrievableFields(FieldMask.Builder builderForValue)
public Product.Builder setRetrievableFields(FieldMask.Builder builderForValue)
Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types:
- audience
- availability
- brands
- color_info
- conditions
- gtin
- materials
- name
- patterns
- price_info
- rating
- sizes
- title
- uri Supported fields only for Type.PRIMARY and Type.COLLECTION:
- categories
- description
- images Supported fields only for Type.VARIANT:
- Only the first image in images To mark attributes as retrievable, include paths of the form "attributes.key" where "key" is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default:
- name For Type.VARIANT, the following fields are always returned in by default:
- name
- color_info The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse can increase response payload size and serving latency.
.google.protobuf.FieldMask retrievable_fields = 30;
Name | Description |
builderForValue | Builder |
Type | Description |
Product.Builder |
setSizes(int index, String value)
public Product.Builder setSizes(int index, String value)
The size of the product. To represent different size systems or size types, consider using this format: [[[size_system:]size_type:]size_value]. For example, in "US:MENS:M", "US" represents size system; "MENS" represents size type; "M" represents size value. In "GIRLS:27", size system is empty; "GIRLS" represents size type; "27" represents size value. In "32 inches", both size system and size type are empty, while size value is "32 inches". A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property size, size_type, and size_system. Schema.org property Product.size.
repeated string sizes = 26;
Name | Description |
index | int The index to set the value at. |
value | String The sizes to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setTags(int index, String value)
public Product.Builder setTags(int index, String value)
Custom tags associated with the product. At most 250 values are allowed per Product. This value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. This tag can be used for filtering recommendation results by passing the tag as part of the PredictRequest.filter. Corresponding properties: Google Merchant Center property custom_label_0\u20134.
repeated string tags = 13;
Name | Description |
index | int The index to set the value at. |
value | String The tags to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setTitle(String value)
public Product.Builder setTitle(String value)
Required. Product title. This field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property title. Schema.org property Product.name.
string title = 8 [(.google.api.field_behavior) = REQUIRED];
Name | Description |
value | String The title to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setTitleBytes(ByteString value)
public Product.Builder setTitleBytes(ByteString value)
Required. Product title. This field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property title. Schema.org property Product.name.
string title = 8 [(.google.api.field_behavior) = REQUIRED];
Name | Description |
value | ByteString The bytes for title to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setTtl(Duration value)
public Product.Builder setTtl(Duration value)
Input only. The TTL (time to live) of the product. If it is set, it must be a non-negative value, and expire_time is set as current timestamp plus ttl. The derived expire_time is returned in the output and ttl is left blank when retrieving the Product. If it is set, the product is not available for SearchService.Search after current timestamp plus ttl. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts.
.google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY];
Name | Description |
value | Duration |
Type | Description |
Product.Builder |
setTtl(Duration.Builder builderForValue)
public Product.Builder setTtl(Duration.Builder builderForValue)
Input only. The TTL (time to live) of the product. If it is set, it must be a non-negative value, and expire_time is set as current timestamp plus ttl. The derived expire_time is returned in the output and ttl is left blank when retrieving the Product. If it is set, the product is not available for SearchService.Search after current timestamp plus ttl. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts.
.google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY];
Name | Description |
builderForValue | Builder |
Type | Description |
Product.Builder |
setType(Product.Type value)
public Product.Builder setType(Product.Type value)
Immutable. The type of the product. Default to Catalog.product_level_config.ingestion_product_type if unset.
.google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE];
Name | Description |
value | Product.Type The type to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setTypeValue(int value)
public Product.Builder setTypeValue(int value)
Immutable. The type of the product. Default to Catalog.product_level_config.ingestion_product_type if unset.
.google.cloud.retail.v2.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE];
Name | Description |
value | int The enum numeric value on the wire for type to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setUnknownFields(UnknownFieldSet unknownFields)
public final Product.Builder setUnknownFields(UnknownFieldSet unknownFields)
Name | Description |
unknownFields | UnknownFieldSet |
Type | Description |
Product.Builder |
setUri(String value)
public Product.Builder setUri(String value)
Canonical URL directly linking to the product detail page. It is strongly recommended to provide a valid uri for the product, otherwise the service performance could be significantly degraded. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property link. Schema.org property Offer.url.
string uri = 22;
Name | Description |
value | String The uri to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setUriBytes(ByteString value)
public Product.Builder setUriBytes(ByteString value)
Canonical URL directly linking to the product detail page. It is strongly recommended to provide a valid uri for the product, otherwise the service performance could be significantly degraded. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property link. Schema.org property Offer.url.
string uri = 22;
Name | Description |
value | ByteString The bytes for uri to set. |
Type | Description |
Product.Builder | This builder for chaining. |
setVariants(int index, Product value)
public Product.Builder setVariants(int index, Product value)
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Name | Description |
index | int |
value | Product |
Type | Description |
Product.Builder |
setVariants(int index, Product.Builder builderForValue)
public Product.Builder setVariants(int index, Product.Builder builderForValue)
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
repeated .google.cloud.retail.v2.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY];
Name | Description |
index | int |
builderForValue | Product.Builder |
Type | Description |
Product.Builder |