aws_sdk_deadline/operation/create_budget/
_create_budget_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateBudgetInput {
6 pub client_token: ::std::option::Option<::std::string::String>,
8 pub farm_id: ::std::option::Option<::std::string::String>,
10 pub usage_tracking_resource: ::std::option::Option<crate::types::UsageTrackingResource>,
12 pub display_name: ::std::option::Option<::std::string::String>,
16 pub description: ::std::option::Option<::std::string::String>,
20 pub approximate_dollar_limit: ::std::option::Option<f32>,
22 pub actions: ::std::option::Option<::std::vec::Vec<crate::types::BudgetActionToAdd>>,
24 pub schedule: ::std::option::Option<crate::types::BudgetSchedule>,
26}
27impl CreateBudgetInput {
28 pub fn client_token(&self) -> ::std::option::Option<&str> {
30 self.client_token.as_deref()
31 }
32 pub fn farm_id(&self) -> ::std::option::Option<&str> {
34 self.farm_id.as_deref()
35 }
36 pub fn usage_tracking_resource(&self) -> ::std::option::Option<&crate::types::UsageTrackingResource> {
38 self.usage_tracking_resource.as_ref()
39 }
40 pub fn display_name(&self) -> ::std::option::Option<&str> {
44 self.display_name.as_deref()
45 }
46 pub fn description(&self) -> ::std::option::Option<&str> {
50 self.description.as_deref()
51 }
52 pub fn approximate_dollar_limit(&self) -> ::std::option::Option<f32> {
54 self.approximate_dollar_limit
55 }
56 pub fn actions(&self) -> &[crate::types::BudgetActionToAdd] {
60 self.actions.as_deref().unwrap_or_default()
61 }
62 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 pub fn builder() -> crate::operation::create_budget::builders::CreateBudgetInputBuilder {
84 crate::operation::create_budget::builders::CreateBudgetInputBuilder::default()
85 }
86}
87
88#[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 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 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.client_token = input;
110 self
111 }
112 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
114 &self.client_token
115 }
116 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 pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.farm_id = input;
125 self
126 }
127 pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
129 &self.farm_id
130 }
131 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 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 pub fn get_usage_tracking_resource(&self) -> &::std::option::Option<crate::types::UsageTrackingResource> {
144 &self.usage_tracking_resource
145 }
146 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 pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158 self.display_name = input;
159 self
160 }
161 pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
165 &self.display_name
166 }
167 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178 self.description = input;
179 self
180 }
181 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
185 &self.description
186 }
187 pub fn approximate_dollar_limit(mut self, input: f32) -> Self {
190 self.approximate_dollar_limit = ::std::option::Option::Some(input);
191 self
192 }
193 pub fn set_approximate_dollar_limit(mut self, input: ::std::option::Option<f32>) -> Self {
195 self.approximate_dollar_limit = input;
196 self
197 }
198 pub fn get_approximate_dollar_limit(&self) -> &::std::option::Option<f32> {
200 &self.approximate_dollar_limit
201 }
202 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 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 pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BudgetActionToAdd>> {
220 &self.actions
221 }
222 pub fn schedule(mut self, input: crate::types::BudgetSchedule) -> Self {
225 self.schedule = ::std::option::Option::Some(input);
226 self
227 }
228 pub fn set_schedule(mut self, input: ::std::option::Option<crate::types::BudgetSchedule>) -> Self {
230 self.schedule = input;
231 self
232 }
233 pub fn get_schedule(&self) -> &::std::option::Option<crate::types::BudgetSchedule> {
235 &self.schedule
236 }
237 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}