aws_sdk_deadline/operation/update_budget/
_update_budget_input.rs

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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
// 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)]
pub struct UpdateBudgetInput {
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The farm ID of the budget to update.</p>
    pub farm_id: ::std::option::Option<::std::string::String>,
    /// <p>The budget ID to update.</p>
    pub budget_id: ::std::option::Option<::std::string::String>,
    /// <p>The display name of the budget to update.</p><important>
    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
    /// </important>
    pub display_name: ::std::option::Option<::std::string::String>,
    /// <p>The description of the budget to update.</p><important>
    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
    /// </important>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>Updates the status of the budget.</p>
    /// <ul>
    /// <li>
    /// <p><code>ACTIVE</code>–The budget is being evaluated.</p></li>
    /// <li>
    /// <p><code>INACTIVE</code>–The budget is inactive. This can include Expired, Canceled, or deleted Deleted statuses.</p></li>
    /// </ul>
    pub status: ::std::option::Option<crate::types::BudgetStatus>,
    /// <p>The dollar limit to update on the budget. Based on consumed usage.</p>
    pub approximate_dollar_limit: ::std::option::Option<f32>,
    /// <p>The budget actions to add. Budget actions specify what happens when the budget runs out.</p>
    pub actions_to_add: ::std::option::Option<::std::vec::Vec<crate::types::BudgetActionToAdd>>,
    /// <p>The budget actions to remove from the budget.</p>
    pub actions_to_remove: ::std::option::Option<::std::vec::Vec<crate::types::BudgetActionToRemove>>,
    /// <p>The schedule to update.</p>
    pub schedule: ::std::option::Option<crate::types::BudgetSchedule>,
}
impl UpdateBudgetInput {
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The farm ID of the budget to update.</p>
    pub fn farm_id(&self) -> ::std::option::Option<&str> {
        self.farm_id.as_deref()
    }
    /// <p>The budget ID to update.</p>
    pub fn budget_id(&self) -> ::std::option::Option<&str> {
        self.budget_id.as_deref()
    }
    /// <p>The display name of the budget to update.</p><important>
    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
    /// </important>
    pub fn display_name(&self) -> ::std::option::Option<&str> {
        self.display_name.as_deref()
    }
    /// <p>The description of the budget to update.</p><important>
    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
    /// </important>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>Updates the status of the budget.</p>
    /// <ul>
    /// <li>
    /// <p><code>ACTIVE</code>–The budget is being evaluated.</p></li>
    /// <li>
    /// <p><code>INACTIVE</code>–The budget is inactive. This can include Expired, Canceled, or deleted Deleted statuses.</p></li>
    /// </ul>
    pub fn status(&self) -> ::std::option::Option<&crate::types::BudgetStatus> {
        self.status.as_ref()
    }
    /// <p>The dollar limit to update on the budget. Based on consumed usage.</p>
    pub fn approximate_dollar_limit(&self) -> ::std::option::Option<f32> {
        self.approximate_dollar_limit
    }
    /// <p>The budget actions to add. Budget actions specify what happens when the budget runs out.</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 `.actions_to_add.is_none()`.
    pub fn actions_to_add(&self) -> &[crate::types::BudgetActionToAdd] {
        self.actions_to_add.as_deref().unwrap_or_default()
    }
    /// <p>The budget actions to remove from the budget.</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 `.actions_to_remove.is_none()`.
    pub fn actions_to_remove(&self) -> &[crate::types::BudgetActionToRemove] {
        self.actions_to_remove.as_deref().unwrap_or_default()
    }
    /// <p>The schedule to update.</p>
    pub fn schedule(&self) -> ::std::option::Option<&crate::types::BudgetSchedule> {
        self.schedule.as_ref()
    }
}
impl ::std::fmt::Debug for UpdateBudgetInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("UpdateBudgetInput");
        formatter.field("client_token", &self.client_token);
        formatter.field("farm_id", &self.farm_id);
        formatter.field("budget_id", &self.budget_id);
        formatter.field("display_name", &self.display_name);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("status", &self.status);
        formatter.field("approximate_dollar_limit", &self.approximate_dollar_limit);
        formatter.field("actions_to_add", &self.actions_to_add);
        formatter.field("actions_to_remove", &self.actions_to_remove);
        formatter.field("schedule", &self.schedule);
        formatter.finish()
    }
}
impl UpdateBudgetInput {
    /// Creates a new builder-style object to manufacture [`UpdateBudgetInput`](crate::operation::update_budget::UpdateBudgetInput).
    pub fn builder() -> crate::operation::update_budget::builders::UpdateBudgetInputBuilder {
        crate::operation::update_budget::builders::UpdateBudgetInputBuilder::default()
    }
}

