Product
(
mapping
=
None
,
*
,
ignore_unknown_fields
=
False
,
**
kwargs
)
Product captures all metadata information of items to be recommended or searched.
Attributes
name
str
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".id
str
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.
Google Merchant Center property id
__.
Schema.org Property Product.sku
__.type_
google.cloud.retail_v2.types.Product.Type
Immutable. The type of the product. This field is output-only.
primary_product_id
str
Variant group identifier. Must be an id , with the same parent branch with this product. Otherwise, an error is thrown. For Type.PRIMARY Product s, this field can only be empty or set to the same value as id . For VARIANT Product s, 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. Google Merchant Center Property
item_group_id
__.
Schema.org Property Product.inProductGroupWithID
__.
This field must be enabled before it can be used. `Learn
more `__.categories
Sequence[str]
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. Google Merchant Center property
google_product_category
__.
Schema.org property [Product.category]
(https://schema.org/category).title
str
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
__.description
str
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
__.attributes
Sequence[ google.cloud.retail_v2.types.Product.AttributesEntry
]
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.tags
Sequence[str]
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 . Google Merchant Center property
custom_label_0–4
__.price_info
google.cloud.retail_v2.types.PriceInfo
Product price and cost information. Google Merchant Center property
price
__.available_time
google.protobuf.timestamp_pb2.Timestamp
The timestamp when this Product becomes available recommendation and search.
availability
google.cloud.retail_v2.types.Product.Availability
The online availability of the Product . Default to Availability.IN_STOCK . Google Merchant Center Property
availability
__.
Schema.org Property Offer.availability
__.available_quantity
google.protobuf.wrappers_pb2.Int32Value
The available quantity of the item.
uri
str
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
__.images
Sequence[ google.cloud.retail_v2.types.Image
]
Product images for the product. A maximum of 300 images are allowed. Google Merchant Center property
image_link
__.
Schema.org property Product.image
__.Classes
AttributesEntry
AttributesEntry
(
mapping
=
None
,
*
,
ignore_unknown_fields
=
False
,
**
kwargs
)
The abstract base class for a message.
kwargs
dict
Keys and values corresponding to the fields of the message.
mapping
Union[dict, .Message
]
A dictionary or message to be used to determine the values for this message.
ignore_unknown_fields
Optional(bool)
If True, do not raise errors for unknown fields. Only applied if mapping
is a mapping type or there are keyword parameters.
Availability
Availability
(
value
)
Product availability. If this field is unspecified, the product is assumed to be in stock.
Type
Type
(
value
)
The type of this product.