aws_sdk_deadline/operation/create_limit/
_create_limit_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 CreateLimitInput {
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 display name of the limit.</p><important>
9    /// <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>
10    /// </important>
11    pub display_name: ::std::option::Option<::std::string::String>,
12    /// <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>
13    pub amount_requirement_name: ::std::option::Option<::std::string::String>,
14    /// <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>
15    /// <p>The <code>maxCount</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>
16    pub max_count: ::std::option::Option<i32>,
17    /// <p>The farm ID of the farm that contains the limit.</p>
18    pub farm_id: ::std::option::Option<::std::string::String>,
19    /// <p>A description of the limit. A description helps you identify the purpose of the limit.</p><important>
20    /// <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>
21    /// </important>
22    pub description: ::std::option::Option<::std::string::String>,
23}
24impl CreateLimitInput {
25    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
26    pub fn client_token(&self) -> ::std::option::Option<&str> {
27        self.client_token.as_deref()
28    }
29    /// <p>The display name of the limit.</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 fn display_name(&self) -> ::std::option::Option<&str> {
33        self.display_name.as_deref()
34    }
35    /// <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>
36    pub fn amount_requirement_name(&self) -> ::std::option::Option<&str> {
37        self.amount_requirement_name.as_deref()
38    }
39    /// <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>
40    /// <p>The <code>maxCount</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>
41    pub fn max_count(&self) -> ::std::option::Option<i32> {
42        self.max_count
43    }
44    /// <p>The farm ID of the farm that contains the limit.</p>
45    pub fn farm_id(&self) -> ::std::option::Option<&str> {
46        self.farm_id.as_deref()
47    }
48    /// <p>A description of the limit. A description helps you identify the purpose of the limit.</p><important>
49    /// <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>
50    /// </important>
51    pub fn description(&self) -> ::std::option::Option<&str> {
52        self.description.as_deref()
53    }
54}
55impl ::std::fmt::Debug for CreateLimitInput {
56    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
57        let mut formatter = f.debug_struct("CreateLimitInput");
58        formatter.field("client_token", &self.client_token);
59        formatter.field("display_name", &self.display_name);
60        formatter.field("amount_requirement_name", &self.amount_requirement_name);
61        formatter.field("max_count", &self.max_count);
62        formatter.field("farm_id", &self.farm_id);
63        formatter.field("description", &"*** Sensitive Data Redacted ***");
64        formatter.finish()
65    }
66}
67impl CreateLimitInput {
68    /// Creates a new builder-style object to manufacture [`CreateLimitInput`](crate::operation::create_limit::CreateLimitInput).
69    pub fn builder() -> crate::operation::create_limit::builders::CreateLimitInputBuilder {
70        crate::operation::create_limit::builders::CreateLimitInputBuilder::default()
71    }
72}
73
74/// A builder for [`CreateLimitInput`](crate::operation::create_limit::CreateLimitInput).
75#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
76#[non_exhaustive]
77pub struct CreateLimitInputBuilder {
78    pub(crate) client_token: ::std::option::Option<::std::string::String>,
79    pub(crate) display_name: ::std::option::Option<::std::string::String>,
80    pub(crate) amount_requirement_name: ::std::option::Option<::std::string::String>,
81    pub(crate) max_count: ::std::option::Option<i32>,
82    pub(crate) farm_id: ::std::option::Option<::std::string::String>,
83    pub(crate) description: ::std::option::Option<::std::string::String>,
84}
85impl CreateLimitInputBuilder {
86    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
87    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        self.client_token = ::std::option::Option::Some(input.into());
89        self
90    }
91    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
92    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.client_token = input;
94        self
95    }
96    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
97    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
98        &self.client_token
99    }
100    /// <p>The display name of the limit.</p><important>
101    /// <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>
102    /// </important>
103    /// This field is required.
104    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.display_name = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>The display name of the limit.</p><important>
109    /// <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>
110    /// </important>
111    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112        self.display_name = input;
113        self
114    }
115    /// <p>The display name of the limit.</p><important>
116    /// <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>
117    /// </important>
118    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
119        &self.display_name
120    }
121    /// <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>
122    /// This field is required.
123    pub fn amount_requirement_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.amount_requirement_name = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <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>
128    pub fn set_amount_requirement_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.amount_requirement_name = input;
130        self
131    }
132    /// <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>
133    pub fn get_amount_requirement_name(&self) -> &::std::option::Option<::std::string::String> {
134        &self.amount_requirement_name
135    }
136    /// <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>
137    /// <p>The <code>maxCount</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>
138    /// This field is required.
139    pub fn max_count(mut self, input: i32) -> Self {
140        self.max_count = ::std::option::Option::Some(input);
141        self
142    }
143    /// <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>
144    /// <p>The <code>maxCount</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>
145    pub fn set_max_count(mut self, input: ::std::option::Option<i32>) -> Self {
146        self.max_count = input;
147        self
148    }
149    /// <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>
150    /// <p>The <code>maxCount</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>
151    pub fn get_max_count(&self) -> &::std::option::Option<i32> {
152        &self.max_count
153    }
154    /// <p>The farm ID of the farm that contains the limit.</p>
155    /// This field is required.
156    pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.farm_id = ::std::option::Option::Some(input.into());
158        self
159    }
160    /// <p>The farm ID of the farm that contains the limit.</p>
161    pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.farm_id = input;
163        self
164    }
165    /// <p>The farm ID of the farm that contains the limit.</p>
166    pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
167        &self.farm_id
168    }
169    /// <p>A description of the limit. A description helps you identify the purpose of the limit.</p><important>
170    /// <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>
171    /// </important>
172    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.description = ::std::option::Option::Some(input.into());
174        self
175    }
176    /// <p>A description of the limit. A description helps you identify the purpose of the limit.</p><important>
177    /// <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>
178    /// </important>
179    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180        self.description = input;
181        self
182    }
183    /// <p>A description of the limit. A description helps you identify the purpose of the limit.</p><important>
184    /// <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>
185    /// </important>
186    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
187        &self.description
188    }
189    /// Consumes the builder and constructs a [`CreateLimitInput`](crate::operation::create_limit::CreateLimitInput).
190    pub fn build(self) -> ::std::result::Result<crate::operation::create_limit::CreateLimitInput, ::aws_smithy_types::error::operation::BuildError> {
191        ::std::result::Result::Ok(crate::operation::create_limit::CreateLimitInput {
192            client_token: self.client_token,
193            display_name: self.display_name,
194            amount_requirement_name: self.amount_requirement_name,
195            max_count: self.max_count,
196            farm_id: self.farm_id,
197            description: self.description,
198        })
199    }
200}
201impl ::std::fmt::Debug for CreateLimitInputBuilder {
202    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
203        let mut formatter = f.debug_struct("CreateLimitInputBuilder");
204        formatter.field("client_token", &self.client_token);
205        formatter.field("display_name", &self.display_name);
206        formatter.field("amount_requirement_name", &self.amount_requirement_name);
207        formatter.field("max_count", &self.max_count);
208        formatter.field("farm_id", &self.farm_id);
209        formatter.field("description", &"*** Sensitive Data Redacted ***");
210        formatter.finish()
211    }
212}