aws_sdk_deadline/operation/create_job/
_create_job_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 CreateJobInput {
6    /// <p>The farm ID of the farm to connect to the job.</p>
7    pub farm_id: ::std::option::Option<::std::string::String>,
8    /// <p>The ID of the queue that the job is submitted to.</p>
9    pub queue_id: ::std::option::Option<::std::string::String>,
10    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
11    pub client_token: ::std::option::Option<::std::string::String>,
12    /// <p>The job template to use for this job.</p>
13    pub template: ::std::option::Option<::std::string::String>,
14    /// <p>The file type for the job template.</p>
15    pub template_type: ::std::option::Option<crate::types::JobTemplateType>,
16    /// <p>The priority of the job. The highest priority (first scheduled) is 100. When two jobs have the same priority, the oldest job is scheduled first.</p>
17    pub priority: ::std::option::Option<i32>,
18    /// <p>The parameters for the job.</p>
19    pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::JobParameter>>,
20    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
21    pub attachments: ::std::option::Option<crate::types::Attachments>,
22    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
23    pub storage_profile_id: ::std::option::Option<::std::string::String>,
24    /// <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>
25    pub target_task_run_status: ::std::option::Option<crate::types::CreateJobTargetTaskRunStatus>,
26    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
27    pub max_failed_tasks_count: ::std::option::Option<i32>,
28    /// <p>The maximum number of retries for each task.</p>
29    pub max_retries_per_task: ::std::option::Option<i32>,
30    /// <p>The maximum number of worker hosts that can concurrently process a job. When the <code>maxWorkerCount</code> is reached, no more workers will be assigned to process the job, even if the fleets assigned to the job's queue has available workers.</p>
31    /// <p>You can't set the <code>maxWorkerCount</code> to 0. If you set it to -1, there is no maximum number of workers.</p>
32    /// <p>If you don't specify the <code>maxWorkerCount</code>, Deadline Cloud won't throttle the number of workers used to process the job.</p>
33    pub max_worker_count: ::std::option::Option<i32>,
34    /// <p>The job ID for the source job.</p>
35    pub source_job_id: ::std::option::Option<::std::string::String>,
36}
37impl CreateJobInput {
38    /// <p>The farm ID of the farm to connect to the job.</p>
39    pub fn farm_id(&self) -> ::std::option::Option<&str> {
40        self.farm_id.as_deref()
41    }
42    /// <p>The ID of the queue that the job is submitted to.</p>
43    pub fn queue_id(&self) -> ::std::option::Option<&str> {
44        self.queue_id.as_deref()
45    }
46    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
47    pub fn client_token(&self) -> ::std::option::Option<&str> {
48        self.client_token.as_deref()
49    }
50    /// <p>The job template to use for this job.</p>
51    pub fn template(&self) -> ::std::option::Option<&str> {
52        self.template.as_deref()
53    }
54    /// <p>The file type for the job template.</p>
55    pub fn template_type(&self) -> ::std::option::Option<&crate::types::JobTemplateType> {
56        self.template_type.as_ref()
57    }
58    /// <p>The priority of the job. The highest priority (first scheduled) is 100. When two jobs have the same priority, the oldest job is scheduled first.</p>
59    pub fn priority(&self) -> ::std::option::Option<i32> {
60        self.priority
61    }
62    /// <p>The parameters for the job.</p>
63    pub fn parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::JobParameter>> {
64        self.parameters.as_ref()
65    }
66    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
67    pub fn attachments(&self) -> ::std::option::Option<&crate::types::Attachments> {
68        self.attachments.as_ref()
69    }
70    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
71    pub fn storage_profile_id(&self) -> ::std::option::Option<&str> {
72        self.storage_profile_id.as_deref()
73    }
74    /// <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>
75    pub fn target_task_run_status(&self) -> ::std::option::Option<&crate::types::CreateJobTargetTaskRunStatus> {
76        self.target_task_run_status.as_ref()
77    }
78    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
79    pub fn max_failed_tasks_count(&self) -> ::std::option::Option<i32> {
80        self.max_failed_tasks_count
81    }
82    /// <p>The maximum number of retries for each task.</p>
83    pub fn max_retries_per_task(&self) -> ::std::option::Option<i32> {
84        self.max_retries_per_task
85    }
86    /// <p>The maximum number of worker hosts that can concurrently process a job. When the <code>maxWorkerCount</code> is reached, no more workers will be assigned to process the job, even if the fleets assigned to the job's queue has available workers.</p>
87    /// <p>You can't set the <code>maxWorkerCount</code> to 0. If you set it to -1, there is no maximum number of workers.</p>
88    /// <p>If you don't specify the <code>maxWorkerCount</code>, Deadline Cloud won't throttle the number of workers used to process the job.</p>
89    pub fn max_worker_count(&self) -> ::std::option::Option<i32> {
90        self.max_worker_count
91    }
92    /// <p>The job ID for the source job.</p>
93    pub fn source_job_id(&self) -> ::std::option::Option<&str> {
94        self.source_job_id.as_deref()
95    }
96}
97impl ::std::fmt::Debug for CreateJobInput {
98    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
99        let mut formatter = f.debug_struct("CreateJobInput");
100        formatter.field("farm_id", &self.farm_id);
101        formatter.field("queue_id", &self.queue_id);
102        formatter.field("client_token", &self.client_token);
103        formatter.field("template", &"*** Sensitive Data Redacted ***");
104        formatter.field("template_type", &self.template_type);
105        formatter.field("priority", &self.priority);
106        formatter.field("parameters", &"*** Sensitive Data Redacted ***");
107        formatter.field("attachments", &self.attachments);
108        formatter.field("storage_profile_id", &self.storage_profile_id);
109        formatter.field("target_task_run_status", &self.target_task_run_status);
110        formatter.field("max_failed_tasks_count", &self.max_failed_tasks_count);
111        formatter.field("max_retries_per_task", &self.max_retries_per_task);
112        formatter.field("max_worker_count", &self.max_worker_count);
113        formatter.field("source_job_id", &self.source_job_id);
114        formatter.finish()
115    }
116}
117impl CreateJobInput {
118    /// Creates a new builder-style object to manufacture [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
119    pub fn builder() -> crate::operation::create_job::builders::CreateJobInputBuilder {
120        crate::operation::create_job::builders::CreateJobInputBuilder::default()
121    }
122}
123
124/// A builder for [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
125#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
126#[non_exhaustive]
127pub struct CreateJobInputBuilder {
128    pub(crate) farm_id: ::std::option::Option<::std::string::String>,
129    pub(crate) queue_id: ::std::option::Option<::std::string::String>,
130    pub(crate) client_token: ::std::option::Option<::std::string::String>,
131    pub(crate) template: ::std::option::Option<::std::string::String>,
132    pub(crate) template_type: ::std::option::Option<crate::types::JobTemplateType>,
133    pub(crate) priority: ::std::option::Option<i32>,
134    pub(crate) parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::JobParameter>>,
135    pub(crate) attachments: ::std::option::Option<crate::types::Attachments>,
136    pub(crate) storage_profile_id: ::std::option::Option<::std::string::String>,
137    pub(crate) target_task_run_status: ::std::option::Option<crate::types::CreateJobTargetTaskRunStatus>,
138    pub(crate) max_failed_tasks_count: ::std::option::Option<i32>,
139    pub(crate) max_retries_per_task: ::std::option::Option<i32>,
140    pub(crate) max_worker_count: ::std::option::Option<i32>,
141    pub(crate) source_job_id: ::std::option::Option<::std::string::String>,
142}
143impl CreateJobInputBuilder {
144    /// <p>The farm ID of the farm to connect to the job.</p>
145    /// This field is required.
146    pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.farm_id = ::std::option::Option::Some(input.into());
148        self
149    }
150    /// <p>The farm ID of the farm to connect to the job.</p>
151    pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.farm_id = input;
153        self
154    }
155    /// <p>The farm ID of the farm to connect to the job.</p>
156    pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
157        &self.farm_id
158    }
159    /// <p>The ID of the queue that the job is submitted to.</p>
160    /// This field is required.
161    pub fn queue_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.queue_id = ::std::option::Option::Some(input.into());
163        self
164    }
165    /// <p>The ID of the queue that the job is submitted to.</p>
166    pub fn set_queue_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.queue_id = input;
168        self
169    }
170    /// <p>The ID of the queue that the job is submitted to.</p>
171    pub fn get_queue_id(&self) -> &::std::option::Option<::std::string::String> {
172        &self.queue_id
173    }
174    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
175    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.client_token = ::std::option::Option::Some(input.into());
177        self
178    }
179    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
180    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.client_token = input;
182        self
183    }
184    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
185    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
186        &self.client_token
187    }
188    /// <p>The job template to use for this job.</p>
189    pub fn template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190        self.template = ::std::option::Option::Some(input.into());
191        self
192    }
193    /// <p>The job template to use for this job.</p>
194    pub fn set_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195        self.template = input;
196        self
197    }
198    /// <p>The job template to use for this job.</p>
199    pub fn get_template(&self) -> &::std::option::Option<::std::string::String> {
200        &self.template
201    }
202    /// <p>The file type for the job template.</p>
203    pub fn template_type(mut self, input: crate::types::JobTemplateType) -> Self {
204        self.template_type = ::std::option::Option::Some(input);
205        self
206    }
207    /// <p>The file type for the job template.</p>
208    pub fn set_template_type(mut self, input: ::std::option::Option<crate::types::JobTemplateType>) -> Self {
209        self.template_type = input;
210        self
211    }
212    /// <p>The file type for the job template.</p>
213    pub fn get_template_type(&self) -> &::std::option::Option<crate::types::JobTemplateType> {
214        &self.template_type
215    }
216    /// <p>The priority of the job. The highest priority (first scheduled) is 100. When two jobs have the same priority, the oldest job is scheduled first.</p>
217    /// This field is required.
218    pub fn priority(mut self, input: i32) -> Self {
219        self.priority = ::std::option::Option::Some(input);
220        self
221    }
222    /// <p>The priority of the job. The highest priority (first scheduled) is 100. When two jobs have the same priority, the oldest job is scheduled first.</p>
223    pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
224        self.priority = input;
225        self
226    }
227    /// <p>The priority of the job. The highest priority (first scheduled) is 100. When two jobs have the same priority, the oldest job is scheduled first.</p>
228    pub fn get_priority(&self) -> &::std::option::Option<i32> {
229        &self.priority
230    }
231    /// Adds a key-value pair to `parameters`.
232    ///
233    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
234    ///
235    /// <p>The parameters for the job.</p>
236    pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::JobParameter) -> Self {
237        let mut hash_map = self.parameters.unwrap_or_default();
238        hash_map.insert(k.into(), v);
239        self.parameters = ::std::option::Option::Some(hash_map);
240        self
241    }
242    /// <p>The parameters for the job.</p>
243    pub fn set_parameters(
244        mut self,
245        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::JobParameter>>,
246    ) -> Self {
247        self.parameters = input;
248        self
249    }
250    /// <p>The parameters for the job.</p>
251    pub fn get_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::JobParameter>> {
252        &self.parameters
253    }
254    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
255    pub fn attachments(mut self, input: crate::types::Attachments) -> Self {
256        self.attachments = ::std::option::Option::Some(input);
257        self
258    }
259    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
260    pub fn set_attachments(mut self, input: ::std::option::Option<crate::types::Attachments>) -> Self {
261        self.attachments = input;
262        self
263    }
264    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
265    pub fn get_attachments(&self) -> &::std::option::Option<crate::types::Attachments> {
266        &self.attachments
267    }
268    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
269    pub fn storage_profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
270        self.storage_profile_id = ::std::option::Option::Some(input.into());
271        self
272    }
273    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
274    pub fn set_storage_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
275        self.storage_profile_id = input;
276        self
277    }
278    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
279    pub fn get_storage_profile_id(&self) -> &::std::option::Option<::std::string::String> {
280        &self.storage_profile_id
281    }
282    /// <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>
283    pub fn target_task_run_status(mut self, input: crate::types::CreateJobTargetTaskRunStatus) -> Self {
284        self.target_task_run_status = ::std::option::Option::Some(input);
285        self
286    }
287    /// <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>
288    pub fn set_target_task_run_status(mut self, input: ::std::option::Option<crate::types::CreateJobTargetTaskRunStatus>) -> Self {
289        self.target_task_run_status = input;
290        self
291    }
292    /// <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>
293    pub fn get_target_task_run_status(&self) -> &::std::option::Option<crate::types::CreateJobTargetTaskRunStatus> {
294        &self.target_task_run_status
295    }
296    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
297    pub fn max_failed_tasks_count(mut self, input: i32) -> Self {
298        self.max_failed_tasks_count = ::std::option::Option::Some(input);
299        self
300    }
301    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
302    pub fn set_max_failed_tasks_count(mut self, input: ::std::option::Option<i32>) -> Self {
303        self.max_failed_tasks_count = input;
304        self
305    }
306    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
307    pub fn get_max_failed_tasks_count(&self) -> &::std::option::Option<i32> {
308        &self.max_failed_tasks_count
309    }
310    /// <p>The maximum number of retries for each task.</p>
311    pub fn max_retries_per_task(mut self, input: i32) -> Self {
312        self.max_retries_per_task = ::std::option::Option::Some(input);
313        self
314    }
315    /// <p>The maximum number of retries for each task.</p>
316    pub fn set_max_retries_per_task(mut self, input: ::std::option::Option<i32>) -> Self {
317        self.max_retries_per_task = input;
318        self
319    }
320    /// <p>The maximum number of retries for each task.</p>
321    pub fn get_max_retries_per_task(&self) -> &::std::option::Option<i32> {
322        &self.max_retries_per_task
323    }
324    /// <p>The maximum number of worker hosts that can concurrently process a job. When the <code>maxWorkerCount</code> is reached, no more workers will be assigned to process the job, even if the fleets assigned to the job's queue has available workers.</p>
325    /// <p>You can't set the <code>maxWorkerCount</code> to 0. If you set it to -1, there is no maximum number of workers.</p>
326    /// <p>If you don't specify the <code>maxWorkerCount</code>, Deadline Cloud won't throttle the number of workers used to process the job.</p>
327    pub fn max_worker_count(mut self, input: i32) -> Self {
328        self.max_worker_count = ::std::option::Option::Some(input);
329        self
330    }
331    /// <p>The maximum number of worker hosts that can concurrently process a job. When the <code>maxWorkerCount</code> is reached, no more workers will be assigned to process the job, even if the fleets assigned to the job's queue has available workers.</p>
332    /// <p>You can't set the <code>maxWorkerCount</code> to 0. If you set it to -1, there is no maximum number of workers.</p>
333    /// <p>If you don't specify the <code>maxWorkerCount</code>, Deadline Cloud won't throttle the number of workers used to process the job.</p>
334    pub fn set_max_worker_count(mut self, input: ::std::option::Option<i32>) -> Self {
335        self.max_worker_count = input;
336        self
337    }
338    /// <p>The maximum number of worker hosts that can concurrently process a job. When the <code>maxWorkerCount</code> is reached, no more workers will be assigned to process the job, even if the fleets assigned to the job's queue has available workers.</p>
339    /// <p>You can't set the <code>maxWorkerCount</code> to 0. If you set it to -1, there is no maximum number of workers.</p>
340    /// <p>If you don't specify the <code>maxWorkerCount</code>, Deadline Cloud won't throttle the number of workers used to process the job.</p>
341    pub fn get_max_worker_count(&self) -> &::std::option::Option<i32> {
342        &self.max_worker_count
343    }
344    /// <p>The job ID for the source job.</p>
345    pub fn source_job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
346        self.source_job_id = ::std::option::Option::Some(input.into());
347        self
348    }
349    /// <p>The job ID for the source job.</p>
350    pub fn set_source_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
351        self.source_job_id = input;
352        self
353    }
354    /// <p>The job ID for the source job.</p>
355    pub fn get_source_job_id(&self) -> &::std::option::Option<::std::string::String> {
356        &self.source_job_id
357    }
358    /// Consumes the builder and constructs a [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
359    pub fn build(self) -> ::std::result::Result<crate::operation::create_job::CreateJobInput, ::aws_smithy_types::error::operation::BuildError> {
360        ::std::result::Result::Ok(crate::operation::create_job::CreateJobInput {
361            farm_id: self.farm_id,
362            queue_id: self.queue_id,
363            client_token: self.client_token,
364            template: self.template,
365            template_type: self.template_type,
366            priority: self.priority,
367            parameters: self.parameters,
368            attachments: self.attachments,
369            storage_profile_id: self.storage_profile_id,
370            target_task_run_status: self.target_task_run_status,
371            max_failed_tasks_count: self.max_failed_tasks_count,
372            max_retries_per_task: self.max_retries_per_task,
373            max_worker_count: self.max_worker_count,
374            source_job_id: self.source_job_id,
375        })
376    }
377}
378impl ::std::fmt::Debug for CreateJobInputBuilder {
379    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
380        let mut formatter = f.debug_struct("CreateJobInputBuilder");
381        formatter.field("farm_id", &self.farm_id);
382        formatter.field("queue_id", &self.queue_id);
383        formatter.field("client_token", &self.client_token);
384        formatter.field("template", &"*** Sensitive Data Redacted ***");
385        formatter.field("template_type", &self.template_type);
386        formatter.field("priority", &self.priority);
387        formatter.field("parameters", &"*** Sensitive Data Redacted ***");
388        formatter.field("attachments", &self.attachments);
389        formatter.field("storage_profile_id", &self.storage_profile_id);
390        formatter.field("target_task_run_status", &self.target_task_run_status);
391        formatter.field("max_failed_tasks_count", &self.max_failed_tasks_count);
392        formatter.field("max_retries_per_task", &self.max_retries_per_task);
393        formatter.field("max_worker_count", &self.max_worker_count);
394        formatter.field("source_job_id", &self.source_job_id);
395        formatter.finish()
396    }
397}