aws_sdk_transfer/operation/create_agreement/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_agreement::_create_agreement_output::CreateAgreementOutputBuilder;
3
4pub use crate::operation::create_agreement::_create_agreement_input::CreateAgreementInputBuilder;
5
6impl crate::operation::create_agreement::builders::CreateAgreementInputBuilder {
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_agreement::CreateAgreementOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_agreement::CreateAgreementError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_agreement();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateAgreement`.
24///
25/// <p>Creates an agreement. An agreement is a bilateral trading partner agreement, or partnership, between an Transfer Family server and an AS2 process. The agreement defines the file and message transfer relationship between the server and the AS2 process. To define an agreement, Transfer Family combines a server, local profile, partner profile, certificate, and other attributes.</p>
26/// <p>The partner is identified with the <code>PartnerProfileId</code>, and the AS2 process is identified with the <code>LocalProfileId</code>.</p><note>
27/// <p>Specify <i>either</i> <code>BaseDirectory</code> or <code>CustomDirectories</code>, but not both. Specifying both causes the command to fail.</p>
28/// </note>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateAgreementFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::create_agreement::builders::CreateAgreementInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::create_agreement::CreateAgreementOutput,
38 crate::operation::create_agreement::CreateAgreementError,
39 > for CreateAgreementFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<
46 crate::operation::create_agreement::CreateAgreementOutput,
47 crate::operation::create_agreement::CreateAgreementError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl CreateAgreementFluentBuilder {
54 /// Creates a new `CreateAgreementFluentBuilder`.
55 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56 Self {
57 handle,
58 inner: ::std::default::Default::default(),
59 config_override: ::std::option::Option::None,
60 }
61 }
62 /// Access the CreateAgreement as a reference.
63 pub fn as_input(&self) -> &crate::operation::create_agreement::builders::CreateAgreementInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::create_agreement::CreateAgreementOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::create_agreement::CreateAgreementError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::create_agreement::CreateAgreement::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::create_agreement::CreateAgreement::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::create_agreement::CreateAgreementOutput,
100 crate::operation::create_agreement::CreateAgreementError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 /// <p>A name or short description to identify the agreement.</p>
115 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.description(input.into());
117 self
118 }
119 /// <p>A name or short description to identify the agreement.</p>
120 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.inner = self.inner.set_description(input);
122 self
123 }
124 /// <p>A name or short description to identify the agreement.</p>
125 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_description()
127 }
128 /// <p>A system-assigned unique identifier for a server instance. This is the specific server that the agreement uses.</p>
129 pub fn server_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.inner = self.inner.server_id(input.into());
131 self
132 }
133 /// <p>A system-assigned unique identifier for a server instance. This is the specific server that the agreement uses.</p>
134 pub fn set_server_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.inner = self.inner.set_server_id(input);
136 self
137 }
138 /// <p>A system-assigned unique identifier for a server instance. This is the specific server that the agreement uses.</p>
139 pub fn get_server_id(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_server_id()
141 }
142 /// <p>A unique identifier for the AS2 local profile.</p>
143 pub fn local_profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.inner = self.inner.local_profile_id(input.into());
145 self
146 }
147 /// <p>A unique identifier for the AS2 local profile.</p>
148 pub fn set_local_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149 self.inner = self.inner.set_local_profile_id(input);
150 self
151 }
152 /// <p>A unique identifier for the AS2 local profile.</p>
153 pub fn get_local_profile_id(&self) -> &::std::option::Option<::std::string::String> {
154 self.inner.get_local_profile_id()
155 }
156 /// <p>A unique identifier for the partner profile used in the agreement.</p>
157 pub fn partner_profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158 self.inner = self.inner.partner_profile_id(input.into());
159 self
160 }
161 /// <p>A unique identifier for the partner profile used in the agreement.</p>
162 pub fn set_partner_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163 self.inner = self.inner.set_partner_profile_id(input);
164 self
165 }
166 /// <p>A unique identifier for the partner profile used in the agreement.</p>
167 pub fn get_partner_profile_id(&self) -> &::std::option::Option<::std::string::String> {
168 self.inner.get_partner_profile_id()
169 }
170 /// <p>The landing directory (folder) for files transferred by using the AS2 protocol.</p>
171 /// <p>A <code>BaseDirectory</code> example is <code>/<i>amzn-s3-demo-bucket</i>/home/mydirectory</code>.</p>
172 pub fn base_directory(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173 self.inner = self.inner.base_directory(input.into());
174 self
175 }
176 /// <p>The landing directory (folder) for files transferred by using the AS2 protocol.</p>
177 /// <p>A <code>BaseDirectory</code> example is <code>/<i>amzn-s3-demo-bucket</i>/home/mydirectory</code>.</p>
178 pub fn set_base_directory(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179 self.inner = self.inner.set_base_directory(input);
180 self
181 }
182 /// <p>The landing directory (folder) for files transferred by using the AS2 protocol.</p>
183 /// <p>A <code>BaseDirectory</code> example is <code>/<i>amzn-s3-demo-bucket</i>/home/mydirectory</code>.</p>
184 pub fn get_base_directory(&self) -> &::std::option::Option<::std::string::String> {
185 self.inner.get_base_directory()
186 }
187 /// <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>
188 /// <p><b>For AS2 connectors</b></p>
189 /// <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>
190 /// <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>
191 /// <p><b>For SFTP connectors</b></p>
192 /// <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>
193 pub fn access_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194 self.inner = self.inner.access_role(input.into());
195 self
196 }
197 /// <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>
198 /// <p><b>For AS2 connectors</b></p>
199 /// <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>
200 /// <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>
201 /// <p><b>For SFTP connectors</b></p>
202 /// <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>
203 pub fn set_access_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204 self.inner = self.inner.set_access_role(input);
205 self
206 }
207 /// <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>
208 /// <p><b>For AS2 connectors</b></p>
209 /// <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>
210 /// <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>
211 /// <p><b>For SFTP connectors</b></p>
212 /// <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>
213 pub fn get_access_role(&self) -> &::std::option::Option<::std::string::String> {
214 self.inner.get_access_role()
215 }
216 /// <p>The status of the agreement. The agreement can be either <code>ACTIVE</code> or <code>INACTIVE</code>.</p>
217 pub fn status(mut self, input: crate::types::AgreementStatusType) -> Self {
218 self.inner = self.inner.status(input);
219 self
220 }
221 /// <p>The status of the agreement. The agreement can be either <code>ACTIVE</code> or <code>INACTIVE</code>.</p>
222 pub fn set_status(mut self, input: ::std::option::Option<crate::types::AgreementStatusType>) -> Self {
223 self.inner = self.inner.set_status(input);
224 self
225 }
226 /// <p>The status of the agreement. The agreement can be either <code>ACTIVE</code> or <code>INACTIVE</code>.</p>
227 pub fn get_status(&self) -> &::std::option::Option<crate::types::AgreementStatusType> {
228 self.inner.get_status()
229 }
230 ///
231 /// Appends an item to `Tags`.
232 ///
233 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
234 ///
235 /// <p>Key-value pairs that can be used to group and search for agreements.</p>
236 pub fn tags(mut self, input: crate::types::Tag) -> Self {
237 self.inner = self.inner.tags(input);
238 self
239 }
240 /// <p>Key-value pairs that can be used to group and search for agreements.</p>
241 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
242 self.inner = self.inner.set_tags(input);
243 self
244 }
245 /// <p>Key-value pairs that can be used to group and search for agreements.</p>
246 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
247 self.inner.get_tags()
248 }
249 /// <p>Determines whether or not Transfer Family appends a unique string of characters to the end of the AS2 message payload filename when saving it.</p>
250 /// <ul>
251 /// <li>
252 /// <p><code>ENABLED</code>: the filename provided by your trading parter is preserved when the file is saved.</p></li>
253 /// <li>
254 /// <p><code>DISABLED</code> (default value): when Transfer Family saves the file, the filename is adjusted, as described in <a href="https://docs.aws.amazon.com/transfer/latest/userguide/send-as2-messages.html#file-names-as2">File names and locations</a>.</p></li>
255 /// </ul>
256 pub fn preserve_filename(mut self, input: crate::types::PreserveFilenameType) -> Self {
257 self.inner = self.inner.preserve_filename(input);
258 self
259 }
260 /// <p>Determines whether or not Transfer Family appends a unique string of characters to the end of the AS2 message payload filename when saving it.</p>
261 /// <ul>
262 /// <li>
263 /// <p><code>ENABLED</code>: the filename provided by your trading parter is preserved when the file is saved.</p></li>
264 /// <li>
265 /// <p><code>DISABLED</code> (default value): when Transfer Family saves the file, the filename is adjusted, as described in <a href="https://docs.aws.amazon.com/transfer/latest/userguide/send-as2-messages.html#file-names-as2">File names and locations</a>.</p></li>
266 /// </ul>
267 pub fn set_preserve_filename(mut self, input: ::std::option::Option<crate::types::PreserveFilenameType>) -> Self {
268 self.inner = self.inner.set_preserve_filename(input);
269 self
270 }
271 /// <p>Determines whether or not Transfer Family appends a unique string of characters to the end of the AS2 message payload filename when saving it.</p>
272 /// <ul>
273 /// <li>
274 /// <p><code>ENABLED</code>: the filename provided by your trading parter is preserved when the file is saved.</p></li>
275 /// <li>
276 /// <p><code>DISABLED</code> (default value): when Transfer Family saves the file, the filename is adjusted, as described in <a href="https://docs.aws.amazon.com/transfer/latest/userguide/send-as2-messages.html#file-names-as2">File names and locations</a>.</p></li>
277 /// </ul>
278 pub fn get_preserve_filename(&self) -> &::std::option::Option<crate::types::PreserveFilenameType> {
279 self.inner.get_preserve_filename()
280 }
281 /// <p>Determines whether or not unsigned messages from your trading partners will be accepted.</p>
282 /// <ul>
283 /// <li>
284 /// <p><code>ENABLED</code>: Transfer Family rejects unsigned messages from your trading partner.</p></li>
285 /// <li>
286 /// <p><code>DISABLED</code> (default value): Transfer Family accepts unsigned messages from your trading partner.</p></li>
287 /// </ul>
288 pub fn enforce_message_signing(mut self, input: crate::types::EnforceMessageSigningType) -> Self {
289 self.inner = self.inner.enforce_message_signing(input);
290 self
291 }
292 /// <p>Determines whether or not unsigned messages from your trading partners will be accepted.</p>
293 /// <ul>
294 /// <li>
295 /// <p><code>ENABLED</code>: Transfer Family rejects unsigned messages from your trading partner.</p></li>
296 /// <li>
297 /// <p><code>DISABLED</code> (default value): Transfer Family accepts unsigned messages from your trading partner.</p></li>
298 /// </ul>
299 pub fn set_enforce_message_signing(mut self, input: ::std::option::Option<crate::types::EnforceMessageSigningType>) -> Self {
300 self.inner = self.inner.set_enforce_message_signing(input);
301 self
302 }
303 /// <p>Determines whether or not unsigned messages from your trading partners will be accepted.</p>
304 /// <ul>
305 /// <li>
306 /// <p><code>ENABLED</code>: Transfer Family rejects unsigned messages from your trading partner.</p></li>
307 /// <li>
308 /// <p><code>DISABLED</code> (default value): Transfer Family accepts unsigned messages from your trading partner.</p></li>
309 /// </ul>
310 pub fn get_enforce_message_signing(&self) -> &::std::option::Option<crate::types::EnforceMessageSigningType> {
311 self.inner.get_enforce_message_signing()
312 }
313 /// <p>A <code>CustomDirectoriesType</code> structure. This structure specifies custom directories for storing various AS2 message files. You can specify directories for the following types of files.</p>
314 /// <ul>
315 /// <li>
316 /// <p>Failed files</p></li>
317 /// <li>
318 /// <p>MDN files</p></li>
319 /// <li>
320 /// <p>Payload files</p></li>
321 /// <li>
322 /// <p>Status files</p></li>
323 /// <li>
324 /// <p>Temporary files</p></li>
325 /// </ul>
326 pub fn custom_directories(mut self, input: crate::types::CustomDirectoriesType) -> Self {
327 self.inner = self.inner.custom_directories(input);
328 self
329 }
330 /// <p>A <code>CustomDirectoriesType</code> structure. This structure specifies custom directories for storing various AS2 message files. You can specify directories for the following types of files.</p>
331 /// <ul>
332 /// <li>
333 /// <p>Failed files</p></li>
334 /// <li>
335 /// <p>MDN files</p></li>
336 /// <li>
337 /// <p>Payload files</p></li>
338 /// <li>
339 /// <p>Status files</p></li>
340 /// <li>
341 /// <p>Temporary files</p></li>
342 /// </ul>
343 pub fn set_custom_directories(mut self, input: ::std::option::Option<crate::types::CustomDirectoriesType>) -> Self {
344 self.inner = self.inner.set_custom_directories(input);
345 self
346 }
347 /// <p>A <code>CustomDirectoriesType</code> structure. This structure specifies custom directories for storing various AS2 message files. You can specify directories for the following types of files.</p>
348 /// <ul>
349 /// <li>
350 /// <p>Failed files</p></li>
351 /// <li>
352 /// <p>MDN files</p></li>
353 /// <li>
354 /// <p>Payload files</p></li>
355 /// <li>
356 /// <p>Status files</p></li>
357 /// <li>
358 /// <p>Temporary files</p></li>
359 /// </ul>
360 pub fn get_custom_directories(&self) -> &::std::option::Option<crate::types::CustomDirectoriesType> {
361 self.inner.get_custom_directories()
362 }
363}