aws_sdk_transfer/operation/create_connector/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_connector::_create_connector_output::CreateConnectorOutputBuilder;
3
4pub use crate::operation::create_connector::_create_connector_input::CreateConnectorInputBuilder;
5
6impl crate::operation::create_connector::builders::CreateConnectorInputBuilder {
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_connector::CreateConnectorOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_connector::CreateConnectorError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_connector();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateConnector`.
24///
25/// <p>Creates the connector, which captures the parameters for a connection for the AS2 or SFTP protocol. For AS2, the connector is required for sending files to an externally hosted AS2 server. For SFTP, the connector is required when sending files to an SFTP server or receiving files from an SFTP server. For more details about connectors, see <a href="https://docs.aws.amazon.com/transfer/latest/userguide/configure-as2-connector.html">Configure AS2 connectors</a> and <a href="https://docs.aws.amazon.com/transfer/latest/userguide/configure-sftp-connector.html">Create SFTP connectors</a>.</p><note>
26/// <p>You must specify exactly one configuration object: either for AS2 (<code>As2Config</code>) or SFTP (<code>SftpConfig</code>).</p>
27/// </note>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateConnectorFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::create_connector::builders::CreateConnectorInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::create_connector::CreateConnectorOutput,
37 crate::operation::create_connector::CreateConnectorError,
38 > for CreateConnectorFluentBuilder
39{
40 fn send(
41 self,
42 config_override: crate::config::Builder,
43 ) -> crate::client::customize::internal::BoxFuture<
44 crate::client::customize::internal::SendResult<
45 crate::operation::create_connector::CreateConnectorOutput,
46 crate::operation::create_connector::CreateConnectorError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl CreateConnectorFluentBuilder {
53 /// Creates a new `CreateConnectorFluentBuilder`.
54 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55 Self {
56 handle,
57 inner: ::std::default::Default::default(),
58 config_override: ::std::option::Option::None,
59 }
60 }
61 /// Access the CreateConnector as a reference.
62 pub fn as_input(&self) -> &crate::operation::create_connector::builders::CreateConnectorInputBuilder {
63 &self.inner
64 }
65 /// Sends the request and returns the response.
66 ///
67 /// If an error occurs, an `SdkError` will be returned with additional details that
68 /// can be matched against.
69 ///
70 /// By default, any retryable failures will be retried twice. Retry behavior
71 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72 /// set when configuring the client.
73 pub async fn send(
74 self,
75 ) -> ::std::result::Result<
76 crate::operation::create_connector::CreateConnectorOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::create_connector::CreateConnectorError,
79 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80 >,
81 > {
82 let input = self
83 .inner
84 .build()
85 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86 let runtime_plugins = crate::operation::create_connector::CreateConnector::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::create_connector::CreateConnector::orchestrate(&runtime_plugins, input).await
92 }
93
94 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95 pub fn customize(
96 self,
97 ) -> crate::client::customize::CustomizableOperation<
98 crate::operation::create_connector::CreateConnectorOutput,
99 crate::operation::create_connector::CreateConnectorError,
100 Self,
101 > {
102 crate::client::customize::CustomizableOperation::new(self)
103 }
104 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105 self.set_config_override(::std::option::Option::Some(config_override.into()));
106 self
107 }
108
109 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110 self.config_override = config_override;
111 self
112 }
113 /// <p>The URL of the partner's AS2 or SFTP endpoint.</p>
114 /// <p>When creating AS2 connectors or service-managed SFTP connectors (connectors without egress configuration), you must provide a URL to specify the remote server endpoint. For VPC Lattice type connectors, the URL must be null.</p>
115 pub fn url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.url(input.into());
117 self
118 }
119 /// <p>The URL of the partner's AS2 or SFTP endpoint.</p>
120 /// <p>When creating AS2 connectors or service-managed SFTP connectors (connectors without egress configuration), you must provide a URL to specify the remote server endpoint. For VPC Lattice type connectors, the URL must be null.</p>
121 pub fn set_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.inner = self.inner.set_url(input);
123 self
124 }
125 /// <p>The URL of the partner's AS2 or SFTP endpoint.</p>
126 /// <p>When creating AS2 connectors or service-managed SFTP connectors (connectors without egress configuration), you must provide a URL to specify the remote server endpoint. For VPC Lattice type connectors, the URL must be null.</p>
127 pub fn get_url(&self) -> &::std::option::Option<::std::string::String> {
128 self.inner.get_url()
129 }
130 /// <p>A structure that contains the parameters for an AS2 connector object.</p>
131 pub fn as2_config(mut self, input: crate::types::As2ConnectorConfig) -> Self {
132 self.inner = self.inner.as2_config(input);
133 self
134 }
135 /// <p>A structure that contains the parameters for an AS2 connector object.</p>
136 pub fn set_as2_config(mut self, input: ::std::option::Option<crate::types::As2ConnectorConfig>) -> Self {
137 self.inner = self.inner.set_as2_config(input);
138 self
139 }
140 /// <p>A structure that contains the parameters for an AS2 connector object.</p>
141 pub fn get_as2_config(&self) -> &::std::option::Option<crate::types::As2ConnectorConfig> {
142 self.inner.get_as2_config()
143 }
144 /// <p>Connectors are used to send files using either the AS2 or SFTP protocol. For the access role, provide the Amazon Resource Name (ARN) of the Identity and Access Management role to use.</p>
145 /// <p><b>For AS2 connectors</b></p>
146 /// <p>With AS2, you can send files by calling <code>StartFileTransfer</code> and specifying the file paths in the request parameter, <code>SendFilePaths</code>. We use the file’s parent directory (for example, for <code>--send-file-paths /bucket/dir/file.txt</code>, parent directory is <code>/bucket/dir/</code>) to temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and write a final JSON file containing relevant metadata of the transmission. So, the <code>AccessRole</code> needs to provide read and write access to the parent directory of the file location used in the <code>StartFileTransfer</code> request. Additionally, you need to provide read and write access to the parent directory of the files that you intend to send with <code>StartFileTransfer</code>.</p>
147 /// <p>If you are using Basic authentication for your AS2 connector, the access role requires the <code>secretsmanager:GetSecretValue</code> permission for the secret. If the secret is encrypted using a customer-managed key instead of the Amazon Web Services managed key in Secrets Manager, then the role also needs the <code>kms:Decrypt</code> permission for that key.</p>
148 /// <p><b>For SFTP connectors</b></p>
149 /// <p>Make sure that the access role provides read and write access to the parent directory of the file location that's used in the <code>StartFileTransfer</code> request. Additionally, make sure that the role provides <code>secretsmanager:GetSecretValue</code> permission to Secrets Manager.</p>
150 pub fn access_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.inner = self.inner.access_role(input.into());
152 self
153 }
154 /// <p>Connectors are used to send files using either the AS2 or SFTP protocol. For the access role, provide the Amazon Resource Name (ARN) of the Identity and Access Management role to use.</p>
155 /// <p><b>For AS2 connectors</b></p>
156 /// <p>With AS2, you can send files by calling <code>StartFileTransfer</code> and specifying the file paths in the request parameter, <code>SendFilePaths</code>. We use the file’s parent directory (for example, for <code>--send-file-paths /bucket/dir/file.txt</code>, parent directory is <code>/bucket/dir/</code>) to temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and write a final JSON file containing relevant metadata of the transmission. So, the <code>AccessRole</code> needs to provide read and write access to the parent directory of the file location used in the <code>StartFileTransfer</code> request. Additionally, you need to provide read and write access to the parent directory of the files that you intend to send with <code>StartFileTransfer</code>.</p>
157 /// <p>If you are using Basic authentication for your AS2 connector, the access role requires the <code>secretsmanager:GetSecretValue</code> permission for the secret. If the secret is encrypted using a customer-managed key instead of the Amazon Web Services managed key in Secrets Manager, then the role also needs the <code>kms:Decrypt</code> permission for that key.</p>
158 /// <p><b>For SFTP connectors</b></p>
159 /// <p>Make sure that the access role provides read and write access to the parent directory of the file location that's used in the <code>StartFileTransfer</code> request. Additionally, make sure that the role provides <code>secretsmanager:GetSecretValue</code> permission to Secrets Manager.</p>
160 pub fn set_access_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161 self.inner = self.inner.set_access_role(input);
162 self
163 }
164 /// <p>Connectors are used to send files using either the AS2 or SFTP protocol. For the access role, provide the Amazon Resource Name (ARN) of the Identity and Access Management role to use.</p>
165 /// <p><b>For AS2 connectors</b></p>
166 /// <p>With AS2, you can send files by calling <code>StartFileTransfer</code> and specifying the file paths in the request parameter, <code>SendFilePaths</code>. We use the file’s parent directory (for example, for <code>--send-file-paths /bucket/dir/file.txt</code>, parent directory is <code>/bucket/dir/</code>) to temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and write a final JSON file containing relevant metadata of the transmission. So, the <code>AccessRole</code> needs to provide read and write access to the parent directory of the file location used in the <code>StartFileTransfer</code> request. Additionally, you need to provide read and write access to the parent directory of the files that you intend to send with <code>StartFileTransfer</code>.</p>
167 /// <p>If you are using Basic authentication for your AS2 connector, the access role requires the <code>secretsmanager:GetSecretValue</code> permission for the secret. If the secret is encrypted using a customer-managed key instead of the Amazon Web Services managed key in Secrets Manager, then the role also needs the <code>kms:Decrypt</code> permission for that key.</p>
168 /// <p><b>For SFTP connectors</b></p>
169 /// <p>Make sure that the access role provides read and write access to the parent directory of the file location that's used in the <code>StartFileTransfer</code> request. Additionally, make sure that the role provides <code>secretsmanager:GetSecretValue</code> permission to Secrets Manager.</p>
170 pub fn get_access_role(&self) -> &::std::option::Option<::std::string::String> {
171 self.inner.get_access_role()
172 }
173 /// <p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that allows a connector to turn on CloudWatch logging for Amazon S3 events. When set, you can view connector activity in your CloudWatch logs.</p>
174 pub fn logging_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175 self.inner = self.inner.logging_role(input.into());
176 self
177 }
178 /// <p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that allows a connector to turn on CloudWatch logging for Amazon S3 events. When set, you can view connector activity in your CloudWatch logs.</p>
179 pub fn set_logging_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180 self.inner = self.inner.set_logging_role(input);
181 self
182 }
183 /// <p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that allows a connector to turn on CloudWatch logging for Amazon S3 events. When set, you can view connector activity in your CloudWatch logs.</p>
184 pub fn get_logging_role(&self) -> &::std::option::Option<::std::string::String> {
185 self.inner.get_logging_role()
186 }
187 ///
188 /// Appends an item to `Tags`.
189 ///
190 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
191 ///
192 /// <p>Key-value pairs that can be used to group and search for connectors. Tags are metadata attached to connectors for any purpose.</p>
193 pub fn tags(mut self, input: crate::types::Tag) -> Self {
194 self.inner = self.inner.tags(input);
195 self
196 }
197 /// <p>Key-value pairs that can be used to group and search for connectors. Tags are metadata attached to connectors for any purpose.</p>
198 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
199 self.inner = self.inner.set_tags(input);
200 self
201 }
202 /// <p>Key-value pairs that can be used to group and search for connectors. Tags are metadata attached to connectors for any purpose.</p>
203 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
204 self.inner.get_tags()
205 }
206 /// <p>A structure that contains the parameters for an SFTP connector object.</p>
207 pub fn sftp_config(mut self, input: crate::types::SftpConnectorConfig) -> Self {
208 self.inner = self.inner.sftp_config(input);
209 self
210 }
211 /// <p>A structure that contains the parameters for an SFTP connector object.</p>
212 pub fn set_sftp_config(mut self, input: ::std::option::Option<crate::types::SftpConnectorConfig>) -> Self {
213 self.inner = self.inner.set_sftp_config(input);
214 self
215 }
216 /// <p>A structure that contains the parameters for an SFTP connector object.</p>
217 pub fn get_sftp_config(&self) -> &::std::option::Option<crate::types::SftpConnectorConfig> {
218 self.inner.get_sftp_config()
219 }
220 /// <p>Specifies the name of the security policy for the connector.</p>
221 pub fn security_policy_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
222 self.inner = self.inner.security_policy_name(input.into());
223 self
224 }
225 /// <p>Specifies the name of the security policy for the connector.</p>
226 pub fn set_security_policy_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
227 self.inner = self.inner.set_security_policy_name(input);
228 self
229 }
230 /// <p>Specifies the name of the security policy for the connector.</p>
231 pub fn get_security_policy_name(&self) -> &::std::option::Option<::std::string::String> {
232 self.inner.get_security_policy_name()
233 }
234 /// <p>Specifies the egress configuration for the connector, which determines how traffic is routed from the connector to the SFTP server. When set to VPC, enables routing through customer VPCs using VPC_LATTICE for private connectivity.</p>
235 pub fn egress_config(mut self, input: crate::types::ConnectorEgressConfig) -> Self {
236 self.inner = self.inner.egress_config(input);
237 self
238 }
239 /// <p>Specifies the egress configuration for the connector, which determines how traffic is routed from the connector to the SFTP server. When set to VPC, enables routing through customer VPCs using VPC_LATTICE for private connectivity.</p>
240 pub fn set_egress_config(mut self, input: ::std::option::Option<crate::types::ConnectorEgressConfig>) -> Self {
241 self.inner = self.inner.set_egress_config(input);
242 self
243 }
244 /// <p>Specifies the egress configuration for the connector, which determines how traffic is routed from the connector to the SFTP server. When set to VPC, enables routing through customer VPCs using VPC_LATTICE for private connectivity.</p>
245 pub fn get_egress_config(&self) -> &::std::option::Option<crate::types::ConnectorEgressConfig> {
246 self.inner.get_egress_config()
247 }
248}