aws_sdk_datasync/operation/start_task_execution/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_task_execution::_start_task_execution_output::StartTaskExecutionOutputBuilder;
3
4pub use crate::operation::start_task_execution::_start_task_execution_input::StartTaskExecutionInputBuilder;
5
6impl crate::operation::start_task_execution::builders::StartTaskExecutionInputBuilder {
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::start_task_execution::StartTaskExecutionOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::start_task_execution::StartTaskExecutionError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.start_task_execution();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `StartTaskExecution`.
24///
25/// <p>Starts an DataSync transfer task. For each task, you can only run one task execution at a time.</p>
26/// <p>There are several steps to a task execution. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/working-with-task-executions.html#understand-task-execution-statuses">Task execution statuses</a>.</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 StartTaskExecutionFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::start_task_execution::builders::StartTaskExecutionInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::start_task_execution::StartTaskExecutionOutput,
38 crate::operation::start_task_execution::StartTaskExecutionError,
39 > for StartTaskExecutionFluentBuilder
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::start_task_execution::StartTaskExecutionOutput,
47 crate::operation::start_task_execution::StartTaskExecutionError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl StartTaskExecutionFluentBuilder {
54 /// Creates a new `StartTaskExecutionFluentBuilder`.
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 StartTaskExecution as a reference.
63 pub fn as_input(&self) -> &crate::operation::start_task_execution::builders::StartTaskExecutionInputBuilder {
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::start_task_execution::StartTaskExecutionOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::start_task_execution::StartTaskExecutionError,
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::start_task_execution::StartTaskExecution::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::start_task_execution::StartTaskExecution::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::start_task_execution::StartTaskExecutionOutput,
100 crate::operation::start_task_execution::StartTaskExecutionError,
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 Amazon Resource Name (ARN) of the task that you want to start.</p>
115 pub fn task_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.task_arn(input.into());
117 self
118 }
119 /// <p>Specifies the Amazon Resource Name (ARN) of the task that you want to start.</p>
120 pub fn set_task_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.inner = self.inner.set_task_arn(input);
122 self
123 }
124 /// <p>Specifies the Amazon Resource Name (ARN) of the task that you want to start.</p>
125 pub fn get_task_arn(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_task_arn()
127 }
128 /// <p>Indicates how your transfer task is configured. These options include how DataSync handles files, objects, and their associated metadata during your transfer. You also can specify how to verify data integrity, set bandwidth limits for your task, among other options.</p>
129 /// <p>Each option has a default value. Unless you need to, you don't have to configure any option before calling <a href="https://docs.aws.amazon.com/datasync/latest/userguide/API_StartTaskExecution.html">StartTaskExecution</a>.</p>
130 /// <p>You also can override your task options for each task execution. For example, you might want to adjust the <code>LogLevel</code> for an individual execution.</p>
131 pub fn override_options(mut self, input: crate::types::Options) -> Self {
132 self.inner = self.inner.override_options(input);
133 self
134 }
135 /// <p>Indicates how your transfer task is configured. These options include how DataSync handles files, objects, and their associated metadata during your transfer. You also can specify how to verify data integrity, set bandwidth limits for your task, among other options.</p>
136 /// <p>Each option has a default value. Unless you need to, you don't have to configure any option before calling <a href="https://docs.aws.amazon.com/datasync/latest/userguide/API_StartTaskExecution.html">StartTaskExecution</a>.</p>
137 /// <p>You also can override your task options for each task execution. For example, you might want to adjust the <code>LogLevel</code> for an individual execution.</p>
138 pub fn set_override_options(mut self, input: ::std::option::Option<crate::types::Options>) -> Self {
139 self.inner = self.inner.set_override_options(input);
140 self
141 }
142 /// <p>Indicates how your transfer task is configured. These options include how DataSync handles files, objects, and their associated metadata during your transfer. You also can specify how to verify data integrity, set bandwidth limits for your task, among other options.</p>
143 /// <p>Each option has a default value. Unless you need to, you don't have to configure any option before calling <a href="https://docs.aws.amazon.com/datasync/latest/userguide/API_StartTaskExecution.html">StartTaskExecution</a>.</p>
144 /// <p>You also can override your task options for each task execution. For example, you might want to adjust the <code>LogLevel</code> for an individual execution.</p>
145 pub fn get_override_options(&self) -> &::std::option::Option<crate::types::Options> {
146 self.inner.get_override_options()
147 }
148 ///
149 /// Appends an item to `Includes`.
150 ///
151 /// To override the contents of this collection use [`set_includes`](Self::set_includes).
152 ///
153 /// <p>Specifies a list of filter rules that determines which files to include when running a task. The pattern should contain a single filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a pipe), for example, <code>"/folder1|/folder2"</code>.</p>
154 pub fn includes(mut self, input: crate::types::FilterRule) -> Self {
155 self.inner = self.inner.includes(input);
156 self
157 }
158 /// <p>Specifies a list of filter rules that determines which files to include when running a task. The pattern should contain a single filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a pipe), for example, <code>"/folder1|/folder2"</code>.</p>
159 pub fn set_includes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FilterRule>>) -> Self {
160 self.inner = self.inner.set_includes(input);
161 self
162 }
163 /// <p>Specifies a list of filter rules that determines which files to include when running a task. The pattern should contain a single filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a pipe), for example, <code>"/folder1|/folder2"</code>.</p>
164 pub fn get_includes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FilterRule>> {
165 self.inner.get_includes()
166 }
167 ///
168 /// Appends an item to `Excludes`.
169 ///
170 /// To override the contents of this collection use [`set_excludes`](Self::set_excludes).
171 ///
172 /// <p>Specifies a list of filter rules that determines which files to exclude from a task. The list contains a single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for example, <code>"/folder1|/folder2"</code>.</p>
173 pub fn excludes(mut self, input: crate::types::FilterRule) -> Self {
174 self.inner = self.inner.excludes(input);
175 self
176 }
177 /// <p>Specifies a list of filter rules that determines which files to exclude from a task. The list contains a single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for example, <code>"/folder1|/folder2"</code>.</p>
178 pub fn set_excludes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FilterRule>>) -> Self {
179 self.inner = self.inner.set_excludes(input);
180 self
181 }
182 /// <p>Specifies a list of filter rules that determines which files to exclude from a task. The list contains a single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for example, <code>"/folder1|/folder2"</code>.</p>
183 pub fn get_excludes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FilterRule>> {
184 self.inner.get_excludes()
185 }
186 /// <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>
187 /// <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>
188 /// <p>To remove a manifest configuration, specify this parameter with an empty value.</p>
189 pub fn manifest_config(mut self, input: crate::types::ManifestConfig) -> Self {
190 self.inner = self.inner.manifest_config(input);
191 self
192 }
193 /// <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>
194 /// <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>
195 /// <p>To remove a manifest configuration, specify this parameter with an empty value.</p>
196 pub fn set_manifest_config(mut self, input: ::std::option::Option<crate::types::ManifestConfig>) -> Self {
197 self.inner = self.inner.set_manifest_config(input);
198 self
199 }
200 /// <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>
201 /// <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>
202 /// <p>To remove a manifest configuration, specify this parameter with an empty value.</p>
203 pub fn get_manifest_config(&self) -> &::std::option::Option<crate::types::ManifestConfig> {
204 self.inner.get_manifest_config()
205 }
206 /// <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>
207 /// <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>
208 /// <p>To remove a task report configuration, specify this parameter as empty.</p>
209 pub fn task_report_config(mut self, input: crate::types::TaskReportConfig) -> Self {
210 self.inner = self.inner.task_report_config(input);
211 self
212 }
213 /// <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>
214 /// <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>
215 /// <p>To remove a task report configuration, specify this parameter as empty.</p>
216 pub fn set_task_report_config(mut self, input: ::std::option::Option<crate::types::TaskReportConfig>) -> Self {
217 self.inner = self.inner.set_task_report_config(input);
218 self
219 }
220 /// <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>
221 /// <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>
222 /// <p>To remove a task report configuration, specify this parameter as empty.</p>
223 pub fn get_task_report_config(&self) -> &::std::option::Option<crate::types::TaskReportConfig> {
224 self.inner.get_task_report_config()
225 }
226 ///
227 /// Appends an item to `Tags`.
228 ///
229 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
230 ///
231 /// <p>Specifies the tags that you want to apply to the Amazon Resource Name (ARN) representing the task execution.</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 tags(mut self, input: crate::types::TagListEntry) -> Self {
234 self.inner = self.inner.tags(input);
235 self
236 }
237 /// <p>Specifies the tags that you want to apply to the Amazon Resource Name (ARN) representing the task execution.</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 set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>>) -> Self {
240 self.inner = self.inner.set_tags(input);
241 self
242 }
243 /// <p>Specifies the tags that you want to apply to the Amazon Resource Name (ARN) representing the task execution.</p>
244 /// <p><i>Tags</i> are key-value pairs that help you manage, filter, and search for your DataSync resources.</p>
245 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>> {
246 self.inner.get_tags()
247 }
248}