aws_sdk_deadline/operation/create_job/
_create_job_input.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreateJobInput {
    /// <p>The farm ID of the farm to connect to the job.</p>
    pub farm_id: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the queue that the job is submitted to.</p>
    pub queue_id: ::std::option::Option<::std::string::String>,
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The job template to use for this job.</p>
    pub template: ::std::option::Option<::std::string::String>,
    /// <p>The file type for the job template.</p>
    pub template_type: ::std::option::Option<crate::types::JobTemplateType>,
    /// <p>The priority of the job on a scale of 0 to 100. The highest priority (first scheduled) is 100. When two jobs have the same priority, the oldest job is scheduled first.</p>
    pub priority: ::std::option::Option<i32>,
    /// <p>The parameters for the job.</p>
    pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::JobParameter>>,
    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
    pub attachments: ::std::option::Option<crate::types::Attachments>,
    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
    pub storage_profile_id: ::std::option::Option<::std::string::String>,
    /// <p>The initial job status when it is created. Jobs that are created with a <code>SUSPENDED</code> status will not run until manually requeued.</p>
    pub target_task_run_status: ::std::option::Option<crate::types::CreateJobTargetTaskRunStatus>,
    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
    pub max_failed_tasks_count: ::std::option::Option<i32>,
    /// <p>The maximum number of retries for each task.</p>
    pub max_retries_per_task: ::std::option::Option<i32>,
    /// <p>The job ID for the source job.</p>
    pub source_job_id: ::std::option::Option<::std::string::String>,
}
impl CreateJobInput {
    /// <p>The farm ID of the farm to connect to the job.</p>
    pub fn farm_id(&self) -> ::std::option::Option<&str> {
        self.farm_id.as_deref()
    }
    /// <p>The ID of the queue that the job is submitted to.</p>
    pub fn queue_id(&self) -> ::std::option::Option<&str> {
        self.queue_id.as_deref()
    }
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The job template to use for this job.</p>
    pub fn template(&self) -> ::std::option::Option<&str> {
        self.template.as_deref()
    }
    /// <p>The file type for the job template.</p>
    pub fn template_type(&self) -> ::std::option::Option<&crate::types::JobTemplateType> {
        self.template_type.as_ref()
    }
    /// <p>The priority of the job on a scale of 0 to 100. The highest priority (first scheduled) is 100. When two jobs have the same priority, the oldest job is scheduled first.</p>
    pub fn priority(&self) -> ::std::option::Option<i32> {
        self.priority
    }
    /// <p>The parameters for the job.</p>
    pub fn parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::JobParameter>> {
        self.parameters.as_ref()
    }
    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
    pub fn attachments(&self) -> ::std::option::Option<&crate::types::Attachments> {
        self.attachments.as_ref()
    }
    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
    pub fn storage_profile_id(&self) -> ::std::option::Option<&str> {
        self.storage_profile_id.as_deref()
    }
    /// <p>The initial job status when it is created. Jobs that are created with a <code>SUSPENDED</code> status will not run until manually requeued.</p>
    pub fn target_task_run_status(&self) -> ::std::option::Option<&crate::types::CreateJobTargetTaskRunStatus> {
        self.target_task_run_status.as_ref()
    }
    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
    pub fn max_failed_tasks_count(&self) -> ::std::option::Option<i32> {
        self.max_failed_tasks_count
    }
    /// <p>The maximum number of retries for each task.</p>
    pub fn max_retries_per_task(&self) -> ::std::option::Option<i32> {
        self.max_retries_per_task
    }
    /// <p>The job ID for the source job.</p>
    pub fn source_job_id(&self) -> ::std::option::Option<&str> {
        self.source_job_id.as_deref()
    }
}
impl ::std::fmt::Debug for CreateJobInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateJobInput");
        formatter.field("farm_id", &self.farm_id);
        formatter.field("queue_id", &self.queue_id);
        formatter.field("client_token", &self.client_token);
        formatter.field("template", &"*** Sensitive Data Redacted ***");
        formatter.field("template_type", &self.template_type);
        formatter.field("priority", &self.priority);
        formatter.field("parameters", &"*** Sensitive Data Redacted ***");
        formatter.field("attachments", &self.attachments);
        formatter.field("storage_profile_id", &self.storage_profile_id);
        formatter.field("target_task_run_status", &self.target_task_run_status);
        formatter.field("max_failed_tasks_count", &self.max_failed_tasks_count);
        formatter.field("max_retries_per_task", &self.max_retries_per_task);
        formatter.field("source_job_id", &self.source_job_id);
        formatter.finish()
    }
}
impl CreateJobInput {
    /// Creates a new builder-style object to manufacture [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
    pub fn builder() -> crate::operation::create_job::builders::CreateJobInputBuilder {
        crate::operation::create_job::builders::CreateJobInputBuilder::default()
    }
}

