Struct google_api_proto::google::cloud::billing::v1::PricingExpression
source · pub struct PricingExpression {
pub usage_unit: String,
pub display_quantity: f64,
pub tiered_rates: Vec<TierRate>,
pub usage_unit_description: String,
pub base_unit: String,
pub base_unit_description: String,
pub base_unit_conversion_factor: f64,
}
Expand description
Expresses a mathematical pricing formula. For Example:-
usage_unit: GBy
tiered_rates:
\[start_usage_amount: 20, unit_price: $10\]
\[start_usage_amount: 100, unit_price: $5\]
The above expresses a pricing formula where the first 20GB is free, the next 80GB is priced at $10 per GB followed by $5 per GB for additional usage.
Fields§
§usage_unit: String
The short hand for unit of usage this pricing is specified in. Example: usage_unit of “GiBy” means that usage is specified in “Gibi Byte”.
display_quantity: f64
The recommended quantity of units for displaying pricing info. When displaying pricing info it is recommended to display: (unit_price * display_quantity) per display_quantity usage_unit. This field does not affect the pricing formula and is for display purposes only. Example: If the unit_price is “0.0001 USD”, the usage_unit is “GB” and the display_quantity is “1000” then the recommended way of displaying the pricing info is “0.10 USD per 1000 GB”
tiered_rates: Vec<TierRate>
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
usage_unit_description: String
The unit of usage in human readable form. Example: “gibi byte”.
base_unit: String
The base unit for the SKU which is the unit used in usage exports. Example: “By”
base_unit_description: String
The base unit in human readable form. Example: “byte”.
base_unit_conversion_factor: f64
Conversion factor for converting from price per usage_unit to price per base_unit, and start_usage_amount to start_usage_amount in base_unit. unit_price / base_unit_conversion_factor = price per base_unit. start_usage_amount * base_unit_conversion_factor = start_usage_amount in base_unit.
Trait Implementations§
source§impl Clone for PricingExpression
impl Clone for PricingExpression
source§fn clone(&self) -> PricingExpression
fn clone(&self) -> PricingExpression
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PricingExpression
impl Debug for PricingExpression
source§impl Default for PricingExpression
impl Default for PricingExpression
source§impl Message for PricingExpression
impl Message for PricingExpression
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 PricingExpression
impl PartialEq for PricingExpression
source§fn eq(&self, other: &PricingExpression) -> bool
fn eq(&self, other: &PricingExpression) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for PricingExpression
Auto Trait Implementations§
impl Freeze for PricingExpression
impl RefUnwindSafe for PricingExpression
impl Send for PricingExpression
impl Sync for PricingExpression
impl Unpin for PricingExpression
impl UnwindSafe for PricingExpression
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