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><important>
49/// <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>
50/// </important>
51#[derive(::std::clone::Clone, ::std::fmt::Debug)]
52pub struct CreateJobFluentBuilder {
53 handle: ::std::sync::Arc<crate::client::Handle>,
54 inner: crate::operation::create_job::builders::CreateJobInputBuilder,
55 config_override: ::std::option::Option<crate::config::Builder>,
56}
57impl crate::client::customize::internal::CustomizableSend<crate::operation::create_job::CreateJobOutput, crate::operation::create_job::CreateJobError>
58 for CreateJobFluentBuilder
59{
60 fn send(
61 self,
62 config_override: crate::config::Builder,
63 ) -> crate::client::customize::internal::BoxFuture<
64 crate::client::customize::internal::SendResult<crate::operation::create_job::CreateJobOutput, crate::operation::create_job::CreateJobError>,
65 > {
66 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
67 }
68}
69impl CreateJobFluentBuilder {
70 /// Creates a new `CreateJobFluentBuilder`.
71 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
72 Self {
73 handle,
74 inner: ::std::default::Default::default(),
75 config_override: ::std::option::Option::None,
76 }
77 }
78 /// Access the CreateJob as a reference.
79 pub fn as_input(&self) -> &crate::operation::create_job::builders::CreateJobInputBuilder {
80 &self.inner
81 }
82 /// Sends the request and returns the response.
83 ///
84 /// If an error occurs, an `SdkError` will be returned with additional details that
85 /// can be matched against.
86 ///
87 /// By default, any retryable failures will be retried twice. Retry behavior
88 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
89 /// set when configuring the client.
90 pub async fn send(
91 self,
92 ) -> ::std::result::Result<
93 crate::operation::create_job::CreateJobOutput,
94 ::aws_smithy_runtime_api::client::result::SdkError<
95 crate::operation::create_job::CreateJobError,
96 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
97 >,
98 > {
99 let input = self
100 .inner
101 .build()
102 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
103 let runtime_plugins = crate::operation::create_job::CreateJob::operation_runtime_plugins(
104 self.handle.runtime_plugins.clone(),
105 &self.handle.conf,
106 self.config_override,
107 );
108 crate::operation::create_job::CreateJob::orchestrate(&runtime_plugins, input).await
109 }
110
111 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
112 pub fn customize(
113 self,
114 ) -> crate::client::customize::CustomizableOperation<
115 crate::operation::create_job::CreateJobOutput,
116 crate::operation::create_job::CreateJobError,
117 Self,
118 > {
119 crate::client::customize::CustomizableOperation::new(self)
120 }
121 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
122 self.set_config_override(::std::option::Option::Some(config_override.into()));
123 self
124 }
125
126 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
127 self.config_override = config_override;
128 self
129 }
130 /// <p>The Amazon Web Services account ID that creates the job.</p>
131 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132 self.inner = self.inner.account_id(input.into());
133 self
134 }
135 /// <p>The Amazon Web Services account ID that creates the job.</p>
136 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137 self.inner = self.inner.set_account_id(input);
138 self
139 }
140 /// <p>The Amazon Web Services account ID that creates the job.</p>
141 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
142 self.inner.get_account_id()
143 }
144 /// <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>
145 pub fn confirmation_required(mut self, input: bool) -> Self {
146 self.inner = self.inner.confirmation_required(input);
147 self
148 }
149 /// <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>
150 pub fn set_confirmation_required(mut self, input: ::std::option::Option<bool>) -> Self {
151 self.inner = self.inner.set_confirmation_required(input);
152 self
153 }
154 /// <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>
155 pub fn get_confirmation_required(&self) -> &::std::option::Option<bool> {
156 self.inner.get_confirmation_required()
157 }
158 /// <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>
159 pub fn operation(mut self, input: crate::types::JobOperation) -> Self {
160 self.inner = self.inner.operation(input);
161 self
162 }
163 /// <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>
164 pub fn set_operation(mut self, input: ::std::option::Option<crate::types::JobOperation>) -> Self {
165 self.inner = self.inner.set_operation(input);
166 self
167 }
168 /// <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>
169 pub fn get_operation(&self) -> &::std::option::Option<crate::types::JobOperation> {
170 self.inner.get_operation()
171 }
172 /// <p>Configuration parameters for the optional job-completion report.</p>
173 pub fn report(mut self, input: crate::types::JobReport) -> Self {
174 self.inner = self.inner.report(input);
175 self
176 }
177 /// <p>Configuration parameters for the optional job-completion report.</p>
178 pub fn set_report(mut self, input: ::std::option::Option<crate::types::JobReport>) -> Self {
179 self.inner = self.inner.set_report(input);
180 self
181 }
182 /// <p>Configuration parameters for the optional job-completion report.</p>
183 pub fn get_report(&self) -> &::std::option::Option<crate::types::JobReport> {
184 self.inner.get_report()
185 }
186 /// <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>
187 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188 self.inner = self.inner.client_request_token(input.into());
189 self
190 }
191 /// <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>
192 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193 self.inner = self.inner.set_client_request_token(input);
194 self
195 }
196 /// <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>
197 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
198 self.inner.get_client_request_token()
199 }
200 /// <p>Configuration parameters for the manifest.</p>
201 pub fn manifest(mut self, input: crate::types::JobManifest) -> Self {
202 self.inner = self.inner.manifest(input);
203 self
204 }
205 /// <p>Configuration parameters for the manifest.</p>
206 pub fn set_manifest(mut self, input: ::std::option::Option<crate::types::JobManifest>) -> Self {
207 self.inner = self.inner.set_manifest(input);
208 self
209 }
210 /// <p>Configuration parameters for the manifest.</p>
211 pub fn get_manifest(&self) -> &::std::option::Option<crate::types::JobManifest> {
212 self.inner.get_manifest()
213 }
214 /// <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>
215 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216 self.inner = self.inner.description(input.into());
217 self
218 }
219 /// <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>
220 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221 self.inner = self.inner.set_description(input);
222 self
223 }
224 /// <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>
225 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
226 self.inner.get_description()
227 }
228 /// <p>The numerical priority for this job. Higher numbers indicate higher priority.</p>
229 pub fn priority(mut self, input: i32) -> Self {
230 self.inner = self.inner.priority(input);
231 self
232 }
233 /// <p>The numerical priority for this job. Higher numbers indicate higher priority.</p>
234 pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
235 self.inner = self.inner.set_priority(input);
236 self
237 }
238 /// <p>The numerical priority for this job. Higher numbers indicate higher priority.</p>
239 pub fn get_priority(&self) -> &::std::option::Option<i32> {
240 self.inner.get_priority()
241 }
242 /// <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>
243 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
244 self.inner = self.inner.role_arn(input.into());
245 self
246 }
247 /// <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>
248 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
249 self.inner = self.inner.set_role_arn(input);
250 self
251 }
252 /// <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>
253 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
254 self.inner.get_role_arn()
255 }
256 ///
257 /// Appends an item to `Tags`.
258 ///
259 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
260 ///
261 /// <p>A set of tags to associate with the S3 Batch Operations job. This is an optional parameter.</p>
262 pub fn tags(mut self, input: crate::types::S3Tag) -> Self {
263 self.inner = self.inner.tags(input);
264 self
265 }
266 /// <p>A set of tags to associate with the S3 Batch Operations job. This is an optional parameter.</p>
267 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::S3Tag>>) -> Self {
268 self.inner = self.inner.set_tags(input);
269 self
270 }
271 /// <p>A set of tags to associate with the S3 Batch Operations job. This is an optional parameter.</p>
272 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::S3Tag>> {
273 self.inner.get_tags()
274 }
275 /// <p>The attribute container for the ManifestGenerator details. Jobs must be created with either a manifest file or a ManifestGenerator, but not both.</p>
276 pub fn manifest_generator(mut self, input: crate::types::JobManifestGenerator) -> Self {
277 self.inner = self.inner.manifest_generator(input);
278 self
279 }
280 /// <p>The attribute container for the ManifestGenerator details. Jobs must be created with either a manifest file or a ManifestGenerator, but not both.</p>
281 pub fn set_manifest_generator(mut self, input: ::std::option::Option<crate::types::JobManifestGenerator>) -> Self {
282 self.inner = self.inner.set_manifest_generator(input);
283 self
284 }
285 /// <p>The attribute container for the ManifestGenerator details. Jobs must be created with either a manifest file or a ManifestGenerator, but not both.</p>
286 pub fn get_manifest_generator(&self) -> &::std::option::Option<crate::types::JobManifestGenerator> {
287 self.inner.get_manifest_generator()
288 }
289}