pub struct ProductCatalogItem {
pub costs: BTreeMap<String, f32>,
pub currency_code: String,
pub stock_state: i32,
pub available_quantity: i64,
pub canonical_product_uri: String,
pub images: Vec<Image>,
pub price: Option<Price>,
}
Expand description
ProductCatalogItem captures item metadata specific to retail products.
Fields§
§costs: BTreeMap<String, f32>
Optional. A map to pass the costs associated with the product.
For example: {“manufacturing”: 45.5} The profit of selling this item is computed like so:
- If ‘exactPrice’ is provided, profit = displayPrice - sum(costs)
- If ‘priceRange’ is provided, profit = minPrice - sum(costs)
currency_code: String
Optional. Only required if the price is set. Currency code for price/costs. Use three-character ISO-4217 code.
stock_state: i32
Optional. Online stock state of the catalog item. Default is IN_STOCK
.
available_quantity: i64
Optional. The available quantity of the item.
canonical_product_uri: String
Optional. Canonical URL directly linking to the item detail page with a length limit of 5 KiB..
images: Vec<Image>
Optional. Product images for the catalog item.
price: Option<Price>
Product price. Only one of ‘exactPrice’/‘priceRange’ can be provided.
Implementations§
source§impl ProductCatalogItem
impl ProductCatalogItem
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 ProductCatalogItem
impl Clone for ProductCatalogItem
source§fn clone(&self) -> ProductCatalogItem
fn clone(&self) -> ProductCatalogItem
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ProductCatalogItem
impl Debug for ProductCatalogItem
source§impl Default for ProductCatalogItem
impl Default for ProductCatalogItem
source§impl Message for ProductCatalogItem
impl Message for ProductCatalogItem
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 ProductCatalogItem
impl PartialEq for ProductCatalogItem
source§fn eq(&self, other: &ProductCatalogItem) -> bool
fn eq(&self, other: &ProductCatalogItem) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ProductCatalogItem
Auto Trait Implementations§
impl Freeze for ProductCatalogItem
impl RefUnwindSafe for ProductCatalogItem
impl Send for ProductCatalogItem
impl Sync for ProductCatalogItem
impl Unpin for ProductCatalogItem
impl UnwindSafe for ProductCatalogItem
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