Skip to main content

aws_sdk_deadline/operation/create_queue/
_create_queue_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Shared displayName + description for Create operations where both are present. displayName is @required here - this mixin is Create-only by design (Update has optional displayName).
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct CreateQueueInput {
7    /// <p>The farm ID of the farm to connect to the queue.</p>
8    pub farm_id: ::std::option::Option<::std::string::String>,
9    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
10    pub client_token: ::std::option::Option<::std::string::String>,
11    /// <p>The display name of the queue.</p><important>
12    /// <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>
13    /// </important>
14    pub display_name: ::std::option::Option<::std::string::String>,
15    /// <p>The description of the queue.</p><important>
16    /// <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>
17    /// </important>
18    pub description: ::std::option::Option<::std::string::String>,
19    /// <p>The default action to take on a queue if a budget isn't configured.</p>
20    pub default_budget_action: ::std::option::Option<crate::types::DefaultQueueBudgetAction>,
21    /// <p>The job attachment settings for the queue. These are the Amazon S3 bucket name and the Amazon S3 prefix.</p>
22    pub job_attachment_settings: ::std::option::Option<crate::types::JobAttachmentSettings>,
23    /// <p>The IAM role ARN that workers will use while running jobs for this queue.</p>
24    pub role_arn: ::std::option::Option<::std::string::String>,
25    /// <p>The jobs in the queue run as the specified POSIX user.</p>
26    pub job_run_as_user: ::std::option::Option<crate::types::JobRunAsUser>,
27    /// <p>The file system location name to include in the queue.</p>
28    pub required_file_system_location_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
29    /// <p>The storage profile IDs to include in the queue.</p>
30    pub allowed_storage_profile_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
31    /// <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>
32    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
33    /// <p>The scheduling configuration for the queue. This configuration determines how workers are assigned to jobs in the queue.</p>
34    /// <p>If not specified, the queue defaults to the <code>priorityFifo</code> scheduling configuration.</p>
35    pub scheduling_configuration: ::std::option::Option<crate::types::SchedulingConfiguration>,
36}
37impl CreateQueueInput {
38    /// <p>The farm ID of the farm to connect to the queue.</p>
39    pub fn farm_id(&self) -> ::std::option::Option<&str> {
40        self.farm_id.as_deref()
41    }
42    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
43    pub fn client_token(&self) -> ::std::option::Option<&str> {
44        self.client_token.as_deref()
45    }
46    /// <p>The display name of the queue.</p><important>
47    /// <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>
48    /// </important>
49    pub fn display_name(&self) -> ::std::option::Option<&str> {
50        self.display_name.as_deref()
51    }
52    /// <p>The description of the queue.</p><important>
53    /// <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>
54    /// </important>
55    pub fn description(&self) -> ::std::option::Option<&str> {
56        self.description.as_deref()
57    }
58    /// <p>The default action to take on a queue if a budget isn't configured.</p>
59    pub fn default_budget_action(&self) -> ::std::option::Option<&crate::types::DefaultQueueBudgetAction> {
60        self.default_budget_action.as_ref()
61    }
62    /// <p>The job attachment settings for the queue. These are the Amazon S3 bucket name and the Amazon S3 prefix.</p>
63    pub fn job_attachment_settings(&self) -> ::std::option::Option<&crate::types::JobAttachmentSettings> {
64        self.job_attachment_settings.as_ref()
65    }
66    /// <p>The IAM role ARN that workers will use while running jobs for this queue.</p>
67    pub fn role_arn(&self) -> ::std::option::Option<&str> {
68        self.role_arn.as_deref()
69    }
70    /// <p>The jobs in the queue run as the specified POSIX user.</p>
71    pub fn job_run_as_user(&self) -> ::std::option::Option<&crate::types::JobRunAsUser> {
72        self.job_run_as_user.as_ref()
73    }
74    /// <p>The file system location name to include in the queue.</p>
75    ///
76    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.required_file_system_location_names.is_none()`.
77    pub fn required_file_system_location_names(&self) -> &[::std::string::String] {
78        self.required_file_system_location_names.as_deref().unwrap_or_default()
79    }
80    /// <p>The storage profile IDs to include in the queue.</p>
81    ///
82    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.allowed_storage_profile_ids.is_none()`.
83    pub fn allowed_storage_profile_ids(&self) -> &[::std::string::String] {
84        self.allowed_storage_profile_ids.as_deref().unwrap_or_default()
85    }
86    /// <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>
87    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
88        self.tags.as_ref()
89    }
90    /// <p>The scheduling configuration for the queue. This configuration determines how workers are assigned to jobs in the queue.</p>
91    /// <p>If not specified, the queue defaults to the <code>priorityFifo</code> scheduling configuration.</p>
92    pub fn scheduling_configuration(&self) -> ::std::option::Option<&crate::types::SchedulingConfiguration> {
93        self.scheduling_configuration.as_ref()
94    }
95}
96impl ::std::fmt::Debug for CreateQueueInput {
97    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
98        let mut formatter = f.debug_struct("CreateQueueInput");
99        formatter.field("farm_id", &self.farm_id);
100        formatter.field("client_token", &self.client_token);
101        formatter.field("display_name", &self.display_name);
102        formatter.field("description", &"*** Sensitive Data Redacted ***");
103        formatter.field("default_budget_action", &self.default_budget_action);
104        formatter.field("job_attachment_settings", &self.job_attachment_settings);
105        formatter.field("role_arn", &self.role_arn);
106        formatter.field("job_run_as_user", &self.job_run_as_user);
107        formatter.field("required_file_system_location_names", &self.required_file_system_location_names);
108        formatter.field("allowed_storage_profile_ids", &self.allowed_storage_profile_ids);
109        formatter.field("tags", &self.tags);
110        formatter.field("scheduling_configuration", &self.scheduling_configuration);
111        formatter.finish()
112    }
113}
114impl CreateQueueInput {
115    /// Creates a new builder-style object to manufacture [`CreateQueueInput`](crate::operation::create_queue::CreateQueueInput).
116    pub fn builder() -> crate::operation::create_queue::builders::CreateQueueInputBuilder {
117        crate::operation::create_queue::builders::CreateQueueInputBuilder::default()
118    }
119}
120
121/// A builder for [`CreateQueueInput`](crate::operation::create_queue::CreateQueueInput).
122#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
123#[non_exhaustive]
124pub struct CreateQueueInputBuilder {
125    pub(crate) farm_id: ::std::option::Option<::std::string::String>,
126    pub(crate) client_token: ::std::option::Option<::std::string::String>,
127    pub(crate) display_name: ::std::option::Option<::std::string::String>,
128    pub(crate) description: ::std::option::Option<::std::string::String>,
129    pub(crate) default_budget_action: ::std::option::Option<crate::types::DefaultQueueBudgetAction>,
130    pub(crate) job_attachment_settings: ::std::option::Option<crate::types::JobAttachmentSettings>,
131    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
132    pub(crate) job_run_as_user: ::std::option::Option<crate::types::JobRunAsUser>,
133    pub(crate) required_file_system_location_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
134    pub(crate) allowed_storage_profile_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
135    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
136    pub(crate) scheduling_configuration: ::std::option::Option<crate::types::SchedulingConfiguration>,
137}
138impl CreateQueueInputBuilder {
139    /// <p>The farm ID of the farm to connect to the queue.</p>
140    /// This field is required.
141    pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.farm_id = ::std::option::Option::Some(input.into());
143        self
144    }
145    /// <p>The farm ID of the farm to connect to the queue.</p>
146    pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.farm_id = input;
148        self
149    }
150    /// <p>The farm ID of the farm to connect to the queue.</p>
151    pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
152        &self.farm_id
153    }
154    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
155    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        self.client_token = ::std::option::Option::Some(input.into());
157        self
158    }
159    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
160    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161        self.client_token = input;
162        self
163    }
164    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
165    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
166        &self.client_token
167    }
168    /// <p>The display name of the queue.</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    /// This field is required.
172    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.display_name = ::std::option::Option::Some(input.into());
174        self
175    }
176    /// <p>The display name of the queue.</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_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180        self.display_name = input;
181        self
182    }
183    /// <p>The display name of the queue.</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_display_name(&self) -> &::std::option::Option<::std::string::String> {
187        &self.display_name
188    }
189    /// <p>The description of the queue.</p><important>
190    /// <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>
191    /// </important>
192    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.description = ::std::option::Option::Some(input.into());
194        self
195    }
196    /// <p>The description of the queue.</p><important>
197    /// <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>
198    /// </important>
199    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
200        self.description = input;
201        self
202    }
203    /// <p>The description of the queue.</p><important>
204    /// <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>
205    /// </important>
206    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
207        &self.description
208    }
209    /// <p>The default action to take on a queue if a budget isn't configured.</p>
210    pub fn default_budget_action(mut self, input: crate::types::DefaultQueueBudgetAction) -> Self {
211        self.default_budget_action = ::std::option::Option::Some(input);
212        self
213    }
214    /// <p>The default action to take on a queue if a budget isn't configured.</p>
215    pub fn set_default_budget_action(mut self, input: ::std::option::Option<crate::types::DefaultQueueBudgetAction>) -> Self {
216        self.default_budget_action = input;
217        self
218    }
219    /// <p>The default action to take on a queue if a budget isn't configured.</p>
220    pub fn get_default_budget_action(&self) -> &::std::option::Option<crate::types::DefaultQueueBudgetAction> {
221        &self.default_budget_action
222    }
223    /// <p>The job attachment settings for the queue. These are the Amazon S3 bucket name and the Amazon S3 prefix.</p>
224    pub fn job_attachment_settings(mut self, input: crate::types::JobAttachmentSettings) -> Self {
225        self.job_attachment_settings = ::std::option::Option::Some(input);
226        self
227    }
228    /// <p>The job attachment settings for the queue. These are the Amazon S3 bucket name and the Amazon S3 prefix.</p>
229    pub fn set_job_attachment_settings(mut self, input: ::std::option::Option<crate::types::JobAttachmentSettings>) -> Self {
230        self.job_attachment_settings = input;
231        self
232    }
233    /// <p>The job attachment settings for the queue. These are the Amazon S3 bucket name and the Amazon S3 prefix.</p>
234    pub fn get_job_attachment_settings(&self) -> &::std::option::Option<crate::types::JobAttachmentSettings> {
235        &self.job_attachment_settings
236    }
237    /// <p>The IAM role ARN that workers will use while running jobs for this queue.</p>
238    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
239        self.role_arn = ::std::option::Option::Some(input.into());
240        self
241    }
242    /// <p>The IAM role ARN that workers will use while running jobs for this queue.</p>
243    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
244        self.role_arn = input;
245        self
246    }
247    /// <p>The IAM role ARN that workers will use while running jobs for this queue.</p>
248    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
249        &self.role_arn
250    }
251    /// <p>The jobs in the queue run as the specified POSIX user.</p>
252    pub fn job_run_as_user(mut self, input: crate::types::JobRunAsUser) -> Self {
253        self.job_run_as_user = ::std::option::Option::Some(input);
254        self
255    }
256    /// <p>The jobs in the queue run as the specified POSIX user.</p>
257    pub fn set_job_run_as_user(mut self, input: ::std::option::Option<crate::types::JobRunAsUser>) -> Self {
258        self.job_run_as_user = input;
259        self
260    }
261    /// <p>The jobs in the queue run as the specified POSIX user.</p>
262    pub fn get_job_run_as_user(&self) -> &::std::option::Option<crate::types::JobRunAsUser> {
263        &self.job_run_as_user
264    }
265    /// Appends an item to `required_file_system_location_names`.
266    ///
267    /// To override the contents of this collection use [`set_required_file_system_location_names`](Self::set_required_file_system_location_names).
268    ///
269    /// <p>The file system location name to include in the queue.</p>
270    pub fn required_file_system_location_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
271        let mut v = self.required_file_system_location_names.unwrap_or_default();
272        v.push(input.into());
273        self.required_file_system_location_names = ::std::option::Option::Some(v);
274        self
275    }
276    /// <p>The file system location name to include in the queue.</p>
277    pub fn set_required_file_system_location_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
278        self.required_file_system_location_names = input;
279        self
280    }
281    /// <p>The file system location name to include in the queue.</p>
282    pub fn get_required_file_system_location_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
283        &self.required_file_system_location_names
284    }
285    /// Appends an item to `allowed_storage_profile_ids`.
286    ///
287    /// To override the contents of this collection use [`set_allowed_storage_profile_ids`](Self::set_allowed_storage_profile_ids).
288    ///
289    /// <p>The storage profile IDs to include in the queue.</p>
290    pub fn allowed_storage_profile_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
291        let mut v = self.allowed_storage_profile_ids.unwrap_or_default();
292        v.push(input.into());
293        self.allowed_storage_profile_ids = ::std::option::Option::Some(v);
294        self
295    }
296    /// <p>The storage profile IDs to include in the queue.</p>
297    pub fn set_allowed_storage_profile_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
298        self.allowed_storage_profile_ids = input;
299        self
300    }
301    /// <p>The storage profile IDs to include in the queue.</p>
302    pub fn get_allowed_storage_profile_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
303        &self.allowed_storage_profile_ids
304    }
305    /// Adds a key-value pair to `tags`.
306    ///
307    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
308    ///
309    /// <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>
310    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
311        let mut hash_map = self.tags.unwrap_or_default();
312        hash_map.insert(k.into(), v.into());
313        self.tags = ::std::option::Option::Some(hash_map);
314        self
315    }
316    /// <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>
317    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
318        self.tags = input;
319        self
320    }
321    /// <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>
322    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
323        &self.tags
324    }
325    /// <p>The scheduling configuration for the queue. This configuration determines how workers are assigned to jobs in the queue.</p>
326    /// <p>If not specified, the queue defaults to the <code>priorityFifo</code> scheduling configuration.</p>
327    pub fn scheduling_configuration(mut self, input: crate::types::SchedulingConfiguration) -> Self {
328        self.scheduling_configuration = ::std::option::Option::Some(input);
329        self
330    }
331    /// <p>The scheduling configuration for the queue. This configuration determines how workers are assigned to jobs in the queue.</p>
332    /// <p>If not specified, the queue defaults to the <code>priorityFifo</code> scheduling configuration.</p>
333    pub fn set_scheduling_configuration(mut self, input: ::std::option::Option<crate::types::SchedulingConfiguration>) -> Self {
334        self.scheduling_configuration = input;
335        self
336    }
337    /// <p>The scheduling configuration for the queue. This configuration determines how workers are assigned to jobs in the queue.</p>
338    /// <p>If not specified, the queue defaults to the <code>priorityFifo</code> scheduling configuration.</p>
339    pub fn get_scheduling_configuration(&self) -> &::std::option::Option<crate::types::SchedulingConfiguration> {
340        &self.scheduling_configuration
341    }
342    /// Consumes the builder and constructs a [`CreateQueueInput`](crate::operation::create_queue::CreateQueueInput).
343    pub fn build(self) -> ::std::result::Result<crate::operation::create_queue::CreateQueueInput, ::aws_smithy_types::error::operation::BuildError> {
344        ::std::result::Result::Ok(crate::operation::create_queue::CreateQueueInput {
345            farm_id: self.farm_id,
346            client_token: self.client_token,
347            display_name: self.display_name,
348            description: self.description,
349            default_budget_action: self.default_budget_action,
350            job_attachment_settings: self.job_attachment_settings,
351            role_arn: self.role_arn,
352            job_run_as_user: self.job_run_as_user,
353            required_file_system_location_names: self.required_file_system_location_names,
354            allowed_storage_profile_ids: self.allowed_storage_profile_ids,
355            tags: self.tags,
356            scheduling_configuration: self.scheduling_configuration,
357        })
358    }
359}
360impl ::std::fmt::Debug for CreateQueueInputBuilder {
361    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
362        let mut formatter = f.debug_struct("CreateQueueInputBuilder");
363        formatter.field("farm_id", &self.farm_id);
364        formatter.field("client_token", &self.client_token);
365        formatter.field("display_name", &self.display_name);
366        formatter.field("description", &"*** Sensitive Data Redacted ***");
367        formatter.field("default_budget_action", &self.default_budget_action);
368        formatter.field("job_attachment_settings", &self.job_attachment_settings);
369        formatter.field("role_arn", &self.role_arn);
370        formatter.field("job_run_as_user", &self.job_run_as_user);
371        formatter.field("required_file_system_location_names", &self.required_file_system_location_names);
372        formatter.field("allowed_storage_profile_ids", &self.allowed_storage_profile_ids);
373        formatter.field("tags", &self.tags);
374        formatter.field("scheduling_configuration", &self.scheduling_configuration);
375        formatter.finish()
376    }
377}