aws_sdk_iot/types/_job.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The <code>Job</code> object contains details about a job.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Job {
7 /// <p>An ARN identifying the job with format "arn:aws:iot:region:account:job/jobId".</p>
8 pub job_arn: ::std::option::Option<::std::string::String>,
9 /// <p>The unique identifier you assigned to this job when it was created.</p>
10 pub job_id: ::std::option::Option<::std::string::String>,
11 /// <p>Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a device when the thing representing the device is added to a target group, even after the job was completed by all things originally in the group.</p><note>
12 /// <p>We recommend that you use continuous jobs instead of snapshot jobs for dynamic thing group targets. By using continuous jobs, devices that join the group receive the job execution even after the job has been created.</p>
13 /// </note>
14 pub target_selection: ::std::option::Option<crate::types::TargetSelection>,
15 /// <p>The status of the job, one of <code>IN_PROGRESS</code>, <code>CANCELED</code>, <code>DELETION_IN_PROGRESS</code> or <code>COMPLETED</code>.</p>
16 pub status: ::std::option::Option<crate::types::JobStatus>,
17 /// <p>Will be <code>true</code> if the job was canceled with the optional <code>force</code> parameter set to <code>true</code>.</p>
18 pub force_canceled: ::std::option::Option<bool>,
19 /// <p>If the job was updated, provides the reason code for the update.</p>
20 pub reason_code: ::std::option::Option<::std::string::String>,
21 /// <p>If the job was updated, describes the reason for the update.</p>
22 pub comment: ::std::option::Option<::std::string::String>,
23 /// <p>A list of IoT things and thing groups to which the job should be sent.</p>
24 pub targets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
25 /// <p>A short text description of the job.</p>
26 pub description: ::std::option::Option<::std::string::String>,
27 /// <p>Configuration for pre-signed S3 URLs.</p>
28 pub presigned_url_config: ::std::option::Option<crate::types::PresignedUrlConfig>,
29 /// <p>Allows you to create a staged rollout of a job.</p>
30 pub job_executions_rollout_config: ::std::option::Option<crate::types::JobExecutionsRolloutConfig>,
31 /// <p>Configuration for criteria to abort the job.</p>
32 pub abort_config: ::std::option::Option<crate::types::AbortConfig>,
33 /// <p>The time, in seconds since the epoch, when the job was created.</p>
34 pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
35 /// <p>The time, in seconds since the epoch, when the job was last updated.</p>
36 pub last_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
37 /// <p>The time, in seconds since the epoch, when the job was completed.</p>
38 pub completed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
39 /// <p>Details about the job process.</p>
40 pub job_process_details: ::std::option::Option<crate::types::JobProcessDetails>,
41 /// <p>Specifies the amount of time each device has to finish its execution of the job. A timer is started when the job execution status is set to <code>IN_PROGRESS</code>. If the job execution status is not set to another terminal state before the timer expires, it will be automatically set to <code>TIMED_OUT</code>.</p>
42 pub timeout_config: ::std::option::Option<crate::types::TimeoutConfig>,
43 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
44 /// <p>When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.</p>
45 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
46 /// <p>The <code>namespaceId</code> feature is only supported by IoT Greengrass at this time. For more information, see <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/setting-up.html">Setting up IoT Greengrass core devices.</a></p>
47 /// </note>
48 pub namespace_id: ::std::option::Option<::std::string::String>,
49 /// <p>The ARN of the job template used to create the job.</p>
50 pub job_template_arn: ::std::option::Option<::std::string::String>,
51 /// <p>The configuration for the criteria to retry the job.</p>
52 pub job_executions_retry_config: ::std::option::Option<crate::types::JobExecutionsRetryConfig>,
53 /// <p>A key-value map that pairs the patterns that need to be replaced in a managed template job document schema. You can use the description of each key as a guidance to specify the inputs during runtime when creating a job.</p><note>
54 /// <p><code>documentParameters</code> can only be used when creating jobs from Amazon Web Services managed templates. This parameter can't be used with custom job templates or to create jobs from them.</p>
55 /// </note>
56 pub document_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
57 /// <p>Indicates whether a job is concurrent. Will be true when a job is rolling out new job executions or canceling previously created executions, otherwise false.</p>
58 pub is_concurrent: ::std::option::Option<bool>,
59 /// <p>The configuration that allows you to schedule a job for a future date and time in addition to specifying the end behavior for each job execution.</p>
60 pub scheduling_config: ::std::option::Option<crate::types::SchedulingConfig>,
61 /// <p>Displays the next seven maintenance window occurrences and their start times.</p>
62 pub scheduled_job_rollouts: ::std::option::Option<::std::vec::Vec<crate::types::ScheduledJobRollout>>,
63 /// <p>The package version Amazon Resource Names (ARNs) that are installed on the device when the job successfully completes. The package version must be in either the Published or Deprecated state when the job deploys. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.The package version must be in either the Published or Deprecated state when the job deploys. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.</p>
64 /// <p><b>Note:</b>The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed.</p>
65 pub destination_package_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
66}
67impl Job {
68 /// <p>An ARN identifying the job with format "arn:aws:iot:region:account:job/jobId".</p>
69 pub fn job_arn(&self) -> ::std::option::Option<&str> {
70 self.job_arn.as_deref()
71 }
72 /// <p>The unique identifier you assigned to this job when it was created.</p>
73 pub fn job_id(&self) -> ::std::option::Option<&str> {
74 self.job_id.as_deref()
75 }
76 /// <p>Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a device when the thing representing the device is added to a target group, even after the job was completed by all things originally in the group.</p><note>
77 /// <p>We recommend that you use continuous jobs instead of snapshot jobs for dynamic thing group targets. By using continuous jobs, devices that join the group receive the job execution even after the job has been created.</p>
78 /// </note>
79 pub fn target_selection(&self) -> ::std::option::Option<&crate::types::TargetSelection> {
80 self.target_selection.as_ref()
81 }
82 /// <p>The status of the job, one of <code>IN_PROGRESS</code>, <code>CANCELED</code>, <code>DELETION_IN_PROGRESS</code> or <code>COMPLETED</code>.</p>
83 pub fn status(&self) -> ::std::option::Option<&crate::types::JobStatus> {
84 self.status.as_ref()
85 }
86 /// <p>Will be <code>true</code> if the job was canceled with the optional <code>force</code> parameter set to <code>true</code>.</p>
87 pub fn force_canceled(&self) -> ::std::option::Option<bool> {
88 self.force_canceled
89 }
90 /// <p>If the job was updated, provides the reason code for the update.</p>
91 pub fn reason_code(&self) -> ::std::option::Option<&str> {
92 self.reason_code.as_deref()
93 }
94 /// <p>If the job was updated, describes the reason for the update.</p>
95 pub fn comment(&self) -> ::std::option::Option<&str> {
96 self.comment.as_deref()
97 }
98 /// <p>A list of IoT things and thing groups to which the job should be sent.</p>
99 ///
100 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.targets.is_none()`.
101 pub fn targets(&self) -> &[::std::string::String] {
102 self.targets.as_deref().unwrap_or_default()
103 }
104 /// <p>A short text description of the job.</p>
105 pub fn description(&self) -> ::std::option::Option<&str> {
106 self.description.as_deref()
107 }
108 /// <p>Configuration for pre-signed S3 URLs.</p>
109 pub fn presigned_url_config(&self) -> ::std::option::Option<&crate::types::PresignedUrlConfig> {
110 self.presigned_url_config.as_ref()
111 }
112 /// <p>Allows you to create a staged rollout of a job.</p>
113 pub fn job_executions_rollout_config(&self) -> ::std::option::Option<&crate::types::JobExecutionsRolloutConfig> {
114 self.job_executions_rollout_config.as_ref()
115 }
116 /// <p>Configuration for criteria to abort the job.</p>
117 pub fn abort_config(&self) -> ::std::option::Option<&crate::types::AbortConfig> {
118 self.abort_config.as_ref()
119 }
120 /// <p>The time, in seconds since the epoch, when the job was created.</p>
121 pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
122 self.created_at.as_ref()
123 }
124 /// <p>The time, in seconds since the epoch, when the job was last updated.</p>
125 pub fn last_updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
126 self.last_updated_at.as_ref()
127 }
128 /// <p>The time, in seconds since the epoch, when the job was completed.</p>
129 pub fn completed_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
130 self.completed_at.as_ref()
131 }
132 /// <p>Details about the job process.</p>
133 pub fn job_process_details(&self) -> ::std::option::Option<&crate::types::JobProcessDetails> {
134 self.job_process_details.as_ref()
135 }
136 /// <p>Specifies the amount of time each device has to finish its execution of the job. A timer is started when the job execution status is set to <code>IN_PROGRESS</code>. If the job execution status is not set to another terminal state before the timer expires, it will be automatically set to <code>TIMED_OUT</code>.</p>
137 pub fn timeout_config(&self) -> ::std::option::Option<&crate::types::TimeoutConfig> {
138 self.timeout_config.as_ref()
139 }
140 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
141 /// <p>When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.</p>
142 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
143 /// <p>The <code>namespaceId</code> feature is only supported by IoT Greengrass at this time. For more information, see <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/setting-up.html">Setting up IoT Greengrass core devices.</a></p>
144 /// </note>
145 pub fn namespace_id(&self) -> ::std::option::Option<&str> {
146 self.namespace_id.as_deref()
147 }
148 /// <p>The ARN of the job template used to create the job.</p>
149 pub fn job_template_arn(&self) -> ::std::option::Option<&str> {
150 self.job_template_arn.as_deref()
151 }
152 /// <p>The configuration for the criteria to retry the job.</p>
153 pub fn job_executions_retry_config(&self) -> ::std::option::Option<&crate::types::JobExecutionsRetryConfig> {
154 self.job_executions_retry_config.as_ref()
155 }
156 /// <p>A key-value map that pairs the patterns that need to be replaced in a managed template job document schema. You can use the description of each key as a guidance to specify the inputs during runtime when creating a job.</p><note>
157 /// <p><code>documentParameters</code> can only be used when creating jobs from Amazon Web Services managed templates. This parameter can't be used with custom job templates or to create jobs from them.</p>
158 /// </note>
159 pub fn document_parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
160 self.document_parameters.as_ref()
161 }
162 /// <p>Indicates whether a job is concurrent. Will be true when a job is rolling out new job executions or canceling previously created executions, otherwise false.</p>
163 pub fn is_concurrent(&self) -> ::std::option::Option<bool> {
164 self.is_concurrent
165 }
166 /// <p>The configuration that allows you to schedule a job for a future date and time in addition to specifying the end behavior for each job execution.</p>
167 pub fn scheduling_config(&self) -> ::std::option::Option<&crate::types::SchedulingConfig> {
168 self.scheduling_config.as_ref()
169 }
170 /// <p>Displays the next seven maintenance window occurrences and their start times.</p>
171 ///
172 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.scheduled_job_rollouts.is_none()`.
173 pub fn scheduled_job_rollouts(&self) -> &[crate::types::ScheduledJobRollout] {
174 self.scheduled_job_rollouts.as_deref().unwrap_or_default()
175 }
176 /// <p>The package version Amazon Resource Names (ARNs) that are installed on the device when the job successfully completes. The package version must be in either the Published or Deprecated state when the job deploys. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.The package version must be in either the Published or Deprecated state when the job deploys. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.</p>
177 /// <p><b>Note:</b>The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed.</p>
178 ///
179 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.destination_package_versions.is_none()`.
180 pub fn destination_package_versions(&self) -> &[::std::string::String] {
181 self.destination_package_versions.as_deref().unwrap_or_default()
182 }
183}
184impl Job {
185 /// Creates a new builder-style object to manufacture [`Job`](crate::types::Job).
186 pub fn builder() -> crate::types::builders::JobBuilder {
187 crate::types::builders::JobBuilder::default()
188 }
189}
190
191/// A builder for [`Job`](crate::types::Job).
192#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
193#[non_exhaustive]
194pub struct JobBuilder {
195 pub(crate) job_arn: ::std::option::Option<::std::string::String>,
196 pub(crate) job_id: ::std::option::Option<::std::string::String>,
197 pub(crate) target_selection: ::std::option::Option<crate::types::TargetSelection>,
198 pub(crate) status: ::std::option::Option<crate::types::JobStatus>,
199 pub(crate) force_canceled: ::std::option::Option<bool>,
200 pub(crate) reason_code: ::std::option::Option<::std::string::String>,
201 pub(crate) comment: ::std::option::Option<::std::string::String>,
202 pub(crate) targets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
203 pub(crate) description: ::std::option::Option<::std::string::String>,
204 pub(crate) presigned_url_config: ::std::option::Option<crate::types::PresignedUrlConfig>,
205 pub(crate) job_executions_rollout_config: ::std::option::Option<crate::types::JobExecutionsRolloutConfig>,
206 pub(crate) abort_config: ::std::option::Option<crate::types::AbortConfig>,
207 pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
208 pub(crate) last_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
209 pub(crate) completed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
210 pub(crate) job_process_details: ::std::option::Option<crate::types::JobProcessDetails>,
211 pub(crate) timeout_config: ::std::option::Option<crate::types::TimeoutConfig>,
212 pub(crate) namespace_id: ::std::option::Option<::std::string::String>,
213 pub(crate) job_template_arn: ::std::option::Option<::std::string::String>,
214 pub(crate) job_executions_retry_config: ::std::option::Option<crate::types::JobExecutionsRetryConfig>,
215 pub(crate) document_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
216 pub(crate) is_concurrent: ::std::option::Option<bool>,
217 pub(crate) scheduling_config: ::std::option::Option<crate::types::SchedulingConfig>,
218 pub(crate) scheduled_job_rollouts: ::std::option::Option<::std::vec::Vec<crate::types::ScheduledJobRollout>>,
219 pub(crate) destination_package_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
220}
221impl JobBuilder {
222 /// <p>An ARN identifying the job with format "arn:aws:iot:region:account:job/jobId".</p>
223 pub fn job_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
224 self.job_arn = ::std::option::Option::Some(input.into());
225 self
226 }
227 /// <p>An ARN identifying the job with format "arn:aws:iot:region:account:job/jobId".</p>
228 pub fn set_job_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
229 self.job_arn = input;
230 self
231 }
232 /// <p>An ARN identifying the job with format "arn:aws:iot:region:account:job/jobId".</p>
233 pub fn get_job_arn(&self) -> &::std::option::Option<::std::string::String> {
234 &self.job_arn
235 }
236 /// <p>The unique identifier you assigned to this job when it was created.</p>
237 pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238 self.job_id = ::std::option::Option::Some(input.into());
239 self
240 }
241 /// <p>The unique identifier you assigned to this job when it was created.</p>
242 pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
243 self.job_id = input;
244 self
245 }
246 /// <p>The unique identifier you assigned to this job when it was created.</p>
247 pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
248 &self.job_id
249 }
250 /// <p>Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a device when the thing representing the device is added to a target group, even after the job was completed by all things originally in the group.</p><note>
251 /// <p>We recommend that you use continuous jobs instead of snapshot jobs for dynamic thing group targets. By using continuous jobs, devices that join the group receive the job execution even after the job has been created.</p>
252 /// </note>
253 pub fn target_selection(mut self, input: crate::types::TargetSelection) -> Self {
254 self.target_selection = ::std::option::Option::Some(input);
255 self
256 }
257 /// <p>Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a device when the thing representing the device is added to a target group, even after the job was completed by all things originally in the group.</p><note>
258 /// <p>We recommend that you use continuous jobs instead of snapshot jobs for dynamic thing group targets. By using continuous jobs, devices that join the group receive the job execution even after the job has been created.</p>
259 /// </note>
260 pub fn set_target_selection(mut self, input: ::std::option::Option<crate::types::TargetSelection>) -> Self {
261 self.target_selection = input;
262 self
263 }
264 /// <p>Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a device when the thing representing the device is added to a target group, even after the job was completed by all things originally in the group.</p><note>
265 /// <p>We recommend that you use continuous jobs instead of snapshot jobs for dynamic thing group targets. By using continuous jobs, devices that join the group receive the job execution even after the job has been created.</p>
266 /// </note>
267 pub fn get_target_selection(&self) -> &::std::option::Option<crate::types::TargetSelection> {
268 &self.target_selection
269 }
270 /// <p>The status of the job, one of <code>IN_PROGRESS</code>, <code>CANCELED</code>, <code>DELETION_IN_PROGRESS</code> or <code>COMPLETED</code>.</p>
271 pub fn status(mut self, input: crate::types::JobStatus) -> Self {
272 self.status = ::std::option::Option::Some(input);
273 self
274 }
275 /// <p>The status of the job, one of <code>IN_PROGRESS</code>, <code>CANCELED</code>, <code>DELETION_IN_PROGRESS</code> or <code>COMPLETED</code>.</p>
276 pub fn set_status(mut self, input: ::std::option::Option<crate::types::JobStatus>) -> Self {
277 self.status = input;
278 self
279 }
280 /// <p>The status of the job, one of <code>IN_PROGRESS</code>, <code>CANCELED</code>, <code>DELETION_IN_PROGRESS</code> or <code>COMPLETED</code>.</p>
281 pub fn get_status(&self) -> &::std::option::Option<crate::types::JobStatus> {
282 &self.status
283 }
284 /// <p>Will be <code>true</code> if the job was canceled with the optional <code>force</code> parameter set to <code>true</code>.</p>
285 pub fn force_canceled(mut self, input: bool) -> Self {
286 self.force_canceled = ::std::option::Option::Some(input);
287 self
288 }
289 /// <p>Will be <code>true</code> if the job was canceled with the optional <code>force</code> parameter set to <code>true</code>.</p>
290 pub fn set_force_canceled(mut self, input: ::std::option::Option<bool>) -> Self {
291 self.force_canceled = input;
292 self
293 }
294 /// <p>Will be <code>true</code> if the job was canceled with the optional <code>force</code> parameter set to <code>true</code>.</p>
295 pub fn get_force_canceled(&self) -> &::std::option::Option<bool> {
296 &self.force_canceled
297 }
298 /// <p>If the job was updated, provides the reason code for the update.</p>
299 pub fn reason_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
300 self.reason_code = ::std::option::Option::Some(input.into());
301 self
302 }
303 /// <p>If the job was updated, provides the reason code for the update.</p>
304 pub fn set_reason_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
305 self.reason_code = input;
306 self
307 }
308 /// <p>If the job was updated, provides the reason code for the update.</p>
309 pub fn get_reason_code(&self) -> &::std::option::Option<::std::string::String> {
310 &self.reason_code
311 }
312 /// <p>If the job was updated, describes the reason for the update.</p>
313 pub fn comment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
314 self.comment = ::std::option::Option::Some(input.into());
315 self
316 }
317 /// <p>If the job was updated, describes the reason for the update.</p>
318 pub fn set_comment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
319 self.comment = input;
320 self
321 }
322 /// <p>If the job was updated, describes the reason for the update.</p>
323 pub fn get_comment(&self) -> &::std::option::Option<::std::string::String> {
324 &self.comment
325 }
326 /// Appends an item to `targets`.
327 ///
328 /// To override the contents of this collection use [`set_targets`](Self::set_targets).
329 ///
330 /// <p>A list of IoT things and thing groups to which the job should be sent.</p>
331 pub fn targets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
332 let mut v = self.targets.unwrap_or_default();
333 v.push(input.into());
334 self.targets = ::std::option::Option::Some(v);
335 self
336 }
337 /// <p>A list of IoT things and thing groups to which the job should be sent.</p>
338 pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
339 self.targets = input;
340 self
341 }
342 /// <p>A list of IoT things and thing groups to which the job should be sent.</p>
343 pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
344 &self.targets
345 }
346 /// <p>A short text description of the job.</p>
347 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
348 self.description = ::std::option::Option::Some(input.into());
349 self
350 }
351 /// <p>A short text description of the job.</p>
352 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
353 self.description = input;
354 self
355 }
356 /// <p>A short text description of the job.</p>
357 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
358 &self.description
359 }
360 /// <p>Configuration for pre-signed S3 URLs.</p>
361 pub fn presigned_url_config(mut self, input: crate::types::PresignedUrlConfig) -> Self {
362 self.presigned_url_config = ::std::option::Option::Some(input);
363 self
364 }
365 /// <p>Configuration for pre-signed S3 URLs.</p>
366 pub fn set_presigned_url_config(mut self, input: ::std::option::Option<crate::types::PresignedUrlConfig>) -> Self {
367 self.presigned_url_config = input;
368 self
369 }
370 /// <p>Configuration for pre-signed S3 URLs.</p>
371 pub fn get_presigned_url_config(&self) -> &::std::option::Option<crate::types::PresignedUrlConfig> {
372 &self.presigned_url_config
373 }
374 /// <p>Allows you to create a staged rollout of a job.</p>
375 pub fn job_executions_rollout_config(mut self, input: crate::types::JobExecutionsRolloutConfig) -> Self {
376 self.job_executions_rollout_config = ::std::option::Option::Some(input);
377 self
378 }
379 /// <p>Allows you to create a staged rollout of a job.</p>
380 pub fn set_job_executions_rollout_config(mut self, input: ::std::option::Option<crate::types::JobExecutionsRolloutConfig>) -> Self {
381 self.job_executions_rollout_config = input;
382 self
383 }
384 /// <p>Allows you to create a staged rollout of a job.</p>
385 pub fn get_job_executions_rollout_config(&self) -> &::std::option::Option<crate::types::JobExecutionsRolloutConfig> {
386 &self.job_executions_rollout_config
387 }
388 /// <p>Configuration for criteria to abort the job.</p>
389 pub fn abort_config(mut self, input: crate::types::AbortConfig) -> Self {
390 self.abort_config = ::std::option::Option::Some(input);
391 self
392 }
393 /// <p>Configuration for criteria to abort the job.</p>
394 pub fn set_abort_config(mut self, input: ::std::option::Option<crate::types::AbortConfig>) -> Self {
395 self.abort_config = input;
396 self
397 }
398 /// <p>Configuration for criteria to abort the job.</p>
399 pub fn get_abort_config(&self) -> &::std::option::Option<crate::types::AbortConfig> {
400 &self.abort_config
401 }
402 /// <p>The time, in seconds since the epoch, when the job was created.</p>
403 pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
404 self.created_at = ::std::option::Option::Some(input);
405 self
406 }
407 /// <p>The time, in seconds since the epoch, when the job was created.</p>
408 pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
409 self.created_at = input;
410 self
411 }
412 /// <p>The time, in seconds since the epoch, when the job was created.</p>
413 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
414 &self.created_at
415 }
416 /// <p>The time, in seconds since the epoch, when the job was last updated.</p>
417 pub fn last_updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
418 self.last_updated_at = ::std::option::Option::Some(input);
419 self
420 }
421 /// <p>The time, in seconds since the epoch, when the job was last updated.</p>
422 pub fn set_last_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
423 self.last_updated_at = input;
424 self
425 }
426 /// <p>The time, in seconds since the epoch, when the job was last updated.</p>
427 pub fn get_last_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
428 &self.last_updated_at
429 }
430 /// <p>The time, in seconds since the epoch, when the job was completed.</p>
431 pub fn completed_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
432 self.completed_at = ::std::option::Option::Some(input);
433 self
434 }
435 /// <p>The time, in seconds since the epoch, when the job was completed.</p>
436 pub fn set_completed_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
437 self.completed_at = input;
438 self
439 }
440 /// <p>The time, in seconds since the epoch, when the job was completed.</p>
441 pub fn get_completed_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
442 &self.completed_at
443 }
444 /// <p>Details about the job process.</p>
445 pub fn job_process_details(mut self, input: crate::types::JobProcessDetails) -> Self {
446 self.job_process_details = ::std::option::Option::Some(input);
447 self
448 }
449 /// <p>Details about the job process.</p>
450 pub fn set_job_process_details(mut self, input: ::std::option::Option<crate::types::JobProcessDetails>) -> Self {
451 self.job_process_details = input;
452 self
453 }
454 /// <p>Details about the job process.</p>
455 pub fn get_job_process_details(&self) -> &::std::option::Option<crate::types::JobProcessDetails> {
456 &self.job_process_details
457 }
458 /// <p>Specifies the amount of time each device has to finish its execution of the job. A timer is started when the job execution status is set to <code>IN_PROGRESS</code>. If the job execution status is not set to another terminal state before the timer expires, it will be automatically set to <code>TIMED_OUT</code>.</p>
459 pub fn timeout_config(mut self, input: crate::types::TimeoutConfig) -> Self {
460 self.timeout_config = ::std::option::Option::Some(input);
461 self
462 }
463 /// <p>Specifies the amount of time each device has to finish its execution of the job. A timer is started when the job execution status is set to <code>IN_PROGRESS</code>. If the job execution status is not set to another terminal state before the timer expires, it will be automatically set to <code>TIMED_OUT</code>.</p>
464 pub fn set_timeout_config(mut self, input: ::std::option::Option<crate::types::TimeoutConfig>) -> Self {
465 self.timeout_config = input;
466 self
467 }
468 /// <p>Specifies the amount of time each device has to finish its execution of the job. A timer is started when the job execution status is set to <code>IN_PROGRESS</code>. If the job execution status is not set to another terminal state before the timer expires, it will be automatically set to <code>TIMED_OUT</code>.</p>
469 pub fn get_timeout_config(&self) -> &::std::option::Option<crate::types::TimeoutConfig> {
470 &self.timeout_config
471 }
472 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
473 /// <p>When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.</p>
474 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
475 /// <p>The <code>namespaceId</code> feature is only supported by IoT Greengrass at this time. For more information, see <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/setting-up.html">Setting up IoT Greengrass core devices.</a></p>
476 /// </note>
477 pub fn namespace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
478 self.namespace_id = ::std::option::Option::Some(input.into());
479 self
480 }
481 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
482 /// <p>When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.</p>
483 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
484 /// <p>The <code>namespaceId</code> feature is only supported by IoT Greengrass at this time. For more information, see <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/setting-up.html">Setting up IoT Greengrass core devices.</a></p>
485 /// </note>
486 pub fn set_namespace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
487 self.namespace_id = input;
488 self
489 }
490 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
491 /// <p>When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.</p>
492 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
493 /// <p>The <code>namespaceId</code> feature is only supported by IoT Greengrass at this time. For more information, see <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/setting-up.html">Setting up IoT Greengrass core devices.</a></p>
494 /// </note>
495 pub fn get_namespace_id(&self) -> &::std::option::Option<::std::string::String> {
496 &self.namespace_id
497 }
498 /// <p>The ARN of the job template used to create the job.</p>
499 pub fn job_template_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
500 self.job_template_arn = ::std::option::Option::Some(input.into());
501 self
502 }
503 /// <p>The ARN of the job template used to create the job.</p>
504 pub fn set_job_template_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
505 self.job_template_arn = input;
506 self
507 }
508 /// <p>The ARN of the job template used to create the job.</p>
509 pub fn get_job_template_arn(&self) -> &::std::option::Option<::std::string::String> {
510 &self.job_template_arn
511 }
512 /// <p>The configuration for the criteria to retry the job.</p>
513 pub fn job_executions_retry_config(mut self, input: crate::types::JobExecutionsRetryConfig) -> Self {
514 self.job_executions_retry_config = ::std::option::Option::Some(input);
515 self
516 }
517 /// <p>The configuration for the criteria to retry the job.</p>
518 pub fn set_job_executions_retry_config(mut self, input: ::std::option::Option<crate::types::JobExecutionsRetryConfig>) -> Self {
519 self.job_executions_retry_config = input;
520 self
521 }
522 /// <p>The configuration for the criteria to retry the job.</p>
523 pub fn get_job_executions_retry_config(&self) -> &::std::option::Option<crate::types::JobExecutionsRetryConfig> {
524 &self.job_executions_retry_config
525 }
526 /// Adds a key-value pair to `document_parameters`.
527 ///
528 /// To override the contents of this collection use [`set_document_parameters`](Self::set_document_parameters).
529 ///
530 /// <p>A key-value map that pairs the patterns that need to be replaced in a managed template job document schema. You can use the description of each key as a guidance to specify the inputs during runtime when creating a job.</p><note>
531 /// <p><code>documentParameters</code> can only be used when creating jobs from Amazon Web Services managed templates. This parameter can't be used with custom job templates or to create jobs from them.</p>
532 /// </note>
533 pub fn document_parameters(
534 mut self,
535 k: impl ::std::convert::Into<::std::string::String>,
536 v: impl ::std::convert::Into<::std::string::String>,
537 ) -> Self {
538 let mut hash_map = self.document_parameters.unwrap_or_default();
539 hash_map.insert(k.into(), v.into());
540 self.document_parameters = ::std::option::Option::Some(hash_map);
541 self
542 }
543 /// <p>A key-value map that pairs the patterns that need to be replaced in a managed template job document schema. You can use the description of each key as a guidance to specify the inputs during runtime when creating a job.</p><note>
544 /// <p><code>documentParameters</code> can only be used when creating jobs from Amazon Web Services managed templates. This parameter can't be used with custom job templates or to create jobs from them.</p>
545 /// </note>
546 pub fn set_document_parameters(
547 mut self,
548 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
549 ) -> Self {
550 self.document_parameters = input;
551 self
552 }
553 /// <p>A key-value map that pairs the patterns that need to be replaced in a managed template job document schema. You can use the description of each key as a guidance to specify the inputs during runtime when creating a job.</p><note>
554 /// <p><code>documentParameters</code> can only be used when creating jobs from Amazon Web Services managed templates. This parameter can't be used with custom job templates or to create jobs from them.</p>
555 /// </note>
556 pub fn get_document_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
557 &self.document_parameters
558 }
559 /// <p>Indicates whether a job is concurrent. Will be true when a job is rolling out new job executions or canceling previously created executions, otherwise false.</p>
560 pub fn is_concurrent(mut self, input: bool) -> Self {
561 self.is_concurrent = ::std::option::Option::Some(input);
562 self
563 }
564 /// <p>Indicates whether a job is concurrent. Will be true when a job is rolling out new job executions or canceling previously created executions, otherwise false.</p>
565 pub fn set_is_concurrent(mut self, input: ::std::option::Option<bool>) -> Self {
566 self.is_concurrent = input;
567 self
568 }
569 /// <p>Indicates whether a job is concurrent. Will be true when a job is rolling out new job executions or canceling previously created executions, otherwise false.</p>
570 pub fn get_is_concurrent(&self) -> &::std::option::Option<bool> {
571 &self.is_concurrent
572 }
573 /// <p>The configuration that allows you to schedule a job for a future date and time in addition to specifying the end behavior for each job execution.</p>
574 pub fn scheduling_config(mut self, input: crate::types::SchedulingConfig) -> Self {
575 self.scheduling_config = ::std::option::Option::Some(input);
576 self
577 }
578 /// <p>The configuration that allows you to schedule a job for a future date and time in addition to specifying the end behavior for each job execution.</p>
579 pub fn set_scheduling_config(mut self, input: ::std::option::Option<crate::types::SchedulingConfig>) -> Self {
580 self.scheduling_config = input;
581 self
582 }
583 /// <p>The configuration that allows you to schedule a job for a future date and time in addition to specifying the end behavior for each job execution.</p>
584 pub fn get_scheduling_config(&self) -> &::std::option::Option<crate::types::SchedulingConfig> {
585 &self.scheduling_config
586 }
587 /// Appends an item to `scheduled_job_rollouts`.
588 ///
589 /// To override the contents of this collection use [`set_scheduled_job_rollouts`](Self::set_scheduled_job_rollouts).
590 ///
591 /// <p>Displays the next seven maintenance window occurrences and their start times.</p>
592 pub fn scheduled_job_rollouts(mut self, input: crate::types::ScheduledJobRollout) -> Self {
593 let mut v = self.scheduled_job_rollouts.unwrap_or_default();
594 v.push(input);
595 self.scheduled_job_rollouts = ::std::option::Option::Some(v);
596 self
597 }
598 /// <p>Displays the next seven maintenance window occurrences and their start times.</p>
599 pub fn set_scheduled_job_rollouts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ScheduledJobRollout>>) -> Self {
600 self.scheduled_job_rollouts = input;
601 self
602 }
603 /// <p>Displays the next seven maintenance window occurrences and their start times.</p>
604 pub fn get_scheduled_job_rollouts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ScheduledJobRollout>> {
605 &self.scheduled_job_rollouts
606 }
607 /// Appends an item to `destination_package_versions`.
608 ///
609 /// To override the contents of this collection use [`set_destination_package_versions`](Self::set_destination_package_versions).
610 ///
611 /// <p>The package version Amazon Resource Names (ARNs) that are installed on the device when the job successfully completes. The package version must be in either the Published or Deprecated state when the job deploys. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.The package version must be in either the Published or Deprecated state when the job deploys. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.</p>
612 /// <p><b>Note:</b>The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed.</p>
613 pub fn destination_package_versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
614 let mut v = self.destination_package_versions.unwrap_or_default();
615 v.push(input.into());
616 self.destination_package_versions = ::std::option::Option::Some(v);
617 self
618 }
619 /// <p>The package version Amazon Resource Names (ARNs) that are installed on the device when the job successfully completes. The package version must be in either the Published or Deprecated state when the job deploys. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.The package version must be in either the Published or Deprecated state when the job deploys. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.</p>
620 /// <p><b>Note:</b>The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed.</p>
621 pub fn set_destination_package_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
622 self.destination_package_versions = input;
623 self
624 }
625 /// <p>The package version Amazon Resource Names (ARNs) that are installed on the device when the job successfully completes. The package version must be in either the Published or Deprecated state when the job deploys. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.The package version must be in either the Published or Deprecated state when the job deploys. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.</p>
626 /// <p><b>Note:</b>The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed.</p>
627 pub fn get_destination_package_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
628 &self.destination_package_versions
629 }
630 /// Consumes the builder and constructs a [`Job`](crate::types::Job).
631 pub fn build(self) -> crate::types::Job {
632 crate::types::Job {
633 job_arn: self.job_arn,
634 job_id: self.job_id,
635 target_selection: self.target_selection,
636 status: self.status,
637 force_canceled: self.force_canceled,
638 reason_code: self.reason_code,
639 comment: self.comment,
640 targets: self.targets,
641 description: self.description,
642 presigned_url_config: self.presigned_url_config,
643 job_executions_rollout_config: self.job_executions_rollout_config,
644 abort_config: self.abort_config,
645 created_at: self.created_at,
646 last_updated_at: self.last_updated_at,
647 completed_at: self.completed_at,
648 job_process_details: self.job_process_details,
649 timeout_config: self.timeout_config,
650 namespace_id: self.namespace_id,
651 job_template_arn: self.job_template_arn,
652 job_executions_retry_config: self.job_executions_retry_config,
653 document_parameters: self.document_parameters,
654 is_concurrent: self.is_concurrent,
655 scheduling_config: self.scheduling_config,
656 scheduled_job_rollouts: self.scheduled_job_rollouts,
657 destination_package_versions: self.destination_package_versions,
658 }
659 }
660}