aws_sdk_datasync/operation/create_location_object_storage/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_location_object_storage::_create_location_object_storage_output::CreateLocationObjectStorageOutputBuilder;
3
4pub use crate::operation::create_location_object_storage::_create_location_object_storage_input::CreateLocationObjectStorageInputBuilder;
5
6impl crate::operation::create_location_object_storage::builders::CreateLocationObjectStorageInputBuilder {
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_object_storage::CreateLocationObjectStorageOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_location_object_storage::CreateLocationObjectStorageError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_location_object_storage();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateLocationObjectStorage`.
24///
25/// <p>Creates a transfer <i>location</i> for an object storage system. DataSync can use this location as a source or destination for transferring data. You can make transfers with or without a <a href="https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#when-agent-required">DataSync agent</a>.</p>
26/// <p>Before you begin, make sure that you understand the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-object-location.html#create-object-location-prerequisites">prerequisites</a> for DataSync to work with object storage systems.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateLocationObjectStorageFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::create_location_object_storage::builders::CreateLocationObjectStorageInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::create_location_object_storage::CreateLocationObjectStorageOutput,
36 crate::operation::create_location_object_storage::CreateLocationObjectStorageError,
37 > for CreateLocationObjectStorageFluentBuilder
38{
39 fn send(
40 self,
41 config_override: crate::config::Builder,
42 ) -> crate::client::customize::internal::BoxFuture<
43 crate::client::customize::internal::SendResult<
44 crate::operation::create_location_object_storage::CreateLocationObjectStorageOutput,
45 crate::operation::create_location_object_storage::CreateLocationObjectStorageError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl CreateLocationObjectStorageFluentBuilder {
52 /// Creates a new `CreateLocationObjectStorageFluentBuilder`.
53 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54 Self {
55 handle,
56 inner: ::std::default::Default::default(),
57 config_override: ::std::option::Option::None,
58 }
59 }
60 /// Access the CreateLocationObjectStorage as a reference.
61 pub fn as_input(&self) -> &crate::operation::create_location_object_storage::builders::CreateLocationObjectStorageInputBuilder {
62 &self.inner
63 }
64 /// Sends the request and returns the response.
65 ///
66 /// If an error occurs, an `SdkError` will be returned with additional details that
67 /// can be matched against.
68 ///
69 /// By default, any retryable failures will be retried twice. Retry behavior
70 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71 /// set when configuring the client.
72 pub async fn send(
73 self,
74 ) -> ::std::result::Result<
75 crate::operation::create_location_object_storage::CreateLocationObjectStorageOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::create_location_object_storage::CreateLocationObjectStorageError,
78 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79 >,
80 > {
81 let input = self
82 .inner
83 .build()
84 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85 let runtime_plugins = crate::operation::create_location_object_storage::CreateLocationObjectStorage::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::create_location_object_storage::CreateLocationObjectStorage::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::create_location_object_storage::CreateLocationObjectStorageOutput,
98 crate::operation::create_location_object_storage::CreateLocationObjectStorageError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 /// <p>Specifies the domain name or IP address (IPv4 or IPv6) of the object storage server that your DataSync agent connects to.</p>
113 pub fn server_hostname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.inner = self.inner.server_hostname(input.into());
115 self
116 }
117 /// <p>Specifies the domain name or IP address (IPv4 or IPv6) of the object storage server that your DataSync agent connects to.</p>
118 pub fn set_server_hostname(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.inner = self.inner.set_server_hostname(input);
120 self
121 }
122 /// <p>Specifies the domain name or IP address (IPv4 or IPv6) of the object storage server that your DataSync agent connects to.</p>
123 pub fn get_server_hostname(&self) -> &::std::option::Option<::std::string::String> {
124 self.inner.get_server_hostname()
125 }
126 /// <p>Specifies the port that your object storage server accepts inbound network traffic on (for example, port 443).</p>
127 pub fn server_port(mut self, input: i32) -> Self {
128 self.inner = self.inner.server_port(input);
129 self
130 }
131 /// <p>Specifies the port that your object storage server accepts inbound network traffic on (for example, port 443).</p>
132 pub fn set_server_port(mut self, input: ::std::option::Option<i32>) -> Self {
133 self.inner = self.inner.set_server_port(input);
134 self
135 }
136 /// <p>Specifies the port that your object storage server accepts inbound network traffic on (for example, port 443).</p>
137 pub fn get_server_port(&self) -> &::std::option::Option<i32> {
138 self.inner.get_server_port()
139 }
140 /// <p>Specifies the protocol that your object storage server uses to communicate. If not specified, the default value is <code>HTTPS</code>.</p>
141 pub fn server_protocol(mut self, input: crate::types::ObjectStorageServerProtocol) -> Self {
142 self.inner = self.inner.server_protocol(input);
143 self
144 }
145 /// <p>Specifies the protocol that your object storage server uses to communicate. If not specified, the default value is <code>HTTPS</code>.</p>
146 pub fn set_server_protocol(mut self, input: ::std::option::Option<crate::types::ObjectStorageServerProtocol>) -> Self {
147 self.inner = self.inner.set_server_protocol(input);
148 self
149 }
150 /// <p>Specifies the protocol that your object storage server uses to communicate. If not specified, the default value is <code>HTTPS</code>.</p>
151 pub fn get_server_protocol(&self) -> &::std::option::Option<crate::types::ObjectStorageServerProtocol> {
152 self.inner.get_server_protocol()
153 }
154 /// <p>Specifies the object prefix for your object storage server. If this is a source location, DataSync only copies objects with this prefix. If this is a destination location, DataSync writes all objects with this prefix.</p>
155 pub fn subdirectory(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156 self.inner = self.inner.subdirectory(input.into());
157 self
158 }
159 /// <p>Specifies the object prefix for your object storage server. If this is a source location, DataSync only copies objects with this prefix. If this is a destination location, DataSync writes all objects with this prefix.</p>
160 pub fn set_subdirectory(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161 self.inner = self.inner.set_subdirectory(input);
162 self
163 }
164 /// <p>Specifies the object prefix for your object storage server. If this is a source location, DataSync only copies objects with this prefix. If this is a destination location, DataSync writes all objects with this prefix.</p>
165 pub fn get_subdirectory(&self) -> &::std::option::Option<::std::string::String> {
166 self.inner.get_subdirectory()
167 }
168 /// <p>Specifies the name of the object storage bucket involved in the transfer.</p>
169 pub fn bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170 self.inner = self.inner.bucket_name(input.into());
171 self
172 }
173 /// <p>Specifies the name of the object storage bucket involved in the transfer.</p>
174 pub fn set_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175 self.inner = self.inner.set_bucket_name(input);
176 self
177 }
178 /// <p>Specifies the name of the object storage bucket involved in the transfer.</p>
179 pub fn get_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
180 self.inner.get_bucket_name()
181 }
182 /// <p>Specifies the access key (for example, a user name) if credentials are required to authenticate with the object storage server.</p>
183 pub fn access_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184 self.inner = self.inner.access_key(input.into());
185 self
186 }
187 /// <p>Specifies the access key (for example, a user name) if credentials are required to authenticate with the object storage server.</p>
188 pub fn set_access_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189 self.inner = self.inner.set_access_key(input);
190 self
191 }
192 /// <p>Specifies the access key (for example, a user name) if credentials are required to authenticate with the object storage server.</p>
193 pub fn get_access_key(&self) -> &::std::option::Option<::std::string::String> {
194 self.inner.get_access_key()
195 }
196 /// <p>Specifies the secret key (for example, a password) if credentials are required to authenticate with the object storage server.</p><note>
197 /// <p>If you provide a secret using <code>SecretKey</code>, but do not provide secret configuration details using <code>CmkSecretConfig</code> or <code>CustomSecretConfig</code>, then DataSync stores the token using your Amazon Web Services account's Secrets Manager secret.</p>
198 /// </note>
199 pub fn secret_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200 self.inner = self.inner.secret_key(input.into());
201 self
202 }
203 /// <p>Specifies the secret key (for example, a password) if credentials are required to authenticate with the object storage server.</p><note>
204 /// <p>If you provide a secret using <code>SecretKey</code>, but do not provide secret configuration details using <code>CmkSecretConfig</code> or <code>CustomSecretConfig</code>, then DataSync stores the token using your Amazon Web Services account's Secrets Manager secret.</p>
205 /// </note>
206 pub fn set_secret_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207 self.inner = self.inner.set_secret_key(input);
208 self
209 }
210 /// <p>Specifies the secret key (for example, a password) if credentials are required to authenticate with the object storage server.</p><note>
211 /// <p>If you provide a secret using <code>SecretKey</code>, but do not provide secret configuration details using <code>CmkSecretConfig</code> or <code>CustomSecretConfig</code>, then DataSync stores the token using your Amazon Web Services account's Secrets Manager secret.</p>
212 /// </note>
213 pub fn get_secret_key(&self) -> &::std::option::Option<::std::string::String> {
214 self.inner.get_secret_key()
215 }
216 ///
217 /// Appends an item to `AgentArns`.
218 ///
219 /// To override the contents of this collection use [`set_agent_arns`](Self::set_agent_arns).
220 ///
221 /// <p>(Optional) Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can connect with your object storage system. If you are setting up an agentless cross-cloud transfer, you do not need to specify a value for this parameter.</p><note>
222 /// <p>Make sure you configure this parameter correctly when you first create your storage location. You cannot add or remove agents from a storage location after you create it.</p>
223 /// </note>
224 pub fn agent_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
225 self.inner = self.inner.agent_arns(input.into());
226 self
227 }
228 /// <p>(Optional) Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can connect with your object storage system. If you are setting up an agentless cross-cloud transfer, you do not need to specify a value for this parameter.</p><note>
229 /// <p>Make sure you configure this parameter correctly when you first create your storage location. You cannot add or remove agents from a storage location after you create it.</p>
230 /// </note>
231 pub fn set_agent_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
232 self.inner = self.inner.set_agent_arns(input);
233 self
234 }
235 /// <p>(Optional) Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can connect with your object storage system. If you are setting up an agentless cross-cloud transfer, you do not need to specify a value for this parameter.</p><note>
236 /// <p>Make sure you configure this parameter correctly when you first create your storage location. You cannot add or remove agents from a storage location after you create it.</p>
237 /// </note>
238 pub fn get_agent_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
239 self.inner.get_agent_arns()
240 }
241 ///
242 /// Appends an item to `Tags`.
243 ///
244 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
245 ///
246 /// <p>Specifies the key-value pair that represents a tag that you want to add to the resource. Tags can help you manage, filter, and search for your resources. We recommend creating a name tag for your location.</p>
247 pub fn tags(mut self, input: crate::types::TagListEntry) -> Self {
248 self.inner = self.inner.tags(input);
249 self
250 }
251 /// <p>Specifies the key-value pair that represents a tag that you want to add to the resource. Tags can help you manage, filter, and search for your resources. We recommend creating a name tag for your location.</p>
252 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>>) -> Self {
253 self.inner = self.inner.set_tags(input);
254 self
255 }
256 /// <p>Specifies the key-value pair that represents a tag that you want to add to the resource. Tags can help you manage, filter, and search for your resources. We recommend creating a name tag for your location.</p>
257 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>> {
258 self.inner.get_tags()
259 }
260 /// <p>Specifies a certificate chain for DataSync to authenticate with your object storage system if the system uses a private or self-signed certificate authority (CA). You must specify a single <code>.pem</code> file with a full certificate chain (for example, <code>file:///home/user/.ssh/object_storage_certificates.pem</code>).</p>
261 /// <p>The certificate chain might include:</p>
262 /// <ul>
263 /// <li>
264 /// <p>The object storage system's certificate</p></li>
265 /// <li>
266 /// <p>All intermediate certificates (if there are any)</p></li>
267 /// <li>
268 /// <p>The root certificate of the signing CA</p></li>
269 /// </ul>
270 /// <p>You can concatenate your certificates into a <code>.pem</code> file (which can be up to 32768 bytes before base64 encoding). The following example <code>cat</code> command creates an <code>object_storage_certificates.pem</code> file that includes three certificates:</p>
271 /// <p><code>cat object_server_certificate.pem intermediate_certificate.pem ca_root_certificate.pem > object_storage_certificates.pem</code></p>
272 /// <p>To use this parameter, configure <code>ServerProtocol</code> to <code>HTTPS</code>.</p>
273 pub fn server_certificate(mut self, input: ::aws_smithy_types::Blob) -> Self {
274 self.inner = self.inner.server_certificate(input);
275 self
276 }
277 /// <p>Specifies a certificate chain for DataSync to authenticate with your object storage system if the system uses a private or self-signed certificate authority (CA). You must specify a single <code>.pem</code> file with a full certificate chain (for example, <code>file:///home/user/.ssh/object_storage_certificates.pem</code>).</p>
278 /// <p>The certificate chain might include:</p>
279 /// <ul>
280 /// <li>
281 /// <p>The object storage system's certificate</p></li>
282 /// <li>
283 /// <p>All intermediate certificates (if there are any)</p></li>
284 /// <li>
285 /// <p>The root certificate of the signing CA</p></li>
286 /// </ul>
287 /// <p>You can concatenate your certificates into a <code>.pem</code> file (which can be up to 32768 bytes before base64 encoding). The following example <code>cat</code> command creates an <code>object_storage_certificates.pem</code> file that includes three certificates:</p>
288 /// <p><code>cat object_server_certificate.pem intermediate_certificate.pem ca_root_certificate.pem > object_storage_certificates.pem</code></p>
289 /// <p>To use this parameter, configure <code>ServerProtocol</code> to <code>HTTPS</code>.</p>
290 pub fn set_server_certificate(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
291 self.inner = self.inner.set_server_certificate(input);
292 self
293 }
294 /// <p>Specifies a certificate chain for DataSync to authenticate with your object storage system if the system uses a private or self-signed certificate authority (CA). You must specify a single <code>.pem</code> file with a full certificate chain (for example, <code>file:///home/user/.ssh/object_storage_certificates.pem</code>).</p>
295 /// <p>The certificate chain might include:</p>
296 /// <ul>
297 /// <li>
298 /// <p>The object storage system's certificate</p></li>
299 /// <li>
300 /// <p>All intermediate certificates (if there are any)</p></li>
301 /// <li>
302 /// <p>The root certificate of the signing CA</p></li>
303 /// </ul>
304 /// <p>You can concatenate your certificates into a <code>.pem</code> file (which can be up to 32768 bytes before base64 encoding). The following example <code>cat</code> command creates an <code>object_storage_certificates.pem</code> file that includes three certificates:</p>
305 /// <p><code>cat object_server_certificate.pem intermediate_certificate.pem ca_root_certificate.pem > object_storage_certificates.pem</code></p>
306 /// <p>To use this parameter, configure <code>ServerProtocol</code> to <code>HTTPS</code>.</p>
307 pub fn get_server_certificate(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
308 self.inner.get_server_certificate()
309 }
310 /// <p>Specifies configuration information for a DataSync-managed secret, which includes the <code>SecretKey</code> that DataSync uses to access a specific object storage location, with a customer-managed KMS key.</p>
311 /// <p>When you include this paramater as part of a <code>CreateLocationObjectStorage</code> request, you provide only the KMS key ARN. DataSync uses this KMS key together with the value you specify for the <code>SecretKey</code> parameter to create a DataSync-managed secret to store the location access credentials.</p>
312 /// <p>Make sure the DataSync has permission to access the KMS key that you specify.</p><note>
313 /// <p>You can use either <code>CmkSecretConfig</code> (with <code>SecretKey</code>) or <code>CustomSecretConfig</code> (without <code>SecretKey</code>) to provide credentials for a <code>CreateLocationObjectStorage</code> request. Do not provide both parameters for the same request.</p>
314 /// </note>
315 pub fn cmk_secret_config(mut self, input: crate::types::CmkSecretConfig) -> Self {
316 self.inner = self.inner.cmk_secret_config(input);
317 self
318 }
319 /// <p>Specifies configuration information for a DataSync-managed secret, which includes the <code>SecretKey</code> that DataSync uses to access a specific object storage location, with a customer-managed KMS key.</p>
320 /// <p>When you include this paramater as part of a <code>CreateLocationObjectStorage</code> request, you provide only the KMS key ARN. DataSync uses this KMS key together with the value you specify for the <code>SecretKey</code> parameter to create a DataSync-managed secret to store the location access credentials.</p>
321 /// <p>Make sure the DataSync has permission to access the KMS key that you specify.</p><note>
322 /// <p>You can use either <code>CmkSecretConfig</code> (with <code>SecretKey</code>) or <code>CustomSecretConfig</code> (without <code>SecretKey</code>) to provide credentials for a <code>CreateLocationObjectStorage</code> request. Do not provide both parameters for the same request.</p>
323 /// </note>
324 pub fn set_cmk_secret_config(mut self, input: ::std::option::Option<crate::types::CmkSecretConfig>) -> Self {
325 self.inner = self.inner.set_cmk_secret_config(input);
326 self
327 }
328 /// <p>Specifies configuration information for a DataSync-managed secret, which includes the <code>SecretKey</code> that DataSync uses to access a specific object storage location, with a customer-managed KMS key.</p>
329 /// <p>When you include this paramater as part of a <code>CreateLocationObjectStorage</code> request, you provide only the KMS key ARN. DataSync uses this KMS key together with the value you specify for the <code>SecretKey</code> parameter to create a DataSync-managed secret to store the location access credentials.</p>
330 /// <p>Make sure the DataSync has permission to access the KMS key that you specify.</p><note>
331 /// <p>You can use either <code>CmkSecretConfig</code> (with <code>SecretKey</code>) or <code>CustomSecretConfig</code> (without <code>SecretKey</code>) to provide credentials for a <code>CreateLocationObjectStorage</code> request. Do not provide both parameters for the same request.</p>
332 /// </note>
333 pub fn get_cmk_secret_config(&self) -> &::std::option::Option<crate::types::CmkSecretConfig> {
334 self.inner.get_cmk_secret_config()
335 }
336 /// <p>Specifies configuration information for a customer-managed Secrets Manager secret where the secret key for a specific object storage location is stored in plain text. This configuration includes the secret ARN, and the ARN for an IAM role that provides access to the secret.</p><note>
337 /// <p>You can use either <code>CmkSecretConfig</code> (with <code>SecretKey</code>) or <code>CustomSecretConfig</code> (without <code>SecretKey</code>) to provide credentials for a <code>CreateLocationObjectStorage</code> request. Do not provide both parameters for the same request.</p>
338 /// </note>
339 pub fn custom_secret_config(mut self, input: crate::types::CustomSecretConfig) -> Self {
340 self.inner = self.inner.custom_secret_config(input);
341 self
342 }
343 /// <p>Specifies configuration information for a customer-managed Secrets Manager secret where the secret key for a specific object storage location is stored in plain text. This configuration includes the secret ARN, and the ARN for an IAM role that provides access to the secret.</p><note>
344 /// <p>You can use either <code>CmkSecretConfig</code> (with <code>SecretKey</code>) or <code>CustomSecretConfig</code> (without <code>SecretKey</code>) to provide credentials for a <code>CreateLocationObjectStorage</code> request. Do not provide both parameters for the same request.</p>
345 /// </note>
346 pub fn set_custom_secret_config(mut self, input: ::std::option::Option<crate::types::CustomSecretConfig>) -> Self {
347 self.inner = self.inner.set_custom_secret_config(input);
348 self
349 }
350 /// <p>Specifies configuration information for a customer-managed Secrets Manager secret where the secret key for a specific object storage location is stored in plain text. This configuration includes the secret ARN, and the ARN for an IAM role that provides access to the secret.</p><note>
351 /// <p>You can use either <code>CmkSecretConfig</code> (with <code>SecretKey</code>) or <code>CustomSecretConfig</code> (without <code>SecretKey</code>) to provide credentials for a <code>CreateLocationObjectStorage</code> request. Do not provide both parameters for the same request.</p>
352 /// </note>
353 pub fn get_custom_secret_config(&self) -> &::std::option::Option<crate::types::CustomSecretConfig> {
354 self.inner.get_custom_secret_config()
355 }
356}