Class Product (1.0.0)

public sealed class Product : IMessage<Product>, IEquatable<Product>, IDeepCloneable<Product>, IBufferMessage, IMessage

Product captures all metadata information of items to be recommended or searched.

Inheritance

System.Object > Product

Implements

Google.Protobuf.IMessage<Product>, System.IEquatable<Product>, Google.Protobuf.IDeepCloneable<Product>, Google.Protobuf.IBufferMessage, Google.Protobuf.IMessage

Namespace

Google.Cloud.Retail.V2

Assembly

Google.Cloud.Retail.V2.dll

Constructors

Product()

public Product()

Product(Product)

public Product(Product other)
Parameter
NameDescription
otherProduct

Properties

Attributes

public MapField<string, CustomAttribute> Attributes { get; }

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: { &quot;vendor&quot;: {&quot;text&quot;: [&quot;vendor123&quot;, &quot;vendor456&quot;]}, &quot;lengths_cm&quot;: {&quot;numbers&quot;:[2.3, 15.4]}, &quot;heights_cm&quot;: {&quot;numbers&quot;:[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.

Property Value
TypeDescription
Google.Protobuf.Collections.MapField<System.String, CustomAttribute>

Availability

public Product.Types.Availability Availability { get; set; }

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.

Property Value
TypeDescription
Product.Types.Availability

AvailableQuantity

public int? AvailableQuantity { get; set; }

The available quantity of the item.

Property Value
TypeDescription
System.Nullable<System.Int32>

AvailableTime

public Timestamp AvailableTime { get; set; }

The timestamp when this [Product][google.cloud.retail.v2.Product] becomes available recommendation and search.

Property Value
TypeDescription
Google.Protobuf.WellKnownTypes.Timestamp

Categories

public RepeatedField<string> Categories { get; }

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

Property Value
TypeDescription
Google.Protobuf.Collections.RepeatedField<System.String>

Description

public string Description { get; set; }

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.

Property Value
TypeDescription
System.String

Id

public string Id { get; set; }

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.

Property Value
TypeDescription
System.String

Images

public RepeatedField<Image> Images { get; }

Product images for the product.

A maximum of 300 images are allowed.

Google Merchant Center property image_link. Schema.org property Product.image.

Property Value
TypeDescription
Google.Protobuf.Collections.RepeatedField<Image>

Name

public string Name { get; set; }

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".

Property Value
TypeDescription
System.String

PriceInfo

public PriceInfo PriceInfo { get; set; }

Product price and cost information.

Google Merchant Center property price.

Property Value
TypeDescription
PriceInfo

PrimaryProductId

public string PrimaryProductId { get; set; }

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.

Property Value
TypeDescription
System.String

ProductName

public ProductName ProductName { get; set; }

ProductName-typed view over the Name resource name property.

Property Value
TypeDescription
ProductName

Tags

public RepeatedField<string> Tags { get; }

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.

Property Value
TypeDescription
Google.Protobuf.Collections.RepeatedField<System.String>

Title

public string Title { get; set; }

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.

Property Value
TypeDescription
System.String

Type

public Product.Types.Type Type { get; set; }

Immutable. The type of the product. This field is output-only.

Property Value
TypeDescription
Product.Types.Type

Uri

public string Uri { get; set; }

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.

Property Value
TypeDescription
System.String