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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A budget action resource.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Action {
/// <p>A system-generated universally unique identifier (UUID) for the action.</p>
pub action_id: ::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::string::String,
/// <p>The type of a notification. It must be ACTUAL or FORECASTED.</p>
pub notification_type: 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: crate::types::ActionType,
/// <p>The trigger threshold of the action.</p>
pub action_threshold: ::std::option::Option<crate::types::ActionThreshold>,
/// <p>Where you specify 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::string::String,
/// <p>This specifies if the action needs manual or automatic approval.</p>
pub approval_model: crate::types::ApprovalModel,
/// <p>The status of the action.</p>
pub status: crate::types::ActionStatus,
/// <p>A list of subscribers.</p>
pub subscribers: ::std::vec::Vec<crate::types::Subscriber>,
}
impl Action {
/// <p>A system-generated universally unique identifier (UUID) for the action.</p>
pub fn action_id(&self) -> &str {
use std::ops::Deref;
self.action_id.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) -> &str {
use std::ops::Deref;
self.budget_name.deref()
}
/// <p>The type of a notification. It must be ACTUAL or FORECASTED.</p>
pub fn notification_type(&self) -> &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>
pub fn action_type(&self) -> &crate::types::ActionType {
&self.action_type
}
/// <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>Where you specify 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) -> &str {
use std::ops::Deref;
self.execution_role_arn.deref()
}
/// <p>This specifies if the action needs manual or automatic approval.</p>
pub fn approval_model(&self) -> &crate::types::ApprovalModel {
&self.approval_model
}
/// <p>The status of the action.</p>
pub fn status(&self) -> &crate::types::ActionStatus {
&self.status
}
/// <p>A list of subscribers.</p>
pub fn subscribers(&self) -> &[crate::types::Subscriber] {
use std::ops::Deref;
self.subscribers.deref()
}
}
impl Action {
/// Creates a new builder-style object to manufacture [`Action`](crate::types::Action).
pub fn builder() -> crate::types::builders::ActionBuilder {
crate::types::builders::ActionBuilder::default()
}
}
/// A builder for [`Action`](crate::types::Action).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ActionBuilder {
pub(crate) action_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) status: ::std::option::Option<crate::types::ActionStatus>,
pub(crate) subscribers: ::std::option::Option<::std::vec::Vec<crate::types::Subscriber>>,
}
impl ActionBuilder {
/// <p>A system-generated universally unique identifier (UUID) for the action.</p>
/// This field is required.
pub fn action_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.action_id = ::std::option::Option::Some(input.into());
self
}
/// <p>A system-generated universally unique identifier (UUID) for the action.</p>
pub fn set_action_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.action_id = input;
self
}
/// <p>A system-generated universally unique identifier (UUID) for the action.</p>
pub fn get_action_id(&self) -> &::std::option::Option<::std::string::String> {
&self.action_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>Where you specify 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>Where you specify 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>Where you specify 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
}
/// <p>The status of the action.</p>
/// This field is required.
pub fn status(mut self, input: crate::types::ActionStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>The status of the action.</p>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::ActionStatus>) -> Self {
self.status = input;
self
}
/// <p>The status of the action.</p>
pub fn get_status(&self) -> &::std::option::Option<crate::types::ActionStatus> {
&self.status
}
/// 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
}
/// Consumes the builder and constructs a [`Action`](crate::types::Action).
/// This method will fail if any of the following fields are not set:
/// - [`action_id`](crate::types::builders::ActionBuilder::action_id)
/// - [`budget_name`](crate::types::builders::ActionBuilder::budget_name)
/// - [`notification_type`](crate::types::builders::ActionBuilder::notification_type)
/// - [`action_type`](crate::types::builders::ActionBuilder::action_type)
/// - [`execution_role_arn`](crate::types::builders::ActionBuilder::execution_role_arn)
/// - [`approval_model`](crate::types::builders::ActionBuilder::approval_model)
/// - [`status`](crate::types::builders::ActionBuilder::status)
/// - [`subscribers`](crate::types::builders::ActionBuilder::subscribers)
pub fn build(self) -> ::std::result::Result<crate::types::Action, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Action {
action_id: self.action_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"action_id",
"action_id was not specified but it is required when building Action",
)
})?,
budget_name: self.budget_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"budget_name",
"budget_name was not specified but it is required when building Action",
)
})?,
notification_type: self.notification_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"notification_type",
"notification_type was not specified but it is required when building Action",
)
})?,
action_type: self.action_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"action_type",
"action_type was not specified but it is required when building Action",
)
})?,
action_threshold: self.action_threshold,
definition: self.definition,
execution_role_arn: self.execution_role_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"execution_role_arn",
"execution_role_arn was not specified but it is required when building Action",
)
})?,
approval_model: self.approval_model.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"approval_model",
"approval_model was not specified but it is required when building Action",
)
})?,
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 Action",
)
})?,
subscribers: self.subscribers.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"subscribers",
"subscribers was not specified but it is required when building Action",
)
})?,
})
}
}