aws_sdk_deadline/operation/create_fleet/_create_fleet_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 CreateFleetInput {
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 of the farm to connect to the fleet.</p>
9 pub farm_id: ::std::option::Option<::std::string::String>,
10 /// <p>The display name of the fleet.</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 description of the fleet.</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 IAM role ARN for the role that the fleet's workers will use.</p>
19 pub role_arn: ::std::option::Option<::std::string::String>,
20 /// <p>The minimum number of workers for the fleet.</p>
21 pub min_worker_count: ::std::option::Option<i32>,
22 /// <p>The maximum number of workers for the fleet.</p>
23 /// <p>Deadline Cloud limits the number of workers to less than or equal to the fleet's maximum worker count. The service maintains eventual consistency for the worker count. If you make multiple rapid calls to <code>CreateWorker</code> before the field updates, you might exceed your fleet's maximum worker count. For example, if your <code>maxWorkerCount</code> is 10 and you currently have 9 workers, making two quick <code>CreateWorker</code> calls might successfully create 2 workers instead of 1, resulting in 11 total workers.</p>
24 pub max_worker_count: ::std::option::Option<i32>,
25 /// <p>The configuration settings for the fleet. Customer managed fleets are self-managed. Service managed Amazon EC2 fleets are managed by Deadline Cloud.</p>
26 pub configuration: ::std::option::Option<crate::types::FleetConfiguration>,
27 /// <p>Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.</p>
28 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
29 /// <p>Provides a script that runs as a worker is starting up that you can use to provide additional configuration for workers in your fleet.</p>
30 pub host_configuration: ::std::option::Option<crate::types::HostConfiguration>,
31}
32impl CreateFleetInput {
33 /// <p>The unique token which the server uses to recognize retries of the same request.</p>
34 pub fn client_token(&self) -> ::std::option::Option<&str> {
35 self.client_token.as_deref()
36 }
37 /// <p>The farm ID of the farm to connect to the fleet.</p>
38 pub fn farm_id(&self) -> ::std::option::Option<&str> {
39 self.farm_id.as_deref()
40 }
41 /// <p>The display name of the fleet.</p><important>
42 /// <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>
43 /// </important>
44 pub fn display_name(&self) -> ::std::option::Option<&str> {
45 self.display_name.as_deref()
46 }
47 /// <p>The description of the fleet.</p><important>
48 /// <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>
49 /// </important>
50 pub fn description(&self) -> ::std::option::Option<&str> {
51 self.description.as_deref()
52 }
53 /// <p>The IAM role ARN for the role that the fleet's workers will use.</p>
54 pub fn role_arn(&self) -> ::std::option::Option<&str> {
55 self.role_arn.as_deref()
56 }
57 /// <p>The minimum number of workers for the fleet.</p>
58 pub fn min_worker_count(&self) -> ::std::option::Option<i32> {
59 self.min_worker_count
60 }
61 /// <p>The maximum number of workers for the fleet.</p>
62 /// <p>Deadline Cloud limits the number of workers to less than or equal to the fleet's maximum worker count. The service maintains eventual consistency for the worker count. If you make multiple rapid calls to <code>CreateWorker</code> before the field updates, you might exceed your fleet's maximum worker count. For example, if your <code>maxWorkerCount</code> is 10 and you currently have 9 workers, making two quick <code>CreateWorker</code> calls might successfully create 2 workers instead of 1, resulting in 11 total workers.</p>
63 pub fn max_worker_count(&self) -> ::std::option::Option<i32> {
64 self.max_worker_count
65 }
66 /// <p>The configuration settings for the fleet. Customer managed fleets are self-managed. Service managed Amazon EC2 fleets are managed by Deadline Cloud.</p>
67 pub fn configuration(&self) -> ::std::option::Option<&crate::types::FleetConfiguration> {
68 self.configuration.as_ref()
69 }
70 /// <p>Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.</p>
71 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
72 self.tags.as_ref()
73 }
74 /// <p>Provides a script that runs as a worker is starting up that you can use to provide additional configuration for workers in your fleet.</p>
75 pub fn host_configuration(&self) -> ::std::option::Option<&crate::types::HostConfiguration> {
76 self.host_configuration.as_ref()
77 }
78}
79impl ::std::fmt::Debug for CreateFleetInput {
80 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
81 let mut formatter = f.debug_struct("CreateFleetInput");
82 formatter.field("client_token", &self.client_token);
83 formatter.field("farm_id", &self.farm_id);
84 formatter.field("display_name", &self.display_name);
85 formatter.field("description", &"*** Sensitive Data Redacted ***");
86 formatter.field("role_arn", &self.role_arn);
87 formatter.field("min_worker_count", &self.min_worker_count);
88 formatter.field("max_worker_count", &self.max_worker_count);
89 formatter.field("configuration", &self.configuration);
90 formatter.field("tags", &self.tags);
91 formatter.field("host_configuration", &self.host_configuration);
92 formatter.finish()
93 }
94}
95impl CreateFleetInput {
96 /// Creates a new builder-style object to manufacture [`CreateFleetInput`](crate::operation::create_fleet::CreateFleetInput).
97 pub fn builder() -> crate::operation::create_fleet::builders::CreateFleetInputBuilder {
98 crate::operation::create_fleet::builders::CreateFleetInputBuilder::default()
99 }
100}
101
102/// A builder for [`CreateFleetInput`](crate::operation::create_fleet::CreateFleetInput).
103#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
104#[non_exhaustive]
105pub struct CreateFleetInputBuilder {
106 pub(crate) client_token: ::std::option::Option<::std::string::String>,
107 pub(crate) farm_id: ::std::option::Option<::std::string::String>,
108 pub(crate) display_name: ::std::option::Option<::std::string::String>,
109 pub(crate) description: ::std::option::Option<::std::string::String>,
110 pub(crate) role_arn: ::std::option::Option<::std::string::String>,
111 pub(crate) min_worker_count: ::std::option::Option<i32>,
112 pub(crate) max_worker_count: ::std::option::Option<i32>,
113 pub(crate) configuration: ::std::option::Option<crate::types::FleetConfiguration>,
114 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
115 pub(crate) host_configuration: ::std::option::Option<crate::types::HostConfiguration>,
116}
117impl CreateFleetInputBuilder {
118 /// <p>The unique token which the server uses to recognize retries of the same request.</p>
119 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 self.client_token = ::std::option::Option::Some(input.into());
121 self
122 }
123 /// <p>The unique token which the server uses to recognize retries of the same request.</p>
124 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125 self.client_token = input;
126 self
127 }
128 /// <p>The unique token which the server uses to recognize retries of the same request.</p>
129 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
130 &self.client_token
131 }
132 /// <p>The farm ID of the farm to connect to the fleet.</p>
133 /// This field is required.
134 pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135 self.farm_id = ::std::option::Option::Some(input.into());
136 self
137 }
138 /// <p>The farm ID of the farm to connect to the fleet.</p>
139 pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140 self.farm_id = input;
141 self
142 }
143 /// <p>The farm ID of the farm to connect to the fleet.</p>
144 pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
145 &self.farm_id
146 }
147 /// <p>The display name of the fleet.</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 /// This field is required.
151 pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152 self.display_name = ::std::option::Option::Some(input.into());
153 self
154 }
155 /// <p>The display name of the fleet.</p><important>
156 /// <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>
157 /// </important>
158 pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.display_name = input;
160 self
161 }
162 /// <p>The display name of the fleet.</p><important>
163 /// <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>
164 /// </important>
165 pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
166 &self.display_name
167 }
168 /// <p>The description of the fleet.</p><important>
169 /// <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>
170 /// </important>
171 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172 self.description = ::std::option::Option::Some(input.into());
173 self
174 }
175 /// <p>The description of the fleet.</p><important>
176 /// <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>
177 /// </important>
178 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179 self.description = input;
180 self
181 }
182 /// <p>The description of the fleet.</p><important>
183 /// <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>
184 /// </important>
185 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
186 &self.description
187 }
188 /// <p>The IAM role ARN for the role that the fleet's workers will use.</p>
189 /// This field is required.
190 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191 self.role_arn = ::std::option::Option::Some(input.into());
192 self
193 }
194 /// <p>The IAM role ARN for the role that the fleet's workers will use.</p>
195 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196 self.role_arn = input;
197 self
198 }
199 /// <p>The IAM role ARN for the role that the fleet's workers will use.</p>
200 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
201 &self.role_arn
202 }
203 /// <p>The minimum number of workers for the fleet.</p>
204 pub fn min_worker_count(mut self, input: i32) -> Self {
205 self.min_worker_count = ::std::option::Option::Some(input);
206 self
207 }
208 /// <p>The minimum number of workers for the fleet.</p>
209 pub fn set_min_worker_count(mut self, input: ::std::option::Option<i32>) -> Self {
210 self.min_worker_count = input;
211 self
212 }
213 /// <p>The minimum number of workers for the fleet.</p>
214 pub fn get_min_worker_count(&self) -> &::std::option::Option<i32> {
215 &self.min_worker_count
216 }
217 /// <p>The maximum number of workers for the fleet.</p>
218 /// <p>Deadline Cloud limits the number of workers to less than or equal to the fleet's maximum worker count. The service maintains eventual consistency for the worker count. If you make multiple rapid calls to <code>CreateWorker</code> before the field updates, you might exceed your fleet's maximum worker count. For example, if your <code>maxWorkerCount</code> is 10 and you currently have 9 workers, making two quick <code>CreateWorker</code> calls might successfully create 2 workers instead of 1, resulting in 11 total workers.</p>
219 /// This field is required.
220 pub fn max_worker_count(mut self, input: i32) -> Self {
221 self.max_worker_count = ::std::option::Option::Some(input);
222 self
223 }
224 /// <p>The maximum number of workers for the fleet.</p>
225 /// <p>Deadline Cloud limits the number of workers to less than or equal to the fleet's maximum worker count. The service maintains eventual consistency for the worker count. If you make multiple rapid calls to <code>CreateWorker</code> before the field updates, you might exceed your fleet's maximum worker count. For example, if your <code>maxWorkerCount</code> is 10 and you currently have 9 workers, making two quick <code>CreateWorker</code> calls might successfully create 2 workers instead of 1, resulting in 11 total workers.</p>
226 pub fn set_max_worker_count(mut self, input: ::std::option::Option<i32>) -> Self {
227 self.max_worker_count = input;
228 self
229 }
230 /// <p>The maximum number of workers for the fleet.</p>
231 /// <p>Deadline Cloud limits the number of workers to less than or equal to the fleet's maximum worker count. The service maintains eventual consistency for the worker count. If you make multiple rapid calls to <code>CreateWorker</code> before the field updates, you might exceed your fleet's maximum worker count. For example, if your <code>maxWorkerCount</code> is 10 and you currently have 9 workers, making two quick <code>CreateWorker</code> calls might successfully create 2 workers instead of 1, resulting in 11 total workers.</p>
232 pub fn get_max_worker_count(&self) -> &::std::option::Option<i32> {
233 &self.max_worker_count
234 }
235 /// <p>The configuration settings for the fleet. Customer managed fleets are self-managed. Service managed Amazon EC2 fleets are managed by Deadline Cloud.</p>
236 /// This field is required.
237 pub fn configuration(mut self, input: crate::types::FleetConfiguration) -> Self {
238 self.configuration = ::std::option::Option::Some(input);
239 self
240 }
241 /// <p>The configuration settings for the fleet. Customer managed fleets are self-managed. Service managed Amazon EC2 fleets are managed by Deadline Cloud.</p>
242 pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::FleetConfiguration>) -> Self {
243 self.configuration = input;
244 self
245 }
246 /// <p>The configuration settings for the fleet. Customer managed fleets are self-managed. Service managed Amazon EC2 fleets are managed by Deadline Cloud.</p>
247 pub fn get_configuration(&self) -> &::std::option::Option<crate::types::FleetConfiguration> {
248 &self.configuration
249 }
250 /// Adds a key-value pair to `tags`.
251 ///
252 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
253 ///
254 /// <p>Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.</p>
255 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
256 let mut hash_map = self.tags.unwrap_or_default();
257 hash_map.insert(k.into(), v.into());
258 self.tags = ::std::option::Option::Some(hash_map);
259 self
260 }
261 /// <p>Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.</p>
262 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
263 self.tags = input;
264 self
265 }
266 /// <p>Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.</p>
267 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
268 &self.tags
269 }
270 /// <p>Provides a script that runs as a worker is starting up that you can use to provide additional configuration for workers in your fleet.</p>
271 pub fn host_configuration(mut self, input: crate::types::HostConfiguration) -> Self {
272 self.host_configuration = ::std::option::Option::Some(input);
273 self
274 }
275 /// <p>Provides a script that runs as a worker is starting up that you can use to provide additional configuration for workers in your fleet.</p>
276 pub fn set_host_configuration(mut self, input: ::std::option::Option<crate::types::HostConfiguration>) -> Self {
277 self.host_configuration = input;
278 self
279 }
280 /// <p>Provides a script that runs as a worker is starting up that you can use to provide additional configuration for workers in your fleet.</p>
281 pub fn get_host_configuration(&self) -> &::std::option::Option<crate::types::HostConfiguration> {
282 &self.host_configuration
283 }
284 /// Consumes the builder and constructs a [`CreateFleetInput`](crate::operation::create_fleet::CreateFleetInput).
285 pub fn build(self) -> ::std::result::Result<crate::operation::create_fleet::CreateFleetInput, ::aws_smithy_types::error::operation::BuildError> {
286 ::std::result::Result::Ok(crate::operation::create_fleet::CreateFleetInput {
287 client_token: self.client_token,
288 farm_id: self.farm_id,
289 display_name: self.display_name,
290 description: self.description,
291 role_arn: self.role_arn,
292 min_worker_count: self.min_worker_count,
293 max_worker_count: self.max_worker_count,
294 configuration: self.configuration,
295 tags: self.tags,
296 host_configuration: self.host_configuration,
297 })
298 }
299}
300impl ::std::fmt::Debug for CreateFleetInputBuilder {
301 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
302 let mut formatter = f.debug_struct("CreateFleetInputBuilder");
303 formatter.field("client_token", &self.client_token);
304 formatter.field("farm_id", &self.farm_id);
305 formatter.field("display_name", &self.display_name);
306 formatter.field("description", &"*** Sensitive Data Redacted ***");
307 formatter.field("role_arn", &self.role_arn);
308 formatter.field("min_worker_count", &self.min_worker_count);
309 formatter.field("max_worker_count", &self.max_worker_count);
310 formatter.field("configuration", &self.configuration);
311 formatter.field("tags", &self.tags);
312 formatter.field("host_configuration", &self.host_configuration);
313 formatter.finish()
314 }
315}