aws_sdk_datasync/operation/update_task/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_task::_update_task_output::UpdateTaskOutputBuilder;
3
4pub use crate::operation::update_task::_update_task_input::UpdateTaskInputBuilder;
5
6impl crate::operation::update_task::builders::UpdateTaskInputBuilder {
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_task::UpdateTaskOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_task::UpdateTaskError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_task();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateTask`.
24///
25/// <p>Updates the configuration of a <i>task</i>, which defines where and how DataSync transfers your data.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateTaskFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_task::builders::UpdateTaskInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_task::UpdateTaskOutput,
35        crate::operation::update_task::UpdateTaskError,
36    > for UpdateTaskFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::update_task::UpdateTaskOutput,
44            crate::operation::update_task::UpdateTaskError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateTaskFluentBuilder {
51    /// Creates a new `UpdateTaskFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the UpdateTask as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_task::builders::UpdateTaskInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::update_task::UpdateTaskOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_task::UpdateTaskError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::update_task::UpdateTask::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_task::UpdateTask::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::update_task::UpdateTaskOutput,
97        crate::operation::update_task::UpdateTaskError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>Specifies the ARN of the task that you want to update.</p>
112    pub fn task_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.task_arn(input.into());
114        self
115    }
116    /// <p>Specifies the ARN of the task that you want to update.</p>
117    pub fn set_task_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_task_arn(input);
119        self
120    }
121    /// <p>Specifies the ARN of the task that you want to update.</p>
122    pub fn get_task_arn(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_task_arn()
124    }
125    /// <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>
126    /// <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>
127    /// <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>
128    pub fn options(mut self, input: crate::types::Options) -> Self {
129        self.inner = self.inner.options(input);
130        self
131    }
132    /// <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>
133    /// <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>
134    /// <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>
135    pub fn set_options(mut self, input: ::std::option::Option<crate::types::Options>) -> Self {
136        self.inner = self.inner.set_options(input);
137        self
138    }
139    /// <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>
140    /// <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>
141    /// <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>
142    pub fn get_options(&self) -> &::std::option::Option<crate::types::Options> {
143        self.inner.get_options()
144    }
145    ///
146    /// Appends an item to `Excludes`.
147    ///
148    /// To override the contents of this collection use [`set_excludes`](Self::set_excludes).
149    ///
150    /// <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>
151    pub fn excludes(mut self, input: crate::types::FilterRule) -> Self {
152        self.inner = self.inner.excludes(input);
153        self
154    }
155    /// <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>
156    pub fn set_excludes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FilterRule>>) -> Self {
157        self.inner = self.inner.set_excludes(input);
158        self
159    }
160    /// <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>
161    pub fn get_excludes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FilterRule>> {
162        self.inner.get_excludes()
163    }
164    /// <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>
165    pub fn schedule(mut self, input: crate::types::TaskSchedule) -> Self {
166        self.inner = self.inner.schedule(input);
167        self
168    }
169    /// <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>
170    pub fn set_schedule(mut self, input: ::std::option::Option<crate::types::TaskSchedule>) -> Self {
171        self.inner = self.inner.set_schedule(input);
172        self
173    }
174    /// <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>
175    pub fn get_schedule(&self) -> &::std::option::Option<crate::types::TaskSchedule> {
176        self.inner.get_schedule()
177    }
178    /// <p>Specifies the name of your task.</p>
179    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180        self.inner = self.inner.name(input.into());
181        self
182    }
183    /// <p>Specifies the name of your task.</p>
184    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
185        self.inner = self.inner.set_name(input);
186        self
187    }
188    /// <p>Specifies the name of your task.</p>
189    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
190        self.inner.get_name()
191    }
192    /// <p>Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group for monitoring your task.</p>
193    /// <p>For Enhanced mode tasks, you must use <code>/aws/datasync</code> as your log group name. For example:</p>
194    /// <p><code>arn:aws:logs:us-east-1:111222333444:log-group:/aws/datasync:*</code></p>
195    /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/configure-logging.html">Monitoring data transfers with CloudWatch Logs</a>.</p>
196    pub fn cloud_watch_log_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.inner = self.inner.cloud_watch_log_group_arn(input.into());
198        self
199    }
200    /// <p>Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group for monitoring your task.</p>
201    /// <p>For Enhanced mode tasks, you must use <code>/aws/datasync</code> as your log group name. For example:</p>
202    /// <p><code>arn:aws:logs:us-east-1:111222333444:log-group:/aws/datasync:*</code></p>
203    /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/configure-logging.html">Monitoring data transfers with CloudWatch Logs</a>.</p>
204    pub fn set_cloud_watch_log_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205        self.inner = self.inner.set_cloud_watch_log_group_arn(input);
206        self
207    }
208    /// <p>Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group for monitoring your task.</p>
209    /// <p>For Enhanced mode tasks, you must use <code>/aws/datasync</code> as your log group name. For example:</p>
210    /// <p><code>arn:aws:logs:us-east-1:111222333444:log-group:/aws/datasync:*</code></p>
211    /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/configure-logging.html">Monitoring data transfers with CloudWatch Logs</a>.</p>
212    pub fn get_cloud_watch_log_group_arn(&self) -> &::std::option::Option<::std::string::String> {
213        self.inner.get_cloud_watch_log_group_arn()
214    }
215    ///
216    /// Appends an item to `Includes`.
217    ///
218    /// To override the contents of this collection use [`set_includes`](Self::set_includes).
219    ///
220    /// <p>Specifies include filters 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>
221    pub fn includes(mut self, input: crate::types::FilterRule) -> Self {
222        self.inner = self.inner.includes(input);
223        self
224    }
225    /// <p>Specifies include filters 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>
226    pub fn set_includes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FilterRule>>) -> Self {
227        self.inner = self.inner.set_includes(input);
228        self
229    }
230    /// <p>Specifies include filters 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>
231    pub fn get_includes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FilterRule>> {
232        self.inner.get_includes()
233    }
234    /// <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>
235    /// <p>When using this parameter, your caller identity (the IAM 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>
236    /// <p>To remove a manifest configuration, specify this parameter as empty.</p>
237    pub fn manifest_config(mut self, input: crate::types::ManifestConfig) -> Self {
238        self.inner = self.inner.manifest_config(input);
239        self
240    }
241    /// <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>
242    /// <p>When using this parameter, your caller identity (the IAM 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>
243    /// <p>To remove a manifest configuration, specify this parameter as empty.</p>
244    pub fn set_manifest_config(mut self, input: ::std::option::Option<crate::types::ManifestConfig>) -> Self {
245        self.inner = self.inner.set_manifest_config(input);
246        self
247    }
248    /// <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>
249    /// <p>When using this parameter, your caller identity (the IAM 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>
250    /// <p>To remove a manifest configuration, specify this parameter as empty.</p>
251    pub fn get_manifest_config(&self) -> &::std::option::Option<crate::types::ManifestConfig> {
252        self.inner.get_manifest_config()
253    }
254    /// <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>
255    /// <p>When using this parameter, your caller identity (the IAM 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>
256    /// <p>To remove a task report configuration, specify this parameter as empty.</p>
257    pub fn task_report_config(mut self, input: crate::types::TaskReportConfig) -> Self {
258        self.inner = self.inner.task_report_config(input);
259        self
260    }
261    /// <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>
262    /// <p>When using this parameter, your caller identity (the IAM 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    /// <p>To remove a task report configuration, specify this parameter as empty.</p>
264    pub fn set_task_report_config(mut self, input: ::std::option::Option<crate::types::TaskReportConfig>) -> Self {
265        self.inner = self.inner.set_task_report_config(input);
266        self
267    }
268    /// <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>
269    /// <p>When using this parameter, your caller identity (the IAM 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>
270    /// <p>To remove a task report configuration, specify this parameter as empty.</p>
271    pub fn get_task_report_config(&self) -> &::std::option::Option<crate::types::TaskReportConfig> {
272        self.inner.get_task_report_config()
273    }
274}