aws_sdk_datasync/operation/create_task/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_task::_create_task_output::CreateTaskOutputBuilder;
3
4pub use crate::operation::create_task::_create_task_input::CreateTaskInputBuilder;
5
6impl crate::operation::create_task::builders::CreateTaskInputBuilder {
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_task::CreateTaskOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_task::CreateTaskError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_task();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateTask`.
24///
25/// <p>Configures a <i>task</i>, which defines where and how DataSync transfers your data.</p>
26/// <p>A task includes a source location, destination location, and transfer options (such as bandwidth limits, scheduling, and more).</p><important>
27/// <p>If you're planning to transfer data to or from an Amazon S3 location, review <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#create-s3-location-s3-requests">how DataSync can affect your S3 request charges</a> and the <a href="http://aws.amazon.com/datasync/pricing/">DataSync pricing page</a> before you begin.</p>
28/// </important>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateTaskFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::create_task::builders::CreateTaskInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::create_task::CreateTaskOutput,
38 crate::operation::create_task::CreateTaskError,
39 > for CreateTaskFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<
46 crate::operation::create_task::CreateTaskOutput,
47 crate::operation::create_task::CreateTaskError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl CreateTaskFluentBuilder {
54 /// Creates a new `CreateTaskFluentBuilder`.
55 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56 Self {
57 handle,
58 inner: ::std::default::Default::default(),
59 config_override: ::std::option::Option::None,
60 }
61 }
62 /// Access the CreateTask as a reference.
63 pub fn as_input(&self) -> &crate::operation::create_task::builders::CreateTaskInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::create_task::CreateTaskOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::create_task::CreateTaskError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::create_task::CreateTask::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::create_task::CreateTask::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::create_task::CreateTaskOutput,
100 crate::operation::create_task::CreateTaskError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 /// <p>Specifies the ARN of your transfer's source location.</p>
115 pub fn source_location_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.source_location_arn(input.into());
117 self
118 }
119 /// <p>Specifies the ARN of your transfer's source location.</p>
120 pub fn set_source_location_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.inner = self.inner.set_source_location_arn(input);
122 self
123 }
124 /// <p>Specifies the ARN of your transfer's source location.</p>
125 pub fn get_source_location_arn(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_source_location_arn()
127 }
128 /// <p>Specifies the ARN of your transfer's destination location.</p>
129 pub fn destination_location_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.inner = self.inner.destination_location_arn(input.into());
131 self
132 }
133 /// <p>Specifies the ARN of your transfer's destination location.</p>
134 pub fn set_destination_location_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.inner = self.inner.set_destination_location_arn(input);
136 self
137 }
138 /// <p>Specifies the ARN of your transfer's destination location.</p>
139 pub fn get_destination_location_arn(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_destination_location_arn()
141 }
142 /// <p>Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group for monitoring your task.</p>
143 /// <p>For Enhanced mode tasks, you don't need to specify anything. DataSync automatically sends logs to a CloudWatch log group named <code>/aws/datasync</code>.</p>
144 pub fn cloud_watch_log_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145 self.inner = self.inner.cloud_watch_log_group_arn(input.into());
146 self
147 }
148 /// <p>Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group for monitoring your task.</p>
149 /// <p>For Enhanced mode tasks, you don't need to specify anything. DataSync automatically sends logs to a CloudWatch log group named <code>/aws/datasync</code>.</p>
150 pub fn set_cloud_watch_log_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151 self.inner = self.inner.set_cloud_watch_log_group_arn(input);
152 self
153 }
154 /// <p>Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group for monitoring your task.</p>
155 /// <p>For Enhanced mode tasks, you don't need to specify anything. DataSync automatically sends logs to a CloudWatch log group named <code>/aws/datasync</code>.</p>
156 pub fn get_cloud_watch_log_group_arn(&self) -> &::std::option::Option<::std::string::String> {
157 self.inner.get_cloud_watch_log_group_arn()
158 }
159 /// <p>Specifies the name of your task.</p>
160 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161 self.inner = self.inner.name(input.into());
162 self
163 }
164 /// <p>Specifies the name of your task.</p>
165 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166 self.inner = self.inner.set_name(input);
167 self
168 }
169 /// <p>Specifies the name of your task.</p>
170 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
171 self.inner.get_name()
172 }
173 /// <p>Specifies your task's settings, such as preserving file metadata, verifying data integrity, among other options.</p>
174 pub fn options(mut self, input: crate::types::Options) -> Self {
175 self.inner = self.inner.options(input);
176 self
177 }
178 /// <p>Specifies your task's settings, such as preserving file metadata, verifying data integrity, among other options.</p>
179 pub fn set_options(mut self, input: ::std::option::Option<crate::types::Options>) -> Self {
180 self.inner = self.inner.set_options(input);
181 self
182 }
183 /// <p>Specifies your task's settings, such as preserving file metadata, verifying data integrity, among other options.</p>
184 pub fn get_options(&self) -> &::std::option::Option<crate::types::Options> {
185 self.inner.get_options()
186 }
187 ///
188 /// Appends an item to `Excludes`.
189 ///
190 /// To override the contents of this collection use [`set_excludes`](Self::set_excludes).
191 ///
192 /// <p>Specifies exclude filters that define the files, objects, and folders in your source location that you don't want DataSync to transfer. For more information and examples, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/filtering.html">Specifying what DataSync transfers by using filters</a>.</p>
193 pub fn excludes(mut self, input: crate::types::FilterRule) -> Self {
194 self.inner = self.inner.excludes(input);
195 self
196 }
197 /// <p>Specifies exclude filters that define the files, objects, and folders in your source location that you don't want DataSync to transfer. For more information and examples, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/filtering.html">Specifying what DataSync transfers by using filters</a>.</p>
198 pub fn set_excludes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FilterRule>>) -> Self {
199 self.inner = self.inner.set_excludes(input);
200 self
201 }
202 /// <p>Specifies exclude filters that define the files, objects, and folders in your source location that you don't want DataSync to transfer. For more information and examples, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/filtering.html">Specifying what DataSync transfers by using filters</a>.</p>
203 pub fn get_excludes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FilterRule>> {
204 self.inner.get_excludes()
205 }
206 /// <p>Specifies a schedule for when you want your task to run. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/task-scheduling.html">Scheduling your task</a>.</p>
207 pub fn schedule(mut self, input: crate::types::TaskSchedule) -> Self {
208 self.inner = self.inner.schedule(input);
209 self
210 }
211 /// <p>Specifies a schedule for when you want your task to run. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/task-scheduling.html">Scheduling your task</a>.</p>
212 pub fn set_schedule(mut self, input: ::std::option::Option<crate::types::TaskSchedule>) -> Self {
213 self.inner = self.inner.set_schedule(input);
214 self
215 }
216 /// <p>Specifies a schedule for when you want your task to run. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/task-scheduling.html">Scheduling your task</a>.</p>
217 pub fn get_schedule(&self) -> &::std::option::Option<crate::types::TaskSchedule> {
218 self.inner.get_schedule()
219 }
220 ///
221 /// Appends an item to `Tags`.
222 ///
223 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
224 ///
225 /// <p>Specifies the tags that you want to apply to your task.</p>
226 /// <p><i>Tags</i> are key-value pairs that help you manage, filter, and search for your DataSync resources.</p>
227 pub fn tags(mut self, input: crate::types::TagListEntry) -> Self {
228 self.inner = self.inner.tags(input);
229 self
230 }
231 /// <p>Specifies the tags that you want to apply to your task.</p>
232 /// <p><i>Tags</i> are key-value pairs that help you manage, filter, and search for your DataSync resources.</p>
233 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>>) -> Self {
234 self.inner = self.inner.set_tags(input);
235 self
236 }
237 /// <p>Specifies the tags that you want to apply to your task.</p>
238 /// <p><i>Tags</i> are key-value pairs that help you manage, filter, and search for your DataSync resources.</p>
239 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>> {
240 self.inner.get_tags()
241 }
242 ///
243 /// Appends an item to `Includes`.
244 ///
245 /// To override the contents of this collection use [`set_includes`](Self::set_includes).
246 ///
247 /// <p>Specifies include filters that define the files, objects, and folders in your source location that you want DataSync to transfer. For more information and examples, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/filtering.html">Specifying what DataSync transfers by using filters</a>.</p>
248 pub fn includes(mut self, input: crate::types::FilterRule) -> Self {
249 self.inner = self.inner.includes(input);
250 self
251 }
252 /// <p>Specifies include filters that define the files, objects, and folders in your source location that you want DataSync to transfer. For more information and examples, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/filtering.html">Specifying what DataSync transfers by using filters</a>.</p>
253 pub fn set_includes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FilterRule>>) -> Self {
254 self.inner = self.inner.set_includes(input);
255 self
256 }
257 /// <p>Specifies include filters that define the files, objects, and folders in your source location that you want DataSync to transfer. For more information and examples, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/filtering.html">Specifying what DataSync transfers by using filters</a>.</p>
258 pub fn get_includes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FilterRule>> {
259 self.inner.get_includes()
260 }
261 /// <p>Configures a manifest, which is a list of files or objects that you want DataSync to transfer. For more information and configuration examples, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/transferring-with-manifest.html">Specifying what DataSync transfers by using a manifest</a>.</p>
262 /// <p>When using this parameter, your caller identity (the role that you're using DataSync with) must have the <code>iam:PassRole</code> permission. The <a href="https://docs.aws.amazon.com/datasync/latest/userguide/security-iam-awsmanpol.html#security-iam-awsmanpol-awsdatasyncfullaccess">AWSDataSyncFullAccess</a> policy includes this permission.</p>
263 pub fn manifest_config(mut self, input: crate::types::ManifestConfig) -> Self {
264 self.inner = self.inner.manifest_config(input);
265 self
266 }
267 /// <p>Configures a manifest, which is a list of files or objects that you want DataSync to transfer. For more information and configuration examples, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/transferring-with-manifest.html">Specifying what DataSync transfers by using a manifest</a>.</p>
268 /// <p>When using this parameter, your caller identity (the role that you're using DataSync with) must have the <code>iam:PassRole</code> permission. The <a href="https://docs.aws.amazon.com/datasync/latest/userguide/security-iam-awsmanpol.html#security-iam-awsmanpol-awsdatasyncfullaccess">AWSDataSyncFullAccess</a> policy includes this permission.</p>
269 pub fn set_manifest_config(mut self, input: ::std::option::Option<crate::types::ManifestConfig>) -> Self {
270 self.inner = self.inner.set_manifest_config(input);
271 self
272 }
273 /// <p>Configures a manifest, which is a list of files or objects that you want DataSync to transfer. For more information and configuration examples, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/transferring-with-manifest.html">Specifying what DataSync transfers by using a manifest</a>.</p>
274 /// <p>When using this parameter, your caller identity (the role that you're using DataSync with) must have the <code>iam:PassRole</code> permission. The <a href="https://docs.aws.amazon.com/datasync/latest/userguide/security-iam-awsmanpol.html#security-iam-awsmanpol-awsdatasyncfullaccess">AWSDataSyncFullAccess</a> policy includes this permission.</p>
275 pub fn get_manifest_config(&self) -> &::std::option::Option<crate::types::ManifestConfig> {
276 self.inner.get_manifest_config()
277 }
278 /// <p>Specifies how you want to configure a task report, which provides detailed information about your DataSync transfer. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/task-reports.html">Monitoring your DataSync transfers with task reports</a>.</p>
279 /// <p>When using this parameter, your caller identity (the role that you're using DataSync with) must have the <code>iam:PassRole</code> permission. The <a href="https://docs.aws.amazon.com/datasync/latest/userguide/security-iam-awsmanpol.html#security-iam-awsmanpol-awsdatasyncfullaccess">AWSDataSyncFullAccess</a> policy includes this permission.</p>
280 pub fn task_report_config(mut self, input: crate::types::TaskReportConfig) -> Self {
281 self.inner = self.inner.task_report_config(input);
282 self
283 }
284 /// <p>Specifies how you want to configure a task report, which provides detailed information about your DataSync transfer. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/task-reports.html">Monitoring your DataSync transfers with task reports</a>.</p>
285 /// <p>When using this parameter, your caller identity (the role that you're using DataSync with) must have the <code>iam:PassRole</code> permission. The <a href="https://docs.aws.amazon.com/datasync/latest/userguide/security-iam-awsmanpol.html#security-iam-awsmanpol-awsdatasyncfullaccess">AWSDataSyncFullAccess</a> policy includes this permission.</p>
286 pub fn set_task_report_config(mut self, input: ::std::option::Option<crate::types::TaskReportConfig>) -> Self {
287 self.inner = self.inner.set_task_report_config(input);
288 self
289 }
290 /// <p>Specifies how you want to configure a task report, which provides detailed information about your DataSync transfer. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/task-reports.html">Monitoring your DataSync transfers with task reports</a>.</p>
291 /// <p>When using this parameter, your caller identity (the role that you're using DataSync with) must have the <code>iam:PassRole</code> permission. The <a href="https://docs.aws.amazon.com/datasync/latest/userguide/security-iam-awsmanpol.html#security-iam-awsmanpol-awsdatasyncfullaccess">AWSDataSyncFullAccess</a> policy includes this permission.</p>
292 pub fn get_task_report_config(&self) -> &::std::option::Option<crate::types::TaskReportConfig> {
293 self.inner.get_task_report_config()
294 }
295 /// <p>Specifies one of the following task modes for your data transfer:</p>
296 /// <ul>
297 /// <li>
298 /// <p><code>ENHANCED</code> - Transfer virtually unlimited numbers of objects with higher performance than Basic mode. Enhanced mode tasks optimize the data transfer process by listing, preparing, transferring, and verifying data in parallel. Enhanced mode is currently available for transfers between Amazon S3 locations, transfers between Azure Blob and Amazon S3 without an agent, and transfers between other clouds and Amazon S3 without an agent.</p><note>
299 /// <p>To create an Enhanced mode task, the IAM role that you use to call the <code>CreateTask</code> operation must have the <code>iam:CreateServiceLinkedRole</code> permission.</p>
300 /// </note></li>
301 /// <li>
302 /// <p><code>BASIC</code> (default) - Transfer files or objects between Amazon Web Services storage and all other supported DataSync locations. Basic mode tasks are subject to <a href="https://docs.aws.amazon.com/datasync/latest/userguide/datasync-limits.html">quotas</a> on the number of files, objects, and directories in a dataset. Basic mode sequentially prepares, transfers, and verifies data, making it slower than Enhanced mode for most workloads.</p></li>
303 /// </ul>
304 /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html#task-mode-differences">Understanding task mode differences</a>.</p>
305 pub fn task_mode(mut self, input: crate::types::TaskMode) -> Self {
306 self.inner = self.inner.task_mode(input);
307 self
308 }
309 /// <p>Specifies one of the following task modes for your data transfer:</p>
310 /// <ul>
311 /// <li>
312 /// <p><code>ENHANCED</code> - Transfer virtually unlimited numbers of objects with higher performance than Basic mode. Enhanced mode tasks optimize the data transfer process by listing, preparing, transferring, and verifying data in parallel. Enhanced mode is currently available for transfers between Amazon S3 locations, transfers between Azure Blob and Amazon S3 without an agent, and transfers between other clouds and Amazon S3 without an agent.</p><note>
313 /// <p>To create an Enhanced mode task, the IAM role that you use to call the <code>CreateTask</code> operation must have the <code>iam:CreateServiceLinkedRole</code> permission.</p>
314 /// </note></li>
315 /// <li>
316 /// <p><code>BASIC</code> (default) - Transfer files or objects between Amazon Web Services storage and all other supported DataSync locations. Basic mode tasks are subject to <a href="https://docs.aws.amazon.com/datasync/latest/userguide/datasync-limits.html">quotas</a> on the number of files, objects, and directories in a dataset. Basic mode sequentially prepares, transfers, and verifies data, making it slower than Enhanced mode for most workloads.</p></li>
317 /// </ul>
318 /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html#task-mode-differences">Understanding task mode differences</a>.</p>
319 pub fn set_task_mode(mut self, input: ::std::option::Option<crate::types::TaskMode>) -> Self {
320 self.inner = self.inner.set_task_mode(input);
321 self
322 }
323 /// <p>Specifies one of the following task modes for your data transfer:</p>
324 /// <ul>
325 /// <li>
326 /// <p><code>ENHANCED</code> - Transfer virtually unlimited numbers of objects with higher performance than Basic mode. Enhanced mode tasks optimize the data transfer process by listing, preparing, transferring, and verifying data in parallel. Enhanced mode is currently available for transfers between Amazon S3 locations, transfers between Azure Blob and Amazon S3 without an agent, and transfers between other clouds and Amazon S3 without an agent.</p><note>
327 /// <p>To create an Enhanced mode task, the IAM role that you use to call the <code>CreateTask</code> operation must have the <code>iam:CreateServiceLinkedRole</code> permission.</p>
328 /// </note></li>
329 /// <li>
330 /// <p><code>BASIC</code> (default) - Transfer files or objects between Amazon Web Services storage and all other supported DataSync locations. Basic mode tasks are subject to <a href="https://docs.aws.amazon.com/datasync/latest/userguide/datasync-limits.html">quotas</a> on the number of files, objects, and directories in a dataset. Basic mode sequentially prepares, transfers, and verifies data, making it slower than Enhanced mode for most workloads.</p></li>
331 /// </ul>
332 /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html#task-mode-differences">Understanding task mode differences</a>.</p>
333 pub fn get_task_mode(&self) -> &::std::option::Option<crate::types::TaskMode> {
334 self.inner.get_task_mode()
335 }
336}