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 version 4 (IPv4) address 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 version 4 (IPv4) address 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 version 4 (IPv4) address 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.</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.</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.</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>
197 pub fn secret_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198 self.inner = self.inner.secret_key(input.into());
199 self
200 }
201 /// <p>Specifies the secret key (for example, a password) if credentials are required to authenticate with the object storage server.</p>
202 pub fn set_secret_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203 self.inner = self.inner.set_secret_key(input);
204 self
205 }
206 /// <p>Specifies the secret key (for example, a password) if credentials are required to authenticate with the object storage server.</p>
207 pub fn get_secret_key(&self) -> &::std::option::Option<::std::string::String> {
208 self.inner.get_secret_key()
209 }
210 ///
211 /// Appends an item to `AgentArns`.
212 ///
213 /// To override the contents of this collection use [`set_agent_arns`](Self::set_agent_arns).
214 ///
215 /// <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>
216 /// <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>
217 /// </note>
218 pub fn agent_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
219 self.inner = self.inner.agent_arns(input.into());
220 self
221 }
222 /// <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>
223 /// <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>
224 /// </note>
225 pub fn set_agent_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
226 self.inner = self.inner.set_agent_arns(input);
227 self
228 }
229 /// <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>
230 /// <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>
231 /// </note>
232 pub fn get_agent_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
233 self.inner.get_agent_arns()
234 }
235 ///
236 /// Appends an item to `Tags`.
237 ///
238 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
239 ///
240 /// <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>
241 pub fn tags(mut self, input: crate::types::TagListEntry) -> Self {
242 self.inner = self.inner.tags(input);
243 self
244 }
245 /// <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>
246 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>>) -> Self {
247 self.inner = self.inner.set_tags(input);
248 self
249 }
250 /// <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>
251 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>> {
252 self.inner.get_tags()
253 }
254 /// <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>
255 /// <p>The certificate chain might include:</p>
256 /// <ul>
257 /// <li>
258 /// <p>The object storage system's certificate</p></li>
259 /// <li>
260 /// <p>All intermediate certificates (if there are any)</p></li>
261 /// <li>
262 /// <p>The root certificate of the signing CA</p></li>
263 /// </ul>
264 /// <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>
265 /// <p><code>cat object_server_certificate.pem intermediate_certificate.pem ca_root_certificate.pem > object_storage_certificates.pem</code></p>
266 /// <p>To use this parameter, configure <code>ServerProtocol</code> to <code>HTTPS</code>.</p>
267 pub fn server_certificate(mut self, input: ::aws_smithy_types::Blob) -> Self {
268 self.inner = self.inner.server_certificate(input);
269 self
270 }
271 /// <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>
272 /// <p>The certificate chain might include:</p>
273 /// <ul>
274 /// <li>
275 /// <p>The object storage system's certificate</p></li>
276 /// <li>
277 /// <p>All intermediate certificates (if there are any)</p></li>
278 /// <li>
279 /// <p>The root certificate of the signing CA</p></li>
280 /// </ul>
281 /// <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>
282 /// <p><code>cat object_server_certificate.pem intermediate_certificate.pem ca_root_certificate.pem > object_storage_certificates.pem</code></p>
283 /// <p>To use this parameter, configure <code>ServerProtocol</code> to <code>HTTPS</code>.</p>
284 pub fn set_server_certificate(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
285 self.inner = self.inner.set_server_certificate(input);
286 self
287 }
288 /// <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>
289 /// <p>The certificate chain might include:</p>
290 /// <ul>
291 /// <li>
292 /// <p>The object storage system's certificate</p></li>
293 /// <li>
294 /// <p>All intermediate certificates (if there are any)</p></li>
295 /// <li>
296 /// <p>The root certificate of the signing CA</p></li>
297 /// </ul>
298 /// <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>
299 /// <p><code>cat object_server_certificate.pem intermediate_certificate.pem ca_root_certificate.pem > object_storage_certificates.pem</code></p>
300 /// <p>To use this parameter, configure <code>ServerProtocol</code> to <code>HTTPS</code>.</p>
301 pub fn get_server_certificate(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
302 self.inner.get_server_certificate()
303 }
304 /// <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>
305 /// <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>
306 /// <p>Make sure the DataSync has permission to access the KMS key that you specify.</p><note>
307 /// <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>
308 /// </note>
309 pub fn cmk_secret_config(mut self, input: crate::types::CmkSecretConfig) -> Self {
310 self.inner = self.inner.cmk_secret_config(input);
311 self
312 }
313 /// <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>
314 /// <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>
315 /// <p>Make sure the DataSync has permission to access the KMS key that you specify.</p><note>
316 /// <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>
317 /// </note>
318 pub fn set_cmk_secret_config(mut self, input: ::std::option::Option<crate::types::CmkSecretConfig>) -> Self {
319 self.inner = self.inner.set_cmk_secret_config(input);
320 self
321 }
322 /// <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>
323 /// <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>
324 /// <p>Make sure the DataSync has permission to access the KMS key that you specify.</p><note>
325 /// <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>
326 /// </note>
327 pub fn get_cmk_secret_config(&self) -> &::std::option::Option<crate::types::CmkSecretConfig> {
328 self.inner.get_cmk_secret_config()
329 }
330 /// <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>
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 custom_secret_config(mut self, input: crate::types::CustomSecretConfig) -> Self {
334 self.inner = self.inner.custom_secret_config(input);
335 self
336 }
337 /// <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>
338 /// <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>
339 /// </note>
340 pub fn set_custom_secret_config(mut self, input: ::std::option::Option<crate::types::CustomSecretConfig>) -> Self {
341 self.inner = self.inner.set_custom_secret_config(input);
342 self
343 }
344 /// <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>
345 /// <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>
346 /// </note>
347 pub fn get_custom_secret_config(&self) -> &::std::option::Option<crate::types::CustomSecretConfig> {
348 self.inner.get_custom_secret_config()
349 }
350}