Struct google_api_proto::google::cloud::recommendationengine::v1beta1::ProductDetail
source · pub struct ProductDetail {
pub id: String,
pub currency_code: String,
pub original_price: f32,
pub display_price: f32,
pub stock_state: i32,
pub quantity: i32,
pub available_quantity: i32,
pub item_attributes: Option<FeatureMap>,
}
Expand description
Detailed product information associated with a user event.
Fields§
§id: String
Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.
currency_code: String
Optional. Currency code for price/costs. Use three-character ISO-4217 code. Required only if originalPrice or displayPrice is set.
original_price: f32
Optional. Original price of the product. If provided, this will override the original price in Catalog for this product.
display_price: f32
Optional. Display price of the product (e.g. discounted price). If provided, this will override the display price in Catalog for this product.
stock_state: i32
Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event.
quantity: i32
Optional. Quantity of the product associated with the user event. For
example, this field will be 2 if two products are added to the shopping
cart for add-to-cart
event. Required for add-to-cart
, add-to-list
,
remove-from-cart
, checkout-start
, purchase-complete
, refund
event
types.
available_quantity: i32
Optional. Quantity of the products in stock when a user event happens.
Optional. If provided, this overrides the available quantity in Catalog for
this event. and can only be set if stock_status
is set to IN_STOCK
.
Note that if an item is out of stock, you must set the stock_state
field
to be OUT_OF_STOCK
. Leaving this field unspecified / as zero is not
sufficient to mark the item out of stock.
item_attributes: Option<FeatureMap>
Optional. Extra features associated with a product in the user event.
Implementations§
source§impl ProductDetail
impl ProductDetail
sourcepub fn stock_state(&self) -> StockState
pub fn stock_state(&self) -> StockState
Returns the enum value of stock_state
, or the default if the field is set to an invalid enum value.
sourcepub fn set_stock_state(&mut self, value: StockState)
pub fn set_stock_state(&mut self, value: StockState)
Sets stock_state
to the provided enum value.
Trait Implementations§
source§impl Clone for ProductDetail
impl Clone for ProductDetail
source§fn clone(&self) -> ProductDetail
fn clone(&self) -> ProductDetail
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ProductDetail
impl Debug for ProductDetail
source§impl Default for ProductDetail
impl Default for ProductDetail
source§impl Message for ProductDetail
impl Message for ProductDetail
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for ProductDetail
impl PartialEq for ProductDetail
source§fn eq(&self, other: &ProductDetail) -> bool
fn eq(&self, other: &ProductDetail) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ProductDetail
Auto Trait Implementations§
impl Freeze for ProductDetail
impl RefUnwindSafe for ProductDetail
impl Send for ProductDetail
impl Sync for ProductDetail
impl Unpin for ProductDetail
impl UnwindSafe for ProductDetail
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request