Struct gapi_grpc::google::cloud::retail::v2beta::Product[][src]

pub struct Product {
    pub name: String,
    pub id: String,
    pub type: i32,
    pub primary_product_id: String,
    pub categories: Vec<String>,
    pub title: String,
    pub description: String,
    pub attributes: HashMap<String, CustomAttribute>,
    pub tags: Vec<String>,
    pub price_info: Option<PriceInfo>,
    pub available_time: Option<Timestamp>,
    pub availability: i32,
    pub available_quantity: Option<i32>,
    pub uri: String,
    pub images: Vec<Image>,
}

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

Fields

name: String

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: String

Immutable. [Product][google.cloud.retail.v2beta.Product] identifier, which is the final component of [name][google.cloud.retail.v2beta.Product.name]. For example, this field is “id_1”, if [name][google.cloud.retail.v2beta.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.

type: i32

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

primary_product_id: String

Variant group identifier. Must be an [id][google.cloud.retail.v2beta.Product.id], with the same parent branch with this product. Otherwise, an error is thrown.

For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] [Product][google.cloud.retail.v2beta.Product]s, this field can only be empty or set to the same value as [id][google.cloud.retail.v2beta.Product.id].

For VARIANT [Product][google.cloud.retail.v2beta.Product]s, this field cannot be empty. A maximum of 2,000 products are allowed to share the same [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] [Product][google.cloud.retail.v2beta.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: Vec<String>

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.v2beta.Product.Type.PRIMARY] [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT error is returned.

At most 250 values are allowed per [Product][google.cloud.retail.v2beta.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: String

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: String

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: HashMap<String, CustomAttribute>

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: Vec<String>

Custom tags associated with the product.

At most 250 values are allowed per [Product][google.cloud.retail.v2beta.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.v2beta.PredictRequest.filter].

Google Merchant Center property custom_label_0–4.

price_info: Option<PriceInfo>

Product price and cost information.

Google Merchant Center property price.

available_time: Option<Timestamp>

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

availability: i32

The online availability of the [Product][google.cloud.retail.v2beta.Product]. Default to [Availability.IN_STOCK][google.cloud.retail.v2beta.Product.Availability.IN_STOCK].

Google Merchant Center Property availability. Schema.org Property Offer.availability.

available_quantity: Option<i32>

The available quantity of the item.

uri: String

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: Vec<Image>

Product images for the product.

A maximum of 300 images are allowed.

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

Implementations

impl Product[src]

pub fn type(&self) -> Type[src]

Returns the enum value of type, or the default if the field is set to an invalid enum value.

pub fn set_type(&mut self, value: Type)[src]

Sets type to the provided enum value.

pub fn availability(&self) -> Availability[src]

Returns the enum value of availability, or the default if the field is set to an invalid enum value.

pub fn set_availability(&mut self, value: Availability)[src]

Sets availability to the provided enum value.

Trait Implementations

impl Clone for Product[src]

impl Debug for Product[src]

impl Default for Product[src]

impl Message for Product[src]

impl PartialEq<Product> for Product[src]

impl StructuralPartialEq for Product[src]

Auto Trait Implementations

impl RefUnwindSafe for Product

impl Send for Product

impl Sync for Product

impl Unpin for Product

impl UnwindSafe for Product

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> WithSubscriber for T[src]