aws_sdk_deadline/operation/update_job/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_job::_update_job_output::UpdateJobOutputBuilder;
3
4pub use crate::operation::update_job::_update_job_input::UpdateJobInputBuilder;
5
6impl crate::operation::update_job::builders::UpdateJobInputBuilder {
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::update_job::UpdateJobOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_job::UpdateJobError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_job();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateJob`.
24///
25/// <p>Updates a job.</p>
26/// <p>When you change the status of the job to <code>ARCHIVED</code>, the job can't be scheduled or archived.</p><important>
27/// <p>An archived jobs and its steps and tasks are deleted after 120 days. The job can't be recovered.</p>
28/// </important>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct UpdateJobFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::update_job::builders::UpdateJobInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl crate::client::customize::internal::CustomizableSend<crate::operation::update_job::UpdateJobOutput, crate::operation::update_job::UpdateJobError>
36    for UpdateJobFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<crate::operation::update_job::UpdateJobOutput, crate::operation::update_job::UpdateJobError>,
43    > {
44        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
45    }
46}
47impl UpdateJobFluentBuilder {
48    /// Creates a new `UpdateJobFluentBuilder`.
49    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
50        Self {
51            handle,
52            inner: ::std::default::Default::default(),
53            config_override: ::std::option::Option::None,
54        }
55    }
56    /// Access the UpdateJob as a reference.
57    pub fn as_input(&self) -> &crate::operation::update_job::builders::UpdateJobInputBuilder {
58        &self.inner
59    }
60    /// Sends the request and returns the response.
61    ///
62    /// If an error occurs, an `SdkError` will be returned with additional details that
63    /// can be matched against.
64    ///
65    /// By default, any retryable failures will be retried twice. Retry behavior
66    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
67    /// set when configuring the client.
68    pub async fn send(
69        self,
70    ) -> ::std::result::Result<
71        crate::operation::update_job::UpdateJobOutput,
72        ::aws_smithy_runtime_api::client::result::SdkError<
73            crate::operation::update_job::UpdateJobError,
74            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
75        >,
76    > {
77        let input = self
78            .inner
79            .build()
80            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
81        let runtime_plugins = crate::operation::update_job::UpdateJob::operation_runtime_plugins(
82            self.handle.runtime_plugins.clone(),
83            &self.handle.conf,
84            self.config_override,
85        );
86        crate::operation::update_job::UpdateJob::orchestrate(&runtime_plugins, input).await
87    }
88
89    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
90    pub fn customize(
91        self,
92    ) -> crate::client::customize::CustomizableOperation<
93        crate::operation::update_job::UpdateJobOutput,
94        crate::operation::update_job::UpdateJobError,
95        Self,
96    > {
97        crate::client::customize::CustomizableOperation::new(self)
98    }
99    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
100        self.set_config_override(::std::option::Option::Some(config_override.into()));
101        self
102    }
103
104    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
105        self.config_override = config_override;
106        self
107    }
108    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
109    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.inner = self.inner.client_token(input.into());
111        self
112    }
113    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
114    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.inner = self.inner.set_client_token(input);
116        self
117    }
118    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
119    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
120        self.inner.get_client_token()
121    }
122    /// <p>The task status to update the job's tasks to.</p>
123    pub fn target_task_run_status(mut self, input: crate::types::JobTargetTaskRunStatus) -> Self {
124        self.inner = self.inner.target_task_run_status(input);
125        self
126    }
127    /// <p>The task status to update the job's tasks to.</p>
128    pub fn set_target_task_run_status(mut self, input: ::std::option::Option<crate::types::JobTargetTaskRunStatus>) -> Self {
129        self.inner = self.inner.set_target_task_run_status(input);
130        self
131    }
132    /// <p>The task status to update the job's tasks to.</p>
133    pub fn get_target_task_run_status(&self) -> &::std::option::Option<crate::types::JobTargetTaskRunStatus> {
134        self.inner.get_target_task_run_status()
135    }
136    /// <p>The job priority to update.</p>
137    pub fn priority(mut self, input: i32) -> Self {
138        self.inner = self.inner.priority(input);
139        self
140    }
141    /// <p>The job priority to update.</p>
142    pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
143        self.inner = self.inner.set_priority(input);
144        self
145    }
146    /// <p>The job priority to update.</p>
147    pub fn get_priority(&self) -> &::std::option::Option<i32> {
148        self.inner.get_priority()
149    }
150    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
151    pub fn max_failed_tasks_count(mut self, input: i32) -> Self {
152        self.inner = self.inner.max_failed_tasks_count(input);
153        self
154    }
155    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
156    pub fn set_max_failed_tasks_count(mut self, input: ::std::option::Option<i32>) -> Self {
157        self.inner = self.inner.set_max_failed_tasks_count(input);
158        self
159    }
160    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
161    pub fn get_max_failed_tasks_count(&self) -> &::std::option::Option<i32> {
162        self.inner.get_max_failed_tasks_count()
163    }
164    /// <p>The maximum number of retries for a job.</p>
165    pub fn max_retries_per_task(mut self, input: i32) -> Self {
166        self.inner = self.inner.max_retries_per_task(input);
167        self
168    }
169    /// <p>The maximum number of retries for a job.</p>
170    pub fn set_max_retries_per_task(mut self, input: ::std::option::Option<i32>) -> Self {
171        self.inner = self.inner.set_max_retries_per_task(input);
172        self
173    }
174    /// <p>The maximum number of retries for a job.</p>
175    pub fn get_max_retries_per_task(&self) -> &::std::option::Option<i32> {
176        self.inner.get_max_retries_per_task()
177    }
178    /// <p>The status of a job in its lifecycle. When you change the status of the job to <code>ARCHIVED</code>, the job can't be scheduled or archived.</p><important>
179    /// <p>An archived jobs and its steps and tasks are deleted after 120 days. The job can't be recovered.</p>
180    /// </important>
181    pub fn lifecycle_status(mut self, input: crate::types::UpdateJobLifecycleStatus) -> Self {
182        self.inner = self.inner.lifecycle_status(input);
183        self
184    }
185    /// <p>The status of a job in its lifecycle. When you change the status of the job to <code>ARCHIVED</code>, the job can't be scheduled or archived.</p><important>
186    /// <p>An archived jobs and its steps and tasks are deleted after 120 days. The job can't be recovered.</p>
187    /// </important>
188    pub fn set_lifecycle_status(mut self, input: ::std::option::Option<crate::types::UpdateJobLifecycleStatus>) -> Self {
189        self.inner = self.inner.set_lifecycle_status(input);
190        self
191    }
192    /// <p>The status of a job in its lifecycle. When you change the status of the job to <code>ARCHIVED</code>, the job can't be scheduled or archived.</p><important>
193    /// <p>An archived jobs and its steps and tasks are deleted after 120 days. The job can't be recovered.</p>
194    /// </important>
195    pub fn get_lifecycle_status(&self) -> &::std::option::Option<crate::types::UpdateJobLifecycleStatus> {
196        self.inner.get_lifecycle_status()
197    }
198    /// <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>
199    /// <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>
200    /// <p>If you don't specify the <code>maxWorkerCount</code>, the default is -1.</p>
201    /// <p>The maximum number of workers that can process tasks in the job.</p>
202    pub fn max_worker_count(mut self, input: i32) -> Self {
203        self.inner = self.inner.max_worker_count(input);
204        self
205    }
206    /// <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>
207    /// <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>
208    /// <p>If you don't specify the <code>maxWorkerCount</code>, the default is -1.</p>
209    /// <p>The maximum number of workers that can process tasks in the job.</p>
210    pub fn set_max_worker_count(mut self, input: ::std::option::Option<i32>) -> Self {
211        self.inner = self.inner.set_max_worker_count(input);
212        self
213    }
214    /// <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>
215    /// <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>
216    /// <p>If you don't specify the <code>maxWorkerCount</code>, the default is -1.</p>
217    /// <p>The maximum number of workers that can process tasks in the job.</p>
218    pub fn get_max_worker_count(&self) -> &::std::option::Option<i32> {
219        self.inner.get_max_worker_count()
220    }
221    /// <p>The farm ID of the job to update.</p>
222    pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
223        self.inner = self.inner.farm_id(input.into());
224        self
225    }
226    /// <p>The farm ID of the job to update.</p>
227    pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
228        self.inner = self.inner.set_farm_id(input);
229        self
230    }
231    /// <p>The farm ID of the job to update.</p>
232    pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
233        self.inner.get_farm_id()
234    }
235    /// <p>The queue ID of the job to update.</p>
236    pub fn queue_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
237        self.inner = self.inner.queue_id(input.into());
238        self
239    }
240    /// <p>The queue ID of the job to update.</p>
241    pub fn set_queue_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
242        self.inner = self.inner.set_queue_id(input);
243        self
244    }
245    /// <p>The queue ID of the job to update.</p>
246    pub fn get_queue_id(&self) -> &::std::option::Option<::std::string::String> {
247        self.inner.get_queue_id()
248    }
249    /// <p>The job ID to update.</p>
250    pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
251        self.inner = self.inner.job_id(input.into());
252        self
253    }
254    /// <p>The job ID to update.</p>
255    pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
256        self.inner = self.inner.set_job_id(input);
257        self
258    }
259    /// <p>The job ID to update.</p>
260    pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
261        self.inner.get_job_id()
262    }
263}