Struct google_api_proto::google::cloud::billing::budgets::v1::ThresholdRule
source · pub struct ThresholdRule {
pub threshold_percent: f64,
pub spend_basis: i32,
}
Expand description
ThresholdRule contains the definition of a threshold. Threshold rules define the triggering events used to generate a budget notification email. When a threshold is crossed (spend exceeds the specified percentages of the budget), budget alert emails are sent to the email recipients you specify in the NotificationsRule.
Threshold rules also affect the fields included in the JSON data object sent to a Pub/Sub topic.
Threshold rules are required if using email notifications.
Threshold rules are optional if only setting a
pubsubTopic
NotificationsRule,
unless you want your JSON data object to include data about the thresholds
you set.
For more information, see set budget threshold rules and actions.
Fields§
§threshold_percent: f64
Required. Send an alert when this threshold is exceeded. This is a 1.0-based percentage, so 0.5 = 50%. Validation: non-negative number.
spend_basis: i32
Optional. The type of basis used to determine if spend has passed the threshold. Behavior defaults to CURRENT_SPEND if not set.
Implementations§
source§impl ThresholdRule
impl ThresholdRule
sourcepub fn spend_basis(&self) -> Basis
pub fn spend_basis(&self) -> Basis
Returns the enum value of spend_basis
, or the default if the field is set to an invalid enum value.
sourcepub fn set_spend_basis(&mut self, value: Basis)
pub fn set_spend_basis(&mut self, value: Basis)
Sets spend_basis
to the provided enum value.
Trait Implementations§
source§impl Clone for ThresholdRule
impl Clone for ThresholdRule
source§fn clone(&self) -> ThresholdRule
fn clone(&self) -> ThresholdRule
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ThresholdRule
impl Debug for ThresholdRule
source§impl Default for ThresholdRule
impl Default for ThresholdRule
source§impl Message for ThresholdRule
impl Message for ThresholdRule
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 ThresholdRule
impl PartialEq for ThresholdRule
source§fn eq(&self, other: &ThresholdRule) -> bool
fn eq(&self, other: &ThresholdRule) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for ThresholdRule
impl StructuralPartialEq for ThresholdRule
Auto Trait Implementations§
impl Freeze for ThresholdRule
impl RefUnwindSafe for ThresholdRule
impl Send for ThresholdRule
impl Sync for ThresholdRule
impl Unpin for ThresholdRule
impl UnwindSafe for ThresholdRule
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