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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateBudgetActionInput {
/// <p>The account ID of the user. It's a 12-digit number.</p>
pub account_id: ::std::option::Option<::std::string::String>,
/// <p>A string that represents the budget name. The ":" and "\" characters, and the "/action/" substring, aren't allowed.</p>
pub budget_name: ::std::option::Option<::std::string::String>,
/// <p>The type of a notification. It must be ACTUAL or FORECASTED.</p>
pub notification_type: ::std::option::Option<crate::types::NotificationType>,
/// <p>The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition.</p>
pub action_type: ::std::option::Option<crate::types::ActionType>,
/// <p>The trigger threshold of the action.</p>
pub action_threshold: ::std::option::Option<crate::types::ActionThreshold>,
/// <p>Specifies all of the type-specific parameters.</p>
pub definition: ::std::option::Option<crate::types::Definition>,
/// <p>The role passed for action execution and reversion. Roles and actions must be in the same account.</p>
pub execution_role_arn: ::std::option::Option<::std::string::String>,
/// <p>This specifies if the action needs manual or automatic approval.</p>
pub approval_model: ::std::option::Option<crate::types::ApprovalModel>,
/// <p>A list of subscribers.</p>
pub subscribers: ::std::option::Option<::std::vec::Vec<crate::types::Subscriber>>,
/// <p>An optional list of tags to associate with the specified budget action. Each tag consists of a key and a value, and each key must be unique for the resource.</p>
pub resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
}
impl CreateBudgetActionInput {
/// <p>The account ID of the user. It's a 12-digit number.</p>
pub fn account_id(&self) -> ::std::option::Option<&str> {
self.account_id.as_deref()
}
/// <p>A string that represents the budget name. The ":" and "\" characters, and the "/action/" substring, aren't allowed.</p>
pub fn budget_name(&self) -> ::std::option::Option<&str> {
self.budget_name.as_deref()
}
/// <p>The type of a notification. It must be ACTUAL or FORECASTED.</p>
pub fn notification_type(&self) -> ::std::option::Option<&crate::types::NotificationType> {
self.notification_type.as_ref()
}
/// <p>The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition.</p>
pub fn action_type(&self) -> ::std::option::Option<&crate::types::ActionType> {
self.action_type.as_ref()
}
/// <p>The trigger threshold of the action.</p>
pub fn action_threshold(&self) -> ::std::option::Option<&crate::types::ActionThreshold> {
self.action_threshold.as_ref()
}
/// <p>Specifies all of the type-specific parameters.</p>
pub fn definition(&self) -> ::std::option::Option<&crate::types::Definition> {
self.definition.as_ref()
}
/// <p>The role passed for action execution and reversion. Roles and actions must be in the same account.</p>
pub fn execution_role_arn(&self) -> ::std::option::Option<&str> {
self.execution_role_arn.as_deref()
}
/// <p>This specifies if the action needs manual or automatic approval.</p>
pub fn approval_model(&self) -> ::std::option::Option<&crate::types::ApprovalModel> {
self.approval_model.as_ref()
}
/// <p>A list of subscribers.</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 `.subscribers.is_none()`.
pub fn subscribers(&self) -> &[crate::types::Subscriber] {
self.subscribers.as_deref().unwrap_or_default()
}
/// <p>An optional list of tags to associate with the specified budget action. Each tag consists of a key and a value, and each key must be unique for the resource.</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 `.resource_tags.is_none()`.
pub fn resource_tags(&self) -> &[crate::types::ResourceTag] {
self.resource_tags.as_deref().unwrap_or_default()
}
}
impl CreateBudgetActionInput {
/// Creates a new builder-style object to manufacture [`CreateBudgetActionInput`](crate::operation::create_budget_action::CreateBudgetActionInput).
pub fn builder() -> crate::operation::create_budget_action::builders::CreateBudgetActionInputBuilder {
crate::operation::create_budget_action::builders::CreateBudgetActionInputBuilder::default()
}
}
/// A builder for [`CreateBudgetActionInput`](crate::operation::create_budget_action::CreateBudgetActionInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CreateBudgetActionInputBuilder {
pub(crate) account_id: ::std::option::Option<::std::string::String>,
pub(crate) budget_name: ::std::option::Option<::std::string::String>,
pub(crate) notification_type: ::std::option::Option<crate::types::NotificationType>,
pub(crate) action_type: ::std::option::Option<crate::types::ActionType>,
pub(crate) action_threshold: ::std::option::Option<crate::types::ActionThreshold>,
pub(crate) definition: ::std::option::Option<crate::types::Definition>,
pub(crate) execution_role_arn: ::std::option::Option<::std::string::String>,
pub(crate) approval_model: ::std::option::Option<crate::types::ApprovalModel>,
pub(crate) subscribers: ::std::option::Option<::std::vec::Vec<crate::types::Subscriber>>,
pub(crate) resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
}
impl CreateBudgetActionInputBuilder {
/// <p>The account ID of the user. It's a 12-digit number.</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 account ID of the user. It's a 12-digit number.</p>
pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.account_id = input;
self
}
/// <p>The account ID of the user. It's a 12-digit number.</p>
pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
&self.account_id
}
/// <p>A string that represents the budget name. The ":" and "\" characters, and the "/action/" substring, aren't allowed.</p>
/// This field is required.
pub fn budget_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.budget_name = ::std::option::Option::Some(input.into());
self
}
/// <p>A string that represents the budget name. The ":" and "\" characters, and the "/action/" substring, aren't allowed.</p>
pub fn set_budget_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.budget_name = input;
self
}
/// <p>A string that represents the budget name. The ":" and "\" characters, and the "/action/" substring, aren't allowed.</p>
pub fn get_budget_name(&self) -> &::std::option::Option<::std::string::String> {
&self.budget_name
}
/// <p>The type of a notification. It must be ACTUAL or FORECASTED.</p>
/// This field is required.
pub fn notification_type(mut self, input: crate::types::NotificationType) -> Self {
self.notification_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of a notification. It must be ACTUAL or FORECASTED.</p>
pub fn set_notification_type(mut self, input: ::std::option::Option<crate::types::NotificationType>) -> Self {
self.notification_type = input;
self
}
/// <p>The type of a notification. It must be ACTUAL or FORECASTED.</p>
pub fn get_notification_type(&self) -> &::std::option::Option<crate::types::NotificationType> {
&self.notification_type
}
/// <p>The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition.</p>
/// This field is required.
pub fn action_type(mut self, input: crate::types::ActionType) -> Self {
self.action_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition.</p>
pub fn set_action_type(mut self, input: ::std::option::Option<crate::types::ActionType>) -> Self {
self.action_type = input;
self
}
/// <p>The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition.</p>
pub fn get_action_type(&self) -> &::std::option::Option<crate::types::ActionType> {
&self.action_type
}
/// <p>The trigger threshold of the action.</p>
/// This field is required.
pub fn action_threshold(mut self, input: crate::types::ActionThreshold) -> Self {
self.action_threshold = ::std::option::Option::Some(input);
self
}
/// <p>The trigger threshold of the action.</p>
pub fn set_action_threshold(mut self, input: ::std::option::Option<crate::types::ActionThreshold>) -> Self {
self.action_threshold = input;
self
}
/// <p>The trigger threshold of the action.</p>
pub fn get_action_threshold(&self) -> &::std::option::Option<crate::types::ActionThreshold> {
&self.action_threshold
}
/// <p>Specifies all of the type-specific parameters.</p>
/// This field is required.
pub fn definition(mut self, input: crate::types::Definition) -> Self {
self.definition = ::std::option::Option::Some(input);
self
}
/// <p>Specifies all of the type-specific parameters.</p>
pub fn set_definition(mut self, input: ::std::option::Option<crate::types::Definition>) -> Self {
self.definition = input;
self
}
/// <p>Specifies all of the type-specific parameters.</p>
pub fn get_definition(&self) -> &::std::option::Option<crate::types::Definition> {
&self.definition
}
/// <p>The role passed for action execution and reversion. Roles and actions must be in the same account.</p>
/// This field is required.
pub fn execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.execution_role_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The role passed for action execution and reversion. Roles and actions must be in the same account.</p>
pub fn set_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.execution_role_arn = input;
self
}
/// <p>The role passed for action execution and reversion. Roles and actions must be in the same account.</p>
pub fn get_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.execution_role_arn
}
/// <p>This specifies if the action needs manual or automatic approval.</p>
/// This field is required.
pub fn approval_model(mut self, input: crate::types::ApprovalModel) -> Self {
self.approval_model = ::std::option::Option::Some(input);
self
}
/// <p>This specifies if the action needs manual or automatic approval.</p>
pub fn set_approval_model(mut self, input: ::std::option::Option<crate::types::ApprovalModel>) -> Self {
self.approval_model = input;
self
}
/// <p>This specifies if the action needs manual or automatic approval.</p>
pub fn get_approval_model(&self) -> &::std::option::Option<crate::types::ApprovalModel> {
&self.approval_model
}
/// Appends an item to `subscribers`.
///
/// To override the contents of this collection use [`set_subscribers`](Self::set_subscribers).
///
/// <p>A list of subscribers.</p>
pub fn subscribers(mut self, input: crate::types::Subscriber) -> Self {
let mut v = self.subscribers.unwrap_or_default();
v.push(input);
self.subscribers = ::std::option::Option::Some(v);
self
}
/// <p>A list of subscribers.</p>
pub fn set_subscribers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Subscriber>>) -> Self {
self.subscribers = input;
self
}
/// <p>A list of subscribers.</p>
pub fn get_subscribers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Subscriber>> {
&self.subscribers
}
/// Appends an item to `resource_tags`.
///
/// To override the contents of this collection use [`set_resource_tags`](Self::set_resource_tags).
///
/// <p>An optional list of tags to associate with the specified budget action. Each tag consists of a key and a value, and each key must be unique for the resource.</p>
pub fn resource_tags(mut self, input: crate::types::ResourceTag) -> Self {
let mut v = self.resource_tags.unwrap_or_default();
v.push(input);
self.resource_tags = ::std::option::Option::Some(v);
self
}
/// <p>An optional list of tags to associate with the specified budget action. Each tag consists of a key and a value, and each key must be unique for the resource.</p>
pub fn set_resource_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>) -> Self {
self.resource_tags = input;
self
}
/// <p>An optional list of tags to associate with the specified budget action. Each tag consists of a key and a value, and each key must be unique for the resource.</p>
pub fn get_resource_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>> {
&self.resource_tags
}
/// Consumes the builder and constructs a [`CreateBudgetActionInput`](crate::operation::create_budget_action::CreateBudgetActionInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_budget_action::CreateBudgetActionInput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::create_budget_action::CreateBudgetActionInput {
account_id: self.account_id,
budget_name: self.budget_name,
notification_type: self.notification_type,
action_type: self.action_type,
action_threshold: self.action_threshold,
definition: self.definition,
execution_role_arn: self.execution_role_arn,
approval_model: self.approval_model,
subscribers: self.subscribers,
resource_tags: self.resource_tags,
})
}
}