aws_sdk_datasync/operation/create_location_s3/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_location_s3::_create_location_s3_output::CreateLocationS3OutputBuilder;
3
4pub use crate::operation::create_location_s3::_create_location_s3_input::CreateLocationS3InputBuilder;
5
6impl crate::operation::create_location_s3::builders::CreateLocationS3InputBuilder {
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_location_s3::CreateLocationS3Output,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_location_s3::CreateLocationS3Error,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_location_s3();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateLocationS3`.
24///
25/// <p>Creates a transfer <i>location</i> for an Amazon S3 bucket. DataSync can use this location as a source or destination for transferring data.</p><important>
26/// <p>Before you begin, make sure that you read the following topics:</p>
27/// <ul>
28/// <li>
29/// <p><a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes">Storage class considerations with Amazon S3 locations</a></p></li>
30/// <li>
31/// <p><a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#create-s3-location-s3-requests">Evaluating S3 request costs when using DataSync</a></p></li>
32/// </ul>
33/// </important>
34/// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html">Configuring transfers with Amazon S3</a>.</p>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct CreateLocationS3FluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::create_location_s3::builders::CreateLocationS3InputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::create_location_s3::CreateLocationS3Output,
44        crate::operation::create_location_s3::CreateLocationS3Error,
45    > for CreateLocationS3FluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::create_location_s3::CreateLocationS3Output,
53            crate::operation::create_location_s3::CreateLocationS3Error,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl CreateLocationS3FluentBuilder {
60    /// Creates a new `CreateLocationS3FluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the CreateLocationS3 as a reference.
69    pub fn as_input(&self) -> &crate::operation::create_location_s3::builders::CreateLocationS3InputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::create_location_s3::CreateLocationS3Output,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::create_location_s3::CreateLocationS3Error,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::create_location_s3::CreateLocationS3::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::create_location_s3::CreateLocationS3::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::create_location_s3::CreateLocationS3Output,
106        crate::operation::create_location_s3::CreateLocationS3Error,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>Specifies a prefix in the S3 bucket that DataSync reads from or writes to (depending on whether the bucket is a source or destination location).</p><note>
121    /// <p>DataSync can't transfer objects with a prefix that begins with a slash (<code>/</code>) or includes <code>//</code>, <code>/./</code>, or <code>/../</code> patterns. For example:</p>
122    /// <ul>
123    /// <li>
124    /// <p><code>/photos</code></p></li>
125    /// <li>
126    /// <p><code>photos//2006/January</code></p></li>
127    /// <li>
128    /// <p><code>photos/./2006/February</code></p></li>
129    /// <li>
130    /// <p><code>photos/../2006/March</code></p></li>
131    /// </ul>
132    /// </note>
133    pub fn subdirectory(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.subdirectory(input.into());
135        self
136    }
137    /// <p>Specifies a prefix in the S3 bucket that DataSync reads from or writes to (depending on whether the bucket is a source or destination location).</p><note>
138    /// <p>DataSync can't transfer objects with a prefix that begins with a slash (<code>/</code>) or includes <code>//</code>, <code>/./</code>, or <code>/../</code> patterns. For example:</p>
139    /// <ul>
140    /// <li>
141    /// <p><code>/photos</code></p></li>
142    /// <li>
143    /// <p><code>photos//2006/January</code></p></li>
144    /// <li>
145    /// <p><code>photos/./2006/February</code></p></li>
146    /// <li>
147    /// <p><code>photos/../2006/March</code></p></li>
148    /// </ul>
149    /// </note>
150    pub fn set_subdirectory(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.inner = self.inner.set_subdirectory(input);
152        self
153    }
154    /// <p>Specifies a prefix in the S3 bucket that DataSync reads from or writes to (depending on whether the bucket is a source or destination location).</p><note>
155    /// <p>DataSync can't transfer objects with a prefix that begins with a slash (<code>/</code>) or includes <code>//</code>, <code>/./</code>, or <code>/../</code> patterns. For example:</p>
156    /// <ul>
157    /// <li>
158    /// <p><code>/photos</code></p></li>
159    /// <li>
160    /// <p><code>photos//2006/January</code></p></li>
161    /// <li>
162    /// <p><code>photos/./2006/February</code></p></li>
163    /// <li>
164    /// <p><code>photos/../2006/March</code></p></li>
165    /// </ul>
166    /// </note>
167    pub fn get_subdirectory(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_subdirectory()
169    }
170    /// <p>Specifies the ARN of the S3 bucket that you want to use as a location. (When creating your DataSync task later, you specify whether this location is a transfer source or destination.)</p>
171    /// <p>If your S3 bucket is located on an Outposts resource, you must specify an Amazon S3 access point. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html">Managing data access with Amazon S3 access points</a> in the <i>Amazon S3 User Guide</i>.</p>
172    pub fn s3_bucket_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.inner = self.inner.s3_bucket_arn(input.into());
174        self
175    }
176    /// <p>Specifies the ARN of the S3 bucket that you want to use as a location. (When creating your DataSync task later, you specify whether this location is a transfer source or destination.)</p>
177    /// <p>If your S3 bucket is located on an Outposts resource, you must specify an Amazon S3 access point. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html">Managing data access with Amazon S3 access points</a> in the <i>Amazon S3 User Guide</i>.</p>
178    pub fn set_s3_bucket_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179        self.inner = self.inner.set_s3_bucket_arn(input);
180        self
181    }
182    /// <p>Specifies the ARN of the S3 bucket that you want to use as a location. (When creating your DataSync task later, you specify whether this location is a transfer source or destination.)</p>
183    /// <p>If your S3 bucket is located on an Outposts resource, you must specify an Amazon S3 access point. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html">Managing data access with Amazon S3 access points</a> in the <i>Amazon S3 User Guide</i>.</p>
184    pub fn get_s3_bucket_arn(&self) -> &::std::option::Option<::std::string::String> {
185        self.inner.get_s3_bucket_arn()
186    }
187    /// <p>Specifies the storage class that you want your objects to use when Amazon S3 is a transfer destination.</p>
188    /// <p>For buckets in Amazon Web Services Regions, the storage class defaults to <code>STANDARD</code>. For buckets on Outposts, the storage class defaults to <code>OUTPOSTS</code>.</p>
189    /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes">Storage class considerations with Amazon S3 transfers</a>.</p>
190    pub fn s3_storage_class(mut self, input: crate::types::S3StorageClass) -> Self {
191        self.inner = self.inner.s3_storage_class(input);
192        self
193    }
194    /// <p>Specifies the storage class that you want your objects to use when Amazon S3 is a transfer destination.</p>
195    /// <p>For buckets in Amazon Web Services Regions, the storage class defaults to <code>STANDARD</code>. For buckets on Outposts, the storage class defaults to <code>OUTPOSTS</code>.</p>
196    /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes">Storage class considerations with Amazon S3 transfers</a>.</p>
197    pub fn set_s3_storage_class(mut self, input: ::std::option::Option<crate::types::S3StorageClass>) -> Self {
198        self.inner = self.inner.set_s3_storage_class(input);
199        self
200    }
201    /// <p>Specifies the storage class that you want your objects to use when Amazon S3 is a transfer destination.</p>
202    /// <p>For buckets in Amazon Web Services Regions, the storage class defaults to <code>STANDARD</code>. For buckets on Outposts, the storage class defaults to <code>OUTPOSTS</code>.</p>
203    /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes">Storage class considerations with Amazon S3 transfers</a>.</p>
204    pub fn get_s3_storage_class(&self) -> &::std::option::Option<crate::types::S3StorageClass> {
205        self.inner.get_s3_storage_class()
206    }
207    /// <p>Specifies the Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that DataSync uses to access your S3 bucket.</p>
208    /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#create-s3-location-access">Providing DataSync access to S3 buckets</a>.</p>
209    pub fn s3_config(mut self, input: crate::types::S3Config) -> Self {
210        self.inner = self.inner.s3_config(input);
211        self
212    }
213    /// <p>Specifies the Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that DataSync uses to access your S3 bucket.</p>
214    /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#create-s3-location-access">Providing DataSync access to S3 buckets</a>.</p>
215    pub fn set_s3_config(mut self, input: ::std::option::Option<crate::types::S3Config>) -> Self {
216        self.inner = self.inner.set_s3_config(input);
217        self
218    }
219    /// <p>Specifies the Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that DataSync uses to access your S3 bucket.</p>
220    /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#create-s3-location-access">Providing DataSync access to S3 buckets</a>.</p>
221    pub fn get_s3_config(&self) -> &::std::option::Option<crate::types::S3Config> {
222        self.inner.get_s3_config()
223    }
224    ///
225    /// Appends an item to `AgentArns`.
226    ///
227    /// To override the contents of this collection use [`set_agent_arns`](Self::set_agent_arns).
228    ///
229    /// <p>(Amazon S3 on Outposts only) Specifies the Amazon Resource Name (ARN) of the DataSync agent on your Outpost.</p>
230    /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/deploy-agents.html#outposts-agent">Deploy your DataSync agent on Outposts</a>.</p>
231    pub fn agent_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232        self.inner = self.inner.agent_arns(input.into());
233        self
234    }
235    /// <p>(Amazon S3 on Outposts only) Specifies the Amazon Resource Name (ARN) of the DataSync agent on your Outpost.</p>
236    /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/deploy-agents.html#outposts-agent">Deploy your DataSync agent on Outposts</a>.</p>
237    pub fn set_agent_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
238        self.inner = self.inner.set_agent_arns(input);
239        self
240    }
241    /// <p>(Amazon S3 on Outposts only) Specifies the Amazon Resource Name (ARN) of the DataSync agent on your Outpost.</p>
242    /// <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/deploy-agents.html#outposts-agent">Deploy your DataSync agent on Outposts</a>.</p>
243    pub fn get_agent_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
244        self.inner.get_agent_arns()
245    }
246    ///
247    /// Appends an item to `Tags`.
248    ///
249    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
250    ///
251    /// <p>Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least a name tag for your transfer location.</p>
252    pub fn tags(mut self, input: crate::types::TagListEntry) -> Self {
253        self.inner = self.inner.tags(input);
254        self
255    }
256    /// <p>Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least a name tag for your transfer location.</p>
257    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>>) -> Self {
258        self.inner = self.inner.set_tags(input);
259        self
260    }
261    /// <p>Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least a name tag for your transfer location.</p>
262    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>> {
263        self.inner.get_tags()
264    }
265}