Struct gapi_grpc::google::cloud::retail::v2beta::Product [−][src]
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.
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]
fn encode_raw<B>(&self, buf: &mut B) where
B: BufMut,
[src]
B: BufMut,
fn merge_field<B>(
&mut self,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext
) -> Result<(), DecodeError> where
B: Buf,
[src]
&mut self,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext
) -> Result<(), DecodeError> where
B: Buf,
fn encoded_len(&self) -> usize
[src]
fn clear(&mut self)
[src]
pub fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
[src]
B: BufMut,
pub fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
[src]
B: BufMut,
pub fn decode<B>(buf: B) -> Result<Self, DecodeError> where
Self: Default,
B: Buf,
[src]
Self: Default,
B: Buf,
pub fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
Self: Default,
B: Buf,
[src]
Self: Default,
B: Buf,
pub fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
[src]
B: Buf,
pub fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
[src]
B: Buf,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoRequest<T> for T
[src]
pub fn into_request(self) -> Request<T>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,