aws_sdk_deadline/operation/update_limit/
_update_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 UpdateLimitInput {
6    /// <p>The unique identifier of the farm that contains the limit.</p>
7    pub farm_id: ::std::option::Option<::std::string::String>,
8    /// <p>The unique identifier of the limit to update.</p>
9    pub limit_id: ::std::option::Option<::std::string::String>,
10    /// <p>The new display name of the limit.</p><important>
11    /// <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>
12    /// </important>
13    pub display_name: ::std::option::Option<::std::string::String>,
14    /// <p>The new description of the limit.</p><important>
15    /// <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>
16    /// </important>
17    pub description: ::std::option::Option<::std::string::String>,
18    /// <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>
19    /// <p>If more than the new maximum number is currently in use, running jobs finish but no new jobs are started until the number of resources in use is below the new maximum number.</p>
20    /// <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>
21    pub max_count: ::std::option::Option<i32>,
22}
23impl UpdateLimitInput {
24    /// <p>The unique identifier of the farm that contains the limit.</p>
25    pub fn farm_id(&self) -> ::std::option::Option<&str> {
26        self.farm_id.as_deref()
27    }
28    /// <p>The unique identifier of the limit to update.</p>
29    pub fn limit_id(&self) -> ::std::option::Option<&str> {
30        self.limit_id.as_deref()
31    }
32    /// <p>The new display name of the limit.</p><important>
33    /// <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>
34    /// </important>
35    pub fn display_name(&self) -> ::std::option::Option<&str> {
36        self.display_name.as_deref()
37    }
38    /// <p>The new description of the limit.</p><important>
39    /// <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>
40    /// </important>
41    pub fn description(&self) -> ::std::option::Option<&str> {
42        self.description.as_deref()
43    }
44    /// <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>
45    /// <p>If more than the new maximum number is currently in use, running jobs finish but no new jobs are started until the number of resources in use is below the new maximum number.</p>
46    /// <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>
47    pub fn max_count(&self) -> ::std::option::Option<i32> {
48        self.max_count
49    }
50}
51impl ::std::fmt::Debug for UpdateLimitInput {
52    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
53        let mut formatter = f.debug_struct("UpdateLimitInput");
54        formatter.field("farm_id", &self.farm_id);
55        formatter.field("limit_id", &self.limit_id);
56        formatter.field("display_name", &self.display_name);
57        formatter.field("description", &"*** Sensitive Data Redacted ***");
58        formatter.field("max_count", &self.max_count);
59        formatter.finish()
60    }
61}
62impl UpdateLimitInput {
63    /// Creates a new builder-style object to manufacture [`UpdateLimitInput`](crate::operation::update_limit::UpdateLimitInput).
64    pub fn builder() -> crate::operation::update_limit::builders::UpdateLimitInputBuilder {
65        crate::operation::update_limit::builders::UpdateLimitInputBuilder::default()
66    }
67}
68
69/// A builder for [`UpdateLimitInput`](crate::operation::update_limit::UpdateLimitInput).
70#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
71#[non_exhaustive]
72pub struct UpdateLimitInputBuilder {
73    pub(crate) farm_id: ::std::option::Option<::std::string::String>,
74    pub(crate) limit_id: ::std::option::Option<::std::string::String>,
75    pub(crate) display_name: ::std::option::Option<::std::string::String>,
76    pub(crate) description: ::std::option::Option<::std::string::String>,
77    pub(crate) max_count: ::std::option::Option<i32>,
78}
79impl UpdateLimitInputBuilder {
80    /// <p>The unique identifier of the farm that contains the limit.</p>
81    /// This field is required.
82    pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.farm_id = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The unique identifier of the farm that contains the limit.</p>
87    pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.farm_id = input;
89        self
90    }
91    /// <p>The unique identifier of the farm that contains the limit.</p>
92    pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
93        &self.farm_id
94    }
95    /// <p>The unique identifier of the limit to update.</p>
96    /// This field is required.
97    pub fn limit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        self.limit_id = ::std::option::Option::Some(input.into());
99        self
100    }
101    /// <p>The unique identifier of the limit to update.</p>
102    pub fn set_limit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.limit_id = input;
104        self
105    }
106    /// <p>The unique identifier of the limit to update.</p>
107    pub fn get_limit_id(&self) -> &::std::option::Option<::std::string::String> {
108        &self.limit_id
109    }
110    /// <p>The new display name of the limit.</p><important>
111    /// <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>
112    /// </important>
113    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.display_name = ::std::option::Option::Some(input.into());
115        self
116    }
117    /// <p>The new display name of the limit.</p><important>
118    /// <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>
119    /// </important>
120    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.display_name = input;
122        self
123    }
124    /// <p>The new display name of the limit.</p><important>
125    /// <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>
126    /// </important>
127    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
128        &self.display_name
129    }
130    /// <p>The new description of the limit.</p><important>
131    /// <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>
132    /// </important>
133    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.description = ::std::option::Option::Some(input.into());
135        self
136    }
137    /// <p>The new description of the limit.</p><important>
138    /// <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>
139    /// </important>
140    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.description = input;
142        self
143    }
144    /// <p>The new description of the limit.</p><important>
145    /// <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>
146    /// </important>
147    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
148        &self.description
149    }
150    /// <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>
151    /// <p>If more than the new maximum number is currently in use, running jobs finish but no new jobs are started until the number of resources in use is below the new maximum number.</p>
152    /// <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>
153    pub fn max_count(mut self, input: i32) -> Self {
154        self.max_count = ::std::option::Option::Some(input);
155        self
156    }
157    /// <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>
158    /// <p>If more than the new maximum number is currently in use, running jobs finish but no new jobs are started until the number of resources in use is below the new maximum number.</p>
159    /// <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>
160    pub fn set_max_count(mut self, input: ::std::option::Option<i32>) -> Self {
161        self.max_count = input;
162        self
163    }
164    /// <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>
165    /// <p>If more than the new maximum number is currently in use, running jobs finish but no new jobs are started until the number of resources in use is below the new maximum number.</p>
166    /// <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>
167    pub fn get_max_count(&self) -> &::std::option::Option<i32> {
168        &self.max_count
169    }
170    /// Consumes the builder and constructs a [`UpdateLimitInput`](crate::operation::update_limit::UpdateLimitInput).
171    pub fn build(self) -> ::std::result::Result<crate::operation::update_limit::UpdateLimitInput, ::aws_smithy_types::error::operation::BuildError> {
172        ::std::result::Result::Ok(crate::operation::update_limit::UpdateLimitInput {
173            farm_id: self.farm_id,
174            limit_id: self.limit_id,
175            display_name: self.display_name,
176            description: self.description,
177            max_count: self.max_count,
178        })
179    }
180}
181impl ::std::fmt::Debug for UpdateLimitInputBuilder {
182    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
183        let mut formatter = f.debug_struct("UpdateLimitInputBuilder");
184        formatter.field("farm_id", &self.farm_id);
185        formatter.field("limit_id", &self.limit_id);
186        formatter.field("display_name", &self.display_name);
187        formatter.field("description", &"*** Sensitive Data Redacted ***");
188        formatter.field("max_count", &self.max_count);
189        formatter.finish()
190    }
191}