1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Request of CreateBudget</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateBudgetInput {
/// <p>The <code>accountId</code> that is associated with the budget.</p>
pub account_id: ::std::option::Option<::std::string::String>,
/// <p>The budget object that you want to create.</p>
pub budget: ::std::option::Option<crate::types::Budget>,
/// <p>A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your <code>CreateBudget</code> call, Amazon Web Services creates the notifications and subscribers for you.</p>
pub notifications_with_subscribers: ::std::option::Option<::std::vec::Vec<crate::types::NotificationWithSubscribers>>,
}
impl CreateBudgetInput {
/// <p>The <code>accountId</code> that is associated with the budget.</p>
pub fn account_id(&self) -> ::std::option::Option<&str> {
self.account_id.as_deref()
}
/// <p>The budget object that you want to create.</p>
pub fn budget(&self) -> ::std::option::Option<&crate::types::Budget> {
self.budget.as_ref()
}
/// <p>A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your <code>CreateBudget</code> call, Amazon Web Services creates the notifications and subscribers for you.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.notifications_with_subscribers.is_none()`.
pub fn notifications_with_subscribers(&self) -> &[crate::types::NotificationWithSubscribers] {
self.notifications_with_subscribers.as_deref().unwrap_or_default()
}
}
impl CreateBudgetInput {
/// Creates a new builder-style object to manufacture [`CreateBudgetInput`](crate::operation::create_budget::CreateBudgetInput).
pub fn builder() -> crate::operation::create_budget::builders::CreateBudgetInputBuilder {
crate::operation::create_budget::builders::CreateBudgetInputBuilder::default()
}
}
/// A builder for [`CreateBudgetInput`](crate::operation::create_budget::CreateBudgetInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CreateBudgetInputBuilder {
pub(crate) account_id: ::std::option::Option<::std::string::String>,
pub(crate) budget: ::std::option::Option<crate::types::Budget>,
pub(crate) notifications_with_subscribers: ::std::option::Option<::std::vec::Vec<crate::types::NotificationWithSubscribers>>,
}
impl CreateBudgetInputBuilder {
/// <p>The <code>accountId</code> that is associated with the budget.</p>
/// This field is required.
pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.account_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The <code>accountId</code> that is associated with the budget.</p>
pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.account_id = input;
self
}
/// <p>The <code>accountId</code> that is associated with the budget.</p>
pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
&self.account_id
}
/// <p>The budget object that you want to create.</p>
/// This field is required.
pub fn budget(mut self, input: crate::types::Budget) -> Self {
self.budget = ::std::option::Option::Some(input);
self
}
/// <p>The budget object that you want to create.</p>
pub fn set_budget(mut self, input: ::std::option::Option<crate::types::Budget>) -> Self {
self.budget = input;
self
}
/// <p>The budget object that you want to create.</p>
pub fn get_budget(&self) -> &::std::option::Option<crate::types::Budget> {
&self.budget
}
/// Appends an item to `notifications_with_subscribers`.
///
/// To override the contents of this collection use [`set_notifications_with_subscribers`](Self::set_notifications_with_subscribers).
///
/// <p>A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your <code>CreateBudget</code> call, Amazon Web Services creates the notifications and subscribers for you.</p>
pub fn notifications_with_subscribers(mut self, input: crate::types::NotificationWithSubscribers) -> Self {
let mut v = self.notifications_with_subscribers.unwrap_or_default();
v.push(input);
self.notifications_with_subscribers = ::std::option::Option::Some(v);
self
}
/// <p>A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your <code>CreateBudget</code> call, Amazon Web Services creates the notifications and subscribers for you.</p>
pub fn set_notifications_with_subscribers(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::NotificationWithSubscribers>>,
) -> Self {
self.notifications_with_subscribers = input;
self
}
/// <p>A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your <code>CreateBudget</code> call, Amazon Web Services creates the notifications and subscribers for you.</p>
pub fn get_notifications_with_subscribers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::NotificationWithSubscribers>> {
&self.notifications_with_subscribers
}
/// Consumes the builder and constructs a [`CreateBudgetInput`](crate::operation::create_budget::CreateBudgetInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_budget::CreateBudgetInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_budget::CreateBudgetInput {
account_id: self.account_id,
budget: self.budget,
notifications_with_subscribers: self.notifications_with_subscribers,
})
}
}