aws_sdk_deadline/operation/get_budget/
_get_budget_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct GetBudgetOutput {
6 pub budget_id: ::std::string::String,
8 pub usage_tracking_resource: ::std::option::Option<crate::types::UsageTrackingResource>,
10 pub status: crate::types::BudgetStatus,
18 pub display_name: ::std::string::String,
22 pub description: ::std::option::Option<::std::string::String>,
26 pub approximate_dollar_limit: f32,
28 pub usages: ::std::option::Option<crate::types::ConsumedUsages>,
30 pub actions: ::std::vec::Vec<crate::types::ResponseBudgetAction>,
32 pub schedule: ::std::option::Option<crate::types::BudgetSchedule>,
34 pub created_by: ::std::string::String,
36 pub created_at: ::aws_smithy_types::DateTime,
38 pub updated_by: ::std::option::Option<::std::string::String>,
40 pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
42 pub queue_stopped_at: ::std::option::Option<::aws_smithy_types::DateTime>,
44 _request_id: Option<String>,
45}
46impl GetBudgetOutput {
47 pub fn budget_id(&self) -> &str {
49 use std::ops::Deref;
50 self.budget_id.deref()
51 }
52 pub fn usage_tracking_resource(&self) -> ::std::option::Option<&crate::types::UsageTrackingResource> {
54 self.usage_tracking_resource.as_ref()
55 }
56 pub fn status(&self) -> &crate::types::BudgetStatus {
64 &self.status
65 }
66 pub fn display_name(&self) -> &str {
70 use std::ops::Deref;
71 self.display_name.deref()
72 }
73 pub fn description(&self) -> ::std::option::Option<&str> {
77 self.description.as_deref()
78 }
79 pub fn approximate_dollar_limit(&self) -> f32 {
81 self.approximate_dollar_limit
82 }
83 pub fn usages(&self) -> ::std::option::Option<&crate::types::ConsumedUsages> {
85 self.usages.as_ref()
86 }
87 pub fn actions(&self) -> &[crate::types::ResponseBudgetAction] {
89 use std::ops::Deref;
90 self.actions.deref()
91 }
92 pub fn schedule(&self) -> ::std::option::Option<&crate::types::BudgetSchedule> {
94 self.schedule.as_ref()
95 }
96 pub fn created_by(&self) -> &str {
98 use std::ops::Deref;
99 self.created_by.deref()
100 }
101 pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
103 &self.created_at
104 }
105 pub fn updated_by(&self) -> ::std::option::Option<&str> {
107 self.updated_by.as_deref()
108 }
109 pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
111 self.updated_at.as_ref()
112 }
113 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 pub fn builder() -> crate::operation::get_budget::builders::GetBudgetOutputBuilder {
147 crate::operation::get_budget::builders::GetBudgetOutputBuilder::default()
148 }
149}
150
151#[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 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 pub fn set_budget_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180 self.budget_id = input;
181 self
182 }
183 pub fn get_budget_id(&self) -> &::std::option::Option<::std::string::String> {
185 &self.budget_id
186 }
187 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 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 pub fn get_usage_tracking_resource(&self) -> &::std::option::Option<crate::types::UsageTrackingResource> {
200 &self.usage_tracking_resource
201 }
202 pub fn status(mut self, input: crate::types::BudgetStatus) -> Self {
211 self.status = ::std::option::Option::Some(input);
212 self
213 }
214 pub fn set_status(mut self, input: ::std::option::Option<crate::types::BudgetStatus>) -> Self {
222 self.status = input;
223 self
224 }
225 pub fn get_status(&self) -> &::std::option::Option<crate::types::BudgetStatus> {
233 &self.status
234 }
235 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 pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
247 self.display_name = input;
248 self
249 }
250 pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
254 &self.display_name
255 }
256 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
267 self.description = input;
268 self
269 }
270 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
274 &self.description
275 }
276 pub fn approximate_dollar_limit(mut self, input: f32) -> Self {
279 self.approximate_dollar_limit = ::std::option::Option::Some(input);
280 self
281 }
282 pub fn set_approximate_dollar_limit(mut self, input: ::std::option::Option<f32>) -> Self {
284 self.approximate_dollar_limit = input;
285 self
286 }
287 pub fn get_approximate_dollar_limit(&self) -> &::std::option::Option<f32> {
289 &self.approximate_dollar_limit
290 }
291 pub fn usages(mut self, input: crate::types::ConsumedUsages) -> Self {
294 self.usages = ::std::option::Option::Some(input);
295 self
296 }
297 pub fn set_usages(mut self, input: ::std::option::Option<crate::types::ConsumedUsages>) -> Self {
299 self.usages = input;
300 self
301 }
302 pub fn get_usages(&self) -> &::std::option::Option<crate::types::ConsumedUsages> {
304 &self.usages
305 }
306 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 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 pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResponseBudgetAction>> {
324 &self.actions
325 }
326 pub fn schedule(mut self, input: crate::types::BudgetSchedule) -> Self {
329 self.schedule = ::std::option::Option::Some(input);
330 self
331 }
332 pub fn set_schedule(mut self, input: ::std::option::Option<crate::types::BudgetSchedule>) -> Self {
334 self.schedule = input;
335 self
336 }
337 pub fn get_schedule(&self) -> &::std::option::Option<crate::types::BudgetSchedule> {
339 &self.schedule
340 }
341 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 pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
349 self.created_by = input;
350 self
351 }
352 pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
354 &self.created_by
355 }
356 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 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 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
369 &self.created_at
370 }
371 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 pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
378 self.updated_by = input;
379 self
380 }
381 pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
383 &self.updated_by
384 }
385 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 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 pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
397 &self.updated_at
398 }
399 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 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 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 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}