aws_sdk_deadline/operation/update_job/_update_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, ::std::fmt::Debug)]
5pub struct UpdateJobInput {
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 task status to update the job's tasks to.</p>
9 pub target_task_run_status: ::std::option::Option<crate::types::JobTargetTaskRunStatus>,
10 /// <p>The job priority to update.</p>
11 pub priority: ::std::option::Option<i32>,
12 /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
13 pub max_failed_tasks_count: ::std::option::Option<i32>,
14 /// <p>The maximum number of retries for a job.</p>
15 pub max_retries_per_task: ::std::option::Option<i32>,
16 /// <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>
17 /// <p>An archived jobs and its steps and tasks are deleted after 120 days. The job can't be recovered.</p>
18 /// </important>
19 pub lifecycle_status: ::std::option::Option<crate::types::UpdateJobLifecycleStatus>,
20 /// <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>
21 /// <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>
22 /// <p>If you don't specify the <code>maxWorkerCount</code>, the default is -1.</p>
23 /// <p>The maximum number of workers that can process tasks in the job.</p>
24 pub max_worker_count: ::std::option::Option<i32>,
25 /// <p>The farm ID of the job to update.</p>
26 pub farm_id: ::std::option::Option<::std::string::String>,
27 /// <p>The queue ID of the job to update.</p>
28 pub queue_id: ::std::option::Option<::std::string::String>,
29 /// <p>The job ID to update.</p>
30 pub job_id: ::std::option::Option<::std::string::String>,
31}
32impl UpdateJobInput {
33 /// <p>The unique token which the server uses to recognize retries of the same request.</p>
34 pub fn client_token(&self) -> ::std::option::Option<&str> {
35 self.client_token.as_deref()
36 }
37 /// <p>The task status to update the job's tasks to.</p>
38 pub fn target_task_run_status(&self) -> ::std::option::Option<&crate::types::JobTargetTaskRunStatus> {
39 self.target_task_run_status.as_ref()
40 }
41 /// <p>The job priority to update.</p>
42 pub fn priority(&self) -> ::std::option::Option<i32> {
43 self.priority
44 }
45 /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
46 pub fn max_failed_tasks_count(&self) -> ::std::option::Option<i32> {
47 self.max_failed_tasks_count
48 }
49 /// <p>The maximum number of retries for a job.</p>
50 pub fn max_retries_per_task(&self) -> ::std::option::Option<i32> {
51 self.max_retries_per_task
52 }
53 /// <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>
54 /// <p>An archived jobs and its steps and tasks are deleted after 120 days. The job can't be recovered.</p>
55 /// </important>
56 pub fn lifecycle_status(&self) -> ::std::option::Option<&crate::types::UpdateJobLifecycleStatus> {
57 self.lifecycle_status.as_ref()
58 }
59 /// <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>
60 /// <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>
61 /// <p>If you don't specify the <code>maxWorkerCount</code>, the default is -1.</p>
62 /// <p>The maximum number of workers that can process tasks in the job.</p>
63 pub fn max_worker_count(&self) -> ::std::option::Option<i32> {
64 self.max_worker_count
65 }
66 /// <p>The farm ID of the job to update.</p>
67 pub fn farm_id(&self) -> ::std::option::Option<&str> {
68 self.farm_id.as_deref()
69 }
70 /// <p>The queue ID of the job to update.</p>
71 pub fn queue_id(&self) -> ::std::option::Option<&str> {
72 self.queue_id.as_deref()
73 }
74 /// <p>The job ID to update.</p>
75 pub fn job_id(&self) -> ::std::option::Option<&str> {
76 self.job_id.as_deref()
77 }
78}
79impl UpdateJobInput {
80 /// Creates a new builder-style object to manufacture [`UpdateJobInput`](crate::operation::update_job::UpdateJobInput).
81 pub fn builder() -> crate::operation::update_job::builders::UpdateJobInputBuilder {
82 crate::operation::update_job::builders::UpdateJobInputBuilder::default()
83 }
84}
85
86/// A builder for [`UpdateJobInput`](crate::operation::update_job::UpdateJobInput).
87#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
88#[non_exhaustive]
89pub struct UpdateJobInputBuilder {
90 pub(crate) client_token: ::std::option::Option<::std::string::String>,
91 pub(crate) target_task_run_status: ::std::option::Option<crate::types::JobTargetTaskRunStatus>,
92 pub(crate) priority: ::std::option::Option<i32>,
93 pub(crate) max_failed_tasks_count: ::std::option::Option<i32>,
94 pub(crate) max_retries_per_task: ::std::option::Option<i32>,
95 pub(crate) lifecycle_status: ::std::option::Option<crate::types::UpdateJobLifecycleStatus>,
96 pub(crate) max_worker_count: ::std::option::Option<i32>,
97 pub(crate) farm_id: ::std::option::Option<::std::string::String>,
98 pub(crate) queue_id: ::std::option::Option<::std::string::String>,
99 pub(crate) job_id: ::std::option::Option<::std::string::String>,
100}
101impl UpdateJobInputBuilder {
102 /// <p>The unique token which the server uses to recognize retries of the same request.</p>
103 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.client_token = ::std::option::Option::Some(input.into());
105 self
106 }
107 /// <p>The unique token which the server uses to recognize retries of the same request.</p>
108 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.client_token = input;
110 self
111 }
112 /// <p>The unique token which the server uses to recognize retries of the same request.</p>
113 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
114 &self.client_token
115 }
116 /// <p>The task status to update the job's tasks to.</p>
117 pub fn target_task_run_status(mut self, input: crate::types::JobTargetTaskRunStatus) -> Self {
118 self.target_task_run_status = ::std::option::Option::Some(input);
119 self
120 }
121 /// <p>The task status to update the job's tasks to.</p>
122 pub fn set_target_task_run_status(mut self, input: ::std::option::Option<crate::types::JobTargetTaskRunStatus>) -> Self {
123 self.target_task_run_status = input;
124 self
125 }
126 /// <p>The task status to update the job's tasks to.</p>
127 pub fn get_target_task_run_status(&self) -> &::std::option::Option<crate::types::JobTargetTaskRunStatus> {
128 &self.target_task_run_status
129 }
130 /// <p>The job priority to update.</p>
131 pub fn priority(mut self, input: i32) -> Self {
132 self.priority = ::std::option::Option::Some(input);
133 self
134 }
135 /// <p>The job priority to update.</p>
136 pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
137 self.priority = input;
138 self
139 }
140 /// <p>The job priority to update.</p>
141 pub fn get_priority(&self) -> &::std::option::Option<i32> {
142 &self.priority
143 }
144 /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
145 pub fn max_failed_tasks_count(mut self, input: i32) -> Self {
146 self.max_failed_tasks_count = ::std::option::Option::Some(input);
147 self
148 }
149 /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
150 pub fn set_max_failed_tasks_count(mut self, input: ::std::option::Option<i32>) -> Self {
151 self.max_failed_tasks_count = input;
152 self
153 }
154 /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
155 pub fn get_max_failed_tasks_count(&self) -> &::std::option::Option<i32> {
156 &self.max_failed_tasks_count
157 }
158 /// <p>The maximum number of retries for a job.</p>
159 pub fn max_retries_per_task(mut self, input: i32) -> Self {
160 self.max_retries_per_task = ::std::option::Option::Some(input);
161 self
162 }
163 /// <p>The maximum number of retries for a job.</p>
164 pub fn set_max_retries_per_task(mut self, input: ::std::option::Option<i32>) -> Self {
165 self.max_retries_per_task = input;
166 self
167 }
168 /// <p>The maximum number of retries for a job.</p>
169 pub fn get_max_retries_per_task(&self) -> &::std::option::Option<i32> {
170 &self.max_retries_per_task
171 }
172 /// <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>
173 /// <p>An archived jobs and its steps and tasks are deleted after 120 days. The job can't be recovered.</p>
174 /// </important>
175 pub fn lifecycle_status(mut self, input: crate::types::UpdateJobLifecycleStatus) -> Self {
176 self.lifecycle_status = ::std::option::Option::Some(input);
177 self
178 }
179 /// <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>
180 /// <p>An archived jobs and its steps and tasks are deleted after 120 days. The job can't be recovered.</p>
181 /// </important>
182 pub fn set_lifecycle_status(mut self, input: ::std::option::Option<crate::types::UpdateJobLifecycleStatus>) -> Self {
183 self.lifecycle_status = input;
184 self
185 }
186 /// <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>
187 /// <p>An archived jobs and its steps and tasks are deleted after 120 days. The job can't be recovered.</p>
188 /// </important>
189 pub fn get_lifecycle_status(&self) -> &::std::option::Option<crate::types::UpdateJobLifecycleStatus> {
190 &self.lifecycle_status
191 }
192 /// <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>
193 /// <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>
194 /// <p>If you don't specify the <code>maxWorkerCount</code>, the default is -1.</p>
195 /// <p>The maximum number of workers that can process tasks in the job.</p>
196 pub fn max_worker_count(mut self, input: i32) -> Self {
197 self.max_worker_count = ::std::option::Option::Some(input);
198 self
199 }
200 /// <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>
201 /// <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>
202 /// <p>If you don't specify the <code>maxWorkerCount</code>, the default is -1.</p>
203 /// <p>The maximum number of workers that can process tasks in the job.</p>
204 pub fn set_max_worker_count(mut self, input: ::std::option::Option<i32>) -> Self {
205 self.max_worker_count = input;
206 self
207 }
208 /// <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>
209 /// <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>
210 /// <p>If you don't specify the <code>maxWorkerCount</code>, the default is -1.</p>
211 /// <p>The maximum number of workers that can process tasks in the job.</p>
212 pub fn get_max_worker_count(&self) -> &::std::option::Option<i32> {
213 &self.max_worker_count
214 }
215 /// <p>The farm ID of the job to update.</p>
216 /// This field is required.
217 pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218 self.farm_id = ::std::option::Option::Some(input.into());
219 self
220 }
221 /// <p>The farm ID of the job to update.</p>
222 pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
223 self.farm_id = input;
224 self
225 }
226 /// <p>The farm ID of the job to update.</p>
227 pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
228 &self.farm_id
229 }
230 /// <p>The queue ID of the job to update.</p>
231 /// This field is required.
232 pub fn queue_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
233 self.queue_id = ::std::option::Option::Some(input.into());
234 self
235 }
236 /// <p>The queue ID of the job to update.</p>
237 pub fn set_queue_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
238 self.queue_id = input;
239 self
240 }
241 /// <p>The queue ID of the job to update.</p>
242 pub fn get_queue_id(&self) -> &::std::option::Option<::std::string::String> {
243 &self.queue_id
244 }
245 /// <p>The job ID to update.</p>
246 /// This field is required.
247 pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
248 self.job_id = ::std::option::Option::Some(input.into());
249 self
250 }
251 /// <p>The job ID to update.</p>
252 pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
253 self.job_id = input;
254 self
255 }
256 /// <p>The job ID to update.</p>
257 pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
258 &self.job_id
259 }
260 /// Consumes the builder and constructs a [`UpdateJobInput`](crate::operation::update_job::UpdateJobInput).
261 pub fn build(self) -> ::std::result::Result<crate::operation::update_job::UpdateJobInput, ::aws_smithy_types::error::operation::BuildError> {
262 ::std::result::Result::Ok(crate::operation::update_job::UpdateJobInput {
263 client_token: self.client_token,
264 target_task_run_status: self.target_task_run_status,
265 priority: self.priority,
266 max_failed_tasks_count: self.max_failed_tasks_count,
267 max_retries_per_task: self.max_retries_per_task,
268 lifecycle_status: self.lifecycle_status,
269 max_worker_count: self.max_worker_count,
270 farm_id: self.farm_id,
271 queue_id: self.queue_id,
272 job_id: self.job_id,
273 })
274 }
275}