aws_sdk_s3control/operation/update_job_status/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_job_status::_update_job_status_output::UpdateJobStatusOutputBuilder;
3
4pub use crate::operation::update_job_status::_update_job_status_input::UpdateJobStatusInputBuilder;
5
6impl crate::operation::update_job_status::builders::UpdateJobStatusInputBuilder {
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_status::UpdateJobStatusOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_job_status::UpdateJobStatusError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_job_status();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateJobStatus`.
24///
25/// <p>Updates the status for the specified job. Use this operation to confirm that you want to run a job or to cancel an existing job. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/batch-ops.html">S3 Batch Operations</a> in the <i>Amazon S3 User Guide</i>.</p>
26/// <dl>
27/// <dt>
28/// Permissions
29/// </dt>
30/// <dd>
31/// <p>To use the <code>UpdateJobStatus</code> operation, you must have permission to perform the <code>s3:UpdateJobStatus</code> action.</p>
32/// </dd>
33/// </dl>
34/// <p>Related actions include:</p>
35/// <ul>
36/// <li>
37/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a></p></li>
38/// <li>
39/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListJobs.html">ListJobs</a></p></li>
40/// <li>
41/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html">DescribeJob</a></p></li>
42/// <li>
43/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html">UpdateJobStatus</a></p></li>
44/// </ul><important>
45/// <p>You must URL encode any signed header values that contain spaces. For example, if your header value is <code>my file.txt</code>, containing two spaces after <code>my</code>, you must URL encode this value to <code>my%20%20file.txt</code>.</p>
46/// </important>
47#[derive(::std::clone::Clone, ::std::fmt::Debug)]
48pub struct UpdateJobStatusFluentBuilder {
49    handle: ::std::sync::Arc<crate::client::Handle>,
50    inner: crate::operation::update_job_status::builders::UpdateJobStatusInputBuilder,
51    config_override: ::std::option::Option<crate::config::Builder>,
52}
53impl
54    crate::client::customize::internal::CustomizableSend<
55        crate::operation::update_job_status::UpdateJobStatusOutput,
56        crate::operation::update_job_status::UpdateJobStatusError,
57    > for UpdateJobStatusFluentBuilder
58{
59    fn send(
60        self,
61        config_override: crate::config::Builder,
62    ) -> crate::client::customize::internal::BoxFuture<
63        crate::client::customize::internal::SendResult<
64            crate::operation::update_job_status::UpdateJobStatusOutput,
65            crate::operation::update_job_status::UpdateJobStatusError,
66        >,
67    > {
68        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
69    }
70}
71impl UpdateJobStatusFluentBuilder {
72    /// Creates a new `UpdateJobStatusFluentBuilder`.
73    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
74        Self {
75            handle,
76            inner: ::std::default::Default::default(),
77            config_override: ::std::option::Option::None,
78        }
79    }
80    /// Access the UpdateJobStatus as a reference.
81    pub fn as_input(&self) -> &crate::operation::update_job_status::builders::UpdateJobStatusInputBuilder {
82        &self.inner
83    }
84    /// Sends the request and returns the response.
85    ///
86    /// If an error occurs, an `SdkError` will be returned with additional details that
87    /// can be matched against.
88    ///
89    /// By default, any retryable failures will be retried twice. Retry behavior
90    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
91    /// set when configuring the client.
92    pub async fn send(
93        self,
94    ) -> ::std::result::Result<
95        crate::operation::update_job_status::UpdateJobStatusOutput,
96        ::aws_smithy_runtime_api::client::result::SdkError<
97            crate::operation::update_job_status::UpdateJobStatusError,
98            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
99        >,
100    > {
101        let input = self
102            .inner
103            .build()
104            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
105        let runtime_plugins = crate::operation::update_job_status::UpdateJobStatus::operation_runtime_plugins(
106            self.handle.runtime_plugins.clone(),
107            &self.handle.conf,
108            self.config_override,
109        );
110        crate::operation::update_job_status::UpdateJobStatus::orchestrate(&runtime_plugins, input).await
111    }
112
113    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
114    pub fn customize(
115        self,
116    ) -> crate::client::customize::CustomizableOperation<
117        crate::operation::update_job_status::UpdateJobStatusOutput,
118        crate::operation::update_job_status::UpdateJobStatusError,
119        Self,
120    > {
121        crate::client::customize::CustomizableOperation::new(self)
122    }
123    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
124        self.set_config_override(::std::option::Option::Some(config_override.into()));
125        self
126    }
127
128    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
129        self.config_override = config_override;
130        self
131    }
132    /// <p>The Amazon Web Services account ID associated with the S3 Batch Operations job.</p>
133    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.account_id(input.into());
135        self
136    }
137    /// <p>The Amazon Web Services account ID associated with the S3 Batch Operations job.</p>
138    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_account_id(input);
140        self
141    }
142    /// <p>The Amazon Web Services account ID associated with the S3 Batch Operations job.</p>
143    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_account_id()
145    }
146    /// <p>The ID of the job whose status you want to update.</p>
147    pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.job_id(input.into());
149        self
150    }
151    /// <p>The ID of the job whose status you want to update.</p>
152    pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_job_id(input);
154        self
155    }
156    /// <p>The ID of the job whose status you want to update.</p>
157    pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_job_id()
159    }
160    /// <p>The status that you want to move the specified job to.</p>
161    pub fn requested_job_status(mut self, input: crate::types::RequestedJobStatus) -> Self {
162        self.inner = self.inner.requested_job_status(input);
163        self
164    }
165    /// <p>The status that you want to move the specified job to.</p>
166    pub fn set_requested_job_status(mut self, input: ::std::option::Option<crate::types::RequestedJobStatus>) -> Self {
167        self.inner = self.inner.set_requested_job_status(input);
168        self
169    }
170    /// <p>The status that you want to move the specified job to.</p>
171    pub fn get_requested_job_status(&self) -> &::std::option::Option<crate::types::RequestedJobStatus> {
172        self.inner.get_requested_job_status()
173    }
174    /// <p>A description of the reason why you want to change the specified job's status. This field can be any string up to the maximum length.</p>
175    pub fn status_update_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.inner = self.inner.status_update_reason(input.into());
177        self
178    }
179    /// <p>A description of the reason why you want to change the specified job's status. This field can be any string up to the maximum length.</p>
180    pub fn set_status_update_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.inner = self.inner.set_status_update_reason(input);
182        self
183    }
184    /// <p>A description of the reason why you want to change the specified job's status. This field can be any string up to the maximum length.</p>
185    pub fn get_status_update_reason(&self) -> &::std::option::Option<::std::string::String> {
186        self.inner.get_status_update_reason()
187    }
188}