aws_sdk_deadline/operation/create_budget/
_create_budget_input.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 CreateBudgetInput {
6    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
7    pub client_token: ::std::option::Option<::std::string::String>,
8    /// <p>The farm ID to include in this budget.</p>
9    pub farm_id: ::std::option::Option<::std::string::String>,
10    /// <p>The queue ID provided to this budget to track usage.</p>
11    pub usage_tracking_resource: ::std::option::Option<crate::types::UsageTrackingResource>,
12    /// <p>The display name of the budget.</p><important>
13    /// <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>
14    /// </important>
15    pub display_name: ::std::option::Option<::std::string::String>,
16    /// <p>The description of the budget.</p><important>
17    /// <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>
18    /// </important>
19    pub description: ::std::option::Option<::std::string::String>,
20    /// <p>The dollar limit based on consumed usage.</p>
21    pub approximate_dollar_limit: ::std::option::Option<f32>,
22    /// <p>The budget actions to specify what happens when the budget runs out.</p>
23    pub actions: ::std::option::Option<::std::vec::Vec<crate::types::BudgetActionToAdd>>,
24    /// <p>The schedule to associate with this budget.</p>
25    pub schedule: ::std::option::Option<crate::types::BudgetSchedule>,
26}
27impl CreateBudgetInput {
28    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
29    pub fn client_token(&self) -> ::std::option::Option<&str> {
30        self.client_token.as_deref()
31    }
32    /// <p>The farm ID to include in this budget.</p>
33    pub fn farm_id(&self) -> ::std::option::Option<&str> {
34        self.farm_id.as_deref()
35    }
36    /// <p>The queue ID provided to this budget to track usage.</p>
37    pub fn usage_tracking_resource(&self) -> ::std::option::Option<&crate::types::UsageTrackingResource> {
38        self.usage_tracking_resource.as_ref()
39    }
40    /// <p>The display name of the budget.</p><important>
41    /// <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>
42    /// </important>
43    pub fn display_name(&self) -> ::std::option::Option<&str> {
44        self.display_name.as_deref()
45    }
46    /// <p>The description of the budget.</p><important>
47    /// <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>
48    /// </important>
49    pub fn description(&self) -> ::std::option::Option<&str> {
50        self.description.as_deref()
51    }
52    /// <p>The dollar limit based on consumed usage.</p>
53    pub fn approximate_dollar_limit(&self) -> ::std::option::Option<f32> {
54        self.approximate_dollar_limit
55    }
56    /// <p>The budget actions to specify what happens when the budget runs out.</p>
57    ///
58    /// 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.is_none()`.
59    pub fn actions(&self) -> &[crate::types::BudgetActionToAdd] {
60        self.actions.as_deref().unwrap_or_default()
61    }
62    /// <p>The schedule to associate with this budget.</p>
63    pub fn schedule(&self) -> ::std::option::Option<&crate::types::BudgetSchedule> {
64        self.schedule.as_ref()
65    }
66}
67impl ::std::fmt::Debug for CreateBudgetInput {
68    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
69        let mut formatter = f.debug_struct("CreateBudgetInput");
70        formatter.field("client_token", &self.client_token);
71        formatter.field("farm_id", &self.farm_id);
72        formatter.field("usage_tracking_resource", &self.usage_tracking_resource);
73        formatter.field("display_name", &self.display_name);
74        formatter.field("description", &"*** Sensitive Data Redacted ***");
75        formatter.field("approximate_dollar_limit", &self.approximate_dollar_limit);
76        formatter.field("actions", &self.actions);
77        formatter.field("schedule", &self.schedule);
78        formatter.finish()
79    }
80}
81impl CreateBudgetInput {
82    /// Creates a new builder-style object to manufacture [`CreateBudgetInput`](crate::operation::create_budget::CreateBudgetInput).
83    pub fn builder() -> crate::operation::create_budget::builders::CreateBudgetInputBuilder {
84        crate::operation::create_budget::builders::CreateBudgetInputBuilder::default()
85    }
86}
87
88/// A builder for [`CreateBudgetInput`](crate::operation::create_budget::CreateBudgetInput).
89#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
90#[non_exhaustive]
91pub struct CreateBudgetInputBuilder {
92    pub(crate) client_token: ::std::option::Option<::std::string::String>,
93    pub(crate) farm_id: ::std::option::Option<::std::string::String>,
94    pub(crate) usage_tracking_resource: ::std::option::Option<crate::types::UsageTrackingResource>,
95    pub(crate) display_name: ::std::option::Option<::std::string::String>,
96    pub(crate) description: ::std::option::Option<::std::string::String>,
97    pub(crate) approximate_dollar_limit: ::std::option::Option<f32>,
98    pub(crate) actions: ::std::option::Option<::std::vec::Vec<crate::types::BudgetActionToAdd>>,
99    pub(crate) schedule: ::std::option::Option<crate::types::BudgetSchedule>,
100}
101impl CreateBudgetInputBuilder {
102    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
103    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.client_token = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
108    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.client_token = input;
110        self
111    }
112    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
113    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
114        &self.client_token
115    }
116    /// <p>The farm ID to include in this budget.</p>
117    /// This field is required.
118    pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.farm_id = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>The farm ID to include in this budget.</p>
123    pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.farm_id = input;
125        self
126    }
127    /// <p>The farm ID to include in this budget.</p>
128    pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
129        &self.farm_id
130    }
131    /// <p>The queue ID provided to this budget to track usage.</p>
132    /// This field is required.
133    pub fn usage_tracking_resource(mut self, input: crate::types::UsageTrackingResource) -> Self {
134        self.usage_tracking_resource = ::std::option::Option::Some(input);
135        self
136    }
137    /// <p>The queue ID provided to this budget to track usage.</p>
138    pub fn set_usage_tracking_resource(mut self, input: ::std::option::Option<crate::types::UsageTrackingResource>) -> Self {
139        self.usage_tracking_resource = input;
140        self
141    }
142    /// <p>The queue ID provided to this budget to track usage.</p>
143    pub fn get_usage_tracking_resource(&self) -> &::std::option::Option<crate::types::UsageTrackingResource> {
144        &self.usage_tracking_resource
145    }
146    /// <p>The display name of the budget.</p><important>
147    /// <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>
148    /// </important>
149    /// This field is required.
150    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.display_name = ::std::option::Option::Some(input.into());
152        self
153    }
154    /// <p>The display name of the budget.</p><important>
155    /// <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>
156    /// </important>
157    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.display_name = input;
159        self
160    }
161    /// <p>The display name of the budget.</p><important>
162    /// <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>
163    /// </important>
164    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
165        &self.display_name
166    }
167    /// <p>The description of the budget.</p><important>
168    /// <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>
169    /// </important>
170    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.description = ::std::option::Option::Some(input.into());
172        self
173    }
174    /// <p>The description of the budget.</p><important>
175    /// <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>
176    /// </important>
177    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.description = input;
179        self
180    }
181    /// <p>The description of the budget.</p><important>
182    /// <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>
183    /// </important>
184    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
185        &self.description
186    }
187    /// <p>The dollar limit based on consumed usage.</p>
188    /// This field is required.
189    pub fn approximate_dollar_limit(mut self, input: f32) -> Self {
190        self.approximate_dollar_limit = ::std::option::Option::Some(input);
191        self
192    }
193    /// <p>The dollar limit based on consumed usage.</p>
194    pub fn set_approximate_dollar_limit(mut self, input: ::std::option::Option<f32>) -> Self {
195        self.approximate_dollar_limit = input;
196        self
197    }
198    /// <p>The dollar limit based on consumed usage.</p>
199    pub fn get_approximate_dollar_limit(&self) -> &::std::option::Option<f32> {
200        &self.approximate_dollar_limit
201    }
202    /// Appends an item to `actions`.
203    ///
204    /// To override the contents of this collection use [`set_actions`](Self::set_actions).
205    ///
206    /// <p>The budget actions to specify what happens when the budget runs out.</p>
207    pub fn actions(mut self, input: crate::types::BudgetActionToAdd) -> Self {
208        let mut v = self.actions.unwrap_or_default();
209        v.push(input);
210        self.actions = ::std::option::Option::Some(v);
211        self
212    }
213    /// <p>The budget actions to specify what happens when the budget runs out.</p>
214    pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BudgetActionToAdd>>) -> Self {
215        self.actions = input;
216        self
217    }
218    /// <p>The budget actions to specify what happens when the budget runs out.</p>
219    pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BudgetActionToAdd>> {
220        &self.actions
221    }
222    /// <p>The schedule to associate with this budget.</p>
223    /// This field is required.
224    pub fn schedule(mut self, input: crate::types::BudgetSchedule) -> Self {
225        self.schedule = ::std::option::Option::Some(input);
226        self
227    }
228    /// <p>The schedule to associate with this budget.</p>
229    pub fn set_schedule(mut self, input: ::std::option::Option<crate::types::BudgetSchedule>) -> Self {
230        self.schedule = input;
231        self
232    }
233    /// <p>The schedule to associate with this budget.</p>
234    pub fn get_schedule(&self) -> &::std::option::Option<crate::types::BudgetSchedule> {
235        &self.schedule
236    }
237    /// Consumes the builder and constructs a [`CreateBudgetInput`](crate::operation::create_budget::CreateBudgetInput).
238    pub fn build(
239        self,
240    ) -> ::std::result::Result<crate::operation::create_budget::CreateBudgetInput, ::aws_smithy_types::error::operation::BuildError> {
241        ::std::result::Result::Ok(crate::operation::create_budget::CreateBudgetInput {
242            client_token: self.client_token,
243            farm_id: self.farm_id,
244            usage_tracking_resource: self.usage_tracking_resource,
245            display_name: self.display_name,
246            description: self.description,
247            approximate_dollar_limit: self.approximate_dollar_limit,
248            actions: self.actions,
249            schedule: self.schedule,
250        })
251    }
252}
253impl ::std::fmt::Debug for CreateBudgetInputBuilder {
254    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
255        let mut formatter = f.debug_struct("CreateBudgetInputBuilder");
256        formatter.field("client_token", &self.client_token);
257        formatter.field("farm_id", &self.farm_id);
258        formatter.field("usage_tracking_resource", &self.usage_tracking_resource);
259        formatter.field("display_name", &self.display_name);
260        formatter.field("description", &"*** Sensitive Data Redacted ***");
261        formatter.field("approximate_dollar_limit", &self.approximate_dollar_limit);
262        formatter.field("actions", &self.actions);
263        formatter.field("schedule", &self.schedule);
264        formatter.finish()
265    }
266}