aws_sdk_iot/operation/create_job/_create_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 CreateJobInput {
6 /// <p>A job identifier which must be unique for your account. We recommend using a UUID. Alpha-numeric characters, "-" and "_" are valid for use here.</p>
7 pub job_id: ::std::option::Option<::std::string::String>,
8 /// <p>A list of things and thing groups to which the job should be sent.</p>
9 pub targets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10 /// <p>An S3 link, or S3 object URL, to the job document. The link is an Amazon S3 object URL and is required if you don't specify a value for <code>document</code>.</p>
11 /// <p>For example, <code>--document-source https://s3.<i>region-code</i>.amazonaws.com/example-firmware/device-firmware.1.0</code></p>
12 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html">Methods for accessing a bucket</a>.</p>
13 pub document_source: ::std::option::Option<::std::string::String>,
14 /// <p>The job document. Required if you don't specify a value for <code>documentSource</code>.</p>
15 pub document: ::std::option::Option<::std::string::String>,
16 /// <p>A short text description of the job.</p>
17 pub description: ::std::option::Option<::std::string::String>,
18 /// <p>Configuration information for pre-signed S3 URLs.</p>
19 pub presigned_url_config: ::std::option::Option<crate::types::PresignedUrlConfig>,
20 /// <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 thing when the thing is added to a target group, even after the job was completed by all things originally in the group.</p><note>
21 /// <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>
22 /// </note>
23 pub target_selection: ::std::option::Option<crate::types::TargetSelection>,
24 /// <p>Allows you to create a staged rollout of the job.</p>
25 pub job_executions_rollout_config: ::std::option::Option<crate::types::JobExecutionsRolloutConfig>,
26 /// <p>Allows you to create the criteria to abort a job.</p>
27 pub abort_config: ::std::option::Option<crate::types::AbortConfig>,
28 /// <p>Specifies the amount of time each device has to finish its execution of the job. The 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 time expires, it will be automatically set to <code>TIMED_OUT</code>.</p>
29 pub timeout_config: ::std::option::Option<crate::types::TimeoutConfig>,
30 /// <p>Metadata which can be used to manage the job.</p>
31 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
32 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
33 /// <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>
34 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
35 /// <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>
36 /// </note>
37 pub namespace_id: ::std::option::Option<::std::string::String>,
38 /// <p>The ARN of the job template used to create the job.</p>
39 pub job_template_arn: ::std::option::Option<::std::string::String>,
40 /// <p>Allows you to create the criteria to retry a job.</p>
41 pub job_executions_retry_config: ::std::option::Option<crate::types::JobExecutionsRetryConfig>,
42 /// <p>Parameters of an Amazon Web Services managed template that you can specify to create the job document.</p><note>
43 /// <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>
44 /// </note>
45 pub document_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
46 /// <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>
47 pub scheduling_config: ::std::option::Option<crate::types::SchedulingConfig>,
48 /// <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>.</p>
49 /// <p><b>Note:</b>The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed.</p>
50 pub destination_package_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
51}
52impl CreateJobInput {
53 /// <p>A job identifier which must be unique for your account. We recommend using a UUID. Alpha-numeric characters, "-" and "_" are valid for use here.</p>
54 pub fn job_id(&self) -> ::std::option::Option<&str> {
55 self.job_id.as_deref()
56 }
57 /// <p>A list of things and thing groups to which the job should be sent.</p>
58 ///
59 /// 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()`.
60 pub fn targets(&self) -> &[::std::string::String] {
61 self.targets.as_deref().unwrap_or_default()
62 }
63 /// <p>An S3 link, or S3 object URL, to the job document. The link is an Amazon S3 object URL and is required if you don't specify a value for <code>document</code>.</p>
64 /// <p>For example, <code>--document-source https://s3.<i>region-code</i>.amazonaws.com/example-firmware/device-firmware.1.0</code></p>
65 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html">Methods for accessing a bucket</a>.</p>
66 pub fn document_source(&self) -> ::std::option::Option<&str> {
67 self.document_source.as_deref()
68 }
69 /// <p>The job document. Required if you don't specify a value for <code>documentSource</code>.</p>
70 pub fn document(&self) -> ::std::option::Option<&str> {
71 self.document.as_deref()
72 }
73 /// <p>A short text description of the job.</p>
74 pub fn description(&self) -> ::std::option::Option<&str> {
75 self.description.as_deref()
76 }
77 /// <p>Configuration information for pre-signed S3 URLs.</p>
78 pub fn presigned_url_config(&self) -> ::std::option::Option<&crate::types::PresignedUrlConfig> {
79 self.presigned_url_config.as_ref()
80 }
81 /// <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 thing when the thing is added to a target group, even after the job was completed by all things originally in the group.</p><note>
82 /// <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>
83 /// </note>
84 pub fn target_selection(&self) -> ::std::option::Option<&crate::types::TargetSelection> {
85 self.target_selection.as_ref()
86 }
87 /// <p>Allows you to create a staged rollout of the job.</p>
88 pub fn job_executions_rollout_config(&self) -> ::std::option::Option<&crate::types::JobExecutionsRolloutConfig> {
89 self.job_executions_rollout_config.as_ref()
90 }
91 /// <p>Allows you to create the criteria to abort a job.</p>
92 pub fn abort_config(&self) -> ::std::option::Option<&crate::types::AbortConfig> {
93 self.abort_config.as_ref()
94 }
95 /// <p>Specifies the amount of time each device has to finish its execution of the job. The 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 time expires, it will be automatically set to <code>TIMED_OUT</code>.</p>
96 pub fn timeout_config(&self) -> ::std::option::Option<&crate::types::TimeoutConfig> {
97 self.timeout_config.as_ref()
98 }
99 /// <p>Metadata which can be used to manage the job.</p>
100 ///
101 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
102 pub fn tags(&self) -> &[crate::types::Tag] {
103 self.tags.as_deref().unwrap_or_default()
104 }
105 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
106 /// <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>
107 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
108 /// <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>
109 /// </note>
110 pub fn namespace_id(&self) -> ::std::option::Option<&str> {
111 self.namespace_id.as_deref()
112 }
113 /// <p>The ARN of the job template used to create the job.</p>
114 pub fn job_template_arn(&self) -> ::std::option::Option<&str> {
115 self.job_template_arn.as_deref()
116 }
117 /// <p>Allows you to create the criteria to retry a job.</p>
118 pub fn job_executions_retry_config(&self) -> ::std::option::Option<&crate::types::JobExecutionsRetryConfig> {
119 self.job_executions_retry_config.as_ref()
120 }
121 /// <p>Parameters of an Amazon Web Services managed template that you can specify to create the job document.</p><note>
122 /// <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>
123 /// </note>
124 pub fn document_parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
125 self.document_parameters.as_ref()
126 }
127 /// <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>
128 pub fn scheduling_config(&self) -> ::std::option::Option<&crate::types::SchedulingConfig> {
129 self.scheduling_config.as_ref()
130 }
131 /// <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>.</p>
132 /// <p><b>Note:</b>The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed.</p>
133 ///
134 /// 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()`.
135 pub fn destination_package_versions(&self) -> &[::std::string::String] {
136 self.destination_package_versions.as_deref().unwrap_or_default()
137 }
138}
139impl CreateJobInput {
140 /// Creates a new builder-style object to manufacture [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
141 pub fn builder() -> crate::operation::create_job::builders::CreateJobInputBuilder {
142 crate::operation::create_job::builders::CreateJobInputBuilder::default()
143 }
144}
145
146/// A builder for [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
147#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
148#[non_exhaustive]
149pub struct CreateJobInputBuilder {
150 pub(crate) job_id: ::std::option::Option<::std::string::String>,
151 pub(crate) targets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
152 pub(crate) document_source: ::std::option::Option<::std::string::String>,
153 pub(crate) document: ::std::option::Option<::std::string::String>,
154 pub(crate) description: ::std::option::Option<::std::string::String>,
155 pub(crate) presigned_url_config: ::std::option::Option<crate::types::PresignedUrlConfig>,
156 pub(crate) target_selection: ::std::option::Option<crate::types::TargetSelection>,
157 pub(crate) job_executions_rollout_config: ::std::option::Option<crate::types::JobExecutionsRolloutConfig>,
158 pub(crate) abort_config: ::std::option::Option<crate::types::AbortConfig>,
159 pub(crate) timeout_config: ::std::option::Option<crate::types::TimeoutConfig>,
160 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
161 pub(crate) namespace_id: ::std::option::Option<::std::string::String>,
162 pub(crate) job_template_arn: ::std::option::Option<::std::string::String>,
163 pub(crate) job_executions_retry_config: ::std::option::Option<crate::types::JobExecutionsRetryConfig>,
164 pub(crate) document_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
165 pub(crate) scheduling_config: ::std::option::Option<crate::types::SchedulingConfig>,
166 pub(crate) destination_package_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
167}
168impl CreateJobInputBuilder {
169 /// <p>A job identifier which must be unique for your account. We recommend using a UUID. Alpha-numeric characters, "-" and "_" are valid for use here.</p>
170 /// This field is required.
171 pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172 self.job_id = ::std::option::Option::Some(input.into());
173 self
174 }
175 /// <p>A job identifier which must be unique for your account. We recommend using a UUID. Alpha-numeric characters, "-" and "_" are valid for use here.</p>
176 pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177 self.job_id = input;
178 self
179 }
180 /// <p>A job identifier which must be unique for your account. We recommend using a UUID. Alpha-numeric characters, "-" and "_" are valid for use here.</p>
181 pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
182 &self.job_id
183 }
184 /// Appends an item to `targets`.
185 ///
186 /// To override the contents of this collection use [`set_targets`](Self::set_targets).
187 ///
188 /// <p>A list of things and thing groups to which the job should be sent.</p>
189 pub fn targets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190 let mut v = self.targets.unwrap_or_default();
191 v.push(input.into());
192 self.targets = ::std::option::Option::Some(v);
193 self
194 }
195 /// <p>A list of things and thing groups to which the job should be sent.</p>
196 pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
197 self.targets = input;
198 self
199 }
200 /// <p>A list of things and thing groups to which the job should be sent.</p>
201 pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
202 &self.targets
203 }
204 /// <p>An S3 link, or S3 object URL, to the job document. The link is an Amazon S3 object URL and is required if you don't specify a value for <code>document</code>.</p>
205 /// <p>For example, <code>--document-source https://s3.<i>region-code</i>.amazonaws.com/example-firmware/device-firmware.1.0</code></p>
206 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html">Methods for accessing a bucket</a>.</p>
207 pub fn document_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208 self.document_source = ::std::option::Option::Some(input.into());
209 self
210 }
211 /// <p>An S3 link, or S3 object URL, to the job document. The link is an Amazon S3 object URL and is required if you don't specify a value for <code>document</code>.</p>
212 /// <p>For example, <code>--document-source https://s3.<i>region-code</i>.amazonaws.com/example-firmware/device-firmware.1.0</code></p>
213 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html">Methods for accessing a bucket</a>.</p>
214 pub fn set_document_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
215 self.document_source = input;
216 self
217 }
218 /// <p>An S3 link, or S3 object URL, to the job document. The link is an Amazon S3 object URL and is required if you don't specify a value for <code>document</code>.</p>
219 /// <p>For example, <code>--document-source https://s3.<i>region-code</i>.amazonaws.com/example-firmware/device-firmware.1.0</code></p>
220 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html">Methods for accessing a bucket</a>.</p>
221 pub fn get_document_source(&self) -> &::std::option::Option<::std::string::String> {
222 &self.document_source
223 }
224 /// <p>The job document. Required if you don't specify a value for <code>documentSource</code>.</p>
225 pub fn document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
226 self.document = ::std::option::Option::Some(input.into());
227 self
228 }
229 /// <p>The job document. Required if you don't specify a value for <code>documentSource</code>.</p>
230 pub fn set_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
231 self.document = input;
232 self
233 }
234 /// <p>The job document. Required if you don't specify a value for <code>documentSource</code>.</p>
235 pub fn get_document(&self) -> &::std::option::Option<::std::string::String> {
236 &self.document
237 }
238 /// <p>A short text description of the job.</p>
239 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
240 self.description = ::std::option::Option::Some(input.into());
241 self
242 }
243 /// <p>A short text description of the job.</p>
244 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
245 self.description = input;
246 self
247 }
248 /// <p>A short text description of the job.</p>
249 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
250 &self.description
251 }
252 /// <p>Configuration information for pre-signed S3 URLs.</p>
253 pub fn presigned_url_config(mut self, input: crate::types::PresignedUrlConfig) -> Self {
254 self.presigned_url_config = ::std::option::Option::Some(input);
255 self
256 }
257 /// <p>Configuration information for pre-signed S3 URLs.</p>
258 pub fn set_presigned_url_config(mut self, input: ::std::option::Option<crate::types::PresignedUrlConfig>) -> Self {
259 self.presigned_url_config = input;
260 self
261 }
262 /// <p>Configuration information for pre-signed S3 URLs.</p>
263 pub fn get_presigned_url_config(&self) -> &::std::option::Option<crate::types::PresignedUrlConfig> {
264 &self.presigned_url_config
265 }
266 /// <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 thing when the thing is added to a target group, even after the job was completed by all things originally in the group.</p><note>
267 /// <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>
268 /// </note>
269 pub fn target_selection(mut self, input: crate::types::TargetSelection) -> Self {
270 self.target_selection = ::std::option::Option::Some(input);
271 self
272 }
273 /// <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 thing when the thing is added to a target group, even after the job was completed by all things originally in the group.</p><note>
274 /// <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>
275 /// </note>
276 pub fn set_target_selection(mut self, input: ::std::option::Option<crate::types::TargetSelection>) -> Self {
277 self.target_selection = input;
278 self
279 }
280 /// <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 thing when the thing is added to a target group, even after the job was completed by all things originally in the group.</p><note>
281 /// <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>
282 /// </note>
283 pub fn get_target_selection(&self) -> &::std::option::Option<crate::types::TargetSelection> {
284 &self.target_selection
285 }
286 /// <p>Allows you to create a staged rollout of the job.</p>
287 pub fn job_executions_rollout_config(mut self, input: crate::types::JobExecutionsRolloutConfig) -> Self {
288 self.job_executions_rollout_config = ::std::option::Option::Some(input);
289 self
290 }
291 /// <p>Allows you to create a staged rollout of the job.</p>
292 pub fn set_job_executions_rollout_config(mut self, input: ::std::option::Option<crate::types::JobExecutionsRolloutConfig>) -> Self {
293 self.job_executions_rollout_config = input;
294 self
295 }
296 /// <p>Allows you to create a staged rollout of the job.</p>
297 pub fn get_job_executions_rollout_config(&self) -> &::std::option::Option<crate::types::JobExecutionsRolloutConfig> {
298 &self.job_executions_rollout_config
299 }
300 /// <p>Allows you to create the criteria to abort a job.</p>
301 pub fn abort_config(mut self, input: crate::types::AbortConfig) -> Self {
302 self.abort_config = ::std::option::Option::Some(input);
303 self
304 }
305 /// <p>Allows you to create the criteria to abort a job.</p>
306 pub fn set_abort_config(mut self, input: ::std::option::Option<crate::types::AbortConfig>) -> Self {
307 self.abort_config = input;
308 self
309 }
310 /// <p>Allows you to create the criteria to abort a job.</p>
311 pub fn get_abort_config(&self) -> &::std::option::Option<crate::types::AbortConfig> {
312 &self.abort_config
313 }
314 /// <p>Specifies the amount of time each device has to finish its execution of the job. The 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 time expires, it will be automatically set to <code>TIMED_OUT</code>.</p>
315 pub fn timeout_config(mut self, input: crate::types::TimeoutConfig) -> Self {
316 self.timeout_config = ::std::option::Option::Some(input);
317 self
318 }
319 /// <p>Specifies the amount of time each device has to finish its execution of the job. The 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 time expires, it will be automatically set to <code>TIMED_OUT</code>.</p>
320 pub fn set_timeout_config(mut self, input: ::std::option::Option<crate::types::TimeoutConfig>) -> Self {
321 self.timeout_config = input;
322 self
323 }
324 /// <p>Specifies the amount of time each device has to finish its execution of the job. The 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 time expires, it will be automatically set to <code>TIMED_OUT</code>.</p>
325 pub fn get_timeout_config(&self) -> &::std::option::Option<crate::types::TimeoutConfig> {
326 &self.timeout_config
327 }
328 /// Appends an item to `tags`.
329 ///
330 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
331 ///
332 /// <p>Metadata which can be used to manage the job.</p>
333 pub fn tags(mut self, input: crate::types::Tag) -> Self {
334 let mut v = self.tags.unwrap_or_default();
335 v.push(input);
336 self.tags = ::std::option::Option::Some(v);
337 self
338 }
339 /// <p>Metadata which can be used to manage the job.</p>
340 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
341 self.tags = input;
342 self
343 }
344 /// <p>Metadata which can be used to manage the job.</p>
345 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
346 &self.tags
347 }
348 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
349 /// <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>
350 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
351 /// <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>
352 /// </note>
353 pub fn namespace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
354 self.namespace_id = ::std::option::Option::Some(input.into());
355 self
356 }
357 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
358 /// <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>
359 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
360 /// <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>
361 /// </note>
362 pub fn set_namespace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
363 self.namespace_id = input;
364 self
365 }
366 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
367 /// <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>
368 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
369 /// <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>
370 /// </note>
371 pub fn get_namespace_id(&self) -> &::std::option::Option<::std::string::String> {
372 &self.namespace_id
373 }
374 /// <p>The ARN of the job template used to create the job.</p>
375 pub fn job_template_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
376 self.job_template_arn = ::std::option::Option::Some(input.into());
377 self
378 }
379 /// <p>The ARN of the job template used to create the job.</p>
380 pub fn set_job_template_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
381 self.job_template_arn = input;
382 self
383 }
384 /// <p>The ARN of the job template used to create the job.</p>
385 pub fn get_job_template_arn(&self) -> &::std::option::Option<::std::string::String> {
386 &self.job_template_arn
387 }
388 /// <p>Allows you to create the criteria to retry a job.</p>
389 pub fn job_executions_retry_config(mut self, input: crate::types::JobExecutionsRetryConfig) -> Self {
390 self.job_executions_retry_config = ::std::option::Option::Some(input);
391 self
392 }
393 /// <p>Allows you to create the criteria to retry a job.</p>
394 pub fn set_job_executions_retry_config(mut self, input: ::std::option::Option<crate::types::JobExecutionsRetryConfig>) -> Self {
395 self.job_executions_retry_config = input;
396 self
397 }
398 /// <p>Allows you to create the criteria to retry a job.</p>
399 pub fn get_job_executions_retry_config(&self) -> &::std::option::Option<crate::types::JobExecutionsRetryConfig> {
400 &self.job_executions_retry_config
401 }
402 /// Adds a key-value pair to `document_parameters`.
403 ///
404 /// To override the contents of this collection use [`set_document_parameters`](Self::set_document_parameters).
405 ///
406 /// <p>Parameters of an Amazon Web Services managed template that you can specify to create the job document.</p><note>
407 /// <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>
408 /// </note>
409 pub fn document_parameters(
410 mut self,
411 k: impl ::std::convert::Into<::std::string::String>,
412 v: impl ::std::convert::Into<::std::string::String>,
413 ) -> Self {
414 let mut hash_map = self.document_parameters.unwrap_or_default();
415 hash_map.insert(k.into(), v.into());
416 self.document_parameters = ::std::option::Option::Some(hash_map);
417 self
418 }
419 /// <p>Parameters of an Amazon Web Services managed template that you can specify to create the job document.</p><note>
420 /// <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>
421 /// </note>
422 pub fn set_document_parameters(
423 mut self,
424 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
425 ) -> Self {
426 self.document_parameters = input;
427 self
428 }
429 /// <p>Parameters of an Amazon Web Services managed template that you can specify to create the job document.</p><note>
430 /// <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>
431 /// </note>
432 pub fn get_document_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
433 &self.document_parameters
434 }
435 /// <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>
436 pub fn scheduling_config(mut self, input: crate::types::SchedulingConfig) -> Self {
437 self.scheduling_config = ::std::option::Option::Some(input);
438 self
439 }
440 /// <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>
441 pub fn set_scheduling_config(mut self, input: ::std::option::Option<crate::types::SchedulingConfig>) -> Self {
442 self.scheduling_config = input;
443 self
444 }
445 /// <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>
446 pub fn get_scheduling_config(&self) -> &::std::option::Option<crate::types::SchedulingConfig> {
447 &self.scheduling_config
448 }
449 /// Appends an item to `destination_package_versions`.
450 ///
451 /// To override the contents of this collection use [`set_destination_package_versions`](Self::set_destination_package_versions).
452 ///
453 /// <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>.</p>
454 /// <p><b>Note:</b>The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed.</p>
455 pub fn destination_package_versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
456 let mut v = self.destination_package_versions.unwrap_or_default();
457 v.push(input.into());
458 self.destination_package_versions = ::std::option::Option::Some(v);
459 self
460 }
461 /// <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>.</p>
462 /// <p><b>Note:</b>The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed.</p>
463 pub fn set_destination_package_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
464 self.destination_package_versions = input;
465 self
466 }
467 /// <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>.</p>
468 /// <p><b>Note:</b>The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed.</p>
469 pub fn get_destination_package_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
470 &self.destination_package_versions
471 }
472 /// Consumes the builder and constructs a [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
473 pub fn build(self) -> ::std::result::Result<crate::operation::create_job::CreateJobInput, ::aws_smithy_types::error::operation::BuildError> {
474 ::std::result::Result::Ok(crate::operation::create_job::CreateJobInput {
475 job_id: self.job_id,
476 targets: self.targets,
477 document_source: self.document_source,
478 document: self.document,
479 description: self.description,
480 presigned_url_config: self.presigned_url_config,
481 target_selection: self.target_selection,
482 job_executions_rollout_config: self.job_executions_rollout_config,
483 abort_config: self.abort_config,
484 timeout_config: self.timeout_config,
485 tags: self.tags,
486 namespace_id: self.namespace_id,
487 job_template_arn: self.job_template_arn,
488 job_executions_retry_config: self.job_executions_retry_config,
489 document_parameters: self.document_parameters,
490 scheduling_config: self.scheduling_config,
491 destination_package_versions: self.destination_package_versions,
492 })
493 }
494}