#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Budget {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub budget_filter: ::core::option::Option<Filter>,
#[prost(message, optional, tag = "4")]
pub amount: ::core::option::Option<BudgetAmount>,
#[prost(message, repeated, tag = "5")]
pub threshold_rules: ::prost::alloc::vec::Vec<ThresholdRule>,
#[prost(message, optional, tag = "6")]
pub notifications_rule: ::core::option::Option<NotificationsRule>,
#[prost(string, tag = "7")]
pub etag: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BudgetAmount {
#[prost(oneof = "budget_amount::BudgetAmount", tags = "1, 2")]
pub budget_amount: ::core::option::Option<budget_amount::BudgetAmount>,
}
pub mod budget_amount {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum BudgetAmount {
#[prost(message, tag = "1")]
SpecifiedAmount(super::super::super::super::super::r#type::Money),
#[prost(message, tag = "2")]
LastPeriodAmount(super::LastPeriodAmount),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LastPeriodAmount {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ThresholdRule {
#[prost(double, tag = "1")]
pub threshold_percent: f64,
#[prost(enumeration = "threshold_rule::Basis", tag = "2")]
pub spend_basis: i32,
}
pub mod threshold_rule {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Basis {
Unspecified = 0,
CurrentSpend = 1,
ForecastedSpend = 2,
}
impl Basis {
pub fn as_str_name(&self) -> &'static str {
match self {
Basis::Unspecified => "BASIS_UNSPECIFIED",
Basis::CurrentSpend => "CURRENT_SPEND",
Basis::ForecastedSpend => "FORECASTED_SPEND",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BASIS_UNSPECIFIED" => Some(Self::Unspecified),
"CURRENT_SPEND" => Some(Self::CurrentSpend),
"FORECASTED_SPEND" => Some(Self::ForecastedSpend),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NotificationsRule {
#[prost(string, tag = "1")]
pub pubsub_topic: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub schema_version: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub monitoring_notification_channels: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
#[prost(bool, tag = "4")]
pub disable_default_iam_recipients: bool,
#[prost(bool, tag = "5")]
pub enable_project_level_recipients: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Filter {
#[prost(string, repeated, tag = "1")]
pub projects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub resource_ancestors: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "7")]
pub credit_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(enumeration = "filter::CreditTypesTreatment", tag = "4")]
pub credit_types_treatment: i32,
#[prost(string, repeated, tag = "3")]
pub services: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "5")]
pub subaccounts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(btree_map = "string, message", tag = "6")]
pub labels: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost_types::ListValue,
>,
#[prost(oneof = "filter::UsagePeriod", tags = "8, 9")]
pub usage_period: ::core::option::Option<filter::UsagePeriod>,
}
pub mod filter {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CreditTypesTreatment {
Unspecified = 0,
IncludeAllCredits = 1,
ExcludeAllCredits = 2,
IncludeSpecifiedCredits = 3,
}
impl CreditTypesTreatment {
pub fn as_str_name(&self) -> &'static str {
match self {
CreditTypesTreatment::Unspecified => "CREDIT_TYPES_TREATMENT_UNSPECIFIED",
CreditTypesTreatment::IncludeAllCredits => "INCLUDE_ALL_CREDITS",
CreditTypesTreatment::ExcludeAllCredits => "EXCLUDE_ALL_CREDITS",
CreditTypesTreatment::IncludeSpecifiedCredits => {
"INCLUDE_SPECIFIED_CREDITS"
}
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CREDIT_TYPES_TREATMENT_UNSPECIFIED" => Some(Self::Unspecified),
"INCLUDE_ALL_CREDITS" => Some(Self::IncludeAllCredits),
"EXCLUDE_ALL_CREDITS" => Some(Self::ExcludeAllCredits),
"INCLUDE_SPECIFIED_CREDITS" => Some(Self::IncludeSpecifiedCredits),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum UsagePeriod {
#[prost(enumeration = "super::CalendarPeriod", tag = "8")]
CalendarPeriod(i32),
#[prost(message, tag = "9")]
CustomPeriod(super::CustomPeriod),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CustomPeriod {
#[prost(message, optional, tag = "1")]
pub start_date: ::core::option::Option<super::super::super::super::r#type::Date>,
#[prost(message, optional, tag = "2")]
pub end_date: ::core::option::Option<super::super::super::super::r#type::Date>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CalendarPeriod {
Unspecified = 0,
Month = 1,
Quarter = 2,
Year = 3,
}
impl CalendarPeriod {
pub fn as_str_name(&self) -> &'static str {
match self {
CalendarPeriod::Unspecified => "CALENDAR_PERIOD_UNSPECIFIED",
CalendarPeriod::Month => "MONTH",
CalendarPeriod::Quarter => "QUARTER",
CalendarPeriod::Year => "YEAR",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CALENDAR_PERIOD_UNSPECIFIED" => Some(Self::Unspecified),
"MONTH" => Some(Self::Month),
"QUARTER" => Some(Self::Quarter),
"YEAR" => Some(Self::Year),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateBudgetRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub budget: ::core::option::Option<Budget>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateBudgetRequest {
#[prost(message, optional, tag = "1")]
pub budget: ::core::option::Option<Budget>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBudgetRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBudgetsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub scope: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub page_size: i32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBudgetsResponse {
#[prost(message, repeated, tag = "1")]
pub budgets: ::prost::alloc::vec::Vec<Budget>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteBudgetRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
pub mod budget_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct BudgetServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> BudgetServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> BudgetServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
BudgetServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create_budget(
&mut self,
request: impl tonic::IntoRequest<super::CreateBudgetRequest>,
) -> std::result::Result<tonic::Response<super::Budget>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.billing.budgets.v1.BudgetService/CreateBudget",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.billing.budgets.v1.BudgetService",
"CreateBudget",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_budget(
&mut self,
request: impl tonic::IntoRequest<super::UpdateBudgetRequest>,
) -> std::result::Result<tonic::Response<super::Budget>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.billing.budgets.v1.BudgetService/UpdateBudget",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.billing.budgets.v1.BudgetService",
"UpdateBudget",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_budget(
&mut self,
request: impl tonic::IntoRequest<super::GetBudgetRequest>,
) -> std::result::Result<tonic::Response<super::Budget>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.billing.budgets.v1.BudgetService/GetBudget",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.billing.budgets.v1.BudgetService",
"GetBudget",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_budgets(
&mut self,
request: impl tonic::IntoRequest<super::ListBudgetsRequest>,
) -> std::result::Result<
tonic::Response<super::ListBudgetsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.billing.budgets.v1.BudgetService/ListBudgets",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.billing.budgets.v1.BudgetService",
"ListBudgets",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_budget(
&mut self,
request: impl tonic::IntoRequest<super::DeleteBudgetRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.billing.budgets.v1.BudgetService/DeleteBudget",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.billing.budgets.v1.BudgetService",
"DeleteBudget",
),
);
self.inner.unary(req, path, codec).await
}
}
}