aws_sdk_datasync/operation/update_location_s3/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_location_s3::_update_location_s3_output::UpdateLocationS3OutputBuilder;
3
4pub use crate::operation::update_location_s3::_update_location_s3_input::UpdateLocationS3InputBuilder;
5
6impl crate::operation::update_location_s3::builders::UpdateLocationS3InputBuilder {
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_location_s3::UpdateLocationS3Output,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_location_s3::UpdateLocationS3Error,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_location_s3();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateLocationS3`.
24///
25/// <p>Modifies the following configuration parameters of the Amazon S3 transfer location that you're using with DataSync.</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#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct UpdateLocationS3FluentBuilder {
36 handle: ::std::sync::Arc<crate::client::Handle>,
37 inner: crate::operation::update_location_s3::builders::UpdateLocationS3InputBuilder,
38 config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41 crate::client::customize::internal::CustomizableSend<
42 crate::operation::update_location_s3::UpdateLocationS3Output,
43 crate::operation::update_location_s3::UpdateLocationS3Error,
44 > for UpdateLocationS3FluentBuilder
45{
46 fn send(
47 self,
48 config_override: crate::config::Builder,
49 ) -> crate::client::customize::internal::BoxFuture<
50 crate::client::customize::internal::SendResult<
51 crate::operation::update_location_s3::UpdateLocationS3Output,
52 crate::operation::update_location_s3::UpdateLocationS3Error,
53 >,
54 > {
55 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56 }
57}
58impl UpdateLocationS3FluentBuilder {
59 /// Creates a new `UpdateLocationS3FluentBuilder`.
60 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61 Self {
62 handle,
63 inner: ::std::default::Default::default(),
64 config_override: ::std::option::Option::None,
65 }
66 }
67 /// Access the UpdateLocationS3 as a reference.
68 pub fn as_input(&self) -> &crate::operation::update_location_s3::builders::UpdateLocationS3InputBuilder {
69 &self.inner
70 }
71 /// Sends the request and returns the response.
72 ///
73 /// If an error occurs, an `SdkError` will be returned with additional details that
74 /// can be matched against.
75 ///
76 /// By default, any retryable failures will be retried twice. Retry behavior
77 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78 /// set when configuring the client.
79 pub async fn send(
80 self,
81 ) -> ::std::result::Result<
82 crate::operation::update_location_s3::UpdateLocationS3Output,
83 ::aws_smithy_runtime_api::client::result::SdkError<
84 crate::operation::update_location_s3::UpdateLocationS3Error,
85 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86 >,
87 > {
88 let input = self
89 .inner
90 .build()
91 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92 let runtime_plugins = crate::operation::update_location_s3::UpdateLocationS3::operation_runtime_plugins(
93 self.handle.runtime_plugins.clone(),
94 &self.handle.conf,
95 self.config_override,
96 );
97 crate::operation::update_location_s3::UpdateLocationS3::orchestrate(&runtime_plugins, input).await
98 }
99
100 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101 pub fn customize(
102 self,
103 ) -> crate::client::customize::CustomizableOperation<
104 crate::operation::update_location_s3::UpdateLocationS3Output,
105 crate::operation::update_location_s3::UpdateLocationS3Error,
106 Self,
107 > {
108 crate::client::customize::CustomizableOperation::new(self)
109 }
110 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111 self.set_config_override(::std::option::Option::Some(config_override.into()));
112 self
113 }
114
115 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116 self.config_override = config_override;
117 self
118 }
119 /// <p>Specifies the Amazon Resource Name (ARN) of the Amazon S3 transfer location that you're updating.</p>
120 pub fn location_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.inner = self.inner.location_arn(input.into());
122 self
123 }
124 /// <p>Specifies the Amazon Resource Name (ARN) of the Amazon S3 transfer location that you're updating.</p>
125 pub fn set_location_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.inner = self.inner.set_location_arn(input);
127 self
128 }
129 /// <p>Specifies the Amazon Resource Name (ARN) of the Amazon S3 transfer location that you're updating.</p>
130 pub fn get_location_arn(&self) -> &::std::option::Option<::std::string::String> {
131 self.inner.get_location_arn()
132 }
133 /// <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>
134 /// <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>
135 /// <ul>
136 /// <li>
137 /// <p><code>/photos</code></p></li>
138 /// <li>
139 /// <p><code>photos//2006/January</code></p></li>
140 /// <li>
141 /// <p><code>photos/./2006/February</code></p></li>
142 /// <li>
143 /// <p><code>photos/../2006/March</code></p></li>
144 /// </ul>
145 /// </note>
146 pub fn subdirectory(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147 self.inner = self.inner.subdirectory(input.into());
148 self
149 }
150 /// <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>
151 /// <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>
152 /// <ul>
153 /// <li>
154 /// <p><code>/photos</code></p></li>
155 /// <li>
156 /// <p><code>photos//2006/January</code></p></li>
157 /// <li>
158 /// <p><code>photos/./2006/February</code></p></li>
159 /// <li>
160 /// <p><code>photos/../2006/March</code></p></li>
161 /// </ul>
162 /// </note>
163 pub fn set_subdirectory(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164 self.inner = self.inner.set_subdirectory(input);
165 self
166 }
167 /// <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>
168 /// <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>
169 /// <ul>
170 /// <li>
171 /// <p><code>/photos</code></p></li>
172 /// <li>
173 /// <p><code>photos//2006/January</code></p></li>
174 /// <li>
175 /// <p><code>photos/./2006/February</code></p></li>
176 /// <li>
177 /// <p><code>photos/../2006/March</code></p></li>
178 /// </ul>
179 /// </note>
180 pub fn get_subdirectory(&self) -> &::std::option::Option<::std::string::String> {
181 self.inner.get_subdirectory()
182 }
183 /// <p>Specifies the storage class that you want your objects to use when Amazon S3 is a transfer destination.</p>
184 /// <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>
185 /// <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>
186 pub fn s3_storage_class(mut self, input: crate::types::S3StorageClass) -> Self {
187 self.inner = self.inner.s3_storage_class(input);
188 self
189 }
190 /// <p>Specifies the storage class that you want your objects to use when Amazon S3 is a transfer destination.</p>
191 /// <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>
192 /// <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>
193 pub fn set_s3_storage_class(mut self, input: ::std::option::Option<crate::types::S3StorageClass>) -> Self {
194 self.inner = self.inner.set_s3_storage_class(input);
195 self
196 }
197 /// <p>Specifies the storage class that you want your objects to use when Amazon S3 is a transfer destination.</p>
198 /// <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>
199 /// <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>
200 pub fn get_s3_storage_class(&self) -> &::std::option::Option<crate::types::S3StorageClass> {
201 self.inner.get_s3_storage_class()
202 }
203 /// <p>Specifies the Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that DataSync uses to access your S3 bucket.</p>
204 /// <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>
205 pub fn s3_config(mut self, input: crate::types::S3Config) -> Self {
206 self.inner = self.inner.s3_config(input);
207 self
208 }
209 /// <p>Specifies the Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that DataSync uses to access your S3 bucket.</p>
210 /// <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>
211 pub fn set_s3_config(mut self, input: ::std::option::Option<crate::types::S3Config>) -> Self {
212 self.inner = self.inner.set_s3_config(input);
213 self
214 }
215 /// <p>Specifies the Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that DataSync uses to access your S3 bucket.</p>
216 /// <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>
217 pub fn get_s3_config(&self) -> &::std::option::Option<crate::types::S3Config> {
218 self.inner.get_s3_config()
219 }
220}