aws_sdk_transfer/operation/start_file_transfer/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_file_transfer::_start_file_transfer_output::StartFileTransferOutputBuilder;
3
4pub use crate::operation::start_file_transfer::_start_file_transfer_input::StartFileTransferInputBuilder;
5
6impl crate::operation::start_file_transfer::builders::StartFileTransferInputBuilder {
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::start_file_transfer::StartFileTransferOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_file_transfer::StartFileTransferError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_file_transfer();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartFileTransfer`.
24///
25/// <p>Begins a file transfer between local Amazon Web Services storage and a remote AS2 or SFTP server.</p>
26/// <ul>
27/// <li>
28/// <p>For an AS2 connector, you specify the <code>ConnectorId</code> and one or more <code>SendFilePaths</code> to identify the files you want to transfer.</p></li>
29/// <li>
30/// <p>For an SFTP connector, the file transfer can be either outbound or inbound. In both cases, you specify the <code>ConnectorId</code>. Depending on the direction of the transfer, you also specify the following items:</p>
31/// <ul>
32/// <li>
33/// <p>If you are transferring file from a partner's SFTP server to Amazon Web Services storage, you specify one or more <code>RetrieveFilePaths</code> to identify the files you want to transfer, and a <code>LocalDirectoryPath</code> to specify the destination folder.</p></li>
34/// <li>
35/// <p>If you are transferring file to a partner's SFTP server from Amazon Web Services storage, you specify one or more <code>SendFilePaths</code> to identify the files you want to transfer, and a <code>RemoteDirectoryPath</code> to specify the destination folder.</p></li>
36/// </ul></li>
37/// </ul>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct StartFileTransferFluentBuilder {
40    handle: ::std::sync::Arc<crate::client::Handle>,
41    inner: crate::operation::start_file_transfer::builders::StartFileTransferInputBuilder,
42    config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl
45    crate::client::customize::internal::CustomizableSend<
46        crate::operation::start_file_transfer::StartFileTransferOutput,
47        crate::operation::start_file_transfer::StartFileTransferError,
48    > for StartFileTransferFluentBuilder
49{
50    fn send(
51        self,
52        config_override: crate::config::Builder,
53    ) -> crate::client::customize::internal::BoxFuture<
54        crate::client::customize::internal::SendResult<
55            crate::operation::start_file_transfer::StartFileTransferOutput,
56            crate::operation::start_file_transfer::StartFileTransferError,
57        >,
58    > {
59        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
60    }
61}
62impl StartFileTransferFluentBuilder {
63    /// Creates a new `StartFileTransferFluentBuilder`.
64    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
65        Self {
66            handle,
67            inner: ::std::default::Default::default(),
68            config_override: ::std::option::Option::None,
69        }
70    }
71    /// Access the StartFileTransfer as a reference.
72    pub fn as_input(&self) -> &crate::operation::start_file_transfer::builders::StartFileTransferInputBuilder {
73        &self.inner
74    }
75    /// Sends the request and returns the response.
76    ///
77    /// If an error occurs, an `SdkError` will be returned with additional details that
78    /// can be matched against.
79    ///
80    /// By default, any retryable failures will be retried twice. Retry behavior
81    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
82    /// set when configuring the client.
83    pub async fn send(
84        self,
85    ) -> ::std::result::Result<
86        crate::operation::start_file_transfer::StartFileTransferOutput,
87        ::aws_smithy_runtime_api::client::result::SdkError<
88            crate::operation::start_file_transfer::StartFileTransferError,
89            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
90        >,
91    > {
92        let input = self
93            .inner
94            .build()
95            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
96        let runtime_plugins = crate::operation::start_file_transfer::StartFileTransfer::operation_runtime_plugins(
97            self.handle.runtime_plugins.clone(),
98            &self.handle.conf,
99            self.config_override,
100        );
101        crate::operation::start_file_transfer::StartFileTransfer::orchestrate(&runtime_plugins, input).await
102    }
103
104    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
105    pub fn customize(
106        self,
107    ) -> crate::client::customize::CustomizableOperation<
108        crate::operation::start_file_transfer::StartFileTransferOutput,
109        crate::operation::start_file_transfer::StartFileTransferError,
110        Self,
111    > {
112        crate::client::customize::CustomizableOperation::new(self)
113    }
114    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
115        self.set_config_override(::std::option::Option::Some(config_override.into()));
116        self
117    }
118
119    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
120        self.config_override = config_override;
121        self
122    }
123    /// <p>The unique identifier for the connector.</p>
124    pub fn connector_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.inner = self.inner.connector_id(input.into());
126        self
127    }
128    /// <p>The unique identifier for the connector.</p>
129    pub fn set_connector_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_connector_id(input);
131        self
132    }
133    /// <p>The unique identifier for the connector.</p>
134    pub fn get_connector_id(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_connector_id()
136    }
137    ///
138    /// Appends an item to `SendFilePaths`.
139    ///
140    /// To override the contents of this collection use [`set_send_file_paths`](Self::set_send_file_paths).
141    ///
142    /// <p>One or more source paths for the Amazon S3 storage. Each string represents a source file path for one outbound file transfer. For example, <code> <i>amzn-s3-demo-bucket</i>/<i>myfile.txt</i> </code>.</p><note>
143    /// <p>Replace <code> <i>amzn-s3-demo-bucket</i> </code> with one of your actual buckets.</p>
144    /// </note>
145    pub fn send_file_paths(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.inner = self.inner.send_file_paths(input.into());
147        self
148    }
149    /// <p>One or more source paths for the Amazon S3 storage. Each string represents a source file path for one outbound file transfer. For example, <code> <i>amzn-s3-demo-bucket</i>/<i>myfile.txt</i> </code>.</p><note>
150    /// <p>Replace <code> <i>amzn-s3-demo-bucket</i> </code> with one of your actual buckets.</p>
151    /// </note>
152    pub fn set_send_file_paths(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
153        self.inner = self.inner.set_send_file_paths(input);
154        self
155    }
156    /// <p>One or more source paths for the Amazon S3 storage. Each string represents a source file path for one outbound file transfer. For example, <code> <i>amzn-s3-demo-bucket</i>/<i>myfile.txt</i> </code>.</p><note>
157    /// <p>Replace <code> <i>amzn-s3-demo-bucket</i> </code> with one of your actual buckets.</p>
158    /// </note>
159    pub fn get_send_file_paths(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
160        self.inner.get_send_file_paths()
161    }
162    ///
163    /// Appends an item to `RetrieveFilePaths`.
164    ///
165    /// To override the contents of this collection use [`set_retrieve_file_paths`](Self::set_retrieve_file_paths).
166    ///
167    /// <p>One or more source paths for the partner's SFTP server. Each string represents a source file path for one inbound file transfer.</p>
168    pub fn retrieve_file_paths(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.retrieve_file_paths(input.into());
170        self
171    }
172    /// <p>One or more source paths for the partner's SFTP server. Each string represents a source file path for one inbound file transfer.</p>
173    pub fn set_retrieve_file_paths(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
174        self.inner = self.inner.set_retrieve_file_paths(input);
175        self
176    }
177    /// <p>One or more source paths for the partner's SFTP server. Each string represents a source file path for one inbound file transfer.</p>
178    pub fn get_retrieve_file_paths(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
179        self.inner.get_retrieve_file_paths()
180    }
181    /// <p>For an inbound transfer, the <code>LocaDirectoryPath</code> specifies the destination for one or more files that are transferred from the partner's SFTP server.</p>
182    pub fn local_directory_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.local_directory_path(input.into());
184        self
185    }
186    /// <p>For an inbound transfer, the <code>LocaDirectoryPath</code> specifies the destination for one or more files that are transferred from the partner's SFTP server.</p>
187    pub fn set_local_directory_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_local_directory_path(input);
189        self
190    }
191    /// <p>For an inbound transfer, the <code>LocaDirectoryPath</code> specifies the destination for one or more files that are transferred from the partner's SFTP server.</p>
192    pub fn get_local_directory_path(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_local_directory_path()
194    }
195    /// <p>For an outbound transfer, the <code>RemoteDirectoryPath</code> specifies the destination for one or more files that are transferred to the partner's SFTP server. If you don't specify a <code>RemoteDirectoryPath</code>, the destination for transferred files is the SFTP user's home directory.</p>
196    pub fn remote_directory_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.inner = self.inner.remote_directory_path(input.into());
198        self
199    }
200    /// <p>For an outbound transfer, the <code>RemoteDirectoryPath</code> specifies the destination for one or more files that are transferred to the partner's SFTP server. If you don't specify a <code>RemoteDirectoryPath</code>, the destination for transferred files is the SFTP user's home directory.</p>
201    pub fn set_remote_directory_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202        self.inner = self.inner.set_remote_directory_path(input);
203        self
204    }
205    /// <p>For an outbound transfer, the <code>RemoteDirectoryPath</code> specifies the destination for one or more files that are transferred to the partner's SFTP server. If you don't specify a <code>RemoteDirectoryPath</code>, the destination for transferred files is the SFTP user's home directory.</p>
206    pub fn get_remote_directory_path(&self) -> &::std::option::Option<::std::string::String> {
207        self.inner.get_remote_directory_path()
208    }
209}