/// A builder for [`UpdateBudgetInput`](crate::operation::update_budget::UpdateBudgetInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct UpdateBudgetInputBuilder {
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) farm_id: ::std::option::Option<::std::string::String>,
    pub(crate) budget_id: ::std::option::Option<::std::string::String>,
    pub(crate) display_name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::BudgetStatus>,
    pub(crate) approximate_dollar_limit: ::std::option::Option<f32>,
    pub(crate) actions_to_add: ::std::option::Option<::std::vec::Vec<crate::types::BudgetActionToAdd>>,
    pub(crate) actions_to_remove: ::std::option::Option<::std::vec::Vec<crate::types::BudgetActionToRemove>>,
    pub(crate) schedule: ::std::option::Option<crate::types::BudgetSchedule>,
}
impl UpdateBudgetInputBuilder {
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The farm ID of the budget to update.</p>
    /// This field is required.
    pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.farm_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The farm ID of the budget to update.</p>
    pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.farm_id = input;
        self
    }
    /// <p>The farm ID of the budget to update.</p>
    pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.farm_id
    }
    /// <p>The budget ID to update.</p>
    /// This field is required.
    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
    }
    /// <p>The budget ID to update.</p>
    pub fn set_budget_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.budget_id = input;
        self
    }
    /// <p>The budget ID to update.</p>
    pub fn get_budget_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.budget_id
    }
    /// <p>The display name of the budget to update.</p><important>
    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
    /// </important>
    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
    }
    /// <p>The display name of the budget to update.</p><important>
    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
    /// </important>
    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.display_name = input;
        self
    }
    /// <p>The display name of the budget to update.</p><important>
    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
    /// </important>
    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.display_name
    }
    /// <p>The description of the budget to update.</p><important>
    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
    /// </important>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the budget to update.</p><important>
    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
    /// </important>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of the budget to update.</p><important>
    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
    /// </important>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>Updates the status of the budget.</p>
    /// <ul>
    /// <li>
    /// <p><code>ACTIVE</code>–The budget is being evaluated.</p></li>
    /// <li>
    /// <p><code>INACTIVE</code>–The budget is inactive. This can include Expired, Canceled, or deleted Deleted statuses.</p></li>
    /// </ul>
    pub fn status(mut self, input: crate::types::BudgetStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>Updates the status of the budget.</p>
    /// <ul>
    /// <li>
    /// <p><code>ACTIVE</code>–The budget is being evaluated.</p></li>
    /// <li>
    /// <p><code>INACTIVE</code>–The budget is inactive. This can include Expired, Canceled, or deleted Deleted statuses.</p></li>
    /// </ul>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::BudgetStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>Updates the status of the budget.</p>
    /// <ul>
    /// <li>
    /// <p><code>ACTIVE</code>–The budget is being evaluated.</p></li>
    /// <li>
    /// <p><code>INACTIVE</code>–The budget is inactive. This can include Expired, Canceled, or deleted Deleted statuses.</p></li>
    /// </ul>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::BudgetStatus> {
        &self.status
    }
    /// <p>The dollar limit to update on the budget. Based on consumed usage.</p>
    pub fn approximate_dollar_limit(mut self, input: f32) -> Self {
        self.approximate_dollar_limit = ::std::option::Option::Some(input);
        self
    }
    /// <p>The dollar limit to update on the budget. Based on consumed usage.</p>
    pub fn set_approximate_dollar_limit(mut self, input: ::std::option::Option<f32>) -> Self {
        self.approximate_dollar_limit = input;
        self
    }
    /// <p>The dollar limit to update on the budget. Based on consumed usage.</p>
    pub fn get_approximate_dollar_limit(&self) -> &::std::option::Option<f32> {
        &self.approximate_dollar_limit
    }
    /// Appends an item to `actions_to_add`.
    ///
    /// To override the contents of this collection use [`set_actions_to_add`](Self::set_actions_to_add).
    ///
    /// <p>The budget actions to add. Budget actions specify what happens when the budget runs out.</p>
    pub fn actions_to_add(mut self, input: crate::types::BudgetActionToAdd) -> Self {
        let mut v = self.actions_to_add.unwrap_or_default();
        v.push(input);
        self.actions_to_add = ::std::option::Option::Some(v);
        self
    }
    /// <p>The budget actions to add. Budget actions specify what happens when the budget runs out.</p>
    pub fn set_actions_to_add(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BudgetActionToAdd>>) -> Self {
        self.actions_to_add = input;
        self
    }
    /// <p>The budget actions to add. Budget actions specify what happens when the budget runs out.</p>
    pub fn get_actions_to_add(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BudgetActionToAdd>> {
        &self.actions_to_add
    }
    /// Appends an item to `actions_to_remove`.
    ///
    /// To override the contents of this collection use [`set_actions_to_remove`](Self::set_actions_to_remove).
    ///
    /// <p>The budget actions to remove from the budget.</p>
    pub fn actions_to_remove(mut self, input: crate::types::BudgetActionToRemove) -> Self {
        let mut v = self.actions_to_remove.unwrap_or_default();
        v.push(input);
        self.actions_to_remove = ::std::option::Option::Some(v);
        self
    }
    /// <p>The budget actions to remove from the budget.</p>
    pub fn set_actions_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BudgetActionToRemove>>) -> Self {
        self.actions_to_remove = input;
        self
    }
    /// <p>The budget actions to remove from the budget.</p>
    pub fn get_actions_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BudgetActionToRemove>> {
        &self.actions_to_remove
    }
    /// <p>The schedule to update.</p>
    pub fn schedule(mut self, input: crate::types::BudgetSchedule) -> Self {
        self.schedule = ::std::option::Option::Some(input);
        self
    }
    /// <p>The schedule to update.</p>
    pub fn set_schedule(mut self, input: ::std::option::Option<crate::types::BudgetSchedule>) -> Self {
        self.schedule = input;
        self
    }
    /// <p>The schedule to update.</p>
    pub fn get_schedule(&self) -> &::std::option::Option<crate::types::BudgetSchedule> {
        &self.schedule
    }
    /// Consumes the builder and constructs a [`UpdateBudgetInput`](crate::operation::update_budget::UpdateBudgetInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_budget::UpdateBudgetInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_budget::UpdateBudgetInput {
            client_token: self.client_token,
            farm_id: self.farm_id,
            budget_id: self.budget_id,
            display_name: self.display_name,
            description: self.description,
            status: self.status,
            approximate_dollar_limit: self.approximate_dollar_limit,
            actions_to_add: self.actions_to_add,
            actions_to_remove: self.actions_to_remove,
            schedule: self.schedule,
        })
    }
}
impl ::std::fmt::Debug for UpdateBudgetInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("UpdateBudgetInputBuilder");
        formatter.field("client_token", &self.client_token);
        formatter.field("farm_id", &self.farm_id);
        formatter.field("budget_id", &self.budget_id);
        formatter.field("display_name", &self.display_name);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("status", &self.status);
        formatter.field("approximate_dollar_limit", &self.approximate_dollar_limit);
        formatter.field("actions_to_add", &self.actions_to_add);
        formatter.field("actions_to_remove", &self.actions_to_remove);
        formatter.field("schedule", &self.schedule);
        formatter.finish()
    }
}