aws_sdk_iot/operation/update_job/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_job::_update_job_output::UpdateJobOutputBuilder;
3
4pub use crate::operation::update_job::_update_job_input::UpdateJobInputBuilder;
5
6impl crate::operation::update_job::builders::UpdateJobInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::update_job::UpdateJobOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_job::UpdateJobError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_job();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateJob`.
24///
25/// <p>Updates supported fields of the specified job.</p>
26/// <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">UpdateJob</a> action.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct UpdateJobFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::update_job::builders::UpdateJobInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl crate::client::customize::internal::CustomizableSend<crate::operation::update_job::UpdateJobOutput, crate::operation::update_job::UpdateJobError>
34    for UpdateJobFluentBuilder
35{
36    fn send(
37        self,
38        config_override: crate::config::Builder,
39    ) -> crate::client::customize::internal::BoxFuture<
40        crate::client::customize::internal::SendResult<crate::operation::update_job::UpdateJobOutput, crate::operation::update_job::UpdateJobError>,
41    > {
42        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
43    }
44}
45impl UpdateJobFluentBuilder {
46    /// Creates a new `UpdateJobFluentBuilder`.
47    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
48        Self {
49            handle,
50            inner: ::std::default::Default::default(),
51            config_override: ::std::option::Option::None,
52        }
53    }
54    /// Access the UpdateJob as a reference.
55    pub fn as_input(&self) -> &crate::operation::update_job::builders::UpdateJobInputBuilder {
56        &self.inner
57    }
58    /// Sends the request and returns the response.
59    ///
60    /// If an error occurs, an `SdkError` will be returned with additional details that
61    /// can be matched against.
62    ///
63    /// By default, any retryable failures will be retried twice. Retry behavior
64    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
65    /// set when configuring the client.
66    pub async fn send(
67        self,
68    ) -> ::std::result::Result<
69        crate::operation::update_job::UpdateJobOutput,
70        ::aws_smithy_runtime_api::client::result::SdkError<
71            crate::operation::update_job::UpdateJobError,
72            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
73        >,
74    > {
75        let input = self
76            .inner
77            .build()
78            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
79        let runtime_plugins = crate::operation::update_job::UpdateJob::operation_runtime_plugins(
80            self.handle.runtime_plugins.clone(),
81            &self.handle.conf,
82            self.config_override,
83        );
84        crate::operation::update_job::UpdateJob::orchestrate(&runtime_plugins, input).await
85    }
86
87    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
88    pub fn customize(
89        self,
90    ) -> crate::client::customize::CustomizableOperation<
91        crate::operation::update_job::UpdateJobOutput,
92        crate::operation::update_job::UpdateJobError,
93        Self,
94    > {
95        crate::client::customize::CustomizableOperation::new(self)
96    }
97    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
98        self.set_config_override(::std::option::Option::Some(config_override.into()));
99        self
100    }
101
102    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
103        self.config_override = config_override;
104        self
105    }
106    /// <p>The ID of the job to be updated.</p>
107    pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.inner = self.inner.job_id(input.into());
109        self
110    }
111    /// <p>The ID of the job to be updated.</p>
112    pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.inner = self.inner.set_job_id(input);
114        self
115    }
116    /// <p>The ID of the job to be updated.</p>
117    pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
118        self.inner.get_job_id()
119    }
120    /// <p>A short text description of the job.</p>
121    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.description(input.into());
123        self
124    }
125    /// <p>A short text description of the job.</p>
126    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_description(input);
128        self
129    }
130    /// <p>A short text description of the job.</p>
131    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_description()
133    }
134    /// <p>Configuration information for pre-signed S3 URLs.</p>
135    pub fn presigned_url_config(mut self, input: crate::types::PresignedUrlConfig) -> Self {
136        self.inner = self.inner.presigned_url_config(input);
137        self
138    }
139    /// <p>Configuration information for pre-signed S3 URLs.</p>
140    pub fn set_presigned_url_config(mut self, input: ::std::option::Option<crate::types::PresignedUrlConfig>) -> Self {
141        self.inner = self.inner.set_presigned_url_config(input);
142        self
143    }
144    /// <p>Configuration information for pre-signed S3 URLs.</p>
145    pub fn get_presigned_url_config(&self) -> &::std::option::Option<crate::types::PresignedUrlConfig> {
146        self.inner.get_presigned_url_config()
147    }
148    /// <p>Allows you to create a staged rollout of the job.</p>
149    pub fn job_executions_rollout_config(mut self, input: crate::types::JobExecutionsRolloutConfig) -> Self {
150        self.inner = self.inner.job_executions_rollout_config(input);
151        self
152    }
153    /// <p>Allows you to create a staged rollout of the job.</p>
154    pub fn set_job_executions_rollout_config(mut self, input: ::std::option::Option<crate::types::JobExecutionsRolloutConfig>) -> Self {
155        self.inner = self.inner.set_job_executions_rollout_config(input);
156        self
157    }
158    /// <p>Allows you to create a staged rollout of the job.</p>
159    pub fn get_job_executions_rollout_config(&self) -> &::std::option::Option<crate::types::JobExecutionsRolloutConfig> {
160        self.inner.get_job_executions_rollout_config()
161    }
162    /// <p>Allows you to create criteria to abort a job.</p>
163    pub fn abort_config(mut self, input: crate::types::AbortConfig) -> Self {
164        self.inner = self.inner.abort_config(input);
165        self
166    }
167    /// <p>Allows you to create criteria to abort a job.</p>
168    pub fn set_abort_config(mut self, input: ::std::option::Option<crate::types::AbortConfig>) -> Self {
169        self.inner = self.inner.set_abort_config(input);
170        self
171    }
172    /// <p>Allows you to create criteria to abort a job.</p>
173    pub fn get_abort_config(&self) -> &::std::option::Option<crate::types::AbortConfig> {
174        self.inner.get_abort_config()
175    }
176    /// <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>
177    pub fn timeout_config(mut self, input: crate::types::TimeoutConfig) -> Self {
178        self.inner = self.inner.timeout_config(input);
179        self
180    }
181    /// <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>
182    pub fn set_timeout_config(mut self, input: ::std::option::Option<crate::types::TimeoutConfig>) -> Self {
183        self.inner = self.inner.set_timeout_config(input);
184        self
185    }
186    /// <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>
187    pub fn get_timeout_config(&self) -> &::std::option::Option<crate::types::TimeoutConfig> {
188        self.inner.get_timeout_config()
189    }
190    /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
191    /// <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>
192    /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
193    /// <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>
194    /// </note>
195    pub fn namespace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196        self.inner = self.inner.namespace_id(input.into());
197        self
198    }
199    /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
200    /// <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>
201    /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
202    /// <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>
203    /// </note>
204    pub fn set_namespace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205        self.inner = self.inner.set_namespace_id(input);
206        self
207    }
208    /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
209    /// <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>
210    /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
211    /// <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>
212    /// </note>
213    pub fn get_namespace_id(&self) -> &::std::option::Option<::std::string::String> {
214        self.inner.get_namespace_id()
215    }
216    /// <p>Allows you to create the criteria to retry a job.</p>
217    pub fn job_executions_retry_config(mut self, input: crate::types::JobExecutionsRetryConfig) -> Self {
218        self.inner = self.inner.job_executions_retry_config(input);
219        self
220    }
221    /// <p>Allows you to create the criteria to retry a job.</p>
222    pub fn set_job_executions_retry_config(mut self, input: ::std::option::Option<crate::types::JobExecutionsRetryConfig>) -> Self {
223        self.inner = self.inner.set_job_executions_retry_config(input);
224        self
225    }
226    /// <p>Allows you to create the criteria to retry a job.</p>
227    pub fn get_job_executions_retry_config(&self) -> &::std::option::Option<crate::types::JobExecutionsRetryConfig> {
228        self.inner.get_job_executions_retry_config()
229    }
230}