/// A builder for [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateJobInputBuilder {
    pub(crate) farm_id: ::std::option::Option<::std::string::String>,
    pub(crate) queue_id: ::std::option::Option<::std::string::String>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) template: ::std::option::Option<::std::string::String>,
    pub(crate) template_type: ::std::option::Option<crate::types::JobTemplateType>,
    pub(crate) priority: ::std::option::Option<i32>,
    pub(crate) parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::JobParameter>>,
    pub(crate) attachments: ::std::option::Option<crate::types::Attachments>,
    pub(crate) storage_profile_id: ::std::option::Option<::std::string::String>,
    pub(crate) target_task_run_status: ::std::option::Option<crate::types::CreateJobTargetTaskRunStatus>,
    pub(crate) max_failed_tasks_count: ::std::option::Option<i32>,
    pub(crate) max_retries_per_task: ::std::option::Option<i32>,
    pub(crate) source_job_id: ::std::option::Option<::std::string::String>,
}
impl CreateJobInputBuilder {
    /// <p>The farm ID of the farm to connect to the job.</p>
    /// This field is required.
    pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.farm_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The farm ID of the farm to connect to the job.</p>
    pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.farm_id = input;
        self
    }
    /// <p>The farm ID of the farm to connect to the job.</p>
    pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.farm_id
    }
    /// <p>The ID of the queue that the job is submitted to.</p>
    /// This field is required.
    pub fn queue_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.queue_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the queue that the job is submitted to.</p>
    pub fn set_queue_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.queue_id = input;
        self
    }
    /// <p>The ID of the queue that the job is submitted to.</p>
    pub fn get_queue_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.queue_id
    }
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The job template to use for this job.</p>
    pub fn template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.template = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The job template to use for this job.</p>
    pub fn set_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.template = input;
        self
    }
    /// <p>The job template to use for this job.</p>
    pub fn get_template(&self) -> &::std::option::Option<::std::string::String> {
        &self.template
    }
    /// <p>The file type for the job template.</p>
    pub fn template_type(mut self, input: crate::types::JobTemplateType) -> Self {
        self.template_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The file type for the job template.</p>
    pub fn set_template_type(mut self, input: ::std::option::Option<crate::types::JobTemplateType>) -> Self {
        self.template_type = input;
        self
    }
    /// <p>The file type for the job template.</p>
    pub fn get_template_type(&self) -> &::std::option::Option<crate::types::JobTemplateType> {
        &self.template_type
    }
    /// <p>The priority of the job on a scale of 0 to 100. The highest priority (first scheduled) is 100. When two jobs have the same priority, the oldest job is scheduled first.</p>
    /// This field is required.
    pub fn priority(mut self, input: i32) -> Self {
        self.priority = ::std::option::Option::Some(input);
        self
    }
    /// <p>The priority of the job on a scale of 0 to 100. The highest priority (first scheduled) is 100. When two jobs have the same priority, the oldest job is scheduled first.</p>
    pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
        self.priority = input;
        self
    }
    /// <p>The priority of the job on a scale of 0 to 100. The highest priority (first scheduled) is 100. When two jobs have the same priority, the oldest job is scheduled first.</p>
    pub fn get_priority(&self) -> &::std::option::Option<i32> {
        &self.priority
    }
    /// Adds a key-value pair to `parameters`.
    ///
    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
    ///
    /// <p>The parameters for the job.</p>
    pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::JobParameter) -> Self {
        let mut hash_map = self.parameters.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.parameters = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The parameters for the job.</p>
    pub fn set_parameters(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::JobParameter>>,
    ) -> Self {
        self.parameters = input;
        self
    }
    /// <p>The parameters for the job.</p>
    pub fn get_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::JobParameter>> {
        &self.parameters
    }
    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
    pub fn attachments(mut self, input: crate::types::Attachments) -> Self {
        self.attachments = ::std::option::Option::Some(input);
        self
    }
    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
    pub fn set_attachments(mut self, input: ::std::option::Option<crate::types::Attachments>) -> Self {
        self.attachments = input;
        self
    }
    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
    pub fn get_attachments(&self) -> &::std::option::Option<crate::types::Attachments> {
        &self.attachments
    }
    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
    pub fn storage_profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.storage_profile_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
    pub fn set_storage_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.storage_profile_id = input;
        self
    }
    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
    pub fn get_storage_profile_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.storage_profile_id
    }
    /// <p>The initial job status when it is created. Jobs that are created with a <code>SUSPENDED</code> status will not run until manually requeued.</p>
    pub fn target_task_run_status(mut self, input: crate::types::CreateJobTargetTaskRunStatus) -> Self {
        self.target_task_run_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The initial job status when it is created. Jobs that are created with a <code>SUSPENDED</code> status will not run until manually requeued.</p>
    pub fn set_target_task_run_status(mut self, input: ::std::option::Option<crate::types::CreateJobTargetTaskRunStatus>) -> Self {
        self.target_task_run_status = input;
        self
    }
    /// <p>The initial job status when it is created. Jobs that are created with a <code>SUSPENDED</code> status will not run until manually requeued.</p>
    pub fn get_target_task_run_status(&self) -> &::std::option::Option<crate::types::CreateJobTargetTaskRunStatus> {
        &self.target_task_run_status
    }
    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
    pub fn max_failed_tasks_count(mut self, input: i32) -> Self {
        self.max_failed_tasks_count = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
    pub fn set_max_failed_tasks_count(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_failed_tasks_count = input;
        self
    }
    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
    pub fn get_max_failed_tasks_count(&self) -> &::std::option::Option<i32> {
        &self.max_failed_tasks_count
    }
    /// <p>The maximum number of retries for each task.</p>
    pub fn max_retries_per_task(mut self, input: i32) -> Self {
        self.max_retries_per_task = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum number of retries for each task.</p>
    pub fn set_max_retries_per_task(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_retries_per_task = input;
        self
    }
    /// <p>The maximum number of retries for each task.</p>
    pub fn get_max_retries_per_task(&self) -> &::std::option::Option<i32> {
        &self.max_retries_per_task
    }
    /// <p>The job ID for the source job.</p>
    pub fn source_job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_job_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The job ID for the source job.</p>
    pub fn set_source_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_job_id = input;
        self
    }
    /// <p>The job ID for the source job.</p>
    pub fn get_source_job_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_job_id
    }
    /// Consumes the builder and constructs a [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::create_job::CreateJobInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_job::CreateJobInput {
            farm_id: self.farm_id,
            queue_id: self.queue_id,
            client_token: self.client_token,
            template: self.template,
            template_type: self.template_type,
            priority: self.priority,
            parameters: self.parameters,
            attachments: self.attachments,
            storage_profile_id: self.storage_profile_id,
            target_task_run_status: self.target_task_run_status,
            max_failed_tasks_count: self.max_failed_tasks_count,
            max_retries_per_task: self.max_retries_per_task,
            source_job_id: self.source_job_id,
        })
    }
}
impl ::std::fmt::Debug for CreateJobInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateJobInputBuilder");
        formatter.field("farm_id", &self.farm_id);
        formatter.field("queue_id", &self.queue_id);
        formatter.field("client_token", &self.client_token);
        formatter.field("template", &"*** Sensitive Data Redacted ***");
        formatter.field("template_type", &self.template_type);
        formatter.field("priority", &self.priority);
        formatter.field("parameters", &"*** Sensitive Data Redacted ***");
        formatter.field("attachments", &self.attachments);
        formatter.field("storage_profile_id", &self.storage_profile_id);
        formatter.field("target_task_run_status", &self.target_task_run_status);
        formatter.field("max_failed_tasks_count", &self.max_failed_tasks_count);
        formatter.field("max_retries_per_task", &self.max_retries_per_task);
        formatter.field("source_job_id", &self.source_job_id);
        formatter.finish()
    }
}