Struct googapis::google::cloud::retail::v2::PriceInfo [−][src]
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](https://support.google.com/merchants/answer/6324371). Schema.org property [Offer.priceSpecification](https://schema.org/priceSpecification).
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].
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](https://support.google.com/merchants/answer/9017895).
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
fn merge_field<B>(
&mut self,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext
) -> Result<(), DecodeError> where
B: Buf,
Returns the encoded length of the message without a length delimiter.
Encodes the message to a buffer. Read more
Encodes the message to a newly allocated buffer.
Encodes the message with a length-delimiter to a buffer. Read more
Encodes the message with a length-delimiter to a newly allocated buffer.
Decodes an instance of the message from a buffer. Read more
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
Self: Default,
B: Buf,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
Self: Default,
B: Buf,
Decodes a length-delimited instance of the message from the buffer.
Decodes an instance of the message from a buffer, and merges it into self
. Read more
Decodes a length-delimited instance of the message from buffer, and
merges it into self
. Read more
Auto Trait Implementations
impl RefUnwindSafe for PriceInfo
impl UnwindSafe for PriceInfo
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more