Class Product
Product captures all metadata information of items to be recommended or searched.
Inheritance
Inherited Members
Namespace: Google.Cloud.Retail.V2
Assembly: Google.Cloud.Retail.V2.dll
Syntax
public sealed class Product : IMessage<Product>, IEquatable<Product>, IDeepCloneable<Product>, IBufferMessage, IMessage
Constructors
Product()
Declaration
public Product()
Product(Product)
Declaration
public Product(Product other)
Parameters
Type | Name | Description |
---|---|---|
Product | other |
Properties
Attributes
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]}
}
.
A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT error is returned.
The key must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
Declaration
public MapField<string, CustomAttribute> Attributes { get; }
Property Value
Type | Description |
---|---|
MapField<System.String, CustomAttribute> |
Availability
The online availability of the [Product][google.cloud.retail.v2.Product]. Default to [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK].
Google Merchant Center Property availability. Schema.org Property Offer.availability.
Declaration
public Product.Types.Availability Availability { get; set; }
Property Value
Type | Description |
---|---|
Product.Types.Availability |
AvailableQuantity
The available quantity of the item.
Declaration
public int? AvailableQuantity { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
AvailableTime
The timestamp when this [Product][google.cloud.retail.v2.Product] becomes available recommendation and search.
Declaration
public Timestamp AvailableTime { get; set; }
Property Value
Type | Description |
---|---|
Timestamp |
Categories
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][google.cloud.retail.v2.Product.Type.PRIMARY] [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT error is returned.
At most 250 values are allowed per [Product][google.cloud.retail.v2.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.
Google Merchant Center property [google_product_category][mc_google_product_category]. Schema.org property Product.category.
[mc_google_product_category]: https://support.google.com/merchants/answer/6324436
Declaration
public RepeatedField<string> Categories { get; }
Property Value
Type | Description |
---|---|
RepeatedField<System.String> |
Description
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.
Google Merchant Center property description. schema.org property Product.description.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Id
Immutable. [Product][google.cloud.retail.v2.Product] identifier, which is the final component of [name][google.cloud.retail.v2.Product.name]. For example, this field is "id_1", if [name][google.cloud.retail.v2.Product.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.
Google Merchant Center property id. Schema.org Property Product.sku.
Declaration
public string Id { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Images
Product images for the product.
A maximum of 300 images are allowed.
Google Merchant Center property image_link. Schema.org property Product.image.
Declaration
public RepeatedField<Image> Images { get; }
Property Value
Type | Description |
---|---|
RepeatedField<Image> |
Name
Immutable. Full resource name of the product, such as "projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id".
The branch ID must be "default_branch".
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PriceInfo
Product price and cost information.
Google Merchant Center property price.
Declaration
public PriceInfo PriceInfo { get; set; }
Property Value
Type | Description |
---|---|
PriceInfo |
PrimaryProductId
Variant group identifier. Must be an [id][google.cloud.retail.v2.Product.id], with the same parent branch with this product. Otherwise, an error is thrown.
For [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] [Product][google.cloud.retail.v2.Product]s, this field can only be empty or set to the same value as [id][google.cloud.retail.v2.Product.id].
For VARIANT [Product][google.cloud.retail.v2.Product]s, this field cannot be empty. A maximum of 2,000 products are allowed to share the same [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT error is returned.
Google Merchant Center Property item_group_id. Schema.org Property Product.inProductGroupWithID.
This field must be enabled before it can be used. Learn more.
Declaration
public string PrimaryProductId { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ProductName
ProductName-typed view over the Name resource name property.
Declaration
public ProductName ProductName { get; set; }
Property Value
Type | Description |
---|---|
ProductName |
Tags
Custom tags associated with the product.
At most 250 values are allowed per [Product][google.cloud.retail.v2.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][google.cloud.retail.v2.PredictRequest.filter].
Google Merchant Center property custom_label_0–4.
Declaration
public RepeatedField<string> Tags { get; }
Property Value
Type | Description |
---|---|
RepeatedField<System.String> |
Title
Required. Product title.
This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.
Google Merchant Center property title. Schema.org property Product.name.
Declaration
public string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Type
Immutable. The type of the product. This field is output-only.
Declaration
public Product.Types.Type Type { get; set; }
Property Value
Type | Description |
---|---|
Product.Types.Type |
Uri
Canonical URL directly linking to the product detail page.
This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
Google Merchant Center property link. Schema.org property Offer.url.
Declaration
public string Uri { get; set; }
Property Value
Type | Description |
---|---|
System.String |