aws_sdk_iot/operation/update_job/_update_job_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateJobInput {
6 /// <p>The ID of the job to be updated.</p>
7 pub job_id: ::std::option::Option<::std::string::String>,
8 /// <p>A short text description of the job.</p>
9 pub description: ::std::option::Option<::std::string::String>,
10 /// <p>Configuration information for pre-signed S3 URLs.</p>
11 pub presigned_url_config: ::std::option::Option<crate::types::PresignedUrlConfig>,
12 /// <p>Allows you to create a staged rollout of the job.</p>
13 pub job_executions_rollout_config: ::std::option::Option<crate::types::JobExecutionsRolloutConfig>,
14 /// <p>Allows you to create criteria to abort a job.</p>
15 pub abort_config: ::std::option::Option<crate::types::AbortConfig>,
16 /// <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>
17 pub timeout_config: ::std::option::Option<crate::types::TimeoutConfig>,
18 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
19 /// <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>
20 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
21 /// <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>
22 /// </note>
23 pub namespace_id: ::std::option::Option<::std::string::String>,
24 /// <p>Allows you to create the criteria to retry a job.</p>
25 pub job_executions_retry_config: ::std::option::Option<crate::types::JobExecutionsRetryConfig>,
26}
27impl UpdateJobInput {
28 /// <p>The ID of the job to be updated.</p>
29 pub fn job_id(&self) -> ::std::option::Option<&str> {
30 self.job_id.as_deref()
31 }
32 /// <p>A short text description of the job.</p>
33 pub fn description(&self) -> ::std::option::Option<&str> {
34 self.description.as_deref()
35 }
36 /// <p>Configuration information for pre-signed S3 URLs.</p>
37 pub fn presigned_url_config(&self) -> ::std::option::Option<&crate::types::PresignedUrlConfig> {
38 self.presigned_url_config.as_ref()
39 }
40 /// <p>Allows you to create a staged rollout of the job.</p>
41 pub fn job_executions_rollout_config(&self) -> ::std::option::Option<&crate::types::JobExecutionsRolloutConfig> {
42 self.job_executions_rollout_config.as_ref()
43 }
44 /// <p>Allows you to create criteria to abort a job.</p>
45 pub fn abort_config(&self) -> ::std::option::Option<&crate::types::AbortConfig> {
46 self.abort_config.as_ref()
47 }
48 /// <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>
49 pub fn timeout_config(&self) -> ::std::option::Option<&crate::types::TimeoutConfig> {
50 self.timeout_config.as_ref()
51 }
52 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
53 /// <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>
54 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
55 /// <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>
56 /// </note>
57 pub fn namespace_id(&self) -> ::std::option::Option<&str> {
58 self.namespace_id.as_deref()
59 }
60 /// <p>Allows you to create the criteria to retry a job.</p>
61 pub fn job_executions_retry_config(&self) -> ::std::option::Option<&crate::types::JobExecutionsRetryConfig> {
62 self.job_executions_retry_config.as_ref()
63 }
64}
65impl UpdateJobInput {
66 /// Creates a new builder-style object to manufacture [`UpdateJobInput`](crate::operation::update_job::UpdateJobInput).
67 pub fn builder() -> crate::operation::update_job::builders::UpdateJobInputBuilder {
68 crate::operation::update_job::builders::UpdateJobInputBuilder::default()
69 }
70}
71
72/// A builder for [`UpdateJobInput`](crate::operation::update_job::UpdateJobInput).
73#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
74#[non_exhaustive]
75pub struct UpdateJobInputBuilder {
76 pub(crate) job_id: ::std::option::Option<::std::string::String>,
77 pub(crate) description: ::std::option::Option<::std::string::String>,
78 pub(crate) presigned_url_config: ::std::option::Option<crate::types::PresignedUrlConfig>,
79 pub(crate) job_executions_rollout_config: ::std::option::Option<crate::types::JobExecutionsRolloutConfig>,
80 pub(crate) abort_config: ::std::option::Option<crate::types::AbortConfig>,
81 pub(crate) timeout_config: ::std::option::Option<crate::types::TimeoutConfig>,
82 pub(crate) namespace_id: ::std::option::Option<::std::string::String>,
83 pub(crate) job_executions_retry_config: ::std::option::Option<crate::types::JobExecutionsRetryConfig>,
84}
85impl UpdateJobInputBuilder {
86 /// <p>The ID of the job to be updated.</p>
87 /// This field is required.
88 pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 self.job_id = ::std::option::Option::Some(input.into());
90 self
91 }
92 /// <p>The ID of the job to be updated.</p>
93 pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94 self.job_id = input;
95 self
96 }
97 /// <p>The ID of the job to be updated.</p>
98 pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
99 &self.job_id
100 }
101 /// <p>A short text description of the job.</p>
102 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103 self.description = ::std::option::Option::Some(input.into());
104 self
105 }
106 /// <p>A short text description of the job.</p>
107 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108 self.description = input;
109 self
110 }
111 /// <p>A short text description of the job.</p>
112 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
113 &self.description
114 }
115 /// <p>Configuration information for pre-signed S3 URLs.</p>
116 pub fn presigned_url_config(mut self, input: crate::types::PresignedUrlConfig) -> Self {
117 self.presigned_url_config = ::std::option::Option::Some(input);
118 self
119 }
120 /// <p>Configuration information for pre-signed S3 URLs.</p>
121 pub fn set_presigned_url_config(mut self, input: ::std::option::Option<crate::types::PresignedUrlConfig>) -> Self {
122 self.presigned_url_config = input;
123 self
124 }
125 /// <p>Configuration information for pre-signed S3 URLs.</p>
126 pub fn get_presigned_url_config(&self) -> &::std::option::Option<crate::types::PresignedUrlConfig> {
127 &self.presigned_url_config
128 }
129 /// <p>Allows you to create a staged rollout of the job.</p>
130 pub fn job_executions_rollout_config(mut self, input: crate::types::JobExecutionsRolloutConfig) -> Self {
131 self.job_executions_rollout_config = ::std::option::Option::Some(input);
132 self
133 }
134 /// <p>Allows you to create a staged rollout of the job.</p>
135 pub fn set_job_executions_rollout_config(mut self, input: ::std::option::Option<crate::types::JobExecutionsRolloutConfig>) -> Self {
136 self.job_executions_rollout_config = input;
137 self
138 }
139 /// <p>Allows you to create a staged rollout of the job.</p>
140 pub fn get_job_executions_rollout_config(&self) -> &::std::option::Option<crate::types::JobExecutionsRolloutConfig> {
141 &self.job_executions_rollout_config
142 }
143 /// <p>Allows you to create criteria to abort a job.</p>
144 pub fn abort_config(mut self, input: crate::types::AbortConfig) -> Self {
145 self.abort_config = ::std::option::Option::Some(input);
146 self
147 }
148 /// <p>Allows you to create criteria to abort a job.</p>
149 pub fn set_abort_config(mut self, input: ::std::option::Option<crate::types::AbortConfig>) -> Self {
150 self.abort_config = input;
151 self
152 }
153 /// <p>Allows you to create criteria to abort a job.</p>
154 pub fn get_abort_config(&self) -> &::std::option::Option<crate::types::AbortConfig> {
155 &self.abort_config
156 }
157 /// <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>
158 pub fn timeout_config(mut self, input: crate::types::TimeoutConfig) -> Self {
159 self.timeout_config = ::std::option::Option::Some(input);
160 self
161 }
162 /// <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>
163 pub fn set_timeout_config(mut self, input: ::std::option::Option<crate::types::TimeoutConfig>) -> Self {
164 self.timeout_config = input;
165 self
166 }
167 /// <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>
168 pub fn get_timeout_config(&self) -> &::std::option::Option<crate::types::TimeoutConfig> {
169 &self.timeout_config
170 }
171 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
172 /// <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>
173 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
174 /// <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>
175 /// </note>
176 pub fn namespace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177 self.namespace_id = ::std::option::Option::Some(input.into());
178 self
179 }
180 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
181 /// <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>
182 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
183 /// <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>
184 /// </note>
185 pub fn set_namespace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186 self.namespace_id = input;
187 self
188 }
189 /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
190 /// <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>
191 /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
192 /// <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>
193 /// </note>
194 pub fn get_namespace_id(&self) -> &::std::option::Option<::std::string::String> {
195 &self.namespace_id
196 }
197 /// <p>Allows you to create the criteria to retry a job.</p>
198 pub fn job_executions_retry_config(mut self, input: crate::types::JobExecutionsRetryConfig) -> Self {
199 self.job_executions_retry_config = ::std::option::Option::Some(input);
200 self
201 }
202 /// <p>Allows you to create the criteria to retry a job.</p>
203 pub fn set_job_executions_retry_config(mut self, input: ::std::option::Option<crate::types::JobExecutionsRetryConfig>) -> Self {
204 self.job_executions_retry_config = input;
205 self
206 }
207 /// <p>Allows you to create the criteria to retry a job.</p>
208 pub fn get_job_executions_retry_config(&self) -> &::std::option::Option<crate::types::JobExecutionsRetryConfig> {
209 &self.job_executions_retry_config
210 }
211 /// Consumes the builder and constructs a [`UpdateJobInput`](crate::operation::update_job::UpdateJobInput).
212 pub fn build(self) -> ::std::result::Result<crate::operation::update_job::UpdateJobInput, ::aws_smithy_types::error::operation::BuildError> {
213 ::std::result::Result::Ok(crate::operation::update_job::UpdateJobInput {
214 job_id: self.job_id,
215 description: self.description,
216 presigned_url_config: self.presigned_url_config,
217 job_executions_rollout_config: self.job_executions_rollout_config,
218 abort_config: self.abort_config,
219 timeout_config: self.timeout_config,
220 namespace_id: self.namespace_id,
221 job_executions_retry_config: self.job_executions_retry_config,
222 })
223 }
224}