aws_sdk_s3control/operation/create_job/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_job::_create_job_output::CreateJobOutputBuilder;
3
4pub use crate::operation::create_job::_create_job_input::CreateJobInputBuilder;
5
6impl crate::operation::create_job::builders::CreateJobInputBuilder {
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::create_job::CreateJobOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_job::CreateJobError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_job();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateJob`.
24///
25/// <p>This operation creates an S3 Batch Operations job.</p>
26/// <p>You can use S3 Batch Operations to perform large-scale batch actions on Amazon S3 objects. Batch Operations can run a single action on lists of Amazon S3 objects that you specify. 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>
27/// <dl>
28/// <dt>
29/// Permissions
30/// </dt>
31/// <dd>
32/// <p>For information about permissions required to use the Batch Operations, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/batch-ops-iam-role-policies.html">Granting permissions for S3 Batch Operations</a> in the <i>Amazon S3 User Guide</i>.</p>
33/// </dd>
34/// </dl>
35/// <p></p>
36/// <p>Related actions include:</p>
37/// <ul>
38/// <li>
39/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html">DescribeJob</a></p></li>
40/// <li>
41/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListJobs.html">ListJobs</a></p></li>
42/// <li>
43/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobPriority.html">UpdateJobPriority</a></p></li>
44/// <li>
45/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html">UpdateJobStatus</a></p></li>
46/// <li>
47/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_JobOperation.html">JobOperation</a></p></li>
48/// </ul>
49#[derive(::std::clone::Clone, ::std::fmt::Debug)]
50pub struct CreateJobFluentBuilder {
51    handle: ::std::sync::Arc<crate::client::Handle>,
52    inner: crate::operation::create_job::builders::CreateJobInputBuilder,
53    config_override: ::std::option::Option<crate::config::Builder>,
54}
55impl crate::client::customize::internal::CustomizableSend<crate::operation::create_job::CreateJobOutput, crate::operation::create_job::CreateJobError>
56    for CreateJobFluentBuilder
57{
58    fn send(
59        self,
60        config_override: crate::config::Builder,
61    ) -> crate::client::customize::internal::BoxFuture<
62        crate::client::customize::internal::SendResult<crate::operation::create_job::CreateJobOutput, crate::operation::create_job::CreateJobError>,
63    > {
64        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
65    }
66}
67impl CreateJobFluentBuilder {
68    /// Creates a new `CreateJobFluentBuilder`.
69    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
70        Self {
71            handle,
72            inner: ::std::default::Default::default(),
73            config_override: ::std::option::Option::None,
74        }
75    }
76    /// Access the CreateJob as a reference.
77    pub fn as_input(&self) -> &crate::operation::create_job::builders::CreateJobInputBuilder {
78        &self.inner
79    }
80    /// Sends the request and returns the response.
81    ///
82    /// If an error occurs, an `SdkError` will be returned with additional details that
83    /// can be matched against.
84    ///
85    /// By default, any retryable failures will be retried twice. Retry behavior
86    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
87    /// set when configuring the client.
88    pub async fn send(
89        self,
90    ) -> ::std::result::Result<
91        crate::operation::create_job::CreateJobOutput,
92        ::aws_smithy_runtime_api::client::result::SdkError<
93            crate::operation::create_job::CreateJobError,
94            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
95        >,
96    > {
97        let input = self
98            .inner
99            .build()
100            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
101        let runtime_plugins = crate::operation::create_job::CreateJob::operation_runtime_plugins(
102            self.handle.runtime_plugins.clone(),
103            &self.handle.conf,
104            self.config_override,
105        );
106        crate::operation::create_job::CreateJob::orchestrate(&runtime_plugins, input).await
107    }
108
109    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
110    pub fn customize(
111        self,
112    ) -> crate::client::customize::CustomizableOperation<
113        crate::operation::create_job::CreateJobOutput,
114        crate::operation::create_job::CreateJobError,
115        Self,
116    > {
117        crate::client::customize::CustomizableOperation::new(self)
118    }
119    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
120        self.set_config_override(::std::option::Option::Some(config_override.into()));
121        self
122    }
123
124    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
125        self.config_override = config_override;
126        self
127    }
128    /// <p>The Amazon Web Services account ID that creates the job.</p>
129    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.account_id(input.into());
131        self
132    }
133    /// <p>The Amazon Web Services account ID that creates the job.</p>
134    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_account_id(input);
136        self
137    }
138    /// <p>The Amazon Web Services account ID that creates the job.</p>
139    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_account_id()
141    }
142    /// <p>Indicates whether confirmation is required before Amazon S3 runs the job. Confirmation is only required for jobs created through the Amazon S3 console.</p>
143    pub fn confirmation_required(mut self, input: bool) -> Self {
144        self.inner = self.inner.confirmation_required(input);
145        self
146    }
147    /// <p>Indicates whether confirmation is required before Amazon S3 runs the job. Confirmation is only required for jobs created through the Amazon S3 console.</p>
148    pub fn set_confirmation_required(mut self, input: ::std::option::Option<bool>) -> Self {
149        self.inner = self.inner.set_confirmation_required(input);
150        self
151    }
152    /// <p>Indicates whether confirmation is required before Amazon S3 runs the job. Confirmation is only required for jobs created through the Amazon S3 console.</p>
153    pub fn get_confirmation_required(&self) -> &::std::option::Option<bool> {
154        self.inner.get_confirmation_required()
155    }
156    /// <p>The action that you want this job to perform on every object listed in the manifest. For more information about the available actions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-operations.html">Operations</a> in the <i>Amazon S3 User Guide</i>.</p>
157    pub fn operation(mut self, input: crate::types::JobOperation) -> Self {
158        self.inner = self.inner.operation(input);
159        self
160    }
161    /// <p>The action that you want this job to perform on every object listed in the manifest. For more information about the available actions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-operations.html">Operations</a> in the <i>Amazon S3 User Guide</i>.</p>
162    pub fn set_operation(mut self, input: ::std::option::Option<crate::types::JobOperation>) -> Self {
163        self.inner = self.inner.set_operation(input);
164        self
165    }
166    /// <p>The action that you want this job to perform on every object listed in the manifest. For more information about the available actions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-operations.html">Operations</a> in the <i>Amazon S3 User Guide</i>.</p>
167    pub fn get_operation(&self) -> &::std::option::Option<crate::types::JobOperation> {
168        self.inner.get_operation()
169    }
170    /// <p>Configuration parameters for the optional job-completion report.</p>
171    pub fn report(mut self, input: crate::types::JobReport) -> Self {
172        self.inner = self.inner.report(input);
173        self
174    }
175    /// <p>Configuration parameters for the optional job-completion report.</p>
176    pub fn set_report(mut self, input: ::std::option::Option<crate::types::JobReport>) -> Self {
177        self.inner = self.inner.set_report(input);
178        self
179    }
180    /// <p>Configuration parameters for the optional job-completion report.</p>
181    pub fn get_report(&self) -> &::std::option::Option<crate::types::JobReport> {
182        self.inner.get_report()
183    }
184    /// <p>An idempotency token to ensure that you don't accidentally submit the same request twice. You can use any string up to the maximum length.</p>
185    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186        self.inner = self.inner.client_request_token(input.into());
187        self
188    }
189    /// <p>An idempotency token to ensure that you don't accidentally submit the same request twice. You can use any string up to the maximum length.</p>
190    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191        self.inner = self.inner.set_client_request_token(input);
192        self
193    }
194    /// <p>An idempotency token to ensure that you don't accidentally submit the same request twice. You can use any string up to the maximum length.</p>
195    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
196        self.inner.get_client_request_token()
197    }
198    /// <p>Configuration parameters for the manifest.</p>
199    pub fn manifest(mut self, input: crate::types::JobManifest) -> Self {
200        self.inner = self.inner.manifest(input);
201        self
202    }
203    /// <p>Configuration parameters for the manifest.</p>
204    pub fn set_manifest(mut self, input: ::std::option::Option<crate::types::JobManifest>) -> Self {
205        self.inner = self.inner.set_manifest(input);
206        self
207    }
208    /// <p>Configuration parameters for the manifest.</p>
209    pub fn get_manifest(&self) -> &::std::option::Option<crate::types::JobManifest> {
210        self.inner.get_manifest()
211    }
212    /// <p>A description for this job. You can use any string within the permitted length. Descriptions don't need to be unique and can be used for multiple jobs.</p>
213    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214        self.inner = self.inner.description(input.into());
215        self
216    }
217    /// <p>A description for this job. You can use any string within the permitted length. Descriptions don't need to be unique and can be used for multiple jobs.</p>
218    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
219        self.inner = self.inner.set_description(input);
220        self
221    }
222    /// <p>A description for this job. You can use any string within the permitted length. Descriptions don't need to be unique and can be used for multiple jobs.</p>
223    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
224        self.inner.get_description()
225    }
226    /// <p>The numerical priority for this job. Higher numbers indicate higher priority.</p>
227    pub fn priority(mut self, input: i32) -> Self {
228        self.inner = self.inner.priority(input);
229        self
230    }
231    /// <p>The numerical priority for this job. Higher numbers indicate higher priority.</p>
232    pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
233        self.inner = self.inner.set_priority(input);
234        self
235    }
236    /// <p>The numerical priority for this job. Higher numbers indicate higher priority.</p>
237    pub fn get_priority(&self) -> &::std::option::Option<i32> {
238        self.inner.get_priority()
239    }
240    /// <p>The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) role that Batch Operations will use to run this job's action on every object in the manifest.</p>
241    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
242        self.inner = self.inner.role_arn(input.into());
243        self
244    }
245    /// <p>The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) role that Batch Operations will use to run this job's action on every object in the manifest.</p>
246    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
247        self.inner = self.inner.set_role_arn(input);
248        self
249    }
250    /// <p>The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) role that Batch Operations will use to run this job's action on every object in the manifest.</p>
251    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
252        self.inner.get_role_arn()
253    }
254    ///
255    /// Appends an item to `Tags`.
256    ///
257    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
258    ///
259    /// <p>A set of tags to associate with the S3 Batch Operations job. This is an optional parameter.</p>
260    pub fn tags(mut self, input: crate::types::S3Tag) -> Self {
261        self.inner = self.inner.tags(input);
262        self
263    }
264    /// <p>A set of tags to associate with the S3 Batch Operations job. This is an optional parameter.</p>
265    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::S3Tag>>) -> Self {
266        self.inner = self.inner.set_tags(input);
267        self
268    }
269    /// <p>A set of tags to associate with the S3 Batch Operations job. This is an optional parameter.</p>
270    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::S3Tag>> {
271        self.inner.get_tags()
272    }
273    /// <p>The attribute container for the ManifestGenerator details. Jobs must be created with either a manifest file or a ManifestGenerator, but not both.</p>
274    pub fn manifest_generator(mut self, input: crate::types::JobManifestGenerator) -> Self {
275        self.inner = self.inner.manifest_generator(input);
276        self
277    }
278    /// <p>The attribute container for the ManifestGenerator details. Jobs must be created with either a manifest file or a ManifestGenerator, but not both.</p>
279    pub fn set_manifest_generator(mut self, input: ::std::option::Option<crate::types::JobManifestGenerator>) -> Self {
280        self.inner = self.inner.set_manifest_generator(input);
281        self
282    }
283    /// <p>The attribute container for the ManifestGenerator details. Jobs must be created with either a manifest file or a ManifestGenerator, but not both.</p>
284    pub fn get_manifest_generator(&self) -> &::std::option::Option<crate::types::JobManifestGenerator> {
285        self.inner.get_manifest_generator()
286    }
287}