aws_sdk_deadline/operation/get_budget/
_get_budget_output.rs#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct GetBudgetOutput {
pub budget_id: ::std::string::String,
pub usage_tracking_resource: ::std::option::Option<crate::types::UsageTrackingResource>,
pub status: crate::types::BudgetStatus,
pub display_name: ::std::string::String,
pub description: ::std::option::Option<::std::string::String>,
pub approximate_dollar_limit: f32,
pub usages: ::std::option::Option<crate::types::ConsumedUsages>,
pub actions: ::std::vec::Vec<crate::types::ResponseBudgetAction>,
pub schedule: ::std::option::Option<crate::types::BudgetSchedule>,
pub created_by: ::std::string::String,
pub created_at: ::aws_smithy_types::DateTime,
pub updated_by: ::std::option::Option<::std::string::String>,
pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub queue_stopped_at: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl GetBudgetOutput {
pub fn budget_id(&self) -> &str {
use std::ops::Deref;
self.budget_id.deref()
}
pub fn usage_tracking_resource(&self) -> ::std::option::Option<&crate::types::UsageTrackingResource> {
self.usage_tracking_resource.as_ref()
}
pub fn status(&self) -> &crate::types::BudgetStatus {
&self.status
}
pub fn display_name(&self) -> &str {
use std::ops::Deref;
self.display_name.deref()
}
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
pub fn approximate_dollar_limit(&self) -> f32 {
self.approximate_dollar_limit
}
pub fn usages(&self) -> ::std::option::Option<&crate::types::ConsumedUsages> {
self.usages.as_ref()
}
pub fn actions(&self) -> &[crate::types::ResponseBudgetAction] {
use std::ops::Deref;
self.actions.deref()
}
pub fn schedule(&self) -> ::std::option::Option<&crate::types::BudgetSchedule> {
self.schedule.as_ref()
}
pub fn created_by(&self) -> &str {
use std::ops::Deref;
self.created_by.deref()
}
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
pub fn updated_by(&self) -> ::std::option::Option<&str> {
self.updated_by.as_deref()
}
pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.updated_at.as_ref()
}
pub fn queue_stopped_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.queue_stopped_at.as_ref()
}
}
impl ::std::fmt::Debug for GetBudgetOutput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("GetBudgetOutput");
formatter.field("budget_id", &self.budget_id);
formatter.field("usage_tracking_resource", &self.usage_tracking_resource);
formatter.field("status", &self.status);
formatter.field("display_name", &self.display_name);
formatter.field("description", &"*** Sensitive Data Redacted ***");
formatter.field("approximate_dollar_limit", &self.approximate_dollar_limit);
formatter.field("usages", &self.usages);
formatter.field("actions", &self.actions);
formatter.field("schedule", &self.schedule);
formatter.field("created_by", &self.created_by);
formatter.field("created_at", &self.created_at);
formatter.field("updated_by", &self.updated_by);
formatter.field("updated_at", &self.updated_at);
formatter.field("queue_stopped_at", &self.queue_stopped_at);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}
impl ::aws_types::request_id::RequestId for GetBudgetOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetBudgetOutput {
pub fn builder() -> crate::operation::get_budget::builders::GetBudgetOutputBuilder {
crate::operation::get_budget::builders::GetBudgetOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetBudgetOutputBuilder {
pub(crate) budget_id: ::std::option::Option<::std::string::String>,
pub(crate) usage_tracking_resource: ::std::option::Option<crate::types::UsageTrackingResource>,
pub(crate) status: ::std::option::Option<crate::types::BudgetStatus>,
pub(crate) display_name: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) approximate_dollar_limit: ::std::option::Option<f32>,
pub(crate) usages: ::std::option::Option<crate::types::ConsumedUsages>,
pub(crate) actions: ::std::option::Option<::std::vec::Vec<crate::types::ResponseBudgetAction>>,
pub(crate) schedule: ::std::option::Option<crate::types::BudgetSchedule>,
pub(crate) created_by: ::std::option::Option<::std::string::String>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) updated_by: ::std::option::Option<::std::string::String>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) queue_stopped_at: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl GetBudgetOutputBuilder {
pub fn budget_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.budget_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_budget_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.budget_id = input;
self
}
pub fn get_budget_id(&self) -> &::std::option::Option<::std::string::String> {
&self.budget_id
}
pub fn usage_tracking_resource(mut self, input: crate::types::UsageTrackingResource) -> Self {
self.usage_tracking_resource = ::std::option::Option::Some(input);
self
}
pub fn set_usage_tracking_resource(mut self, input: ::std::option::Option<crate::types::UsageTrackingResource>) -> Self {
self.usage_tracking_resource = input;
self
}
pub fn get_usage_tracking_resource(&self) -> &::std::option::Option<crate::types::UsageTrackingResource> {
&self.usage_tracking_resource
}
pub fn status(mut self, input: crate::types::BudgetStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
pub fn set_status(mut self, input: ::std::option::Option<crate::types::BudgetStatus>) -> Self {
self.status = input;
self
}
pub fn get_status(&self) -> &::std::option::Option<crate::types::BudgetStatus> {
&self.status
}
pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.display_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.display_name = input;
self
}
pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
&self.display_name
}
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
pub fn approximate_dollar_limit(mut self, input: f32) -> Self {
self.approximate_dollar_limit = ::std::option::Option::Some(input);
self
}
pub fn set_approximate_dollar_limit(mut self, input: ::std::option::Option<f32>) -> Self {
self.approximate_dollar_limit = input;
self
}
pub fn get_approximate_dollar_limit(&self) -> &::std::option::Option<f32> {
&self.approximate_dollar_limit
}
pub fn usages(mut self, input: crate::types::ConsumedUsages) -> Self {
self.usages = ::std::option::Option::Some(input);
self
}
pub fn set_usages(mut self, input: ::std::option::Option<crate::types::ConsumedUsages>) -> Self {
self.usages = input;
self
}
pub fn get_usages(&self) -> &::std::option::Option<crate::types::ConsumedUsages> {
&self.usages
}
pub fn actions(mut self, input: crate::types::ResponseBudgetAction) -> Self {
let mut v = self.actions.unwrap_or_default();
v.push(input);
self.actions = ::std::option::Option::Some(v);
self
}
pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResponseBudgetAction>>) -> Self {
self.actions = input;
self
}
pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResponseBudgetAction>> {
&self.actions
}
pub fn schedule(mut self, input: crate::types::BudgetSchedule) -> Self {
self.schedule = ::std::option::Option::Some(input);
self
}
pub fn set_schedule(mut self, input: ::std::option::Option<crate::types::BudgetSchedule>) -> Self {
self.schedule = input;
self
}
pub fn get_schedule(&self) -> &::std::option::Option<crate::types::BudgetSchedule> {
&self.schedule
}
pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.created_by = ::std::option::Option::Some(input.into());
self
}
pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.created_by = input;
self
}
pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
&self.created_by
}
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
pub fn updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.updated_by = ::std::option::Option::Some(input.into());
self
}
pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.updated_by = input;
self
}
pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
&self.updated_by
}
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
pub fn queue_stopped_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.queue_stopped_at = ::std::option::Option::Some(input);
self
}
pub fn set_queue_stopped_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.queue_stopped_at = input;
self
}
pub fn get_queue_stopped_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.queue_stopped_at
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
pub fn build(self) -> ::std::result::Result<crate::operation::get_budget::GetBudgetOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_budget::GetBudgetOutput {
budget_id: self.budget_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"budget_id",
"budget_id was not specified but it is required when building GetBudgetOutput",
)
})?,
usage_tracking_resource: self.usage_tracking_resource,
status: self.status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status",
"status was not specified but it is required when building GetBudgetOutput",
)
})?,
display_name: self.display_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"display_name",
"display_name was not specified but it is required when building GetBudgetOutput",
)
})?,
description: self.description,
approximate_dollar_limit: self.approximate_dollar_limit.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"approximate_dollar_limit",
"approximate_dollar_limit was not specified but it is required when building GetBudgetOutput",
)
})?,
usages: self.usages,
actions: self.actions.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"actions",
"actions was not specified but it is required when building GetBudgetOutput",
)
})?,
schedule: self.schedule,
created_by: self.created_by.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_by",
"created_by was not specified but it is required when building GetBudgetOutput",
)
})?,
created_at: self.created_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_at",
"created_at was not specified but it is required when building GetBudgetOutput",
)
})?,
updated_by: self.updated_by,
updated_at: self.updated_at,
queue_stopped_at: self.queue_stopped_at,
_request_id: self._request_id,
})
}
}
impl ::std::fmt::Debug for GetBudgetOutputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("GetBudgetOutputBuilder");
formatter.field("budget_id", &self.budget_id);
formatter.field("usage_tracking_resource", &self.usage_tracking_resource);
formatter.field("status", &self.status);
formatter.field("display_name", &self.display_name);
formatter.field("description", &"*** Sensitive Data Redacted ***");
formatter.field("approximate_dollar_limit", &self.approximate_dollar_limit);
formatter.field("usages", &self.usages);
formatter.field("actions", &self.actions);
formatter.field("schedule", &self.schedule);
formatter.field("created_by", &self.created_by);
formatter.field("created_at", &self.created_at);
formatter.field("updated_by", &self.updated_by);
formatter.field("updated_at", &self.updated_at);
formatter.field("queue_stopped_at", &self.queue_stopped_at);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}