aws_sdk_deadline/operation/get_budget/
_get_budget_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct GetBudgetOutput {
6    /// <p>The budget ID.</p>
7    pub budget_id: ::std::string::String,
8    /// <p>The resource that the budget is tracking usage for.</p>
9    pub usage_tracking_resource: ::std::option::Option<crate::types::UsageTrackingResource>,
10    /// <p>The status of the budget.</p>
11    /// <ul>
12    /// <li>
13    /// <p><code>ACTIVE</code>–Get a budget being evaluated.</p></li>
14    /// <li>
15    /// <p><code>INACTIVE</code>–Get an inactive budget. This can include expired, canceled, or deleted statuses.</p></li>
16    /// </ul>
17    pub status: crate::types::BudgetStatus,
18    /// <p>The display name of the budget.</p><important>
19    /// <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>
20    /// </important>
21    pub display_name: ::std::string::String,
22    /// <p>The description of the budget.</p><important>
23    /// <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>
24    /// </important>
25    pub description: ::std::option::Option<::std::string::String>,
26    /// <p>The consumed usage limit for the budget.</p>
27    pub approximate_dollar_limit: f32,
28    /// <p>The usages of the budget.</p>
29    pub usages: ::std::option::Option<crate::types::ConsumedUsages>,
30    /// <p>The budget actions for the budget.</p>
31    pub actions: ::std::vec::Vec<crate::types::ResponseBudgetAction>,
32    /// <p>The budget schedule.</p>
33    pub schedule: ::std::option::Option<crate::types::BudgetSchedule>,
34    /// <p>The user or system that created this resource.</p>
35    pub created_by: ::std::string::String,
36    /// <p>The date and time the resource was created.</p>
37    pub created_at: ::aws_smithy_types::DateTime,
38    /// <p>The user or system that updated this resource.</p>
39    pub updated_by: ::std::option::Option<::std::string::String>,
40    /// <p>The date and time the resource was updated.</p>
41    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
42    /// <p>The date and time the queue stopped.</p>
43    pub queue_stopped_at: ::std::option::Option<::aws_smithy_types::DateTime>,
44    _request_id: Option<String>,
45}
46impl GetBudgetOutput {
47    /// <p>The budget ID.</p>
48    pub fn budget_id(&self) -> &str {
49        use std::ops::Deref;
50        self.budget_id.deref()
51    }
52    /// <p>The resource that the budget is tracking usage for.</p>
53    pub fn usage_tracking_resource(&self) -> ::std::option::Option<&crate::types::UsageTrackingResource> {
54        self.usage_tracking_resource.as_ref()
55    }
56    /// <p>The status of the budget.</p>
57    /// <ul>
58    /// <li>
59    /// <p><code>ACTIVE</code>–Get a budget being evaluated.</p></li>
60    /// <li>
61    /// <p><code>INACTIVE</code>–Get an inactive budget. This can include expired, canceled, or deleted statuses.</p></li>
62    /// </ul>
63    pub fn status(&self) -> &crate::types::BudgetStatus {
64        &self.status
65    }
66    /// <p>The display name of the budget.</p><important>
67    /// <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>
68    /// </important>
69    pub fn display_name(&self) -> &str {
70        use std::ops::Deref;
71        self.display_name.deref()
72    }
73    /// <p>The description of the budget.</p><important>
74    /// <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>
75    /// </important>
76    pub fn description(&self) -> ::std::option::Option<&str> {
77        self.description.as_deref()
78    }
79    /// <p>The consumed usage limit for the budget.</p>
80    pub fn approximate_dollar_limit(&self) -> f32 {
81        self.approximate_dollar_limit
82    }
83    /// <p>The usages of the budget.</p>
84    pub fn usages(&self) -> ::std::option::Option<&crate::types::ConsumedUsages> {
85        self.usages.as_ref()
86    }
87    /// <p>The budget actions for the budget.</p>
88    pub fn actions(&self) -> &[crate::types::ResponseBudgetAction] {
89        use std::ops::Deref;
90        self.actions.deref()
91    }
92    /// <p>The budget schedule.</p>
93    pub fn schedule(&self) -> ::std::option::Option<&crate::types::BudgetSchedule> {
94        self.schedule.as_ref()
95    }
96    /// <p>The user or system that created this resource.</p>
97    pub fn created_by(&self) -> &str {
98        use std::ops::Deref;
99        self.created_by.deref()
100    }
101    /// <p>The date and time the resource was created.</p>
102    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
103        &self.created_at
104    }
105    /// <p>The user or system that updated this resource.</p>
106    pub fn updated_by(&self) -> ::std::option::Option<&str> {
107        self.updated_by.as_deref()
108    }
109    /// <p>The date and time the resource was updated.</p>
110    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
111        self.updated_at.as_ref()
112    }
113    /// <p>The date and time the queue stopped.</p>
114    pub fn queue_stopped_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
115        self.queue_stopped_at.as_ref()
116    }
117}
118impl ::std::fmt::Debug for GetBudgetOutput {
119    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
120        let mut formatter = f.debug_struct("GetBudgetOutput");
121        formatter.field("budget_id", &self.budget_id);
122        formatter.field("usage_tracking_resource", &self.usage_tracking_resource);
123        formatter.field("status", &self.status);
124        formatter.field("display_name", &self.display_name);
125        formatter.field("description", &"*** Sensitive Data Redacted ***");
126        formatter.field("approximate_dollar_limit", &self.approximate_dollar_limit);
127        formatter.field("usages", &self.usages);
128        formatter.field("actions", &self.actions);
129        formatter.field("schedule", &self.schedule);
130        formatter.field("created_by", &self.created_by);
131        formatter.field("created_at", &self.created_at);
132        formatter.field("updated_by", &self.updated_by);
133        formatter.field("updated_at", &self.updated_at);
134        formatter.field("queue_stopped_at", &self.queue_stopped_at);
135        formatter.field("_request_id", &self._request_id);
136        formatter.finish()
137    }
138}
139impl ::aws_types::request_id::RequestId for GetBudgetOutput {
140    fn request_id(&self) -> Option<&str> {
141        self._request_id.as_deref()
142    }
143}
144impl GetBudgetOutput {
145    /// Creates a new builder-style object to manufacture [`GetBudgetOutput`](crate::operation::get_budget::GetBudgetOutput).
146    pub fn builder() -> crate::operation::get_budget::builders::GetBudgetOutputBuilder {
147        crate::operation::get_budget::builders::GetBudgetOutputBuilder::default()
148    }
149}
150
151/// A builder for [`GetBudgetOutput`](crate::operation::get_budget::GetBudgetOutput).
152#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
153#[non_exhaustive]
154pub struct GetBudgetOutputBuilder {
155    pub(crate) budget_id: ::std::option::Option<::std::string::String>,
156    pub(crate) usage_tracking_resource: ::std::option::Option<crate::types::UsageTrackingResource>,
157    pub(crate) status: ::std::option::Option<crate::types::BudgetStatus>,
158    pub(crate) display_name: ::std::option::Option<::std::string::String>,
159    pub(crate) description: ::std::option::Option<::std::string::String>,
160    pub(crate) approximate_dollar_limit: ::std::option::Option<f32>,
161    pub(crate) usages: ::std::option::Option<crate::types::ConsumedUsages>,
162    pub(crate) actions: ::std::option::Option<::std::vec::Vec<crate::types::ResponseBudgetAction>>,
163    pub(crate) schedule: ::std::option::Option<crate::types::BudgetSchedule>,
164    pub(crate) created_by: ::std::option::Option<::std::string::String>,
165    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
166    pub(crate) updated_by: ::std::option::Option<::std::string::String>,
167    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
168    pub(crate) queue_stopped_at: ::std::option::Option<::aws_smithy_types::DateTime>,
169    _request_id: Option<String>,
170}
171impl GetBudgetOutputBuilder {
172    /// <p>The budget ID.</p>
173    /// This field is required.
174    pub fn budget_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175        self.budget_id = ::std::option::Option::Some(input.into());
176        self
177    }
178    /// <p>The budget ID.</p>
179    pub fn set_budget_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180        self.budget_id = input;
181        self
182    }
183    /// <p>The budget ID.</p>
184    pub fn get_budget_id(&self) -> &::std::option::Option<::std::string::String> {
185        &self.budget_id
186    }
187    /// <p>The resource that the budget is tracking usage for.</p>
188    /// This field is required.
189    pub fn usage_tracking_resource(mut self, input: crate::types::UsageTrackingResource) -> Self {
190        self.usage_tracking_resource = ::std::option::Option::Some(input);
191        self
192    }
193    /// <p>The resource that the budget is tracking usage for.</p>
194    pub fn set_usage_tracking_resource(mut self, input: ::std::option::Option<crate::types::UsageTrackingResource>) -> Self {
195        self.usage_tracking_resource = input;
196        self
197    }
198    /// <p>The resource that the budget is tracking usage for.</p>
199    pub fn get_usage_tracking_resource(&self) -> &::std::option::Option<crate::types::UsageTrackingResource> {
200        &self.usage_tracking_resource
201    }
202    /// <p>The status of the budget.</p>
203    /// <ul>
204    /// <li>
205    /// <p><code>ACTIVE</code>–Get a budget being evaluated.</p></li>
206    /// <li>
207    /// <p><code>INACTIVE</code>–Get an inactive budget. This can include expired, canceled, or deleted statuses.</p></li>
208    /// </ul>
209    /// This field is required.
210    pub fn status(mut self, input: crate::types::BudgetStatus) -> Self {
211        self.status = ::std::option::Option::Some(input);
212        self
213    }
214    /// <p>The status of the budget.</p>
215    /// <ul>
216    /// <li>
217    /// <p><code>ACTIVE</code>–Get a budget being evaluated.</p></li>
218    /// <li>
219    /// <p><code>INACTIVE</code>–Get an inactive budget. This can include expired, canceled, or deleted statuses.</p></li>
220    /// </ul>
221    pub fn set_status(mut self, input: ::std::option::Option<crate::types::BudgetStatus>) -> Self {
222        self.status = input;
223        self
224    }
225    /// <p>The status of the budget.</p>
226    /// <ul>
227    /// <li>
228    /// <p><code>ACTIVE</code>–Get a budget being evaluated.</p></li>
229    /// <li>
230    /// <p><code>INACTIVE</code>–Get an inactive budget. This can include expired, canceled, or deleted statuses.</p></li>
231    /// </ul>
232    pub fn get_status(&self) -> &::std::option::Option<crate::types::BudgetStatus> {
233        &self.status
234    }
235    /// <p>The display name of the budget.</p><important>
236    /// <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>
237    /// </important>
238    /// This field is required.
239    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
240        self.display_name = ::std::option::Option::Some(input.into());
241        self
242    }
243    /// <p>The display name of the budget.</p><important>
244    /// <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>
245    /// </important>
246    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
247        self.display_name = input;
248        self
249    }
250    /// <p>The display name of the budget.</p><important>
251    /// <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>
252    /// </important>
253    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
254        &self.display_name
255    }
256    /// <p>The description of the budget.</p><important>
257    /// <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>
258    /// </important>
259    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
260        self.description = ::std::option::Option::Some(input.into());
261        self
262    }
263    /// <p>The description of the budget.</p><important>
264    /// <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>
265    /// </important>
266    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
267        self.description = input;
268        self
269    }
270    /// <p>The description of the budget.</p><important>
271    /// <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>
272    /// </important>
273    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
274        &self.description
275    }
276    /// <p>The consumed usage limit for the budget.</p>
277    /// This field is required.
278    pub fn approximate_dollar_limit(mut self, input: f32) -> Self {
279        self.approximate_dollar_limit = ::std::option::Option::Some(input);
280        self
281    }
282    /// <p>The consumed usage limit for the budget.</p>
283    pub fn set_approximate_dollar_limit(mut self, input: ::std::option::Option<f32>) -> Self {
284        self.approximate_dollar_limit = input;
285        self
286    }
287    /// <p>The consumed usage limit for the budget.</p>
288    pub fn get_approximate_dollar_limit(&self) -> &::std::option::Option<f32> {
289        &self.approximate_dollar_limit
290    }
291    /// <p>The usages of the budget.</p>
292    /// This field is required.
293    pub fn usages(mut self, input: crate::types::ConsumedUsages) -> Self {
294        self.usages = ::std::option::Option::Some(input);
295        self
296    }
297    /// <p>The usages of the budget.</p>
298    pub fn set_usages(mut self, input: ::std::option::Option<crate::types::ConsumedUsages>) -> Self {
299        self.usages = input;
300        self
301    }
302    /// <p>The usages of the budget.</p>
303    pub fn get_usages(&self) -> &::std::option::Option<crate::types::ConsumedUsages> {
304        &self.usages
305    }
306    /// Appends an item to `actions`.
307    ///
308    /// To override the contents of this collection use [`set_actions`](Self::set_actions).
309    ///
310    /// <p>The budget actions for the budget.</p>
311    pub fn actions(mut self, input: crate::types::ResponseBudgetAction) -> Self {
312        let mut v = self.actions.unwrap_or_default();
313        v.push(input);
314        self.actions = ::std::option::Option::Some(v);
315        self
316    }
317    /// <p>The budget actions for the budget.</p>
318    pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResponseBudgetAction>>) -> Self {
319        self.actions = input;
320        self
321    }
322    /// <p>The budget actions for the budget.</p>
323    pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResponseBudgetAction>> {
324        &self.actions
325    }
326    /// <p>The budget schedule.</p>
327    /// This field is required.
328    pub fn schedule(mut self, input: crate::types::BudgetSchedule) -> Self {
329        self.schedule = ::std::option::Option::Some(input);
330        self
331    }
332    /// <p>The budget schedule.</p>
333    pub fn set_schedule(mut self, input: ::std::option::Option<crate::types::BudgetSchedule>) -> Self {
334        self.schedule = input;
335        self
336    }
337    /// <p>The budget schedule.</p>
338    pub fn get_schedule(&self) -> &::std::option::Option<crate::types::BudgetSchedule> {
339        &self.schedule
340    }
341    /// <p>The user or system that created this resource.</p>
342    /// This field is required.
343    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
344        self.created_by = ::std::option::Option::Some(input.into());
345        self
346    }
347    /// <p>The user or system that created this resource.</p>
348    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
349        self.created_by = input;
350        self
351    }
352    /// <p>The user or system that created this resource.</p>
353    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
354        &self.created_by
355    }
356    /// <p>The date and time the resource was created.</p>
357    /// This field is required.
358    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
359        self.created_at = ::std::option::Option::Some(input);
360        self
361    }
362    /// <p>The date and time the resource was created.</p>
363    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
364        self.created_at = input;
365        self
366    }
367    /// <p>The date and time the resource was created.</p>
368    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
369        &self.created_at
370    }
371    /// <p>The user or system that updated this resource.</p>
372    pub fn updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
373        self.updated_by = ::std::option::Option::Some(input.into());
374        self
375    }
376    /// <p>The user or system that updated this resource.</p>
377    pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
378        self.updated_by = input;
379        self
380    }
381    /// <p>The user or system that updated this resource.</p>
382    pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
383        &self.updated_by
384    }
385    /// <p>The date and time the resource was updated.</p>
386    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
387        self.updated_at = ::std::option::Option::Some(input);
388        self
389    }
390    /// <p>The date and time the resource was updated.</p>
391    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
392        self.updated_at = input;
393        self
394    }
395    /// <p>The date and time the resource was updated.</p>
396    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
397        &self.updated_at
398    }
399    /// <p>The date and time the queue stopped.</p>
400    pub fn queue_stopped_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
401        self.queue_stopped_at = ::std::option::Option::Some(input);
402        self
403    }
404    /// <p>The date and time the queue stopped.</p>
405    pub fn set_queue_stopped_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
406        self.queue_stopped_at = input;
407        self
408    }
409    /// <p>The date and time the queue stopped.</p>
410    pub fn get_queue_stopped_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
411        &self.queue_stopped_at
412    }
413    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
414        self._request_id = Some(request_id.into());
415        self
416    }
417
418    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
419        self._request_id = request_id;
420        self
421    }
422    /// Consumes the builder and constructs a [`GetBudgetOutput`](crate::operation::get_budget::GetBudgetOutput).
423    /// This method will fail if any of the following fields are not set:
424    /// - [`budget_id`](crate::operation::get_budget::builders::GetBudgetOutputBuilder::budget_id)
425    /// - [`status`](crate::operation::get_budget::builders::GetBudgetOutputBuilder::status)
426    /// - [`display_name`](crate::operation::get_budget::builders::GetBudgetOutputBuilder::display_name)
427    /// - [`approximate_dollar_limit`](crate::operation::get_budget::builders::GetBudgetOutputBuilder::approximate_dollar_limit)
428    /// - [`actions`](crate::operation::get_budget::builders::GetBudgetOutputBuilder::actions)
429    /// - [`created_by`](crate::operation::get_budget::builders::GetBudgetOutputBuilder::created_by)
430    /// - [`created_at`](crate::operation::get_budget::builders::GetBudgetOutputBuilder::created_at)
431    pub fn build(self) -> ::std::result::Result<crate::operation::get_budget::GetBudgetOutput, ::aws_smithy_types::error::operation::BuildError> {
432        ::std::result::Result::Ok(crate::operation::get_budget::GetBudgetOutput {
433            budget_id: self.budget_id.ok_or_else(|| {
434                ::aws_smithy_types::error::operation::BuildError::missing_field(
435                    "budget_id",
436                    "budget_id was not specified but it is required when building GetBudgetOutput",
437                )
438            })?,
439            usage_tracking_resource: self.usage_tracking_resource,
440            status: self.status.ok_or_else(|| {
441                ::aws_smithy_types::error::operation::BuildError::missing_field(
442                    "status",
443                    "status was not specified but it is required when building GetBudgetOutput",
444                )
445            })?,
446            display_name: self.display_name.ok_or_else(|| {
447                ::aws_smithy_types::error::operation::BuildError::missing_field(
448                    "display_name",
449                    "display_name was not specified but it is required when building GetBudgetOutput",
450                )
451            })?,
452            description: self.description,
453            approximate_dollar_limit: self.approximate_dollar_limit.ok_or_else(|| {
454                ::aws_smithy_types::error::operation::BuildError::missing_field(
455                    "approximate_dollar_limit",
456                    "approximate_dollar_limit was not specified but it is required when building GetBudgetOutput",
457                )
458            })?,
459            usages: self.usages,
460            actions: self.actions.ok_or_else(|| {
461                ::aws_smithy_types::error::operation::BuildError::missing_field(
462                    "actions",
463                    "actions was not specified but it is required when building GetBudgetOutput",
464                )
465            })?,
466            schedule: self.schedule,
467            created_by: self.created_by.ok_or_else(|| {
468                ::aws_smithy_types::error::operation::BuildError::missing_field(
469                    "created_by",
470                    "created_by was not specified but it is required when building GetBudgetOutput",
471                )
472            })?,
473            created_at: self.created_at.ok_or_else(|| {
474                ::aws_smithy_types::error::operation::BuildError::missing_field(
475                    "created_at",
476                    "created_at was not specified but it is required when building GetBudgetOutput",
477                )
478            })?,
479            updated_by: self.updated_by,
480            updated_at: self.updated_at,
481            queue_stopped_at: self.queue_stopped_at,
482            _request_id: self._request_id,
483        })
484    }
485}
486impl ::std::fmt::Debug for GetBudgetOutputBuilder {
487    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
488        let mut formatter = f.debug_struct("GetBudgetOutputBuilder");
489        formatter.field("budget_id", &self.budget_id);
490        formatter.field("usage_tracking_resource", &self.usage_tracking_resource);
491        formatter.field("status", &self.status);
492        formatter.field("display_name", &self.display_name);
493        formatter.field("description", &"*** Sensitive Data Redacted ***");
494        formatter.field("approximate_dollar_limit", &self.approximate_dollar_limit);
495        formatter.field("usages", &self.usages);
496        formatter.field("actions", &self.actions);
497        formatter.field("schedule", &self.schedule);
498        formatter.field("created_by", &self.created_by);
499        formatter.field("created_at", &self.created_at);
500        formatter.field("updated_by", &self.updated_by);
501        formatter.field("updated_at", &self.updated_at);
502        formatter.field("queue_stopped_at", &self.queue_stopped_at);
503        formatter.field("_request_id", &self._request_id);
504        formatter.finish()
505    }
506}