rusoto_transfer/generated.rs
1// =================================================================
2//
3// * WARNING *
4//
5// This file is generated!
6//
7// Changes made to this file will be overwritten. If changes are
8// required to the generated code, the service_crategen project
9// must be updated to generate the changes.
10//
11// =================================================================
12
13use std::error::Error;
14use std::fmt;
15
16use async_trait::async_trait;
17use rusoto_core::credential::ProvideAwsCredentials;
18use rusoto_core::region;
19use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
20use rusoto_core::{Client, RusotoError};
21
22use rusoto_core::proto;
23use rusoto_core::request::HttpResponse;
24use rusoto_core::signature::SignedRequest;
25#[allow(unused_imports)]
26use serde::{Deserialize, Serialize};
27
28impl TransferClient {
29 fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
30 let mut request = SignedRequest::new(http_method, "transfer", &self.region, request_uri);
31
32 request.set_content_type("application/x-amz-json-1.1".to_owned());
33
34 request
35 }
36
37 async fn sign_and_dispatch<E>(
38 &self,
39 request: SignedRequest,
40 from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
41 ) -> Result<HttpResponse, RusotoError<E>> {
42 let mut response = self.client.sign_and_dispatch(request).await?;
43 if !response.status.is_success() {
44 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
45 return Err(from_response(response));
46 }
47
48 Ok(response)
49 }
50}
51
52use serde_json;
53#[derive(Clone, Debug, Default, PartialEq, Serialize)]
54#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
55pub struct CreateServerRequest {
56 /// <p><p>The Amazon Resource Name (ARN) of the AWS Certificate Manager (ACM) certificate. Required when <code>Protocols</code> is set to <code>FTPS</code>.</p> <p>To request a new public certificate, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html">Request a public certificate</a> in the <i> AWS Certificate Manager User Guide</i>.</p> <p>To import an existing certificate into ACM, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html">Importing certificates into ACM</a> in the <i> AWS Certificate Manager User Guide</i>.</p> <p>To request a private certificate to use FTPS through private IP addresses, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-private.html">Request a private certificate</a> in the <i> AWS Certificate Manager User Guide</i>.</p> <p>Certificates with the following cryptographic algorithms and key sizes are supported:</p> <ul> <li> <p>2048-bit RSA (RSA<em>2048)</p> </li> <li> <p>4096-bit RSA (RSA</em>4096)</p> </li> <li> <p>Elliptic Prime Curve 256 bit (EC<em>prime256v1)</p> </li> <li> <p>Elliptic Prime Curve 384 bit (EC</em>secp384r1)</p> </li> <li> <p>Elliptic Prime Curve 521 bit (EC_secp521r1)</p> </li> </ul> <note> <p>The certificate must be a valid SSL/TLS X.509 version 3 certificate with FQDN or IP address specified and information about the issuer.</p> </note></p>
57 #[serde(rename = "Certificate")]
58 #[serde(skip_serializing_if = "Option::is_none")]
59 pub certificate: Option<String>,
60 /// <p>The virtual private cloud (VPC) endpoint settings that are configured for your file transfer protocol-enabled server. When you host your endpoint within your VPC, you can make it accessible only to resources within your VPC, or you can attach Elastic IPs and make it accessible to clients over the internet. Your VPC's default security groups are automatically assigned to your endpoint.</p>
61 #[serde(rename = "EndpointDetails")]
62 #[serde(skip_serializing_if = "Option::is_none")]
63 pub endpoint_details: Option<EndpointDetails>,
64 /// <p><p>The type of VPC endpoint that you want your file transfer protocol-enabled server to connect to. You can choose to connect to the public internet or a VPC endpoint. With a VPC endpoint, you can restrict access to your server and resources only within your VPC.</p> <note> <p>It is recommended that you use <code>VPC</code> as the <code>EndpointType</code>. With this endpoint type, you have the option to directly associate up to three Elastic IPv4 addresses (BYO IP included) with your server's endpoint and use VPC security groups to restrict traffic by the client's public IP address. This is not possible with <code>EndpointType</code> set to <code>VPC_ENDPOINT</code>.</p> </note></p>
65 #[serde(rename = "EndpointType")]
66 #[serde(skip_serializing_if = "Option::is_none")]
67 pub endpoint_type: Option<String>,
68 /// <p>The RSA private key as generated by the <code>ssh-keygen -N "" -m PEM -f my-new-server-key</code> command.</p> <important> <p>If you aren't planning to migrate existing users from an existing SFTP-enabled server to a new server, don't update the host key. Accidentally changing a server's host key can be disruptive.</p> </important> <p>For more information, see <a href="https://docs.aws.amazon.com/transfer/latest/userguide/edit-server-config.html#configuring-servers-change-host-key">Change the host key for your SFTP-enabled server</a> in the <i>AWS Transfer Family User Guide</i>.</p>
69 #[serde(rename = "HostKey")]
70 #[serde(skip_serializing_if = "Option::is_none")]
71 pub host_key: Option<String>,
72 /// <p>Required when <code>IdentityProviderType</code> is set to <code>API_GATEWAY</code>. Accepts an array containing all of the information required to call a customer-supplied authentication API, including the API Gateway URL. Not required when <code>IdentityProviderType</code> is set to <code>SERVICE_MANAGED</code>.</p>
73 #[serde(rename = "IdentityProviderDetails")]
74 #[serde(skip_serializing_if = "Option::is_none")]
75 pub identity_provider_details: Option<IdentityProviderDetails>,
76 /// <p>Specifies the mode of authentication for a file transfer protocol-enabled server. The default value is <code>SERVICE_MANAGED</code>, which allows you to store and access user credentials within the AWS Transfer Family service. Use the <code>API_GATEWAY</code> value to integrate with an identity provider of your choosing. The <code>API_GATEWAY</code> setting requires you to provide an API Gateway endpoint URL to call for authentication using the <code>IdentityProviderDetails</code> parameter.</p>
77 #[serde(rename = "IdentityProviderType")]
78 #[serde(skip_serializing_if = "Option::is_none")]
79 pub identity_provider_type: Option<String>,
80 /// <p>Allows the service to write your users' activity to your Amazon CloudWatch logs for monitoring and auditing purposes.</p>
81 #[serde(rename = "LoggingRole")]
82 #[serde(skip_serializing_if = "Option::is_none")]
83 pub logging_role: Option<String>,
84 /// <p><p>Specifies the file transfer protocol or protocols over which your file transfer protocol client can connect to your server's endpoint. The available protocols are:</p> <ul> <li> <p> <code>SFTP</code> (Secure Shell (SSH) File Transfer Protocol): File transfer over SSH</p> </li> <li> <p> <code>FTPS</code> (File Transfer Protocol Secure): File transfer with TLS encryption</p> </li> <li> <p> <code>FTP</code> (File Transfer Protocol): Unencrypted file transfer</p> </li> </ul> <note> <p>If you select <code>FTPS</code>, you must choose a certificate stored in AWS Certificate Manager (ACM) which will be used to identify your server when clients connect to it over FTPS.</p> <p>If <code>Protocol</code> includes either <code>FTP</code> or <code>FTPS</code>, then the <code>EndpointType</code> must be <code>VPC</code> and the <code>IdentityProviderType</code> must be <code>API<em>GATEWAY</code>.</p> <p>If <code>Protocol</code> includes <code>FTP</code>, then <code>AddressAllocationIds</code> cannot be associated.</p> <p>If <code>Protocol</code> is set only to <code>SFTP</code>, the <code>EndpointType</code> can be set to <code>PUBLIC</code> and the <code>IdentityProviderType</code> can be set to <code>SERVICE</em>MANAGED</code>.</p> </note></p>
85 #[serde(rename = "Protocols")]
86 #[serde(skip_serializing_if = "Option::is_none")]
87 pub protocols: Option<Vec<String>>,
88 /// <p>Key-value pairs that can be used to group and search for file transfer protocol-enabled servers.</p>
89 #[serde(rename = "Tags")]
90 #[serde(skip_serializing_if = "Option::is_none")]
91 pub tags: Option<Vec<Tag>>,
92}
93
94#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
95#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
96pub struct CreateServerResponse {
97 /// <p>The service-assigned ID of the file transfer protocol-enabled server that is created.</p>
98 #[serde(rename = "ServerId")]
99 pub server_id: String,
100}
101
102#[derive(Clone, Debug, Default, PartialEq, Serialize)]
103#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
104pub struct CreateUserRequest {
105 /// <p>The landing directory (folder) for a user when they log in to the file transfer protocol-enabled server using the client.</p> <p>An example is <i> <code>your-Amazon-S3-bucket-name>/home/username</code> </i>.</p>
106 #[serde(rename = "HomeDirectory")]
107 #[serde(skip_serializing_if = "Option::is_none")]
108 pub home_directory: Option<String>,
109 /// <p><p>Logical directory mappings that specify what Amazon S3 paths and keys should be visible to your user and how you want to make them visible. You will need to specify the "<code>Entry</code>" and "<code>Target</code>" pair, where <code>Entry</code> shows how the path is made visible and <code>Target</code> is the actual Amazon S3 path. If you only specify a target, it will be displayed as is. You will need to also make sure that your IAM role provides access to paths in <code>Target</code>. The following is an example.</p> <p> <code>'[ "/bucket2/documentation", { "Entry": "your-personal-report.pdf", "Target": "/bucket3/customized-reports/${transfer:UserName}.pdf" } ]'</code> </p> <p>In most cases, you can use this value instead of the scope-down policy to lock your user down to the designated home directory ("chroot"). To do this, you can set <code>Entry</code> to '/' and set <code>Target</code> to the HomeDirectory parameter value.</p> <note> <p>If the target of a logical directory entry does not exist in Amazon S3, the entry will be ignored. As a workaround, you can use the Amazon S3 api to create 0 byte objects as place holders for your directory. If using the CLI, use the <code>s3api</code> call instead of <code>s3</code> so you can use the put-object operation. For example, you use the following: <code>aws s3api put-object --bucket bucketname --key path/to/folder/</code>. Make sure that the end of the key name ends in a '/' for it to be considered a folder.</p> </note></p>
110 #[serde(rename = "HomeDirectoryMappings")]
111 #[serde(skip_serializing_if = "Option::is_none")]
112 pub home_directory_mappings: Option<Vec<HomeDirectoryMapEntry>>,
113 /// <p>The type of landing directory (folder) you want your users' home directory to be when they log into the file transfer protocol-enabled server. If you set it to <code>PATH</code>, the user will see the absolute Amazon S3 bucket paths as is in their file transfer protocol clients. If you set it <code>LOGICAL</code>, you will need to provide mappings in the <code>HomeDirectoryMappings</code> for how you want to make Amazon S3 paths visible to your users.</p>
114 #[serde(rename = "HomeDirectoryType")]
115 #[serde(skip_serializing_if = "Option::is_none")]
116 pub home_directory_type: Option<String>,
117 /// <p><p>A scope-down policy for your user so you can use the same IAM role across multiple users. This policy scopes down user access to portions of their Amazon S3 bucket. Variables that you can use inside this policy include <code>${Transfer:UserName}</code>, <code>${Transfer:HomeDirectory}</code>, and <code>${Transfer:HomeBucket}</code>.</p> <note> <p>For scope-down policies, AWS Transfer Family stores the policy as a JSON blob, instead of the Amazon Resource Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the <code>Policy</code> argument.</p> <p>For an example of a scope-down policy, see <a href="https://docs.aws.amazon.com/transfer/latest/userguide/users.html#users-policies-scope-down">Creating a scope-down policy</a>.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html">AssumeRole</a> in the <i>AWS Security Token Service API Reference</i>.</p> </note></p>
118 #[serde(rename = "Policy")]
119 #[serde(skip_serializing_if = "Option::is_none")]
120 pub policy: Option<String>,
121 /// <p>The IAM role that controls your users' access to your Amazon S3 bucket. The policies attached to this role will determine the level of access you want to provide your users when transferring files into and out of your Amazon S3 bucket or buckets. The IAM role should also contain a trust relationship that allows the file transfer protocol-enabled server to access your resources when servicing your users' transfer requests.</p>
122 #[serde(rename = "Role")]
123 pub role: String,
124 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server instance. This is the specific server that you added your user to.</p>
125 #[serde(rename = "ServerId")]
126 pub server_id: String,
127 /// <p>The public portion of the Secure Shell (SSH) key used to authenticate the user to the file transfer protocol-enabled server.</p>
128 #[serde(rename = "SshPublicKeyBody")]
129 #[serde(skip_serializing_if = "Option::is_none")]
130 pub ssh_public_key_body: Option<String>,
131 /// <p>Key-value pairs that can be used to group and search for users. Tags are metadata attached to users for any purpose.</p>
132 #[serde(rename = "Tags")]
133 #[serde(skip_serializing_if = "Option::is_none")]
134 pub tags: Option<Vec<Tag>>,
135 /// <p>A unique string that identifies a user and is associated with a file transfer protocol-enabled server as specified by the <code>ServerId</code>. This user name must be a minimum of 3 and a maximum of 32 characters long. The following are valid characters: a-z, A-Z, 0-9, underscore, and hyphen. The user name can't start with a hyphen.</p>
136 #[serde(rename = "UserName")]
137 pub user_name: String,
138}
139
140#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
141#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
142pub struct CreateUserResponse {
143 /// <p>The ID of the file transfer protocol-enabled server that the user is attached to.</p>
144 #[serde(rename = "ServerId")]
145 pub server_id: String,
146 /// <p>A unique string that identifies a user account associated with a file transfer protocol-enabled server.</p>
147 #[serde(rename = "UserName")]
148 pub user_name: String,
149}
150
151#[derive(Clone, Debug, Default, PartialEq, Serialize)]
152#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
153pub struct DeleteServerRequest {
154 /// <p>A unique system-assigned identifier for a file transfer protocol-enabled server instance.</p>
155 #[serde(rename = "ServerId")]
156 pub server_id: String,
157}
158
159#[derive(Clone, Debug, Default, PartialEq, Serialize)]
160#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
161pub struct DeleteSshPublicKeyRequest {
162 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server instance that has the user assigned to it.</p>
163 #[serde(rename = "ServerId")]
164 pub server_id: String,
165 /// <p>A unique identifier used to reference your user's specific SSH key.</p>
166 #[serde(rename = "SshPublicKeyId")]
167 pub ssh_public_key_id: String,
168 /// <p>A unique string that identifies a user whose public key is being deleted.</p>
169 #[serde(rename = "UserName")]
170 pub user_name: String,
171}
172
173#[derive(Clone, Debug, Default, PartialEq, Serialize)]
174#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
175pub struct DeleteUserRequest {
176 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server instance that has the user assigned to it.</p>
177 #[serde(rename = "ServerId")]
178 pub server_id: String,
179 /// <p>A unique string that identifies a user that is being deleted from a file transfer protocol-enabled server.</p>
180 #[serde(rename = "UserName")]
181 pub user_name: String,
182}
183
184#[derive(Clone, Debug, Default, PartialEq, Serialize)]
185#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
186pub struct DescribeServerRequest {
187 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server.</p>
188 #[serde(rename = "ServerId")]
189 pub server_id: String,
190}
191
192#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
193#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
194pub struct DescribeServerResponse {
195 /// <p>An array containing the properties of a file transfer protocol-enabled server with the <code>ServerID</code> you specified.</p>
196 #[serde(rename = "Server")]
197 pub server: DescribedServer,
198}
199
200#[derive(Clone, Debug, Default, PartialEq, Serialize)]
201#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
202pub struct DescribeUserRequest {
203 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server that has this user assigned.</p>
204 #[serde(rename = "ServerId")]
205 pub server_id: String,
206 /// <p>The name of the user assigned to one or more file transfer protocol-enabled servers. User names are part of the sign-in credentials to use the AWS Transfer Family service and perform file transfer tasks.</p>
207 #[serde(rename = "UserName")]
208 pub user_name: String,
209}
210
211#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
212#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
213pub struct DescribeUserResponse {
214 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server that has this user assigned.</p>
215 #[serde(rename = "ServerId")]
216 pub server_id: String,
217 /// <p>An array containing the properties of the user account for the <code>ServerID</code> value that you specified.</p>
218 #[serde(rename = "User")]
219 pub user: DescribedUser,
220}
221
222/// <p>Describes the properties of a file transfer protocol-enabled server that was specified. Information returned includes the following: the server Amazon Resource Name (ARN), the certificate ARN (if the FTPS protocol was selected), the endpoint type and details, the authentication configuration and type, the logging role, the file transfer protocol or protocols, the server ID and state, and assigned tags or metadata.</p>
223#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
224#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
225pub struct DescribedServer {
226 /// <p>Specifies the unique Amazon Resource Name (ARN) for a file transfer protocol-enabled server to be described.</p>
227 #[serde(rename = "Arn")]
228 pub arn: String,
229 /// <p>Specifies the ARN of the AWS Certificate Manager (ACM) certificate. Required when <code>Protocols</code> is set to <code>FTPS</code>.</p>
230 #[serde(rename = "Certificate")]
231 #[serde(skip_serializing_if = "Option::is_none")]
232 pub certificate: Option<String>,
233 /// <p>Specifies the virtual private cloud (VPC) endpoint settings that you configured for your file transfer protocol-enabled server.</p>
234 #[serde(rename = "EndpointDetails")]
235 #[serde(skip_serializing_if = "Option::is_none")]
236 pub endpoint_details: Option<EndpointDetails>,
237 /// <p>Defines the type of endpoint that your file transfer protocol-enabled server is connected to. If your server is connected to a VPC endpoint, your server isn't accessible over the public internet.</p>
238 #[serde(rename = "EndpointType")]
239 #[serde(skip_serializing_if = "Option::is_none")]
240 pub endpoint_type: Option<String>,
241 /// <p>Specifies the Base64-encoded SHA256 fingerprint of the server's host key. This value is equivalent to the output of the <code>ssh-keygen -l -f my-new-server-key</code> command.</p>
242 #[serde(rename = "HostKeyFingerprint")]
243 #[serde(skip_serializing_if = "Option::is_none")]
244 pub host_key_fingerprint: Option<String>,
245 /// <p>Specifies information to call a customer-supplied authentication API. This field is not populated when the <code>IdentityProviderType</code> of a file transfer protocol-enabled server is <code>SERVICE_MANAGED</code>.</p>
246 #[serde(rename = "IdentityProviderDetails")]
247 #[serde(skip_serializing_if = "Option::is_none")]
248 pub identity_provider_details: Option<IdentityProviderDetails>,
249 /// <p>Specifies the mode of authentication method enabled for this service. A value of <code>SERVICE_MANAGED</code> means that you are using this file transfer protocol-enabled server to store and access user credentials within the service. A value of <code>API_GATEWAY</code> indicates that you have integrated an API Gateway endpoint that will be invoked for authenticating your user into the service.</p>
250 #[serde(rename = "IdentityProviderType")]
251 #[serde(skip_serializing_if = "Option::is_none")]
252 pub identity_provider_type: Option<String>,
253 /// <p>Specifies the AWS Identity and Access Management (IAM) role that allows a file transfer protocol-enabled server to turn on Amazon CloudWatch logging for Amazon S3 events. When set, user activity can be viewed in your CloudWatch logs.</p>
254 #[serde(rename = "LoggingRole")]
255 #[serde(skip_serializing_if = "Option::is_none")]
256 pub logging_role: Option<String>,
257 /// <p><p>Specifies the file transfer protocol or protocols over which your file transfer protocol client can connect to your server's endpoint. The available protocols are:</p> <ul> <li> <p> <code>SFTP</code> (Secure Shell (SSH) File Transfer Protocol): File transfer over SSH</p> </li> <li> <p> <code>FTPS</code> (File Transfer Protocol Secure): File transfer with TLS encryption</p> </li> <li> <p> <code>FTP</code> (File Transfer Protocol): Unencrypted file transfer</p> </li> </ul></p>
258 #[serde(rename = "Protocols")]
259 #[serde(skip_serializing_if = "Option::is_none")]
260 pub protocols: Option<Vec<String>>,
261 /// <p>Specifies the unique system-assigned identifier for a file transfer protocol-enabled server that you instantiate.</p>
262 #[serde(rename = "ServerId")]
263 #[serde(skip_serializing_if = "Option::is_none")]
264 pub server_id: Option<String>,
265 /// <p>Specifies the condition of a file transfer protocol-enabled server for the server that was described. A value of <code>ONLINE</code> indicates that the server can accept jobs and transfer files. A <code>State</code> value of <code>OFFLINE</code> means that the server cannot perform file transfer operations.</p> <p>The states of <code>STARTING</code> and <code>STOPPING</code> indicate that the server is in an intermediate state, either not fully able to respond, or not fully offline. The values of <code>START_FAILED</code> or <code>STOP_FAILED</code> can indicate an error condition.</p>
266 #[serde(rename = "State")]
267 #[serde(skip_serializing_if = "Option::is_none")]
268 pub state: Option<String>,
269 /// <p>Specifies the key-value pairs that you can use to search for and group file transfer protocol-enabled servers that were assigned to the server that was described.</p>
270 #[serde(rename = "Tags")]
271 #[serde(skip_serializing_if = "Option::is_none")]
272 pub tags: Option<Vec<Tag>>,
273 /// <p>Specifies the number of users that are assigned to a file transfer protocol-enabled server you specified with the <code>ServerId</code>.</p>
274 #[serde(rename = "UserCount")]
275 #[serde(skip_serializing_if = "Option::is_none")]
276 pub user_count: Option<i64>,
277}
278
279/// <p>Returns properties of the user that you want to describe.</p>
280#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
281#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
282pub struct DescribedUser {
283 /// <p>Specifies the unique Amazon Resource Name (ARN) for the user that was requested to be described.</p>
284 #[serde(rename = "Arn")]
285 pub arn: String,
286 /// <p>Specifies the landing directory (or folder), which is the location that files are written to or read from in an Amazon S3 bucket, for the described user. An example is <i> <code>your-Amazon-S3-bucket-name>/home/username</code> </i>.</p>
287 #[serde(rename = "HomeDirectory")]
288 #[serde(skip_serializing_if = "Option::is_none")]
289 pub home_directory: Option<String>,
290 /// <p>Specifies the logical directory mappings that specify what Amazon S3 paths and keys should be visible to your user and how you want to make them visible. You will need to specify the "<code>Entry</code>" and "<code>Target</code>" pair, where <code>Entry</code> shows how the path is made visible and <code>Target</code> is the actual Amazon S3 path. If you only specify a target, it will be displayed as is. You will need to also make sure that your AWS Identity and Access Management (IAM) role provides access to paths in <code>Target</code>.</p> <p>In most cases, you can use this value instead of the scope-down policy to lock your user down to the designated home directory ("chroot"). To do this, you can set <code>Entry</code> to '/' and set <code>Target</code> to the HomeDirectory parameter value.</p>
291 #[serde(rename = "HomeDirectoryMappings")]
292 #[serde(skip_serializing_if = "Option::is_none")]
293 pub home_directory_mappings: Option<Vec<HomeDirectoryMapEntry>>,
294 /// <p>Specifies the type of landing directory (folder) you mapped for your users to see when they log into the file transfer protocol-enabled server. If you set it to <code>PATH</code>, the user will see the absolute Amazon S3 bucket paths as is in their file transfer protocol clients. If you set it <code>LOGICAL</code>, you will need to provide mappings in the <code>HomeDirectoryMappings</code> for how you want to make Amazon S3 paths visible to your users.</p>
295 #[serde(rename = "HomeDirectoryType")]
296 #[serde(skip_serializing_if = "Option::is_none")]
297 pub home_directory_type: Option<String>,
298 /// <p>Specifies the name of the policy in use for the described user.</p>
299 #[serde(rename = "Policy")]
300 #[serde(skip_serializing_if = "Option::is_none")]
301 pub policy: Option<String>,
302 /// <p>Specifies the IAM role that controls your users' access to your Amazon S3 bucket. The policies attached to this role will determine the level of access you want to provide your users when transferring files into and out of your Amazon S3 bucket or buckets. The IAM role should also contain a trust relationship that allows a file transfer protocol-enabled server to access your resources when servicing your users' transfer requests.</p>
303 #[serde(rename = "Role")]
304 #[serde(skip_serializing_if = "Option::is_none")]
305 pub role: Option<String>,
306 /// <p>Specifies the public key portion of the Secure Shell (SSH) keys stored for the described user.</p>
307 #[serde(rename = "SshPublicKeys")]
308 #[serde(skip_serializing_if = "Option::is_none")]
309 pub ssh_public_keys: Option<Vec<SshPublicKey>>,
310 /// <p>Specifies the key-value pairs for the user requested. Tag can be used to search for and group users for a variety of purposes.</p>
311 #[serde(rename = "Tags")]
312 #[serde(skip_serializing_if = "Option::is_none")]
313 pub tags: Option<Vec<Tag>>,
314 /// <p>Specifies the name of the user that was requested to be described. User names are used for authentication purposes. This is the string that will be used by your user when they log in to your file transfer protocol-enabled server.</p>
315 #[serde(rename = "UserName")]
316 #[serde(skip_serializing_if = "Option::is_none")]
317 pub user_name: Option<String>,
318}
319
320/// <p>The virtual private cloud (VPC) endpoint settings that are configured for your file transfer protocol-enabled server. With a VPC endpoint, you can restrict access to your server and resources only within your VPC. To control incoming internet traffic, invoke the <code>UpdateServer</code> API and attach an Elastic IP to your server's endpoint.</p>
321#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
322pub struct EndpointDetails {
323 /// <p><p>A list of address allocation IDs that are required to attach an Elastic IP address to your file transfer protocol-enabled server's endpoint. This is only valid in the <code>UpdateServer</code> API.</p> <note> <p>This property can only be use when <code>EndpointType</code> is set to <code>VPC</code>.</p> </note></p>
324 #[serde(rename = "AddressAllocationIds")]
325 #[serde(skip_serializing_if = "Option::is_none")]
326 pub address_allocation_ids: Option<Vec<String>>,
327 /// <p><p>A list of subnet IDs that are required to host your file transfer protocol-enabled server endpoint in your VPC.</p> <note> <p>This property can only be used when <code>EndpointType</code> is set to <code>VPC</code>.</p> </note></p>
328 #[serde(rename = "SubnetIds")]
329 #[serde(skip_serializing_if = "Option::is_none")]
330 pub subnet_ids: Option<Vec<String>>,
331 /// <p><p>The ID of the VPC endpoint.</p> <note> <p>This property can only be used when <code>EndpointType</code> is set to <code>VPC_ENDPOINT</code>.</p> </note></p>
332 #[serde(rename = "VpcEndpointId")]
333 #[serde(skip_serializing_if = "Option::is_none")]
334 pub vpc_endpoint_id: Option<String>,
335 /// <p><p>The VPC ID of the VPC in which a file transfer protocol-enabled server's endpoint will be hosted.</p> <note> <p>This property can only be used when <code>EndpointType</code> is set to <code>VPC</code>.</p> </note></p>
336 #[serde(rename = "VpcId")]
337 #[serde(skip_serializing_if = "Option::is_none")]
338 pub vpc_id: Option<String>,
339}
340
341/// <p>Represents an object that contains entries and a targets for <code>HomeDirectoryMappings</code>.</p>
342#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
343pub struct HomeDirectoryMapEntry {
344 /// <p>Represents an entry and a target for <code>HomeDirectoryMappings</code>.</p>
345 #[serde(rename = "Entry")]
346 pub entry: String,
347 /// <p>Represents the map target that is used in a <code>HomeDirectorymapEntry</code>.</p>
348 #[serde(rename = "Target")]
349 pub target: String,
350}
351
352/// <p>Returns information related to the type of user authentication that is in use for a file transfer protocol-enabled server's users. A server can have only one method of authentication.</p>
353#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
354pub struct IdentityProviderDetails {
355 /// <p>Provides the type of <code>InvocationRole</code> used to authenticate the user account.</p>
356 #[serde(rename = "InvocationRole")]
357 #[serde(skip_serializing_if = "Option::is_none")]
358 pub invocation_role: Option<String>,
359 /// <p>Provides the location of the service endpoint used to authenticate users.</p>
360 #[serde(rename = "Url")]
361 #[serde(skip_serializing_if = "Option::is_none")]
362 pub url: Option<String>,
363}
364
365#[derive(Clone, Debug, Default, PartialEq, Serialize)]
366#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
367pub struct ImportSshPublicKeyRequest {
368 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server.</p>
369 #[serde(rename = "ServerId")]
370 pub server_id: String,
371 /// <p>The public key portion of an SSH key pair.</p>
372 #[serde(rename = "SshPublicKeyBody")]
373 pub ssh_public_key_body: String,
374 /// <p>The name of the user account that is assigned to one or more file transfer protocol-enabled servers.</p>
375 #[serde(rename = "UserName")]
376 pub user_name: String,
377}
378
379/// <p>Identifies the user, the file transfer protocol-enabled server they belong to, and the identifier of the SSH public key associated with that user. A user can have more than one key on each server that they are associated with.</p>
380#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
381#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
382pub struct ImportSshPublicKeyResponse {
383 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server.</p>
384 #[serde(rename = "ServerId")]
385 pub server_id: String,
386 /// <p>The name given to a public key by the system that was imported.</p>
387 #[serde(rename = "SshPublicKeyId")]
388 pub ssh_public_key_id: String,
389 /// <p>A user name assigned to the <code>ServerID</code> value that you specified.</p>
390 #[serde(rename = "UserName")]
391 pub user_name: String,
392}
393
394#[derive(Clone, Debug, Default, PartialEq, Serialize)]
395#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
396pub struct ListServersRequest {
397 /// <p>Specifies the number of file transfer protocol-enabled servers to return as a response to the <code>ListServers</code> query.</p>
398 #[serde(rename = "MaxResults")]
399 #[serde(skip_serializing_if = "Option::is_none")]
400 pub max_results: Option<i64>,
401 /// <p>When additional results are obtained from the<code>ListServers</code> command, a <code>NextToken</code> parameter is returned in the output. You can then pass the <code>NextToken</code> parameter in a subsequent command to continue listing additional file transfer protocol-enabled servers.</p>
402 #[serde(rename = "NextToken")]
403 #[serde(skip_serializing_if = "Option::is_none")]
404 pub next_token: Option<String>,
405}
406
407#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
408#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
409pub struct ListServersResponse {
410 /// <p>When you can get additional results from the <code>ListServers</code> operation, a <code>NextToken</code> parameter is returned in the output. In a following command, you can pass in the <code>NextToken</code> parameter to continue listing additional file transfer protocol-enabled servers.</p>
411 #[serde(rename = "NextToken")]
412 #[serde(skip_serializing_if = "Option::is_none")]
413 pub next_token: Option<String>,
414 /// <p>An array of file transfer protocol-enabled servers that were listed.</p>
415 #[serde(rename = "Servers")]
416 pub servers: Vec<ListedServer>,
417}
418
419#[derive(Clone, Debug, Default, PartialEq, Serialize)]
420#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
421pub struct ListTagsForResourceRequest {
422 /// <p>Requests the tags associated with a particular Amazon Resource Name (ARN). An ARN is an identifier for a specific AWS resource, such as a server, user, or role.</p>
423 #[serde(rename = "Arn")]
424 pub arn: String,
425 /// <p>Specifies the number of tags to return as a response to the <code>ListTagsForResource</code> request.</p>
426 #[serde(rename = "MaxResults")]
427 #[serde(skip_serializing_if = "Option::is_none")]
428 pub max_results: Option<i64>,
429 /// <p>When you request additional results from the <code>ListTagsForResource</code> operation, a <code>NextToken</code> parameter is returned in the input. You can then pass in a subsequent command to the <code>NextToken</code> parameter to continue listing additional tags.</p>
430 #[serde(rename = "NextToken")]
431 #[serde(skip_serializing_if = "Option::is_none")]
432 pub next_token: Option<String>,
433}
434
435#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
436#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
437pub struct ListTagsForResourceResponse {
438 /// <p>The ARN you specified to list the tags of.</p>
439 #[serde(rename = "Arn")]
440 #[serde(skip_serializing_if = "Option::is_none")]
441 pub arn: Option<String>,
442 /// <p>When you can get additional results from the <code>ListTagsForResource</code> call, a <code>NextToken</code> parameter is returned in the output. You can then pass in a subsequent command to the <code>NextToken</code> parameter to continue listing additional tags.</p>
443 #[serde(rename = "NextToken")]
444 #[serde(skip_serializing_if = "Option::is_none")]
445 pub next_token: Option<String>,
446 /// <p>Key-value pairs that are assigned to a resource, usually for the purpose of grouping and searching for items. Tags are metadata that you define.</p>
447 #[serde(rename = "Tags")]
448 #[serde(skip_serializing_if = "Option::is_none")]
449 pub tags: Option<Vec<Tag>>,
450}
451
452#[derive(Clone, Debug, Default, PartialEq, Serialize)]
453#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
454pub struct ListUsersRequest {
455 /// <p>Specifies the number of users to return as a response to the <code>ListUsers</code> request.</p>
456 #[serde(rename = "MaxResults")]
457 #[serde(skip_serializing_if = "Option::is_none")]
458 pub max_results: Option<i64>,
459 /// <p>When you can get additional results from the <code>ListUsers</code> call, a <code>NextToken</code> parameter is returned in the output. You can then pass in a subsequent command to the <code>NextToken</code> parameter to continue listing additional users.</p>
460 #[serde(rename = "NextToken")]
461 #[serde(skip_serializing_if = "Option::is_none")]
462 pub next_token: Option<String>,
463 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server that has users assigned to it.</p>
464 #[serde(rename = "ServerId")]
465 pub server_id: String,
466}
467
468#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
469#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
470pub struct ListUsersResponse {
471 /// <p>When you can get additional results from the <code>ListUsers</code> call, a <code>NextToken</code> parameter is returned in the output. You can then pass in a subsequent command to the <code>NextToken</code> parameter to continue listing additional users.</p>
472 #[serde(rename = "NextToken")]
473 #[serde(skip_serializing_if = "Option::is_none")]
474 pub next_token: Option<String>,
475 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server that the users are assigned to.</p>
476 #[serde(rename = "ServerId")]
477 pub server_id: String,
478 /// <p>Returns the user accounts and their properties for the <code>ServerId</code> value that you specify.</p>
479 #[serde(rename = "Users")]
480 pub users: Vec<ListedUser>,
481}
482
483/// <p>Returns properties of a file transfer protocol-enabled server that was specified.</p>
484#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
485#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
486pub struct ListedServer {
487 /// <p>Specifies the unique Amazon Resource Name (ARN) for a file transfer protocol-enabled server to be listed.</p>
488 #[serde(rename = "Arn")]
489 pub arn: String,
490 /// <p>Specifies the type of VPC endpoint that your file transfer protocol-enabled server is connected to. If your server is connected to a VPC endpoint, your server isn't accessible over the public internet.</p>
491 #[serde(rename = "EndpointType")]
492 #[serde(skip_serializing_if = "Option::is_none")]
493 pub endpoint_type: Option<String>,
494 /// <p>Specifies the authentication method used to validate a user for a file transfer protocol-enabled server that was specified. This can include Secure Shell (SSH), user name and password combinations, or your own custom authentication method. Valid values include <code>SERVICE_MANAGED</code> or <code>API_GATEWAY</code>.</p>
495 #[serde(rename = "IdentityProviderType")]
496 #[serde(skip_serializing_if = "Option::is_none")]
497 pub identity_provider_type: Option<String>,
498 /// <p>Specifies the AWS Identity and Access Management (IAM) role that allows a file transfer protocol-enabled server to turn on Amazon CloudWatch logging.</p>
499 #[serde(rename = "LoggingRole")]
500 #[serde(skip_serializing_if = "Option::is_none")]
501 pub logging_role: Option<String>,
502 /// <p>Specifies the unique system assigned identifier for a file transfer protocol-enabled servers that were listed.</p>
503 #[serde(rename = "ServerId")]
504 #[serde(skip_serializing_if = "Option::is_none")]
505 pub server_id: Option<String>,
506 /// <p>Specifies the condition of a file transfer protocol-enabled server for the server that was described. A value of <code>ONLINE</code> indicates that the server can accept jobs and transfer files. A <code>State</code> value of <code>OFFLINE</code> means that the server cannot perform file transfer operations.</p> <p>The states of <code>STARTING</code> and <code>STOPPING</code> indicate that the server is in an intermediate state, either not fully able to respond, or not fully offline. The values of <code>START_FAILED</code> or <code>STOP_FAILED</code> can indicate an error condition.</p>
507 #[serde(rename = "State")]
508 #[serde(skip_serializing_if = "Option::is_none")]
509 pub state: Option<String>,
510 /// <p>Specifies the number of users that are assigned to a file transfer protocol-enabled server you specified with the <code>ServerId</code>.</p>
511 #[serde(rename = "UserCount")]
512 #[serde(skip_serializing_if = "Option::is_none")]
513 pub user_count: Option<i64>,
514}
515
516/// <p>Returns properties of the user that you specify.</p>
517#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
518#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
519pub struct ListedUser {
520 /// <p>Provides the unique Amazon Resource Name (ARN) for the user that you want to learn about.</p>
521 #[serde(rename = "Arn")]
522 pub arn: String,
523 /// <p>Specifies the location that files are written to or read from an Amazon S3 bucket for the user you specify by their ARN.</p>
524 #[serde(rename = "HomeDirectory")]
525 #[serde(skip_serializing_if = "Option::is_none")]
526 pub home_directory: Option<String>,
527 /// <p>Specifies the type of landing directory (folder) you mapped for your users' home directory. If you set it to <code>PATH</code>, the user will see the absolute Amazon S3 bucket paths as is in their file transfer protocol clients. If you set it <code>LOGICAL</code>, you will need to provide mappings in the <code>HomeDirectoryMappings</code> for how you want to make Amazon S3 paths visible to your users.</p>
528 #[serde(rename = "HomeDirectoryType")]
529 #[serde(skip_serializing_if = "Option::is_none")]
530 pub home_directory_type: Option<String>,
531 /// <p>Specifies the role that is in use by this user. A <i>role</i> is an AWS Identity and Access Management (IAM) entity that, in this case, allows a file transfer protocol-enabled server to act on a user's behalf. It allows the server to inherit the trust relationship that enables that user to perform file operations to their Amazon S3 bucket.</p>
532 #[serde(rename = "Role")]
533 #[serde(skip_serializing_if = "Option::is_none")]
534 pub role: Option<String>,
535 /// <p>Specifies the number of SSH public keys stored for the user you specified.</p>
536 #[serde(rename = "SshPublicKeyCount")]
537 #[serde(skip_serializing_if = "Option::is_none")]
538 pub ssh_public_key_count: Option<i64>,
539 /// <p>Specifies the name of the user whose ARN was specified. User names are used for authentication purposes.</p>
540 #[serde(rename = "UserName")]
541 #[serde(skip_serializing_if = "Option::is_none")]
542 pub user_name: Option<String>,
543}
544
545/// <p>Provides information about the public Secure Shell (SSH) key that is associated with a user account for the specific file transfer protocol-enabled server (as identified by <code>ServerId</code>). The information returned includes the date the key was imported, the public key contents, and the public key ID. A user can store more than one SSH public key associated with their user name on a specific server.</p>
546#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
547#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
548pub struct SshPublicKey {
549 /// <p>Specifies the date that the public key was added to the user account.</p>
550 #[serde(rename = "DateImported")]
551 pub date_imported: f64,
552 /// <p>Specifies the content of the SSH public key as specified by the <code>PublicKeyId</code>.</p>
553 #[serde(rename = "SshPublicKeyBody")]
554 pub ssh_public_key_body: String,
555 /// <p>Specifies the <code>SshPublicKeyId</code> parameter contains the identifier of the public key.</p>
556 #[serde(rename = "SshPublicKeyId")]
557 pub ssh_public_key_id: String,
558}
559
560#[derive(Clone, Debug, Default, PartialEq, Serialize)]
561#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
562pub struct StartServerRequest {
563 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server that you start.</p>
564 #[serde(rename = "ServerId")]
565 pub server_id: String,
566}
567
568#[derive(Clone, Debug, Default, PartialEq, Serialize)]
569#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
570pub struct StopServerRequest {
571 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server that you stopped.</p>
572 #[serde(rename = "ServerId")]
573 pub server_id: String,
574}
575
576/// <p>Creates a key-value pair for a specific resource. Tags are metadata that you can use to search for and group a resource for various purposes. You can apply tags to servers, users, and roles. A tag key can take more than one value. For example, to group servers for accounting purposes, you might create a tag called <code>Group</code> and assign the values <code>Research</code> and <code>Accounting</code> to that group.</p>
577#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
578pub struct Tag {
579 /// <p>The name assigned to the tag that you create.</p>
580 #[serde(rename = "Key")]
581 pub key: String,
582 /// <p>Contains one or more values that you assigned to the key name you create.</p>
583 #[serde(rename = "Value")]
584 pub value: String,
585}
586
587#[derive(Clone, Debug, Default, PartialEq, Serialize)]
588#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
589pub struct TagResourceRequest {
590 /// <p>An Amazon Resource Name (ARN) for a specific AWS resource, such as a server, user, or role.</p>
591 #[serde(rename = "Arn")]
592 pub arn: String,
593 /// <p>Key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to user accounts for any purpose.</p>
594 #[serde(rename = "Tags")]
595 pub tags: Vec<Tag>,
596}
597
598#[derive(Clone, Debug, Default, PartialEq, Serialize)]
599#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
600pub struct TestIdentityProviderRequest {
601 /// <p>A system-assigned identifier for a specific file transfer protocol-enabled server. That server's user authentication method is tested with a user name and password.</p>
602 #[serde(rename = "ServerId")]
603 pub server_id: String,
604 /// <p><p>The type of file transfer protocol to be tested.</p> <p>The available protocols are:</p> <ul> <li> <p>Secure Shell (SSH) File Transfer Protocol (SFTP)</p> </li> <li> <p>File Transfer Protocol Secure (FTPS)</p> </li> <li> <p>File Transfer Protocol (FTP)</p> </li> </ul></p>
605 #[serde(rename = "ServerProtocol")]
606 #[serde(skip_serializing_if = "Option::is_none")]
607 pub server_protocol: Option<String>,
608 /// <p>The source IP address of the user account to be tested.</p>
609 #[serde(rename = "SourceIp")]
610 #[serde(skip_serializing_if = "Option::is_none")]
611 pub source_ip: Option<String>,
612 /// <p>The name of the user account to be tested.</p>
613 #[serde(rename = "UserName")]
614 pub user_name: String,
615 /// <p>The password of the user account to be tested.</p>
616 #[serde(rename = "UserPassword")]
617 #[serde(skip_serializing_if = "Option::is_none")]
618 pub user_password: Option<String>,
619}
620
621#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
622#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
623pub struct TestIdentityProviderResponse {
624 /// <p>A message that indicates whether the test was successful or not.</p>
625 #[serde(rename = "Message")]
626 #[serde(skip_serializing_if = "Option::is_none")]
627 pub message: Option<String>,
628 /// <p>The response that is returned from your API Gateway.</p>
629 #[serde(rename = "Response")]
630 #[serde(skip_serializing_if = "Option::is_none")]
631 pub response: Option<String>,
632 /// <p>The HTTP status code that is the response from your API Gateway.</p>
633 #[serde(rename = "StatusCode")]
634 pub status_code: i64,
635 /// <p>The endpoint of the service used to authenticate a user.</p>
636 #[serde(rename = "Url")]
637 pub url: String,
638}
639
640#[derive(Clone, Debug, Default, PartialEq, Serialize)]
641#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
642pub struct UntagResourceRequest {
643 /// <p>The value of the resource that will have the tag removed. An Amazon Resource Name (ARN) is an identifier for a specific AWS resource, such as a server, user, or role.</p>
644 #[serde(rename = "Arn")]
645 pub arn: String,
646 /// <p>TagKeys are key-value pairs assigned to ARNs that can be used to group and search for resources by type. This metadata can be attached to resources for any purpose.</p>
647 #[serde(rename = "TagKeys")]
648 pub tag_keys: Vec<String>,
649}
650
651#[derive(Clone, Debug, Default, PartialEq, Serialize)]
652#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
653pub struct UpdateServerRequest {
654 /// <p><p>The Amazon Resource Name (ARN) of the AWS Certificate Manager (ACM) certificate. Required when <code>Protocols</code> is set to <code>FTPS</code>.</p> <p>To request a new public certificate, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html">Request a public certificate</a> in the <i> AWS Certificate Manager User Guide</i>.</p> <p>To import an existing certificate into ACM, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html">Importing certificates into ACM</a> in the <i> AWS Certificate Manager User Guide</i>.</p> <p>To request a private certificate to use FTPS through private IP addresses, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-private.html">Request a private certificate</a> in the <i> AWS Certificate Manager User Guide</i>.</p> <p>Certificates with the following cryptographic algorithms and key sizes are supported:</p> <ul> <li> <p>2048-bit RSA (RSA<em>2048)</p> </li> <li> <p>4096-bit RSA (RSA</em>4096)</p> </li> <li> <p>Elliptic Prime Curve 256 bit (EC<em>prime256v1)</p> </li> <li> <p>Elliptic Prime Curve 384 bit (EC</em>secp384r1)</p> </li> <li> <p>Elliptic Prime Curve 521 bit (EC_secp521r1)</p> </li> </ul> <note> <p>The certificate must be a valid SSL/TLS X.509 version 3 certificate with FQDN or IP address specified and information about the issuer.</p> </note></p>
655 #[serde(rename = "Certificate")]
656 #[serde(skip_serializing_if = "Option::is_none")]
657 pub certificate: Option<String>,
658 /// <p>The virtual private cloud (VPC) endpoint settings that are configured for your file transfer protocol-enabled server. With a VPC endpoint, you can restrict access to your server to resources only within your VPC. To control incoming internet traffic, you will need to associate one or more Elastic IP addresses with your server's endpoint.</p>
659 #[serde(rename = "EndpointDetails")]
660 #[serde(skip_serializing_if = "Option::is_none")]
661 pub endpoint_details: Option<EndpointDetails>,
662 /// <p><p>The type of endpoint that you want your file transfer protocol-enabled server to connect to. You can choose to connect to the public internet or a VPC endpoint. With a VPC endpoint, you can restrict access to your server and resources only within your VPC.</p> <note> <p>It is recommended that you use <code>VPC</code> as the <code>EndpointType</code>. With this endpoint type, you have the option to directly associate up to three Elastic IPv4 addresses (BYO IP included) with your server's endpoint and use VPC security groups to restrict traffic by the client's public IP address. This is not possible with <code>EndpointType</code> set to <code>VPC_ENDPOINT</code>.</p> </note></p>
663 #[serde(rename = "EndpointType")]
664 #[serde(skip_serializing_if = "Option::is_none")]
665 pub endpoint_type: Option<String>,
666 /// <p>The RSA private key as generated by <code>ssh-keygen -N "" -m PEM -f my-new-server-key</code>.</p> <important> <p>If you aren't planning to migrate existing users from an existing file transfer protocol-enabled server to a new server, don't update the host key. Accidentally changing a server's host key can be disruptive.</p> </important> <p>For more information, see <a href="https://docs.aws.amazon.com/transfer/latest/userguide/edit-server-config.html#configuring-servers-change-host-key">Change the host key for your SFTP-enabled server</a> in the <i>AWS Transfer Family User Guide</i>.</p>
667 #[serde(rename = "HostKey")]
668 #[serde(skip_serializing_if = "Option::is_none")]
669 pub host_key: Option<String>,
670 /// <p>An array containing all of the information required to call a customer's authentication API method.</p>
671 #[serde(rename = "IdentityProviderDetails")]
672 #[serde(skip_serializing_if = "Option::is_none")]
673 pub identity_provider_details: Option<IdentityProviderDetails>,
674 /// <p>Changes the AWS Identity and Access Management (IAM) role that allows Amazon S3 events to be logged in Amazon CloudWatch, turning logging on or off.</p>
675 #[serde(rename = "LoggingRole")]
676 #[serde(skip_serializing_if = "Option::is_none")]
677 pub logging_role: Option<String>,
678 /// <p><p>Specifies the file transfer protocol or protocols over which your file transfer protocol client can connect to your server's endpoint. The available protocols are:</p> <ul> <li> <p>Secure Shell (SSH) File Transfer Protocol (SFTP): File transfer over SSH</p> </li> <li> <p>File Transfer Protocol Secure (FTPS): File transfer with TLS encryption</p> </li> <li> <p>File Transfer Protocol (FTP): Unencrypted file transfer</p> </li> </ul> <note> <p>If you select <code>FTPS</code>, you must choose a certificate stored in AWS Certificate Manager (ACM) which will be used to identify your server when clients connect to it over FTPS.</p> <p>If <code>Protocol</code> includes either <code>FTP</code> or <code>FTPS</code>, then the <code>EndpointType</code> must be <code>VPC</code> and the <code>IdentityProviderType</code> must be <code>API<em>GATEWAY</code>.</p> <p>If <code>Protocol</code> includes <code>FTP</code>, then <code>AddressAllocationIds</code> cannot be associated.</p> <p>If <code>Protocol</code> is set only to <code>SFTP</code>, the <code>EndpointType</code> can be set to <code>PUBLIC</code> and the <code>IdentityProviderType</code> can be set to <code>SERVICE</em>MANAGED</code>.</p> </note></p>
679 #[serde(rename = "Protocols")]
680 #[serde(skip_serializing_if = "Option::is_none")]
681 pub protocols: Option<Vec<String>>,
682 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server instance that the user account is assigned to.</p>
683 #[serde(rename = "ServerId")]
684 pub server_id: String,
685}
686
687#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
688#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
689pub struct UpdateServerResponse {
690 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server that the user account is assigned to.</p>
691 #[serde(rename = "ServerId")]
692 pub server_id: String,
693}
694
695#[derive(Clone, Debug, Default, PartialEq, Serialize)]
696#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
697pub struct UpdateUserRequest {
698 /// <p>Specifies the landing directory (folder) for a user when they log in to the file transfer protocol-enabled server using their file transfer protocol client.</p> <p>An example is <code>your-Amazon-S3-bucket-name>/home/username</code>.</p>
699 #[serde(rename = "HomeDirectory")]
700 #[serde(skip_serializing_if = "Option::is_none")]
701 pub home_directory: Option<String>,
702 /// <p><p>Logical directory mappings that specify what Amazon S3 paths and keys should be visible to your user and how you want to make them visible. You will need to specify the "<code>Entry</code>" and "<code>Target</code>" pair, where <code>Entry</code> shows how the path is made visible and <code>Target</code> is the actual Amazon S3 path. If you only specify a target, it will be displayed as is. You will need to also make sure that your IAM role provides access to paths in <code>Target</code>. The following is an example.</p> <p> <code>'[ "/bucket2/documentation", { "Entry": "your-personal-report.pdf", "Target": "/bucket3/customized-reports/${transfer:UserName}.pdf" } ]'</code> </p> <p>In most cases, you can use this value instead of the scope-down policy to lock your user down to the designated home directory ("chroot"). To do this, you can set <code>Entry</code> to '/' and set <code>Target</code> to the HomeDirectory parameter value.</p> <note> <p>If the target of a logical directory entry does not exist in Amazon S3, the entry will be ignored. As a workaround, you can use the Amazon S3 api to create 0 byte objects as place holders for your directory. If using the CLI, use the <code>s3api</code> call instead of <code>s3</code> so you can use the put-object operation. For example, you use the following: <code>aws s3api put-object --bucket bucketname --key path/to/folder/</code>. Make sure that the end of the key name ends in a / for it to be considered a folder.</p> </note></p>
703 #[serde(rename = "HomeDirectoryMappings")]
704 #[serde(skip_serializing_if = "Option::is_none")]
705 pub home_directory_mappings: Option<Vec<HomeDirectoryMapEntry>>,
706 /// <p>The type of landing directory (folder) you want your users' home directory to be when they log into the file transfer protocol-enabled server. If you set it to <code>PATH</code>, the user will see the absolute Amazon S3 bucket paths as is in their file transfer protocol clients. If you set it <code>LOGICAL</code>, you will need to provide mappings in the <code>HomeDirectoryMappings</code> for how you want to make Amazon S3 paths visible to your users.</p>
707 #[serde(rename = "HomeDirectoryType")]
708 #[serde(skip_serializing_if = "Option::is_none")]
709 pub home_directory_type: Option<String>,
710 /// <p><p>Allows you to supply a scope-down policy for your user so you can use the same IAM role across multiple users. The policy scopes down user access to portions of your Amazon S3 bucket. Variables you can use inside this policy include <code>${Transfer:UserName}</code>, <code>${Transfer:HomeDirectory}</code>, and <code>${Transfer:HomeBucket}</code>.</p> <note> <p>For scope-down policies, AWS Transfer Family stores the policy as a JSON blob, instead of the Amazon Resource Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the <code>Policy</code> argument.</p> <p>For an example of a scope-down policy, see <a href="https://docs.aws.amazon.com/transfer/latest/userguide/users.html#users-policies-scope-down">Creating a scope-down policy</a>.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html">AssumeRole</a> in the <i>AWS Security Token Service API Reference</i>.</p> </note></p>
711 #[serde(rename = "Policy")]
712 #[serde(skip_serializing_if = "Option::is_none")]
713 pub policy: Option<String>,
714 /// <p>The IAM role that controls your users' access to your Amazon S3 bucket. The policies attached to this role will determine the level of access you want to provide your users when transferring files into and out of your Amazon S3 bucket or buckets. The IAM role should also contain a trust relationship that allows the file transfer protocol-enabled server to access your resources when servicing your users' transfer requests.</p>
715 #[serde(rename = "Role")]
716 #[serde(skip_serializing_if = "Option::is_none")]
717 pub role: Option<String>,
718 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server instance that the user account is assigned to.</p>
719 #[serde(rename = "ServerId")]
720 pub server_id: String,
721 /// <p>A unique string that identifies a user and is associated with a file transfer protocol-enabled server as specified by the <code>ServerId</code>. This is the string that will be used by your user when they log in to your server. This user name is a minimum of 3 and a maximum of 32 characters long. The following are valid characters: a-z, A-Z, 0-9, underscore, and hyphen. The user name can't start with a hyphen.</p>
722 #[serde(rename = "UserName")]
723 pub user_name: String,
724}
725
726/// <p> <code>UpdateUserResponse</code> returns the user name and file transfer protocol-enabled server identifier for the request to update a user's properties.</p>
727#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
728#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
729pub struct UpdateUserResponse {
730 /// <p>A system-assigned unique identifier for a file transfer protocol-enabled server instance that the user account is assigned to.</p>
731 #[serde(rename = "ServerId")]
732 pub server_id: String,
733 /// <p>The unique identifier for a user that is assigned to a file transfer protocol-enabled server instance that was specified in the request.</p>
734 #[serde(rename = "UserName")]
735 pub user_name: String,
736}
737
738/// Errors returned by CreateServer
739#[derive(Debug, PartialEq)]
740pub enum CreateServerError {
741 /// <p>You do not have sufficient access to perform this action.</p>
742 AccessDenied(String),
743 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
744 InternalServiceError(String),
745 /// <p>This exception is thrown when the client submits a malformed request.</p>
746 InvalidRequest(String),
747 /// <p>The requested resource does not exist.</p>
748 ResourceExists(String),
749 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
750 ServiceUnavailable(String),
751 /// <p>The request was denied due to request throttling.</p> <p> HTTP Status Code: 400</p>
752 Throttling(String),
753}
754
755impl CreateServerError {
756 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateServerError> {
757 if let Some(err) = proto::json::Error::parse(&res) {
758 match err.typ.as_str() {
759 "AccessDeniedException" => {
760 return RusotoError::Service(CreateServerError::AccessDenied(err.msg))
761 }
762 "InternalServiceError" => {
763 return RusotoError::Service(CreateServerError::InternalServiceError(err.msg))
764 }
765 "InvalidRequestException" => {
766 return RusotoError::Service(CreateServerError::InvalidRequest(err.msg))
767 }
768 "ResourceExistsException" => {
769 return RusotoError::Service(CreateServerError::ResourceExists(err.msg))
770 }
771 "ServiceUnavailableException" => {
772 return RusotoError::Service(CreateServerError::ServiceUnavailable(err.msg))
773 }
774 "ThrottlingException" => {
775 return RusotoError::Service(CreateServerError::Throttling(err.msg))
776 }
777 "ValidationException" => return RusotoError::Validation(err.msg),
778 _ => {}
779 }
780 }
781 RusotoError::Unknown(res)
782 }
783}
784impl fmt::Display for CreateServerError {
785 #[allow(unused_variables)]
786 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
787 match *self {
788 CreateServerError::AccessDenied(ref cause) => write!(f, "{}", cause),
789 CreateServerError::InternalServiceError(ref cause) => write!(f, "{}", cause),
790 CreateServerError::InvalidRequest(ref cause) => write!(f, "{}", cause),
791 CreateServerError::ResourceExists(ref cause) => write!(f, "{}", cause),
792 CreateServerError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
793 CreateServerError::Throttling(ref cause) => write!(f, "{}", cause),
794 }
795 }
796}
797impl Error for CreateServerError {}
798/// Errors returned by CreateUser
799#[derive(Debug, PartialEq)]
800pub enum CreateUserError {
801 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
802 InternalServiceError(String),
803 /// <p>This exception is thrown when the client submits a malformed request.</p>
804 InvalidRequest(String),
805 /// <p>The requested resource does not exist.</p>
806 ResourceExists(String),
807 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
808 ResourceNotFound(String),
809 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
810 ServiceUnavailable(String),
811}
812
813impl CreateUserError {
814 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateUserError> {
815 if let Some(err) = proto::json::Error::parse(&res) {
816 match err.typ.as_str() {
817 "InternalServiceError" => {
818 return RusotoError::Service(CreateUserError::InternalServiceError(err.msg))
819 }
820 "InvalidRequestException" => {
821 return RusotoError::Service(CreateUserError::InvalidRequest(err.msg))
822 }
823 "ResourceExistsException" => {
824 return RusotoError::Service(CreateUserError::ResourceExists(err.msg))
825 }
826 "ResourceNotFoundException" => {
827 return RusotoError::Service(CreateUserError::ResourceNotFound(err.msg))
828 }
829 "ServiceUnavailableException" => {
830 return RusotoError::Service(CreateUserError::ServiceUnavailable(err.msg))
831 }
832 "ValidationException" => return RusotoError::Validation(err.msg),
833 _ => {}
834 }
835 }
836 RusotoError::Unknown(res)
837 }
838}
839impl fmt::Display for CreateUserError {
840 #[allow(unused_variables)]
841 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
842 match *self {
843 CreateUserError::InternalServiceError(ref cause) => write!(f, "{}", cause),
844 CreateUserError::InvalidRequest(ref cause) => write!(f, "{}", cause),
845 CreateUserError::ResourceExists(ref cause) => write!(f, "{}", cause),
846 CreateUserError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
847 CreateUserError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
848 }
849 }
850}
851impl Error for CreateUserError {}
852/// Errors returned by DeleteServer
853#[derive(Debug, PartialEq)]
854pub enum DeleteServerError {
855 /// <p>You do not have sufficient access to perform this action.</p>
856 AccessDenied(String),
857 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
858 InternalServiceError(String),
859 /// <p>This exception is thrown when the client submits a malformed request.</p>
860 InvalidRequest(String),
861 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
862 ResourceNotFound(String),
863 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
864 ServiceUnavailable(String),
865}
866
867impl DeleteServerError {
868 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteServerError> {
869 if let Some(err) = proto::json::Error::parse(&res) {
870 match err.typ.as_str() {
871 "AccessDeniedException" => {
872 return RusotoError::Service(DeleteServerError::AccessDenied(err.msg))
873 }
874 "InternalServiceError" => {
875 return RusotoError::Service(DeleteServerError::InternalServiceError(err.msg))
876 }
877 "InvalidRequestException" => {
878 return RusotoError::Service(DeleteServerError::InvalidRequest(err.msg))
879 }
880 "ResourceNotFoundException" => {
881 return RusotoError::Service(DeleteServerError::ResourceNotFound(err.msg))
882 }
883 "ServiceUnavailableException" => {
884 return RusotoError::Service(DeleteServerError::ServiceUnavailable(err.msg))
885 }
886 "ValidationException" => return RusotoError::Validation(err.msg),
887 _ => {}
888 }
889 }
890 RusotoError::Unknown(res)
891 }
892}
893impl fmt::Display for DeleteServerError {
894 #[allow(unused_variables)]
895 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
896 match *self {
897 DeleteServerError::AccessDenied(ref cause) => write!(f, "{}", cause),
898 DeleteServerError::InternalServiceError(ref cause) => write!(f, "{}", cause),
899 DeleteServerError::InvalidRequest(ref cause) => write!(f, "{}", cause),
900 DeleteServerError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
901 DeleteServerError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
902 }
903 }
904}
905impl Error for DeleteServerError {}
906/// Errors returned by DeleteSshPublicKey
907#[derive(Debug, PartialEq)]
908pub enum DeleteSshPublicKeyError {
909 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
910 InternalServiceError(String),
911 /// <p>This exception is thrown when the client submits a malformed request.</p>
912 InvalidRequest(String),
913 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
914 ResourceNotFound(String),
915 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
916 ServiceUnavailable(String),
917 /// <p>The request was denied due to request throttling.</p> <p> HTTP Status Code: 400</p>
918 Throttling(String),
919}
920
921impl DeleteSshPublicKeyError {
922 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteSshPublicKeyError> {
923 if let Some(err) = proto::json::Error::parse(&res) {
924 match err.typ.as_str() {
925 "InternalServiceError" => {
926 return RusotoError::Service(DeleteSshPublicKeyError::InternalServiceError(
927 err.msg,
928 ))
929 }
930 "InvalidRequestException" => {
931 return RusotoError::Service(DeleteSshPublicKeyError::InvalidRequest(err.msg))
932 }
933 "ResourceNotFoundException" => {
934 return RusotoError::Service(DeleteSshPublicKeyError::ResourceNotFound(err.msg))
935 }
936 "ServiceUnavailableException" => {
937 return RusotoError::Service(DeleteSshPublicKeyError::ServiceUnavailable(
938 err.msg,
939 ))
940 }
941 "ThrottlingException" => {
942 return RusotoError::Service(DeleteSshPublicKeyError::Throttling(err.msg))
943 }
944 "ValidationException" => return RusotoError::Validation(err.msg),
945 _ => {}
946 }
947 }
948 RusotoError::Unknown(res)
949 }
950}
951impl fmt::Display for DeleteSshPublicKeyError {
952 #[allow(unused_variables)]
953 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
954 match *self {
955 DeleteSshPublicKeyError::InternalServiceError(ref cause) => write!(f, "{}", cause),
956 DeleteSshPublicKeyError::InvalidRequest(ref cause) => write!(f, "{}", cause),
957 DeleteSshPublicKeyError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
958 DeleteSshPublicKeyError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
959 DeleteSshPublicKeyError::Throttling(ref cause) => write!(f, "{}", cause),
960 }
961 }
962}
963impl Error for DeleteSshPublicKeyError {}
964/// Errors returned by DeleteUser
965#[derive(Debug, PartialEq)]
966pub enum DeleteUserError {
967 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
968 InternalServiceError(String),
969 /// <p>This exception is thrown when the client submits a malformed request.</p>
970 InvalidRequest(String),
971 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
972 ResourceNotFound(String),
973 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
974 ServiceUnavailable(String),
975}
976
977impl DeleteUserError {
978 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteUserError> {
979 if let Some(err) = proto::json::Error::parse(&res) {
980 match err.typ.as_str() {
981 "InternalServiceError" => {
982 return RusotoError::Service(DeleteUserError::InternalServiceError(err.msg))
983 }
984 "InvalidRequestException" => {
985 return RusotoError::Service(DeleteUserError::InvalidRequest(err.msg))
986 }
987 "ResourceNotFoundException" => {
988 return RusotoError::Service(DeleteUserError::ResourceNotFound(err.msg))
989 }
990 "ServiceUnavailableException" => {
991 return RusotoError::Service(DeleteUserError::ServiceUnavailable(err.msg))
992 }
993 "ValidationException" => return RusotoError::Validation(err.msg),
994 _ => {}
995 }
996 }
997 RusotoError::Unknown(res)
998 }
999}
1000impl fmt::Display for DeleteUserError {
1001 #[allow(unused_variables)]
1002 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1003 match *self {
1004 DeleteUserError::InternalServiceError(ref cause) => write!(f, "{}", cause),
1005 DeleteUserError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1006 DeleteUserError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1007 DeleteUserError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1008 }
1009 }
1010}
1011impl Error for DeleteUserError {}
1012/// Errors returned by DescribeServer
1013#[derive(Debug, PartialEq)]
1014pub enum DescribeServerError {
1015 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
1016 InternalServiceError(String),
1017 /// <p>This exception is thrown when the client submits a malformed request.</p>
1018 InvalidRequest(String),
1019 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
1020 ResourceNotFound(String),
1021 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
1022 ServiceUnavailable(String),
1023}
1024
1025impl DescribeServerError {
1026 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeServerError> {
1027 if let Some(err) = proto::json::Error::parse(&res) {
1028 match err.typ.as_str() {
1029 "InternalServiceError" => {
1030 return RusotoError::Service(DescribeServerError::InternalServiceError(err.msg))
1031 }
1032 "InvalidRequestException" => {
1033 return RusotoError::Service(DescribeServerError::InvalidRequest(err.msg))
1034 }
1035 "ResourceNotFoundException" => {
1036 return RusotoError::Service(DescribeServerError::ResourceNotFound(err.msg))
1037 }
1038 "ServiceUnavailableException" => {
1039 return RusotoError::Service(DescribeServerError::ServiceUnavailable(err.msg))
1040 }
1041 "ValidationException" => return RusotoError::Validation(err.msg),
1042 _ => {}
1043 }
1044 }
1045 RusotoError::Unknown(res)
1046 }
1047}
1048impl fmt::Display for DescribeServerError {
1049 #[allow(unused_variables)]
1050 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1051 match *self {
1052 DescribeServerError::InternalServiceError(ref cause) => write!(f, "{}", cause),
1053 DescribeServerError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1054 DescribeServerError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1055 DescribeServerError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1056 }
1057 }
1058}
1059impl Error for DescribeServerError {}
1060/// Errors returned by DescribeUser
1061#[derive(Debug, PartialEq)]
1062pub enum DescribeUserError {
1063 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
1064 InternalServiceError(String),
1065 /// <p>This exception is thrown when the client submits a malformed request.</p>
1066 InvalidRequest(String),
1067 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
1068 ResourceNotFound(String),
1069 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
1070 ServiceUnavailable(String),
1071}
1072
1073impl DescribeUserError {
1074 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeUserError> {
1075 if let Some(err) = proto::json::Error::parse(&res) {
1076 match err.typ.as_str() {
1077 "InternalServiceError" => {
1078 return RusotoError::Service(DescribeUserError::InternalServiceError(err.msg))
1079 }
1080 "InvalidRequestException" => {
1081 return RusotoError::Service(DescribeUserError::InvalidRequest(err.msg))
1082 }
1083 "ResourceNotFoundException" => {
1084 return RusotoError::Service(DescribeUserError::ResourceNotFound(err.msg))
1085 }
1086 "ServiceUnavailableException" => {
1087 return RusotoError::Service(DescribeUserError::ServiceUnavailable(err.msg))
1088 }
1089 "ValidationException" => return RusotoError::Validation(err.msg),
1090 _ => {}
1091 }
1092 }
1093 RusotoError::Unknown(res)
1094 }
1095}
1096impl fmt::Display for DescribeUserError {
1097 #[allow(unused_variables)]
1098 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1099 match *self {
1100 DescribeUserError::InternalServiceError(ref cause) => write!(f, "{}", cause),
1101 DescribeUserError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1102 DescribeUserError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1103 DescribeUserError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1104 }
1105 }
1106}
1107impl Error for DescribeUserError {}
1108/// Errors returned by ImportSshPublicKey
1109#[derive(Debug, PartialEq)]
1110pub enum ImportSshPublicKeyError {
1111 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
1112 InternalServiceError(String),
1113 /// <p>This exception is thrown when the client submits a malformed request.</p>
1114 InvalidRequest(String),
1115 /// <p>The requested resource does not exist.</p>
1116 ResourceExists(String),
1117 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
1118 ResourceNotFound(String),
1119 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
1120 ServiceUnavailable(String),
1121 /// <p>The request was denied due to request throttling.</p> <p> HTTP Status Code: 400</p>
1122 Throttling(String),
1123}
1124
1125impl ImportSshPublicKeyError {
1126 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ImportSshPublicKeyError> {
1127 if let Some(err) = proto::json::Error::parse(&res) {
1128 match err.typ.as_str() {
1129 "InternalServiceError" => {
1130 return RusotoError::Service(ImportSshPublicKeyError::InternalServiceError(
1131 err.msg,
1132 ))
1133 }
1134 "InvalidRequestException" => {
1135 return RusotoError::Service(ImportSshPublicKeyError::InvalidRequest(err.msg))
1136 }
1137 "ResourceExistsException" => {
1138 return RusotoError::Service(ImportSshPublicKeyError::ResourceExists(err.msg))
1139 }
1140 "ResourceNotFoundException" => {
1141 return RusotoError::Service(ImportSshPublicKeyError::ResourceNotFound(err.msg))
1142 }
1143 "ServiceUnavailableException" => {
1144 return RusotoError::Service(ImportSshPublicKeyError::ServiceUnavailable(
1145 err.msg,
1146 ))
1147 }
1148 "ThrottlingException" => {
1149 return RusotoError::Service(ImportSshPublicKeyError::Throttling(err.msg))
1150 }
1151 "ValidationException" => return RusotoError::Validation(err.msg),
1152 _ => {}
1153 }
1154 }
1155 RusotoError::Unknown(res)
1156 }
1157}
1158impl fmt::Display for ImportSshPublicKeyError {
1159 #[allow(unused_variables)]
1160 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1161 match *self {
1162 ImportSshPublicKeyError::InternalServiceError(ref cause) => write!(f, "{}", cause),
1163 ImportSshPublicKeyError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1164 ImportSshPublicKeyError::ResourceExists(ref cause) => write!(f, "{}", cause),
1165 ImportSshPublicKeyError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1166 ImportSshPublicKeyError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1167 ImportSshPublicKeyError::Throttling(ref cause) => write!(f, "{}", cause),
1168 }
1169 }
1170}
1171impl Error for ImportSshPublicKeyError {}
1172/// Errors returned by ListServers
1173#[derive(Debug, PartialEq)]
1174pub enum ListServersError {
1175 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
1176 InternalServiceError(String),
1177 /// <p>The <code>NextToken</code> parameter that was passed is invalid.</p>
1178 InvalidNextToken(String),
1179 /// <p>This exception is thrown when the client submits a malformed request.</p>
1180 InvalidRequest(String),
1181 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
1182 ServiceUnavailable(String),
1183}
1184
1185impl ListServersError {
1186 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListServersError> {
1187 if let Some(err) = proto::json::Error::parse(&res) {
1188 match err.typ.as_str() {
1189 "InternalServiceError" => {
1190 return RusotoError::Service(ListServersError::InternalServiceError(err.msg))
1191 }
1192 "InvalidNextTokenException" => {
1193 return RusotoError::Service(ListServersError::InvalidNextToken(err.msg))
1194 }
1195 "InvalidRequestException" => {
1196 return RusotoError::Service(ListServersError::InvalidRequest(err.msg))
1197 }
1198 "ServiceUnavailableException" => {
1199 return RusotoError::Service(ListServersError::ServiceUnavailable(err.msg))
1200 }
1201 "ValidationException" => return RusotoError::Validation(err.msg),
1202 _ => {}
1203 }
1204 }
1205 RusotoError::Unknown(res)
1206 }
1207}
1208impl fmt::Display for ListServersError {
1209 #[allow(unused_variables)]
1210 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1211 match *self {
1212 ListServersError::InternalServiceError(ref cause) => write!(f, "{}", cause),
1213 ListServersError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
1214 ListServersError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1215 ListServersError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1216 }
1217 }
1218}
1219impl Error for ListServersError {}
1220/// Errors returned by ListTagsForResource
1221#[derive(Debug, PartialEq)]
1222pub enum ListTagsForResourceError {
1223 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
1224 InternalServiceError(String),
1225 /// <p>The <code>NextToken</code> parameter that was passed is invalid.</p>
1226 InvalidNextToken(String),
1227 /// <p>This exception is thrown when the client submits a malformed request.</p>
1228 InvalidRequest(String),
1229 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
1230 ServiceUnavailable(String),
1231}
1232
1233impl ListTagsForResourceError {
1234 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
1235 if let Some(err) = proto::json::Error::parse(&res) {
1236 match err.typ.as_str() {
1237 "InternalServiceError" => {
1238 return RusotoError::Service(ListTagsForResourceError::InternalServiceError(
1239 err.msg,
1240 ))
1241 }
1242 "InvalidNextTokenException" => {
1243 return RusotoError::Service(ListTagsForResourceError::InvalidNextToken(
1244 err.msg,
1245 ))
1246 }
1247 "InvalidRequestException" => {
1248 return RusotoError::Service(ListTagsForResourceError::InvalidRequest(err.msg))
1249 }
1250 "ServiceUnavailableException" => {
1251 return RusotoError::Service(ListTagsForResourceError::ServiceUnavailable(
1252 err.msg,
1253 ))
1254 }
1255 "ValidationException" => return RusotoError::Validation(err.msg),
1256 _ => {}
1257 }
1258 }
1259 RusotoError::Unknown(res)
1260 }
1261}
1262impl fmt::Display for ListTagsForResourceError {
1263 #[allow(unused_variables)]
1264 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1265 match *self {
1266 ListTagsForResourceError::InternalServiceError(ref cause) => write!(f, "{}", cause),
1267 ListTagsForResourceError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
1268 ListTagsForResourceError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1269 ListTagsForResourceError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1270 }
1271 }
1272}
1273impl Error for ListTagsForResourceError {}
1274/// Errors returned by ListUsers
1275#[derive(Debug, PartialEq)]
1276pub enum ListUsersError {
1277 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
1278 InternalServiceError(String),
1279 /// <p>The <code>NextToken</code> parameter that was passed is invalid.</p>
1280 InvalidNextToken(String),
1281 /// <p>This exception is thrown when the client submits a malformed request.</p>
1282 InvalidRequest(String),
1283 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
1284 ResourceNotFound(String),
1285 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
1286 ServiceUnavailable(String),
1287}
1288
1289impl ListUsersError {
1290 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListUsersError> {
1291 if let Some(err) = proto::json::Error::parse(&res) {
1292 match err.typ.as_str() {
1293 "InternalServiceError" => {
1294 return RusotoError::Service(ListUsersError::InternalServiceError(err.msg))
1295 }
1296 "InvalidNextTokenException" => {
1297 return RusotoError::Service(ListUsersError::InvalidNextToken(err.msg))
1298 }
1299 "InvalidRequestException" => {
1300 return RusotoError::Service(ListUsersError::InvalidRequest(err.msg))
1301 }
1302 "ResourceNotFoundException" => {
1303 return RusotoError::Service(ListUsersError::ResourceNotFound(err.msg))
1304 }
1305 "ServiceUnavailableException" => {
1306 return RusotoError::Service(ListUsersError::ServiceUnavailable(err.msg))
1307 }
1308 "ValidationException" => return RusotoError::Validation(err.msg),
1309 _ => {}
1310 }
1311 }
1312 RusotoError::Unknown(res)
1313 }
1314}
1315impl fmt::Display for ListUsersError {
1316 #[allow(unused_variables)]
1317 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1318 match *self {
1319 ListUsersError::InternalServiceError(ref cause) => write!(f, "{}", cause),
1320 ListUsersError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
1321 ListUsersError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1322 ListUsersError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1323 ListUsersError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1324 }
1325 }
1326}
1327impl Error for ListUsersError {}
1328/// Errors returned by StartServer
1329#[derive(Debug, PartialEq)]
1330pub enum StartServerError {
1331 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
1332 InternalServiceError(String),
1333 /// <p>This exception is thrown when the client submits a malformed request.</p>
1334 InvalidRequest(String),
1335 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
1336 ResourceNotFound(String),
1337 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
1338 ServiceUnavailable(String),
1339 /// <p>The request was denied due to request throttling.</p> <p> HTTP Status Code: 400</p>
1340 Throttling(String),
1341}
1342
1343impl StartServerError {
1344 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartServerError> {
1345 if let Some(err) = proto::json::Error::parse(&res) {
1346 match err.typ.as_str() {
1347 "InternalServiceError" => {
1348 return RusotoError::Service(StartServerError::InternalServiceError(err.msg))
1349 }
1350 "InvalidRequestException" => {
1351 return RusotoError::Service(StartServerError::InvalidRequest(err.msg))
1352 }
1353 "ResourceNotFoundException" => {
1354 return RusotoError::Service(StartServerError::ResourceNotFound(err.msg))
1355 }
1356 "ServiceUnavailableException" => {
1357 return RusotoError::Service(StartServerError::ServiceUnavailable(err.msg))
1358 }
1359 "ThrottlingException" => {
1360 return RusotoError::Service(StartServerError::Throttling(err.msg))
1361 }
1362 "ValidationException" => return RusotoError::Validation(err.msg),
1363 _ => {}
1364 }
1365 }
1366 RusotoError::Unknown(res)
1367 }
1368}
1369impl fmt::Display for StartServerError {
1370 #[allow(unused_variables)]
1371 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1372 match *self {
1373 StartServerError::InternalServiceError(ref cause) => write!(f, "{}", cause),
1374 StartServerError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1375 StartServerError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1376 StartServerError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1377 StartServerError::Throttling(ref cause) => write!(f, "{}", cause),
1378 }
1379 }
1380}
1381impl Error for StartServerError {}
1382/// Errors returned by StopServer
1383#[derive(Debug, PartialEq)]
1384pub enum StopServerError {
1385 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
1386 InternalServiceError(String),
1387 /// <p>This exception is thrown when the client submits a malformed request.</p>
1388 InvalidRequest(String),
1389 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
1390 ResourceNotFound(String),
1391 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
1392 ServiceUnavailable(String),
1393 /// <p>The request was denied due to request throttling.</p> <p> HTTP Status Code: 400</p>
1394 Throttling(String),
1395}
1396
1397impl StopServerError {
1398 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StopServerError> {
1399 if let Some(err) = proto::json::Error::parse(&res) {
1400 match err.typ.as_str() {
1401 "InternalServiceError" => {
1402 return RusotoError::Service(StopServerError::InternalServiceError(err.msg))
1403 }
1404 "InvalidRequestException" => {
1405 return RusotoError::Service(StopServerError::InvalidRequest(err.msg))
1406 }
1407 "ResourceNotFoundException" => {
1408 return RusotoError::Service(StopServerError::ResourceNotFound(err.msg))
1409 }
1410 "ServiceUnavailableException" => {
1411 return RusotoError::Service(StopServerError::ServiceUnavailable(err.msg))
1412 }
1413 "ThrottlingException" => {
1414 return RusotoError::Service(StopServerError::Throttling(err.msg))
1415 }
1416 "ValidationException" => return RusotoError::Validation(err.msg),
1417 _ => {}
1418 }
1419 }
1420 RusotoError::Unknown(res)
1421 }
1422}
1423impl fmt::Display for StopServerError {
1424 #[allow(unused_variables)]
1425 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1426 match *self {
1427 StopServerError::InternalServiceError(ref cause) => write!(f, "{}", cause),
1428 StopServerError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1429 StopServerError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1430 StopServerError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1431 StopServerError::Throttling(ref cause) => write!(f, "{}", cause),
1432 }
1433 }
1434}
1435impl Error for StopServerError {}
1436/// Errors returned by TagResource
1437#[derive(Debug, PartialEq)]
1438pub enum TagResourceError {
1439 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
1440 InternalServiceError(String),
1441 /// <p>This exception is thrown when the client submits a malformed request.</p>
1442 InvalidRequest(String),
1443 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
1444 ResourceNotFound(String),
1445 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
1446 ServiceUnavailable(String),
1447}
1448
1449impl TagResourceError {
1450 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
1451 if let Some(err) = proto::json::Error::parse(&res) {
1452 match err.typ.as_str() {
1453 "InternalServiceError" => {
1454 return RusotoError::Service(TagResourceError::InternalServiceError(err.msg))
1455 }
1456 "InvalidRequestException" => {
1457 return RusotoError::Service(TagResourceError::InvalidRequest(err.msg))
1458 }
1459 "ResourceNotFoundException" => {
1460 return RusotoError::Service(TagResourceError::ResourceNotFound(err.msg))
1461 }
1462 "ServiceUnavailableException" => {
1463 return RusotoError::Service(TagResourceError::ServiceUnavailable(err.msg))
1464 }
1465 "ValidationException" => return RusotoError::Validation(err.msg),
1466 _ => {}
1467 }
1468 }
1469 RusotoError::Unknown(res)
1470 }
1471}
1472impl fmt::Display for TagResourceError {
1473 #[allow(unused_variables)]
1474 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1475 match *self {
1476 TagResourceError::InternalServiceError(ref cause) => write!(f, "{}", cause),
1477 TagResourceError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1478 TagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1479 TagResourceError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1480 }
1481 }
1482}
1483impl Error for TagResourceError {}
1484/// Errors returned by TestIdentityProvider
1485#[derive(Debug, PartialEq)]
1486pub enum TestIdentityProviderError {
1487 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
1488 InternalServiceError(String),
1489 /// <p>This exception is thrown when the client submits a malformed request.</p>
1490 InvalidRequest(String),
1491 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
1492 ResourceNotFound(String),
1493 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
1494 ServiceUnavailable(String),
1495}
1496
1497impl TestIdentityProviderError {
1498 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TestIdentityProviderError> {
1499 if let Some(err) = proto::json::Error::parse(&res) {
1500 match err.typ.as_str() {
1501 "InternalServiceError" => {
1502 return RusotoError::Service(TestIdentityProviderError::InternalServiceError(
1503 err.msg,
1504 ))
1505 }
1506 "InvalidRequestException" => {
1507 return RusotoError::Service(TestIdentityProviderError::InvalidRequest(err.msg))
1508 }
1509 "ResourceNotFoundException" => {
1510 return RusotoError::Service(TestIdentityProviderError::ResourceNotFound(
1511 err.msg,
1512 ))
1513 }
1514 "ServiceUnavailableException" => {
1515 return RusotoError::Service(TestIdentityProviderError::ServiceUnavailable(
1516 err.msg,
1517 ))
1518 }
1519 "ValidationException" => return RusotoError::Validation(err.msg),
1520 _ => {}
1521 }
1522 }
1523 RusotoError::Unknown(res)
1524 }
1525}
1526impl fmt::Display for TestIdentityProviderError {
1527 #[allow(unused_variables)]
1528 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1529 match *self {
1530 TestIdentityProviderError::InternalServiceError(ref cause) => write!(f, "{}", cause),
1531 TestIdentityProviderError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1532 TestIdentityProviderError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1533 TestIdentityProviderError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1534 }
1535 }
1536}
1537impl Error for TestIdentityProviderError {}
1538/// Errors returned by UntagResource
1539#[derive(Debug, PartialEq)]
1540pub enum UntagResourceError {
1541 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
1542 InternalServiceError(String),
1543 /// <p>This exception is thrown when the client submits a malformed request.</p>
1544 InvalidRequest(String),
1545 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
1546 ResourceNotFound(String),
1547 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
1548 ServiceUnavailable(String),
1549}
1550
1551impl UntagResourceError {
1552 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
1553 if let Some(err) = proto::json::Error::parse(&res) {
1554 match err.typ.as_str() {
1555 "InternalServiceError" => {
1556 return RusotoError::Service(UntagResourceError::InternalServiceError(err.msg))
1557 }
1558 "InvalidRequestException" => {
1559 return RusotoError::Service(UntagResourceError::InvalidRequest(err.msg))
1560 }
1561 "ResourceNotFoundException" => {
1562 return RusotoError::Service(UntagResourceError::ResourceNotFound(err.msg))
1563 }
1564 "ServiceUnavailableException" => {
1565 return RusotoError::Service(UntagResourceError::ServiceUnavailable(err.msg))
1566 }
1567 "ValidationException" => return RusotoError::Validation(err.msg),
1568 _ => {}
1569 }
1570 }
1571 RusotoError::Unknown(res)
1572 }
1573}
1574impl fmt::Display for UntagResourceError {
1575 #[allow(unused_variables)]
1576 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1577 match *self {
1578 UntagResourceError::InternalServiceError(ref cause) => write!(f, "{}", cause),
1579 UntagResourceError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1580 UntagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1581 UntagResourceError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1582 }
1583 }
1584}
1585impl Error for UntagResourceError {}
1586/// Errors returned by UpdateServer
1587#[derive(Debug, PartialEq)]
1588pub enum UpdateServerError {
1589 /// <p>You do not have sufficient access to perform this action.</p>
1590 AccessDenied(String),
1591 /// <p>This exception is thrown when the <code>UpdatServer</code> is called for a file transfer protocol-enabled server that has VPC as the endpoint type and the server's <code>VpcEndpointID</code> is not in the available state.</p>
1592 Conflict(String),
1593 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
1594 InternalServiceError(String),
1595 /// <p>This exception is thrown when the client submits a malformed request.</p>
1596 InvalidRequest(String),
1597 /// <p>The requested resource does not exist.</p>
1598 ResourceExists(String),
1599 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
1600 ResourceNotFound(String),
1601 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
1602 ServiceUnavailable(String),
1603 /// <p>The request was denied due to request throttling.</p> <p> HTTP Status Code: 400</p>
1604 Throttling(String),
1605}
1606
1607impl UpdateServerError {
1608 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateServerError> {
1609 if let Some(err) = proto::json::Error::parse(&res) {
1610 match err.typ.as_str() {
1611 "AccessDeniedException" => {
1612 return RusotoError::Service(UpdateServerError::AccessDenied(err.msg))
1613 }
1614 "ConflictException" => {
1615 return RusotoError::Service(UpdateServerError::Conflict(err.msg))
1616 }
1617 "InternalServiceError" => {
1618 return RusotoError::Service(UpdateServerError::InternalServiceError(err.msg))
1619 }
1620 "InvalidRequestException" => {
1621 return RusotoError::Service(UpdateServerError::InvalidRequest(err.msg))
1622 }
1623 "ResourceExistsException" => {
1624 return RusotoError::Service(UpdateServerError::ResourceExists(err.msg))
1625 }
1626 "ResourceNotFoundException" => {
1627 return RusotoError::Service(UpdateServerError::ResourceNotFound(err.msg))
1628 }
1629 "ServiceUnavailableException" => {
1630 return RusotoError::Service(UpdateServerError::ServiceUnavailable(err.msg))
1631 }
1632 "ThrottlingException" => {
1633 return RusotoError::Service(UpdateServerError::Throttling(err.msg))
1634 }
1635 "ValidationException" => return RusotoError::Validation(err.msg),
1636 _ => {}
1637 }
1638 }
1639 RusotoError::Unknown(res)
1640 }
1641}
1642impl fmt::Display for UpdateServerError {
1643 #[allow(unused_variables)]
1644 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1645 match *self {
1646 UpdateServerError::AccessDenied(ref cause) => write!(f, "{}", cause),
1647 UpdateServerError::Conflict(ref cause) => write!(f, "{}", cause),
1648 UpdateServerError::InternalServiceError(ref cause) => write!(f, "{}", cause),
1649 UpdateServerError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1650 UpdateServerError::ResourceExists(ref cause) => write!(f, "{}", cause),
1651 UpdateServerError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1652 UpdateServerError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1653 UpdateServerError::Throttling(ref cause) => write!(f, "{}", cause),
1654 }
1655 }
1656}
1657impl Error for UpdateServerError {}
1658/// Errors returned by UpdateUser
1659#[derive(Debug, PartialEq)]
1660pub enum UpdateUserError {
1661 /// <p>This exception is thrown when an error occurs in the AWS Transfer Family service.</p>
1662 InternalServiceError(String),
1663 /// <p>This exception is thrown when the client submits a malformed request.</p>
1664 InvalidRequest(String),
1665 /// <p>This exception is thrown when a resource is not found by the AWS Transfer Family service.</p>
1666 ResourceNotFound(String),
1667 /// <p>The request has failed because the AWS Transfer Family service is not available.</p>
1668 ServiceUnavailable(String),
1669 /// <p>The request was denied due to request throttling.</p> <p> HTTP Status Code: 400</p>
1670 Throttling(String),
1671}
1672
1673impl UpdateUserError {
1674 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateUserError> {
1675 if let Some(err) = proto::json::Error::parse(&res) {
1676 match err.typ.as_str() {
1677 "InternalServiceError" => {
1678 return RusotoError::Service(UpdateUserError::InternalServiceError(err.msg))
1679 }
1680 "InvalidRequestException" => {
1681 return RusotoError::Service(UpdateUserError::InvalidRequest(err.msg))
1682 }
1683 "ResourceNotFoundException" => {
1684 return RusotoError::Service(UpdateUserError::ResourceNotFound(err.msg))
1685 }
1686 "ServiceUnavailableException" => {
1687 return RusotoError::Service(UpdateUserError::ServiceUnavailable(err.msg))
1688 }
1689 "ThrottlingException" => {
1690 return RusotoError::Service(UpdateUserError::Throttling(err.msg))
1691 }
1692 "ValidationException" => return RusotoError::Validation(err.msg),
1693 _ => {}
1694 }
1695 }
1696 RusotoError::Unknown(res)
1697 }
1698}
1699impl fmt::Display for UpdateUserError {
1700 #[allow(unused_variables)]
1701 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1702 match *self {
1703 UpdateUserError::InternalServiceError(ref cause) => write!(f, "{}", cause),
1704 UpdateUserError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1705 UpdateUserError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1706 UpdateUserError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1707 UpdateUserError::Throttling(ref cause) => write!(f, "{}", cause),
1708 }
1709 }
1710}
1711impl Error for UpdateUserError {}
1712/// Trait representing the capabilities of the AWS Transfer API. AWS Transfer clients implement this trait.
1713#[async_trait]
1714pub trait Transfer {
1715 /// <p>Instantiates an autoscaling virtual server based on the selected file transfer protocol in AWS. When you make updates to your file transfer protocol-enabled server or when you work with users, use the service-generated <code>ServerId</code> property that is assigned to the newly created server.</p>
1716 async fn create_server(
1717 &self,
1718 input: CreateServerRequest,
1719 ) -> Result<CreateServerResponse, RusotoError<CreateServerError>>;
1720
1721 /// <p>Creates a user and associates them with an existing file transfer protocol-enabled server. You can only create and associate users with servers that have the <code>IdentityProviderType</code> set to <code>SERVICE_MANAGED</code>. Using parameters for <code>CreateUser</code>, you can specify the user name, set the home directory, store the user's public key, and assign the user's AWS Identity and Access Management (IAM) role. You can also optionally add a scope-down policy, and assign metadata with tags that can be used to group and search for users.</p>
1722 async fn create_user(
1723 &self,
1724 input: CreateUserRequest,
1725 ) -> Result<CreateUserResponse, RusotoError<CreateUserError>>;
1726
1727 /// <p>Deletes the file transfer protocol-enabled server that you specify.</p> <p>No response returns from this operation.</p>
1728 async fn delete_server(
1729 &self,
1730 input: DeleteServerRequest,
1731 ) -> Result<(), RusotoError<DeleteServerError>>;
1732
1733 /// <p>Deletes a user's Secure Shell (SSH) public key.</p> <p>No response is returned from this operation.</p>
1734 async fn delete_ssh_public_key(
1735 &self,
1736 input: DeleteSshPublicKeyRequest,
1737 ) -> Result<(), RusotoError<DeleteSshPublicKeyError>>;
1738
1739 /// <p><p>Deletes the user belonging to a file transfer protocol-enabled server you specify.</p> <p>No response returns from this operation.</p> <note> <p>When you delete a user from a server, the user's information is lost.</p> </note></p>
1740 async fn delete_user(
1741 &self,
1742 input: DeleteUserRequest,
1743 ) -> Result<(), RusotoError<DeleteUserError>>;
1744
1745 /// <p>Describes a file transfer protocol-enabled server that you specify by passing the <code>ServerId</code> parameter.</p> <p>The response contains a description of a server's properties. When you set <code>EndpointType</code> to VPC, the response will contain the <code>EndpointDetails</code>.</p>
1746 async fn describe_server(
1747 &self,
1748 input: DescribeServerRequest,
1749 ) -> Result<DescribeServerResponse, RusotoError<DescribeServerError>>;
1750
1751 /// <p>Describes the user assigned to the specific file transfer protocol-enabled server, as identified by its <code>ServerId</code> property.</p> <p>The response from this call returns the properties of the user associated with the <code>ServerId</code> value that was specified.</p>
1752 async fn describe_user(
1753 &self,
1754 input: DescribeUserRequest,
1755 ) -> Result<DescribeUserResponse, RusotoError<DescribeUserError>>;
1756
1757 /// <p>Adds a Secure Shell (SSH) public key to a user account identified by a <code>UserName</code> value assigned to the specific file transfer protocol-enabled server, identified by <code>ServerId</code>.</p> <p>The response returns the <code>UserName</code> value, the <code>ServerId</code> value, and the name of the <code>SshPublicKeyId</code>.</p>
1758 async fn import_ssh_public_key(
1759 &self,
1760 input: ImportSshPublicKeyRequest,
1761 ) -> Result<ImportSshPublicKeyResponse, RusotoError<ImportSshPublicKeyError>>;
1762
1763 /// <p>Lists the file transfer protocol-enabled servers that are associated with your AWS account.</p>
1764 async fn list_servers(
1765 &self,
1766 input: ListServersRequest,
1767 ) -> Result<ListServersResponse, RusotoError<ListServersError>>;
1768
1769 /// <p>Lists all of the tags associated with the Amazon Resource Number (ARN) you specify. The resource can be a user, server, or role.</p>
1770 async fn list_tags_for_resource(
1771 &self,
1772 input: ListTagsForResourceRequest,
1773 ) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>>;
1774
1775 /// <p>Lists the users for a file transfer protocol-enabled server that you specify by passing the <code>ServerId</code> parameter.</p>
1776 async fn list_users(
1777 &self,
1778 input: ListUsersRequest,
1779 ) -> Result<ListUsersResponse, RusotoError<ListUsersError>>;
1780
1781 /// <p>Changes the state of a file transfer protocol-enabled server from <code>OFFLINE</code> to <code>ONLINE</code>. It has no impact on a server that is already <code>ONLINE</code>. An <code>ONLINE</code> server can accept and process file transfer jobs.</p> <p>The state of <code>STARTING</code> indicates that the server is in an intermediate state, either not fully able to respond, or not fully online. The values of <code>START_FAILED</code> can indicate an error condition.</p> <p>No response is returned from this call.</p>
1782 async fn start_server(
1783 &self,
1784 input: StartServerRequest,
1785 ) -> Result<(), RusotoError<StartServerError>>;
1786
1787 /// <p>Changes the state of a file transfer protocol-enabled server from <code>ONLINE</code> to <code>OFFLINE</code>. An <code>OFFLINE</code> server cannot accept and process file transfer jobs. Information tied to your server, such as server and user properties, are not affected by stopping your server. Stopping the server will not reduce or impact your file transfer protocol endpoint billing.</p> <p>The state of <code>STOPPING</code> indicates that the server is in an intermediate state, either not fully able to respond, or not fully offline. The values of <code>STOP_FAILED</code> can indicate an error condition.</p> <p>No response is returned from this call.</p>
1788 async fn stop_server(
1789 &self,
1790 input: StopServerRequest,
1791 ) -> Result<(), RusotoError<StopServerError>>;
1792
1793 /// <p>Attaches a key-value pair to a resource, as identified by its Amazon Resource Name (ARN). Resources are users, servers, roles, and other entities.</p> <p>There is no response returned from this call.</p>
1794 async fn tag_resource(
1795 &self,
1796 input: TagResourceRequest,
1797 ) -> Result<(), RusotoError<TagResourceError>>;
1798
1799 /// <p>If the <code>IdentityProviderType</code> of a file transfer protocol-enabled server is <code>API_Gateway</code>, tests whether your API Gateway is set up successfully. We highly recommend that you call this operation to test your authentication method as soon as you create your server. By doing so, you can troubleshoot issues with the API Gateway integration to ensure that your users can successfully use the service.</p>
1800 async fn test_identity_provider(
1801 &self,
1802 input: TestIdentityProviderRequest,
1803 ) -> Result<TestIdentityProviderResponse, RusotoError<TestIdentityProviderError>>;
1804
1805 /// <p>Detaches a key-value pair from a resource, as identified by its Amazon Resource Name (ARN). Resources are users, servers, roles, and other entities.</p> <p>No response is returned from this call.</p>
1806 async fn untag_resource(
1807 &self,
1808 input: UntagResourceRequest,
1809 ) -> Result<(), RusotoError<UntagResourceError>>;
1810
1811 /// <p>Updates the file transfer protocol-enabled server's properties after that server has been created.</p> <p>The <code>UpdateServer</code> call returns the <code>ServerId</code> of the server you updated.</p>
1812 async fn update_server(
1813 &self,
1814 input: UpdateServerRequest,
1815 ) -> Result<UpdateServerResponse, RusotoError<UpdateServerError>>;
1816
1817 /// <p>Assigns new properties to a user. Parameters you pass modify any or all of the following: the home directory, role, and policy for the <code>UserName</code> and <code>ServerId</code> you specify.</p> <p>The response returns the <code>ServerId</code> and the <code>UserName</code> for the updated user.</p>
1818 async fn update_user(
1819 &self,
1820 input: UpdateUserRequest,
1821 ) -> Result<UpdateUserResponse, RusotoError<UpdateUserError>>;
1822}
1823/// A client for the AWS Transfer API.
1824#[derive(Clone)]
1825pub struct TransferClient {
1826 client: Client,
1827 region: region::Region,
1828}
1829
1830impl TransferClient {
1831 /// Creates a client backed by the default tokio event loop.
1832 ///
1833 /// The client will use the default credentials provider and tls client.
1834 pub fn new(region: region::Region) -> TransferClient {
1835 TransferClient {
1836 client: Client::shared(),
1837 region,
1838 }
1839 }
1840
1841 pub fn new_with<P, D>(
1842 request_dispatcher: D,
1843 credentials_provider: P,
1844 region: region::Region,
1845 ) -> TransferClient
1846 where
1847 P: ProvideAwsCredentials + Send + Sync + 'static,
1848 D: DispatchSignedRequest + Send + Sync + 'static,
1849 {
1850 TransferClient {
1851 client: Client::new_with(credentials_provider, request_dispatcher),
1852 region,
1853 }
1854 }
1855
1856 pub fn new_with_client(client: Client, region: region::Region) -> TransferClient {
1857 TransferClient { client, region }
1858 }
1859}
1860
1861#[async_trait]
1862impl Transfer for TransferClient {
1863 /// <p>Instantiates an autoscaling virtual server based on the selected file transfer protocol in AWS. When you make updates to your file transfer protocol-enabled server or when you work with users, use the service-generated <code>ServerId</code> property that is assigned to the newly created server.</p>
1864 async fn create_server(
1865 &self,
1866 input: CreateServerRequest,
1867 ) -> Result<CreateServerResponse, RusotoError<CreateServerError>> {
1868 let mut request = self.new_signed_request("POST", "/");
1869 request.add_header("x-amz-target", "TransferService.CreateServer");
1870 let encoded = serde_json::to_string(&input).unwrap();
1871 request.set_payload(Some(encoded));
1872
1873 let response = self
1874 .sign_and_dispatch(request, CreateServerError::from_response)
1875 .await?;
1876 let mut response = response;
1877 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1878 proto::json::ResponsePayload::new(&response).deserialize::<CreateServerResponse, _>()
1879 }
1880
1881 /// <p>Creates a user and associates them with an existing file transfer protocol-enabled server. You can only create and associate users with servers that have the <code>IdentityProviderType</code> set to <code>SERVICE_MANAGED</code>. Using parameters for <code>CreateUser</code>, you can specify the user name, set the home directory, store the user's public key, and assign the user's AWS Identity and Access Management (IAM) role. You can also optionally add a scope-down policy, and assign metadata with tags that can be used to group and search for users.</p>
1882 async fn create_user(
1883 &self,
1884 input: CreateUserRequest,
1885 ) -> Result<CreateUserResponse, RusotoError<CreateUserError>> {
1886 let mut request = self.new_signed_request("POST", "/");
1887 request.add_header("x-amz-target", "TransferService.CreateUser");
1888 let encoded = serde_json::to_string(&input).unwrap();
1889 request.set_payload(Some(encoded));
1890
1891 let response = self
1892 .sign_and_dispatch(request, CreateUserError::from_response)
1893 .await?;
1894 let mut response = response;
1895 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1896 proto::json::ResponsePayload::new(&response).deserialize::<CreateUserResponse, _>()
1897 }
1898
1899 /// <p>Deletes the file transfer protocol-enabled server that you specify.</p> <p>No response returns from this operation.</p>
1900 async fn delete_server(
1901 &self,
1902 input: DeleteServerRequest,
1903 ) -> Result<(), RusotoError<DeleteServerError>> {
1904 let mut request = self.new_signed_request("POST", "/");
1905 request.add_header("x-amz-target", "TransferService.DeleteServer");
1906 let encoded = serde_json::to_string(&input).unwrap();
1907 request.set_payload(Some(encoded));
1908
1909 let response = self
1910 .sign_and_dispatch(request, DeleteServerError::from_response)
1911 .await?;
1912 std::mem::drop(response);
1913 Ok(())
1914 }
1915
1916 /// <p>Deletes a user's Secure Shell (SSH) public key.</p> <p>No response is returned from this operation.</p>
1917 async fn delete_ssh_public_key(
1918 &self,
1919 input: DeleteSshPublicKeyRequest,
1920 ) -> Result<(), RusotoError<DeleteSshPublicKeyError>> {
1921 let mut request = self.new_signed_request("POST", "/");
1922 request.add_header("x-amz-target", "TransferService.DeleteSshPublicKey");
1923 let encoded = serde_json::to_string(&input).unwrap();
1924 request.set_payload(Some(encoded));
1925
1926 let response = self
1927 .sign_and_dispatch(request, DeleteSshPublicKeyError::from_response)
1928 .await?;
1929 std::mem::drop(response);
1930 Ok(())
1931 }
1932
1933 /// <p><p>Deletes the user belonging to a file transfer protocol-enabled server you specify.</p> <p>No response returns from this operation.</p> <note> <p>When you delete a user from a server, the user's information is lost.</p> </note></p>
1934 async fn delete_user(
1935 &self,
1936 input: DeleteUserRequest,
1937 ) -> Result<(), RusotoError<DeleteUserError>> {
1938 let mut request = self.new_signed_request("POST", "/");
1939 request.add_header("x-amz-target", "TransferService.DeleteUser");
1940 let encoded = serde_json::to_string(&input).unwrap();
1941 request.set_payload(Some(encoded));
1942
1943 let response = self
1944 .sign_and_dispatch(request, DeleteUserError::from_response)
1945 .await?;
1946 std::mem::drop(response);
1947 Ok(())
1948 }
1949
1950 /// <p>Describes a file transfer protocol-enabled server that you specify by passing the <code>ServerId</code> parameter.</p> <p>The response contains a description of a server's properties. When you set <code>EndpointType</code> to VPC, the response will contain the <code>EndpointDetails</code>.</p>
1951 async fn describe_server(
1952 &self,
1953 input: DescribeServerRequest,
1954 ) -> Result<DescribeServerResponse, RusotoError<DescribeServerError>> {
1955 let mut request = self.new_signed_request("POST", "/");
1956 request.add_header("x-amz-target", "TransferService.DescribeServer");
1957 let encoded = serde_json::to_string(&input).unwrap();
1958 request.set_payload(Some(encoded));
1959
1960 let response = self
1961 .sign_and_dispatch(request, DescribeServerError::from_response)
1962 .await?;
1963 let mut response = response;
1964 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1965 proto::json::ResponsePayload::new(&response).deserialize::<DescribeServerResponse, _>()
1966 }
1967
1968 /// <p>Describes the user assigned to the specific file transfer protocol-enabled server, as identified by its <code>ServerId</code> property.</p> <p>The response from this call returns the properties of the user associated with the <code>ServerId</code> value that was specified.</p>
1969 async fn describe_user(
1970 &self,
1971 input: DescribeUserRequest,
1972 ) -> Result<DescribeUserResponse, RusotoError<DescribeUserError>> {
1973 let mut request = self.new_signed_request("POST", "/");
1974 request.add_header("x-amz-target", "TransferService.DescribeUser");
1975 let encoded = serde_json::to_string(&input).unwrap();
1976 request.set_payload(Some(encoded));
1977
1978 let response = self
1979 .sign_and_dispatch(request, DescribeUserError::from_response)
1980 .await?;
1981 let mut response = response;
1982 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1983 proto::json::ResponsePayload::new(&response).deserialize::<DescribeUserResponse, _>()
1984 }
1985
1986 /// <p>Adds a Secure Shell (SSH) public key to a user account identified by a <code>UserName</code> value assigned to the specific file transfer protocol-enabled server, identified by <code>ServerId</code>.</p> <p>The response returns the <code>UserName</code> value, the <code>ServerId</code> value, and the name of the <code>SshPublicKeyId</code>.</p>
1987 async fn import_ssh_public_key(
1988 &self,
1989 input: ImportSshPublicKeyRequest,
1990 ) -> Result<ImportSshPublicKeyResponse, RusotoError<ImportSshPublicKeyError>> {
1991 let mut request = self.new_signed_request("POST", "/");
1992 request.add_header("x-amz-target", "TransferService.ImportSshPublicKey");
1993 let encoded = serde_json::to_string(&input).unwrap();
1994 request.set_payload(Some(encoded));
1995
1996 let response = self
1997 .sign_and_dispatch(request, ImportSshPublicKeyError::from_response)
1998 .await?;
1999 let mut response = response;
2000 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2001 proto::json::ResponsePayload::new(&response).deserialize::<ImportSshPublicKeyResponse, _>()
2002 }
2003
2004 /// <p>Lists the file transfer protocol-enabled servers that are associated with your AWS account.</p>
2005 async fn list_servers(
2006 &self,
2007 input: ListServersRequest,
2008 ) -> Result<ListServersResponse, RusotoError<ListServersError>> {
2009 let mut request = self.new_signed_request("POST", "/");
2010 request.add_header("x-amz-target", "TransferService.ListServers");
2011 let encoded = serde_json::to_string(&input).unwrap();
2012 request.set_payload(Some(encoded));
2013
2014 let response = self
2015 .sign_and_dispatch(request, ListServersError::from_response)
2016 .await?;
2017 let mut response = response;
2018 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2019 proto::json::ResponsePayload::new(&response).deserialize::<ListServersResponse, _>()
2020 }
2021
2022 /// <p>Lists all of the tags associated with the Amazon Resource Number (ARN) you specify. The resource can be a user, server, or role.</p>
2023 async fn list_tags_for_resource(
2024 &self,
2025 input: ListTagsForResourceRequest,
2026 ) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>> {
2027 let mut request = self.new_signed_request("POST", "/");
2028 request.add_header("x-amz-target", "TransferService.ListTagsForResource");
2029 let encoded = serde_json::to_string(&input).unwrap();
2030 request.set_payload(Some(encoded));
2031
2032 let response = self
2033 .sign_and_dispatch(request, ListTagsForResourceError::from_response)
2034 .await?;
2035 let mut response = response;
2036 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2037 proto::json::ResponsePayload::new(&response).deserialize::<ListTagsForResourceResponse, _>()
2038 }
2039
2040 /// <p>Lists the users for a file transfer protocol-enabled server that you specify by passing the <code>ServerId</code> parameter.</p>
2041 async fn list_users(
2042 &self,
2043 input: ListUsersRequest,
2044 ) -> Result<ListUsersResponse, RusotoError<ListUsersError>> {
2045 let mut request = self.new_signed_request("POST", "/");
2046 request.add_header("x-amz-target", "TransferService.ListUsers");
2047 let encoded = serde_json::to_string(&input).unwrap();
2048 request.set_payload(Some(encoded));
2049
2050 let response = self
2051 .sign_and_dispatch(request, ListUsersError::from_response)
2052 .await?;
2053 let mut response = response;
2054 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2055 proto::json::ResponsePayload::new(&response).deserialize::<ListUsersResponse, _>()
2056 }
2057
2058 /// <p>Changes the state of a file transfer protocol-enabled server from <code>OFFLINE</code> to <code>ONLINE</code>. It has no impact on a server that is already <code>ONLINE</code>. An <code>ONLINE</code> server can accept and process file transfer jobs.</p> <p>The state of <code>STARTING</code> indicates that the server is in an intermediate state, either not fully able to respond, or not fully online. The values of <code>START_FAILED</code> can indicate an error condition.</p> <p>No response is returned from this call.</p>
2059 async fn start_server(
2060 &self,
2061 input: StartServerRequest,
2062 ) -> Result<(), RusotoError<StartServerError>> {
2063 let mut request = self.new_signed_request("POST", "/");
2064 request.add_header("x-amz-target", "TransferService.StartServer");
2065 let encoded = serde_json::to_string(&input).unwrap();
2066 request.set_payload(Some(encoded));
2067
2068 let response = self
2069 .sign_and_dispatch(request, StartServerError::from_response)
2070 .await?;
2071 std::mem::drop(response);
2072 Ok(())
2073 }
2074
2075 /// <p>Changes the state of a file transfer protocol-enabled server from <code>ONLINE</code> to <code>OFFLINE</code>. An <code>OFFLINE</code> server cannot accept and process file transfer jobs. Information tied to your server, such as server and user properties, are not affected by stopping your server. Stopping the server will not reduce or impact your file transfer protocol endpoint billing.</p> <p>The state of <code>STOPPING</code> indicates that the server is in an intermediate state, either not fully able to respond, or not fully offline. The values of <code>STOP_FAILED</code> can indicate an error condition.</p> <p>No response is returned from this call.</p>
2076 async fn stop_server(
2077 &self,
2078 input: StopServerRequest,
2079 ) -> Result<(), RusotoError<StopServerError>> {
2080 let mut request = self.new_signed_request("POST", "/");
2081 request.add_header("x-amz-target", "TransferService.StopServer");
2082 let encoded = serde_json::to_string(&input).unwrap();
2083 request.set_payload(Some(encoded));
2084
2085 let response = self
2086 .sign_and_dispatch(request, StopServerError::from_response)
2087 .await?;
2088 std::mem::drop(response);
2089 Ok(())
2090 }
2091
2092 /// <p>Attaches a key-value pair to a resource, as identified by its Amazon Resource Name (ARN). Resources are users, servers, roles, and other entities.</p> <p>There is no response returned from this call.</p>
2093 async fn tag_resource(
2094 &self,
2095 input: TagResourceRequest,
2096 ) -> Result<(), RusotoError<TagResourceError>> {
2097 let mut request = self.new_signed_request("POST", "/");
2098 request.add_header("x-amz-target", "TransferService.TagResource");
2099 let encoded = serde_json::to_string(&input).unwrap();
2100 request.set_payload(Some(encoded));
2101
2102 let response = self
2103 .sign_and_dispatch(request, TagResourceError::from_response)
2104 .await?;
2105 std::mem::drop(response);
2106 Ok(())
2107 }
2108
2109 /// <p>If the <code>IdentityProviderType</code> of a file transfer protocol-enabled server is <code>API_Gateway</code>, tests whether your API Gateway is set up successfully. We highly recommend that you call this operation to test your authentication method as soon as you create your server. By doing so, you can troubleshoot issues with the API Gateway integration to ensure that your users can successfully use the service.</p>
2110 async fn test_identity_provider(
2111 &self,
2112 input: TestIdentityProviderRequest,
2113 ) -> Result<TestIdentityProviderResponse, RusotoError<TestIdentityProviderError>> {
2114 let mut request = self.new_signed_request("POST", "/");
2115 request.add_header("x-amz-target", "TransferService.TestIdentityProvider");
2116 let encoded = serde_json::to_string(&input).unwrap();
2117 request.set_payload(Some(encoded));
2118
2119 let response = self
2120 .sign_and_dispatch(request, TestIdentityProviderError::from_response)
2121 .await?;
2122 let mut response = response;
2123 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2124 proto::json::ResponsePayload::new(&response)
2125 .deserialize::<TestIdentityProviderResponse, _>()
2126 }
2127
2128 /// <p>Detaches a key-value pair from a resource, as identified by its Amazon Resource Name (ARN). Resources are users, servers, roles, and other entities.</p> <p>No response is returned from this call.</p>
2129 async fn untag_resource(
2130 &self,
2131 input: UntagResourceRequest,
2132 ) -> Result<(), RusotoError<UntagResourceError>> {
2133 let mut request = self.new_signed_request("POST", "/");
2134 request.add_header("x-amz-target", "TransferService.UntagResource");
2135 let encoded = serde_json::to_string(&input).unwrap();
2136 request.set_payload(Some(encoded));
2137
2138 let response = self
2139 .sign_and_dispatch(request, UntagResourceError::from_response)
2140 .await?;
2141 std::mem::drop(response);
2142 Ok(())
2143 }
2144
2145 /// <p>Updates the file transfer protocol-enabled server's properties after that server has been created.</p> <p>The <code>UpdateServer</code> call returns the <code>ServerId</code> of the server you updated.</p>
2146 async fn update_server(
2147 &self,
2148 input: UpdateServerRequest,
2149 ) -> Result<UpdateServerResponse, RusotoError<UpdateServerError>> {
2150 let mut request = self.new_signed_request("POST", "/");
2151 request.add_header("x-amz-target", "TransferService.UpdateServer");
2152 let encoded = serde_json::to_string(&input).unwrap();
2153 request.set_payload(Some(encoded));
2154
2155 let response = self
2156 .sign_and_dispatch(request, UpdateServerError::from_response)
2157 .await?;
2158 let mut response = response;
2159 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2160 proto::json::ResponsePayload::new(&response).deserialize::<UpdateServerResponse, _>()
2161 }
2162
2163 /// <p>Assigns new properties to a user. Parameters you pass modify any or all of the following: the home directory, role, and policy for the <code>UserName</code> and <code>ServerId</code> you specify.</p> <p>The response returns the <code>ServerId</code> and the <code>UserName</code> for the updated user.</p>
2164 async fn update_user(
2165 &self,
2166 input: UpdateUserRequest,
2167 ) -> Result<UpdateUserResponse, RusotoError<UpdateUserError>> {
2168 let mut request = self.new_signed_request("POST", "/");
2169 request.add_header("x-amz-target", "TransferService.UpdateUser");
2170 let encoded = serde_json::to_string(&input).unwrap();
2171 request.set_payload(Some(encoded));
2172
2173 let response = self
2174 .sign_and_dispatch(request, UpdateUserError::from_response)
2175 .await?;
2176 let mut response = response;
2177 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2178 proto::json::ResponsePayload::new(&response).deserialize::<UpdateUserResponse, _>()
2179 }
2180}