aws_sdk_deadline/operation/create_job/
_create_job_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateJobInput {
6 pub farm_id: ::std::option::Option<::std::string::String>,
8 pub queue_id: ::std::option::Option<::std::string::String>,
10 pub client_token: ::std::option::Option<::std::string::String>,
12 pub template: ::std::option::Option<::std::string::String>,
14 pub template_type: ::std::option::Option<crate::types::JobTemplateType>,
16 pub priority: ::std::option::Option<i32>,
18 pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::JobParameter>>,
20 pub attachments: ::std::option::Option<crate::types::Attachments>,
22 pub storage_profile_id: ::std::option::Option<::std::string::String>,
24 pub target_task_run_status: ::std::option::Option<crate::types::CreateJobTargetTaskRunStatus>,
26 pub max_failed_tasks_count: ::std::option::Option<i32>,
28 pub max_retries_per_task: ::std::option::Option<i32>,
30 pub max_worker_count: ::std::option::Option<i32>,
34 pub source_job_id: ::std::option::Option<::std::string::String>,
36}
37impl CreateJobInput {
38 pub fn farm_id(&self) -> ::std::option::Option<&str> {
40 self.farm_id.as_deref()
41 }
42 pub fn queue_id(&self) -> ::std::option::Option<&str> {
44 self.queue_id.as_deref()
45 }
46 pub fn client_token(&self) -> ::std::option::Option<&str> {
48 self.client_token.as_deref()
49 }
50 pub fn template(&self) -> ::std::option::Option<&str> {
52 self.template.as_deref()
53 }
54 pub fn template_type(&self) -> ::std::option::Option<&crate::types::JobTemplateType> {
56 self.template_type.as_ref()
57 }
58 pub fn priority(&self) -> ::std::option::Option<i32> {
60 self.priority
61 }
62 pub fn parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::JobParameter>> {
64 self.parameters.as_ref()
65 }
66 pub fn attachments(&self) -> ::std::option::Option<&crate::types::Attachments> {
68 self.attachments.as_ref()
69 }
70 pub fn storage_profile_id(&self) -> ::std::option::Option<&str> {
72 self.storage_profile_id.as_deref()
73 }
74 pub fn target_task_run_status(&self) -> ::std::option::Option<&crate::types::CreateJobTargetTaskRunStatus> {
76 self.target_task_run_status.as_ref()
77 }
78 pub fn max_failed_tasks_count(&self) -> ::std::option::Option<i32> {
80 self.max_failed_tasks_count
81 }
82 pub fn max_retries_per_task(&self) -> ::std::option::Option<i32> {
84 self.max_retries_per_task
85 }
86 pub fn max_worker_count(&self) -> ::std::option::Option<i32> {
90 self.max_worker_count
91 }
92 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 pub fn builder() -> crate::operation::create_job::builders::CreateJobInputBuilder {
120 crate::operation::create_job::builders::CreateJobInputBuilder::default()
121 }
122}
123
124#[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 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 pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152 self.farm_id = input;
153 self
154 }
155 pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
157 &self.farm_id
158 }
159 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 pub fn set_queue_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167 self.queue_id = input;
168 self
169 }
170 pub fn get_queue_id(&self) -> &::std::option::Option<::std::string::String> {
172 &self.queue_id
173 }
174 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 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181 self.client_token = input;
182 self
183 }
184 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
186 &self.client_token
187 }
188 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 pub fn set_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195 self.template = input;
196 self
197 }
198 pub fn get_template(&self) -> &::std::option::Option<::std::string::String> {
200 &self.template
201 }
202 pub fn template_type(mut self, input: crate::types::JobTemplateType) -> Self {
204 self.template_type = ::std::option::Option::Some(input);
205 self
206 }
207 pub fn set_template_type(mut self, input: ::std::option::Option<crate::types::JobTemplateType>) -> Self {
209 self.template_type = input;
210 self
211 }
212 pub fn get_template_type(&self) -> &::std::option::Option<crate::types::JobTemplateType> {
214 &self.template_type
215 }
216 pub fn priority(mut self, input: i32) -> Self {
219 self.priority = ::std::option::Option::Some(input);
220 self
221 }
222 pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
224 self.priority = input;
225 self
226 }
227 pub fn get_priority(&self) -> &::std::option::Option<i32> {
229 &self.priority
230 }
231 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 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 pub fn get_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::JobParameter>> {
252 &self.parameters
253 }
254 pub fn attachments(mut self, input: crate::types::Attachments) -> Self {
256 self.attachments = ::std::option::Option::Some(input);
257 self
258 }
259 pub fn set_attachments(mut self, input: ::std::option::Option<crate::types::Attachments>) -> Self {
261 self.attachments = input;
262 self
263 }
264 pub fn get_attachments(&self) -> &::std::option::Option<crate::types::Attachments> {
266 &self.attachments
267 }
268 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 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 pub fn get_storage_profile_id(&self) -> &::std::option::Option<::std::string::String> {
280 &self.storage_profile_id
281 }
282 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 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 pub fn get_target_task_run_status(&self) -> &::std::option::Option<crate::types::CreateJobTargetTaskRunStatus> {
294 &self.target_task_run_status
295 }
296 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 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 pub fn get_max_failed_tasks_count(&self) -> &::std::option::Option<i32> {
308 &self.max_failed_tasks_count
309 }
310 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 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 pub fn get_max_retries_per_task(&self) -> &::std::option::Option<i32> {
322 &self.max_retries_per_task
323 }
324 pub fn max_worker_count(mut self, input: i32) -> Self {
328 self.max_worker_count = ::std::option::Option::Some(input);
329 self
330 }
331 pub fn set_max_worker_count(mut self, input: ::std::option::Option<i32>) -> Self {
335 self.max_worker_count = input;
336 self
337 }
338 pub fn get_max_worker_count(&self) -> &::std::option::Option<i32> {
342 &self.max_worker_count
343 }
344 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 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 pub fn get_source_job_id(&self) -> &::std::option::Option<::std::string::String> {
356 &self.source_job_id
357 }
358 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}