Struct google_api_proto::google::cloud::discoveryengine::v1beta::TransactionInfo
source · pub struct TransactionInfo {
pub value: Option<f32>,
pub currency: String,
pub transaction_id: String,
pub tax: Option<f32>,
pub cost: Option<f32>,
pub discount_value: Option<f32>,
}
Expand description
A transaction represents the entire purchase transaction.
Fields§
§value: Option<f32>
Required. Total non-zero value associated with the transaction. This value may include shipping, tax, or other adjustments to the total value that you want to include.
currency: String
Required. Currency code. Use three-character ISO-4217 code.
transaction_id: String
The transaction ID with a length limit of 128 characters.
tax: Option<f32>
All the taxes associated with the transaction.
cost: Option<f32>
All the costs associated with the products. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs, such that:
- Profit = [value][google.cloud.discoveryengine.v1beta.TransactionInfo.value] - [tax][google.cloud.discoveryengine.v1beta.TransactionInfo.tax] - [cost][google.cloud.discoveryengine.v1beta.TransactionInfo.cost]
discount_value: Option<f32>
The total discount(s) value applied to this transaction. This figure should be excluded from [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]
For example, if a user paid [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value] amount, then nominal (pre-discount) value of the transaction is the sum of [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value] and [TransactionInfo.discount_value][google.cloud.discoveryengine.v1beta.TransactionInfo.discount_value]
This means that profit is calculated the same way, regardless of the discount value, and that [TransactionInfo.discount_value][google.cloud.discoveryengine.v1beta.TransactionInfo.discount_value] can be larger than [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]:
- Profit = [value][google.cloud.discoveryengine.v1beta.TransactionInfo.value] - [tax][google.cloud.discoveryengine.v1beta.TransactionInfo.tax] - [cost][google.cloud.discoveryengine.v1beta.TransactionInfo.cost]
Implementations§
source§impl TransactionInfo
impl TransactionInfo
sourcepub fn discount_value(&self) -> f32
pub fn discount_value(&self) -> f32
Returns the value of discount_value
, or the default value if discount_value
is unset.
Trait Implementations§
source§impl Clone for TransactionInfo
impl Clone for TransactionInfo
source§fn clone(&self) -> TransactionInfo
fn clone(&self) -> TransactionInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TransactionInfo
impl Debug for TransactionInfo
source§impl Default for TransactionInfo
impl Default for TransactionInfo
source§impl Message for TransactionInfo
impl Message for TransactionInfo
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 TransactionInfo
impl PartialEq for TransactionInfo
source§fn eq(&self, other: &TransactionInfo) -> bool
fn eq(&self, other: &TransactionInfo) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for TransactionInfo
Auto Trait Implementations§
impl Freeze for TransactionInfo
impl RefUnwindSafe for TransactionInfo
impl Send for TransactionInfo
impl Sync for TransactionInfo
impl Unpin for TransactionInfo
impl UnwindSafe for TransactionInfo
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