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