pub struct PriceInfo {
pub currency_code: String,
pub price: f32,
pub original_price: f32,
pub cost: f32,
pub price_effective_time: Option<Timestamp>,
pub price_expire_time: Option<Timestamp>,
pub price_range: Option<PriceRange>,
}
Expand description
The price information of a [Product][google.cloud.retail.v2.Product].
Fields§
§currency_code: String
The 3-letter currency code defined in ISO 4217.
If this field is an unrecognizable currency code, an INVALID_ARGUMENT error is returned.
The [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] [Product][google.cloud.retail.v2.Product]s with the same [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] must share the same [currency_code][google.cloud.retail.v2.PriceInfo.currency_code]. Otherwise, a FAILED_PRECONDITION error is returned.
price: f32
Price of the product.
Google Merchant Center property price. Schema.org property Offer.price.
original_price: f32
Price of the product without any discount. If zero, by default set to be the [price][google.cloud.retail.v2.PriceInfo.price]. If set, [original_price][google.cloud.retail.v2.PriceInfo.original_price] should be greater than or equal to [price][google.cloud.retail.v2.PriceInfo.price], otherwise an INVALID_ARGUMENT error is thrown.
cost: f32
The costs associated with the sale of a particular product. Used for gross profit reporting.
- Profit = [price][google.cloud.retail.v2.PriceInfo.price] - [cost][google.cloud.retail.v2.PriceInfo.cost]
Google Merchant Center property cost_of_goods_sold.
price_effective_time: Option<Timestamp>
The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] starts to be effective. This can be set as a future timestamp, and the [price][google.cloud.retail.v2.PriceInfo.price] is only used for search after [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time]. If so, the [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] is used before [price_effective_time][google.cloud.retail.v2.PriceInfo.price_effective_time].
Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always effective because it will cause additional latency during search.
price_expire_time: Option<Timestamp>
The timestamp when the [price][google.cloud.retail.v2.PriceInfo.price] stops to be effective. The [price][google.cloud.retail.v2.PriceInfo.price] is used for search before [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time]. If this field is set, the [original_price][google.cloud.retail.v2.PriceInfo.original_price] must be set and [original_price][google.cloud.retail.v2.PriceInfo.original_price] is used after [price_expire_time][google.cloud.retail.v2.PriceInfo.price_expire_time].
Do not set if [price][google.cloud.retail.v2.PriceInfo.price] is always effective because it will cause additional latency during search.
price_range: Option<PriceRange>
Output only. The price range of all the child [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] [Product][google.cloud.retail.v2.Product]s grouped together on the [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] [Product][google.cloud.retail.v2.Product]. Only populated for [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] [Product][google.cloud.retail.v2.Product]s.
Note: This field is OUTPUT_ONLY for [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]. Do not set this field in API requests.
Trait Implementations§
source§impl Message for PriceInfo
impl Message for PriceInfo
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 PriceInfo
impl PartialEq for PriceInfo
impl StructuralPartialEq for PriceInfo
Auto Trait Implementations§
impl Freeze for PriceInfo
impl RefUnwindSafe for PriceInfo
impl Send for PriceInfo
impl Sync for PriceInfo
impl Unpin for PriceInfo
impl UnwindSafe for PriceInfo
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