pub struct Filter {
pub projects: Vec<String>,
pub resource_ancestors: Vec<String>,
pub credit_types: Vec<String>,
pub credit_types_treatment: i32,
pub services: Vec<String>,
pub subaccounts: Vec<String>,
pub labels: BTreeMap<String, ListValue>,
pub usage_period: Option<UsagePeriod>,
}
Expand description
A filter for a budget, limiting the scope of the cost to calculate.
Fields§
§projects: Vec<String>
Optional. A set of projects of the form projects/{project}
,
specifying that usage from only this set of projects should be
included in the budget. If omitted, the report includes all usage for
the billing account, regardless of which project the usage occurred on.
resource_ancestors: Vec<String>
Optional. A set of folder and organization names of the form
folders/{folderId}
or organizations/{organizationId}
, specifying that
usage from only this set of folders and organizations should be included in
the budget. If omitted, the budget includes all usage that the billing
account pays for. If the folder or organization contains projects that are
paid for by a different Cloud Billing account, the budget doesn’t apply
to those projects.
credit_types: Vec<String>
Optional. If [Filter.credit_types_treatment][google.cloud.billing.budgets.v1.Filter.credit_types_treatment] is INCLUDE_SPECIFIED_CREDITS, this is a list of credit types to be subtracted from gross cost to determine the spend for threshold calculations. See a list of acceptable credit type values.
If [Filter.credit_types_treatment][google.cloud.billing.budgets.v1.Filter.credit_types_treatment] is not INCLUDE_SPECIFIED_CREDITS, this field must be empty.
credit_types_treatment: i32
Optional. If not set, default behavior is INCLUDE_ALL_CREDITS
.
services: Vec<String>
Optional. A set of services of the form services/{service_id}
,
specifying that usage from only this set of services should be
included in the budget. If omitted, the report includes usage for
all the services.
The service names are available through the Catalog API:
https://cloud.google.com/billing/v1/how-tos/catalog-api.
subaccounts: Vec<String>
Optional. A set of subaccounts of the form billingAccounts/{account_id}
,
specifying that usage from only this set of subaccounts should be included
in the budget. If a subaccount is set to the name of the parent account,
usage from the parent account is included. If the field is omitted,
the report includes usage from the parent account and all subaccounts,
if they exist.
labels: BTreeMap<String, ListValue>
Optional. A single label and value pair specifying that usage from only this set of labeled resources should be included in the budget. If omitted, the report includes all labeled and unlabeled usage.
An object containing a single "key": value
pair. Example: { "name": "wrench" }
.
Currently, multiple entries or multiple values per entry are not allowed.
usage_period: Option<UsagePeriod>
Multiple options to choose the budget’s time period, specifying that only
usage that occurs during this time period should be included in the budget.
If not set, the usage_period
defaults to CalendarPeriod.MONTH.
Implementations§
source§impl Filter
impl Filter
sourcepub fn credit_types_treatment(&self) -> CreditTypesTreatment
pub fn credit_types_treatment(&self) -> CreditTypesTreatment
Returns the enum value of credit_types_treatment
, or the default if the field is set to an invalid enum value.
sourcepub fn set_credit_types_treatment(&mut self, value: CreditTypesTreatment)
pub fn set_credit_types_treatment(&mut self, value: CreditTypesTreatment)
Sets credit_types_treatment
to the provided enum value.
Trait Implementations§
source§impl Message for Filter
impl Message for Filter
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
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<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
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<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
. Read moresource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
.source§impl PartialEq for Filter
impl PartialEq for Filter
impl StructuralPartialEq for Filter
Auto Trait Implementations§
impl Freeze for Filter
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnwindSafe for Filter
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