aws_sdk_deadline/operation/create_job/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_job::_create_job_output::CreateJobOutputBuilder;
3
4pub use crate::operation::create_job::_create_job_input::CreateJobInputBuilder;
5
6impl crate::operation::create_job::builders::CreateJobInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_job::CreateJobOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_job::CreateJobError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_job();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateJob`.
24///
25/// <p>Creates a job. A job is a set of instructions that Deadline Cloud uses to schedule and run work on available workers. For more information, see <a href="https://docs.aws.amazon.com/deadline-cloud/latest/userguide/deadline-cloud-jobs.html">Deadline Cloud jobs</a>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateJobFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_job::builders::CreateJobInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl crate::client::customize::internal::CustomizableSend<crate::operation::create_job::CreateJobOutput, crate::operation::create_job::CreateJobError>
33    for CreateJobFluentBuilder
34{
35    fn send(
36        self,
37        config_override: crate::config::Builder,
38    ) -> crate::client::customize::internal::BoxFuture<
39        crate::client::customize::internal::SendResult<crate::operation::create_job::CreateJobOutput, crate::operation::create_job::CreateJobError>,
40    > {
41        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
42    }
43}
44impl CreateJobFluentBuilder {
45    /// Creates a new `CreateJobFluentBuilder`.
46    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
47        Self {
48            handle,
49            inner: ::std::default::Default::default(),
50            config_override: ::std::option::Option::None,
51        }
52    }
53    /// Access the CreateJob as a reference.
54    pub fn as_input(&self) -> &crate::operation::create_job::builders::CreateJobInputBuilder {
55        &self.inner
56    }
57    /// Sends the request and returns the response.
58    ///
59    /// If an error occurs, an `SdkError` will be returned with additional details that
60    /// can be matched against.
61    ///
62    /// By default, any retryable failures will be retried twice. Retry behavior
63    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
64    /// set when configuring the client.
65    pub async fn send(
66        self,
67    ) -> ::std::result::Result<
68        crate::operation::create_job::CreateJobOutput,
69        ::aws_smithy_runtime_api::client::result::SdkError<
70            crate::operation::create_job::CreateJobError,
71            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
72        >,
73    > {
74        let input = self
75            .inner
76            .build()
77            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
78        let runtime_plugins = crate::operation::create_job::CreateJob::operation_runtime_plugins(
79            self.handle.runtime_plugins.clone(),
80            &self.handle.conf,
81            self.config_override,
82        );
83        crate::operation::create_job::CreateJob::orchestrate(&runtime_plugins, input).await
84    }
85
86    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
87    pub fn customize(
88        self,
89    ) -> crate::client::customize::CustomizableOperation<
90        crate::operation::create_job::CreateJobOutput,
91        crate::operation::create_job::CreateJobError,
92        Self,
93    > {
94        crate::client::customize::CustomizableOperation::new(self)
95    }
96    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
97        self.set_config_override(::std::option::Option::Some(config_override.into()));
98        self
99    }
100
101    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
102        self.config_override = config_override;
103        self
104    }
105    /// <p>The farm ID of the farm to connect to the job.</p>
106    pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107        self.inner = self.inner.farm_id(input.into());
108        self
109    }
110    /// <p>The farm ID of the farm to connect to the job.</p>
111    pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112        self.inner = self.inner.set_farm_id(input);
113        self
114    }
115    /// <p>The farm ID of the farm to connect to the job.</p>
116    pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
117        self.inner.get_farm_id()
118    }
119    /// <p>The ID of the queue that the job is submitted to.</p>
120    pub fn queue_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.queue_id(input.into());
122        self
123    }
124    /// <p>The ID of the queue that the job is submitted to.</p>
125    pub fn set_queue_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_queue_id(input);
127        self
128    }
129    /// <p>The ID of the queue that the job is submitted to.</p>
130    pub fn get_queue_id(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_queue_id()
132    }
133    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
134    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.client_token(input.into());
136        self
137    }
138    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
139    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_client_token(input);
141        self
142    }
143    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
144    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_client_token()
146    }
147    /// <p>The job template to use for this job.</p>
148    pub fn template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.template(input.into());
150        self
151    }
152    /// <p>The job template to use for this job.</p>
153    pub fn set_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_template(input);
155        self
156    }
157    /// <p>The job template to use for this job.</p>
158    pub fn get_template(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_template()
160    }
161    /// <p>The file type for the job template.</p>
162    pub fn template_type(mut self, input: crate::types::JobTemplateType) -> Self {
163        self.inner = self.inner.template_type(input);
164        self
165    }
166    /// <p>The file type for the job template.</p>
167    pub fn set_template_type(mut self, input: ::std::option::Option<crate::types::JobTemplateType>) -> Self {
168        self.inner = self.inner.set_template_type(input);
169        self
170    }
171    /// <p>The file type for the job template.</p>
172    pub fn get_template_type(&self) -> &::std::option::Option<crate::types::JobTemplateType> {
173        self.inner.get_template_type()
174    }
175    /// <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>
176    pub fn priority(mut self, input: i32) -> Self {
177        self.inner = self.inner.priority(input);
178        self
179    }
180    /// <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>
181    pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
182        self.inner = self.inner.set_priority(input);
183        self
184    }
185    /// <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>
186    pub fn get_priority(&self) -> &::std::option::Option<i32> {
187        self.inner.get_priority()
188    }
189    ///
190    /// Adds a key-value pair to `parameters`.
191    ///
192    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
193    ///
194    /// <p>The parameters for the job.</p>
195    pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::JobParameter) -> Self {
196        self.inner = self.inner.parameters(k.into(), v);
197        self
198    }
199    /// <p>The parameters for the job.</p>
200    pub fn set_parameters(
201        mut self,
202        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::JobParameter>>,
203    ) -> Self {
204        self.inner = self.inner.set_parameters(input);
205        self
206    }
207    /// <p>The parameters for the job.</p>
208    pub fn get_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::JobParameter>> {
209        self.inner.get_parameters()
210    }
211    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
212    pub fn attachments(mut self, input: crate::types::Attachments) -> Self {
213        self.inner = self.inner.attachments(input);
214        self
215    }
216    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
217    pub fn set_attachments(mut self, input: ::std::option::Option<crate::types::Attachments>) -> Self {
218        self.inner = self.inner.set_attachments(input);
219        self
220    }
221    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
222    pub fn get_attachments(&self) -> &::std::option::Option<crate::types::Attachments> {
223        self.inner.get_attachments()
224    }
225    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
226    pub fn storage_profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227        self.inner = self.inner.storage_profile_id(input.into());
228        self
229    }
230    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
231    pub fn set_storage_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
232        self.inner = self.inner.set_storage_profile_id(input);
233        self
234    }
235    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
236    pub fn get_storage_profile_id(&self) -> &::std::option::Option<::std::string::String> {
237        self.inner.get_storage_profile_id()
238    }
239    /// <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>
240    pub fn target_task_run_status(mut self, input: crate::types::CreateJobTargetTaskRunStatus) -> Self {
241        self.inner = self.inner.target_task_run_status(input);
242        self
243    }
244    /// <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>
245    pub fn set_target_task_run_status(mut self, input: ::std::option::Option<crate::types::CreateJobTargetTaskRunStatus>) -> Self {
246        self.inner = self.inner.set_target_task_run_status(input);
247        self
248    }
249    /// <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>
250    pub fn get_target_task_run_status(&self) -> &::std::option::Option<crate::types::CreateJobTargetTaskRunStatus> {
251        self.inner.get_target_task_run_status()
252    }
253    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
254    pub fn max_failed_tasks_count(mut self, input: i32) -> Self {
255        self.inner = self.inner.max_failed_tasks_count(input);
256        self
257    }
258    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
259    pub fn set_max_failed_tasks_count(mut self, input: ::std::option::Option<i32>) -> Self {
260        self.inner = self.inner.set_max_failed_tasks_count(input);
261        self
262    }
263    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
264    pub fn get_max_failed_tasks_count(&self) -> &::std::option::Option<i32> {
265        self.inner.get_max_failed_tasks_count()
266    }
267    /// <p>The maximum number of retries for each task.</p>
268    pub fn max_retries_per_task(mut self, input: i32) -> Self {
269        self.inner = self.inner.max_retries_per_task(input);
270        self
271    }
272    /// <p>The maximum number of retries for each task.</p>
273    pub fn set_max_retries_per_task(mut self, input: ::std::option::Option<i32>) -> Self {
274        self.inner = self.inner.set_max_retries_per_task(input);
275        self
276    }
277    /// <p>The maximum number of retries for each task.</p>
278    pub fn get_max_retries_per_task(&self) -> &::std::option::Option<i32> {
279        self.inner.get_max_retries_per_task()
280    }
281    /// <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>
282    /// <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>
283    /// <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>
284    pub fn max_worker_count(mut self, input: i32) -> Self {
285        self.inner = self.inner.max_worker_count(input);
286        self
287    }
288    /// <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>
289    /// <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>
290    /// <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>
291    pub fn set_max_worker_count(mut self, input: ::std::option::Option<i32>) -> Self {
292        self.inner = self.inner.set_max_worker_count(input);
293        self
294    }
295    /// <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>
296    /// <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>
297    /// <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>
298    pub fn get_max_worker_count(&self) -> &::std::option::Option<i32> {
299        self.inner.get_max_worker_count()
300    }
301    /// <p>The job ID for the source job.</p>
302    pub fn source_job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
303        self.inner = self.inner.source_job_id(input.into());
304        self
305    }
306    /// <p>The job ID for the source job.</p>
307    pub fn set_source_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
308        self.inner = self.inner.set_source_job_id(input);
309        self
310    }
311    /// <p>The job ID for the source job.</p>
312    pub fn get_source_job_id(&self) -> &::std::option::Option<::std::string::String> {
313        self.inner.get_source_job_id()
314    }
315}