aws_sdk_deadline/operation/get_limit/
_get_limit_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 GetLimitOutput {
6    /// <p>The display name of the limit.</p><important>
7    /// <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>
8    /// </important>
9    pub display_name: ::std::string::String,
10    /// <p>The value that you specify as the <code>name</code> in the <code>amounts</code> field of the <code>hostRequirements</code> in a step of a job template to declare the limit requirement.</p>
11    pub amount_requirement_name: ::std::string::String,
12    /// <p>The maximum number of resources constrained by this limit. When all of the resources are in use, steps that require the limit won't be scheduled until the resource is available.</p>
13    /// <p>The <code>maxValue</code> must not be 0. If the value is -1, there is no restriction on the number of resources that can be acquired for this limit.</p>
14    pub max_count: i32,
15    /// <p>The Unix timestamp of the date and time that the limit was created.</p>
16    pub created_at: ::aws_smithy_types::DateTime,
17    /// <p>The user identifier of the person that created the limit.</p>
18    pub created_by: ::std::string::String,
19    /// <p>The Unix timestamp of the date and time that the limit was last updated.</p>
20    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
21    /// <p>The user identifier of the person that last updated the limit.</p>
22    pub updated_by: ::std::option::Option<::std::string::String>,
23    /// <p>The unique identifier of the farm that contains the limit.</p>
24    pub farm_id: ::std::string::String,
25    /// <p>The unique identifier of the limit.</p>
26    pub limit_id: ::std::string::String,
27    /// <p>The number of resources from the limit that are being used by jobs. The result is delayed and may not be the count at the time that you called the operation.</p>
28    pub current_count: i32,
29    /// <p>The description of the limit that helps identify what the limit is used for.</p><important>
30    /// <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>
31    /// </important>
32    pub description: ::std::option::Option<::std::string::String>,
33    _request_id: Option<String>,
34}
35impl GetLimitOutput {
36    /// <p>The display name of the limit.</p><important>
37    /// <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>
38    /// </important>
39    pub fn display_name(&self) -> &str {
40        use std::ops::Deref;
41        self.display_name.deref()
42    }
43    /// <p>The value that you specify as the <code>name</code> in the <code>amounts</code> field of the <code>hostRequirements</code> in a step of a job template to declare the limit requirement.</p>
44    pub fn amount_requirement_name(&self) -> &str {
45        use std::ops::Deref;
46        self.amount_requirement_name.deref()
47    }
48    /// <p>The maximum number of resources constrained by this limit. When all of the resources are in use, steps that require the limit won't be scheduled until the resource is available.</p>
49    /// <p>The <code>maxValue</code> must not be 0. If the value is -1, there is no restriction on the number of resources that can be acquired for this limit.</p>
50    pub fn max_count(&self) -> i32 {
51        self.max_count
52    }
53    /// <p>The Unix timestamp of the date and time that the limit was created.</p>
54    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
55        &self.created_at
56    }
57    /// <p>The user identifier of the person that created the limit.</p>
58    pub fn created_by(&self) -> &str {
59        use std::ops::Deref;
60        self.created_by.deref()
61    }
62    /// <p>The Unix timestamp of the date and time that the limit was last updated.</p>
63    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
64        self.updated_at.as_ref()
65    }
66    /// <p>The user identifier of the person that last updated the limit.</p>
67    pub fn updated_by(&self) -> ::std::option::Option<&str> {
68        self.updated_by.as_deref()
69    }
70    /// <p>The unique identifier of the farm that contains the limit.</p>
71    pub fn farm_id(&self) -> &str {
72        use std::ops::Deref;
73        self.farm_id.deref()
74    }
75    /// <p>The unique identifier of the limit.</p>
76    pub fn limit_id(&self) -> &str {
77        use std::ops::Deref;
78        self.limit_id.deref()
79    }
80    /// <p>The number of resources from the limit that are being used by jobs. The result is delayed and may not be the count at the time that you called the operation.</p>
81    pub fn current_count(&self) -> i32 {
82        self.current_count
83    }
84    /// <p>The description of the limit that helps identify what the limit is used for.</p><important>
85    /// <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>
86    /// </important>
87    pub fn description(&self) -> ::std::option::Option<&str> {
88        self.description.as_deref()
89    }
90}
91impl ::std::fmt::Debug for GetLimitOutput {
92    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
93        let mut formatter = f.debug_struct("GetLimitOutput");
94        formatter.field("display_name", &self.display_name);
95        formatter.field("amount_requirement_name", &self.amount_requirement_name);
96        formatter.field("max_count", &self.max_count);
97        formatter.field("created_at", &self.created_at);
98        formatter.field("created_by", &self.created_by);
99        formatter.field("updated_at", &self.updated_at);
100        formatter.field("updated_by", &self.updated_by);
101        formatter.field("farm_id", &self.farm_id);
102        formatter.field("limit_id", &self.limit_id);
103        formatter.field("current_count", &self.current_count);
104        formatter.field("description", &"*** Sensitive Data Redacted ***");
105        formatter.field("_request_id", &self._request_id);
106        formatter.finish()
107    }
108}
109impl ::aws_types::request_id::RequestId for GetLimitOutput {
110    fn request_id(&self) -> Option<&str> {
111        self._request_id.as_deref()
112    }
113}
114impl GetLimitOutput {
115    /// Creates a new builder-style object to manufacture [`GetLimitOutput`](crate::operation::get_limit::GetLimitOutput).
116    pub fn builder() -> crate::operation::get_limit::builders::GetLimitOutputBuilder {
117        crate::operation::get_limit::builders::GetLimitOutputBuilder::default()
118    }
119}
120
121/// A builder for [`GetLimitOutput`](crate::operation::get_limit::GetLimitOutput).
122#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
123#[non_exhaustive]
124pub struct GetLimitOutputBuilder {
125    pub(crate) display_name: ::std::option::Option<::std::string::String>,
126    pub(crate) amount_requirement_name: ::std::option::Option<::std::string::String>,
127    pub(crate) max_count: ::std::option::Option<i32>,
128    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
129    pub(crate) created_by: ::std::option::Option<::std::string::String>,
130    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
131    pub(crate) updated_by: ::std::option::Option<::std::string::String>,
132    pub(crate) farm_id: ::std::option::Option<::std::string::String>,
133    pub(crate) limit_id: ::std::option::Option<::std::string::String>,
134    pub(crate) current_count: ::std::option::Option<i32>,
135    pub(crate) description: ::std::option::Option<::std::string::String>,
136    _request_id: Option<String>,
137}
138impl GetLimitOutputBuilder {
139    /// <p>The display name of the limit.</p><important>
140    /// <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>
141    /// </important>
142    /// This field is required.
143    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.display_name = ::std::option::Option::Some(input.into());
145        self
146    }
147    /// <p>The display name of the limit.</p><important>
148    /// <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>
149    /// </important>
150    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.display_name = input;
152        self
153    }
154    /// <p>The display name of the limit.</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 get_display_name(&self) -> &::std::option::Option<::std::string::String> {
158        &self.display_name
159    }
160    /// <p>The value that you specify as the <code>name</code> in the <code>amounts</code> field of the <code>hostRequirements</code> in a step of a job template to declare the limit requirement.</p>
161    /// This field is required.
162    pub fn amount_requirement_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.amount_requirement_name = ::std::option::Option::Some(input.into());
164        self
165    }
166    /// <p>The value that you specify as the <code>name</code> in the <code>amounts</code> field of the <code>hostRequirements</code> in a step of a job template to declare the limit requirement.</p>
167    pub fn set_amount_requirement_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.amount_requirement_name = input;
169        self
170    }
171    /// <p>The value that you specify as the <code>name</code> in the <code>amounts</code> field of the <code>hostRequirements</code> in a step of a job template to declare the limit requirement.</p>
172    pub fn get_amount_requirement_name(&self) -> &::std::option::Option<::std::string::String> {
173        &self.amount_requirement_name
174    }
175    /// <p>The maximum number of resources constrained by this limit. When all of the resources are in use, steps that require the limit won't be scheduled until the resource is available.</p>
176    /// <p>The <code>maxValue</code> must not be 0. If the value is -1, there is no restriction on the number of resources that can be acquired for this limit.</p>
177    /// This field is required.
178    pub fn max_count(mut self, input: i32) -> Self {
179        self.max_count = ::std::option::Option::Some(input);
180        self
181    }
182    /// <p>The maximum number of resources constrained by this limit. When all of the resources are in use, steps that require the limit won't be scheduled until the resource is available.</p>
183    /// <p>The <code>maxValue</code> must not be 0. If the value is -1, there is no restriction on the number of resources that can be acquired for this limit.</p>
184    pub fn set_max_count(mut self, input: ::std::option::Option<i32>) -> Self {
185        self.max_count = input;
186        self
187    }
188    /// <p>The maximum number of resources constrained by this limit. When all of the resources are in use, steps that require the limit won't be scheduled until the resource is available.</p>
189    /// <p>The <code>maxValue</code> must not be 0. If the value is -1, there is no restriction on the number of resources that can be acquired for this limit.</p>
190    pub fn get_max_count(&self) -> &::std::option::Option<i32> {
191        &self.max_count
192    }
193    /// <p>The Unix timestamp of the date and time that the limit was created.</p>
194    /// This field is required.
195    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
196        self.created_at = ::std::option::Option::Some(input);
197        self
198    }
199    /// <p>The Unix timestamp of the date and time that the limit was created.</p>
200    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
201        self.created_at = input;
202        self
203    }
204    /// <p>The Unix timestamp of the date and time that the limit was created.</p>
205    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
206        &self.created_at
207    }
208    /// <p>The user identifier of the person that created the limit.</p>
209    /// This field is required.
210    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211        self.created_by = ::std::option::Option::Some(input.into());
212        self
213    }
214    /// <p>The user identifier of the person that created the limit.</p>
215    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.created_by = input;
217        self
218    }
219    /// <p>The user identifier of the person that created the limit.</p>
220    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
221        &self.created_by
222    }
223    /// <p>The Unix timestamp of the date and time that the limit was last updated.</p>
224    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
225        self.updated_at = ::std::option::Option::Some(input);
226        self
227    }
228    /// <p>The Unix timestamp of the date and time that the limit was last updated.</p>
229    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
230        self.updated_at = input;
231        self
232    }
233    /// <p>The Unix timestamp of the date and time that the limit was last updated.</p>
234    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
235        &self.updated_at
236    }
237    /// <p>The user identifier of the person that last updated the limit.</p>
238    pub fn updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
239        self.updated_by = ::std::option::Option::Some(input.into());
240        self
241    }
242    /// <p>The user identifier of the person that last updated the limit.</p>
243    pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
244        self.updated_by = input;
245        self
246    }
247    /// <p>The user identifier of the person that last updated the limit.</p>
248    pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
249        &self.updated_by
250    }
251    /// <p>The unique identifier of the farm that contains the limit.</p>
252    /// This field is required.
253    pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
254        self.farm_id = ::std::option::Option::Some(input.into());
255        self
256    }
257    /// <p>The unique identifier of the farm that contains the limit.</p>
258    pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
259        self.farm_id = input;
260        self
261    }
262    /// <p>The unique identifier of the farm that contains the limit.</p>
263    pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
264        &self.farm_id
265    }
266    /// <p>The unique identifier of the limit.</p>
267    /// This field is required.
268    pub fn limit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
269        self.limit_id = ::std::option::Option::Some(input.into());
270        self
271    }
272    /// <p>The unique identifier of the limit.</p>
273    pub fn set_limit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
274        self.limit_id = input;
275        self
276    }
277    /// <p>The unique identifier of the limit.</p>
278    pub fn get_limit_id(&self) -> &::std::option::Option<::std::string::String> {
279        &self.limit_id
280    }
281    /// <p>The number of resources from the limit that are being used by jobs. The result is delayed and may not be the count at the time that you called the operation.</p>
282    /// This field is required.
283    pub fn current_count(mut self, input: i32) -> Self {
284        self.current_count = ::std::option::Option::Some(input);
285        self
286    }
287    /// <p>The number of resources from the limit that are being used by jobs. The result is delayed and may not be the count at the time that you called the operation.</p>
288    pub fn set_current_count(mut self, input: ::std::option::Option<i32>) -> Self {
289        self.current_count = input;
290        self
291    }
292    /// <p>The number of resources from the limit that are being used by jobs. The result is delayed and may not be the count at the time that you called the operation.</p>
293    pub fn get_current_count(&self) -> &::std::option::Option<i32> {
294        &self.current_count
295    }
296    /// <p>The description of the limit that helps identify what the limit is used for.</p><important>
297    /// <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>
298    /// </important>
299    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
300        self.description = ::std::option::Option::Some(input.into());
301        self
302    }
303    /// <p>The description of the limit that helps identify what the limit is used for.</p><important>
304    /// <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>
305    /// </important>
306    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
307        self.description = input;
308        self
309    }
310    /// <p>The description of the limit that helps identify what the limit is used for.</p><important>
311    /// <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>
312    /// </important>
313    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
314        &self.description
315    }
316    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
317        self._request_id = Some(request_id.into());
318        self
319    }
320
321    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
322        self._request_id = request_id;
323        self
324    }
325    /// Consumes the builder and constructs a [`GetLimitOutput`](crate::operation::get_limit::GetLimitOutput).
326    /// This method will fail if any of the following fields are not set:
327    /// - [`display_name`](crate::operation::get_limit::builders::GetLimitOutputBuilder::display_name)
328    /// - [`amount_requirement_name`](crate::operation::get_limit::builders::GetLimitOutputBuilder::amount_requirement_name)
329    /// - [`max_count`](crate::operation::get_limit::builders::GetLimitOutputBuilder::max_count)
330    /// - [`created_at`](crate::operation::get_limit::builders::GetLimitOutputBuilder::created_at)
331    /// - [`created_by`](crate::operation::get_limit::builders::GetLimitOutputBuilder::created_by)
332    /// - [`farm_id`](crate::operation::get_limit::builders::GetLimitOutputBuilder::farm_id)
333    /// - [`limit_id`](crate::operation::get_limit::builders::GetLimitOutputBuilder::limit_id)
334    /// - [`current_count`](crate::operation::get_limit::builders::GetLimitOutputBuilder::current_count)
335    pub fn build(self) -> ::std::result::Result<crate::operation::get_limit::GetLimitOutput, ::aws_smithy_types::error::operation::BuildError> {
336        ::std::result::Result::Ok(crate::operation::get_limit::GetLimitOutput {
337            display_name: self.display_name.ok_or_else(|| {
338                ::aws_smithy_types::error::operation::BuildError::missing_field(
339                    "display_name",
340                    "display_name was not specified but it is required when building GetLimitOutput",
341                )
342            })?,
343            amount_requirement_name: self.amount_requirement_name.ok_or_else(|| {
344                ::aws_smithy_types::error::operation::BuildError::missing_field(
345                    "amount_requirement_name",
346                    "amount_requirement_name was not specified but it is required when building GetLimitOutput",
347                )
348            })?,
349            max_count: self.max_count.ok_or_else(|| {
350                ::aws_smithy_types::error::operation::BuildError::missing_field(
351                    "max_count",
352                    "max_count was not specified but it is required when building GetLimitOutput",
353                )
354            })?,
355            created_at: self.created_at.ok_or_else(|| {
356                ::aws_smithy_types::error::operation::BuildError::missing_field(
357                    "created_at",
358                    "created_at was not specified but it is required when building GetLimitOutput",
359                )
360            })?,
361            created_by: self.created_by.ok_or_else(|| {
362                ::aws_smithy_types::error::operation::BuildError::missing_field(
363                    "created_by",
364                    "created_by was not specified but it is required when building GetLimitOutput",
365                )
366            })?,
367            updated_at: self.updated_at,
368            updated_by: self.updated_by,
369            farm_id: self.farm_id.ok_or_else(|| {
370                ::aws_smithy_types::error::operation::BuildError::missing_field(
371                    "farm_id",
372                    "farm_id was not specified but it is required when building GetLimitOutput",
373                )
374            })?,
375            limit_id: self.limit_id.ok_or_else(|| {
376                ::aws_smithy_types::error::operation::BuildError::missing_field(
377                    "limit_id",
378                    "limit_id was not specified but it is required when building GetLimitOutput",
379                )
380            })?,
381            current_count: self.current_count.ok_or_else(|| {
382                ::aws_smithy_types::error::operation::BuildError::missing_field(
383                    "current_count",
384                    "current_count was not specified but it is required when building GetLimitOutput",
385                )
386            })?,
387            description: self.description,
388            _request_id: self._request_id,
389        })
390    }
391}
392impl ::std::fmt::Debug for GetLimitOutputBuilder {
393    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
394        let mut formatter = f.debug_struct("GetLimitOutputBuilder");
395        formatter.field("display_name", &self.display_name);
396        formatter.field("amount_requirement_name", &self.amount_requirement_name);
397        formatter.field("max_count", &self.max_count);
398        formatter.field("created_at", &self.created_at);
399        formatter.field("created_by", &self.created_by);
400        formatter.field("updated_at", &self.updated_at);
401        formatter.field("updated_by", &self.updated_by);
402        formatter.field("farm_id", &self.farm_id);
403        formatter.field("limit_id", &self.limit_id);
404        formatter.field("current_count", &self.current_count);
405        formatter.field("description", &"*** Sensitive Data Redacted ***");
406        formatter.field("_request_id", &self._request_id);
407        formatter.finish()
408    }
409}