rusoto_cloud9/
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 Cloud9Client {
29    fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
30        let mut request = SignedRequest::new(http_method, "cloud9", &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 CreateEnvironmentEC2Request {
56    /// <p>The number of minutes until the running instance is shut down after the environment has last been used.</p>
57    #[serde(rename = "automaticStopTimeMinutes")]
58    #[serde(skip_serializing_if = "Option::is_none")]
59    pub automatic_stop_time_minutes: Option<i64>,
60    /// <p>A unique, case-sensitive string that helps AWS Cloud9 to ensure this operation completes no more than one time.</p> <p>For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Client Tokens</a> in the <i>Amazon EC2 API Reference</i>.</p>
61    #[serde(rename = "clientRequestToken")]
62    #[serde(skip_serializing_if = "Option::is_none")]
63    pub client_request_token: Option<String>,
64    /// <p>The description of the environment to create.</p>
65    #[serde(rename = "description")]
66    #[serde(skip_serializing_if = "Option::is_none")]
67    pub description: Option<String>,
68    /// <p>The type of instance to connect to the environment (for example, <code>t2.micro</code>).</p>
69    #[serde(rename = "instanceType")]
70    pub instance_type: String,
71    /// <p>The name of the environment to create.</p> <p>This name is visible to other AWS IAM users in the same AWS account.</p>
72    #[serde(rename = "name")]
73    pub name: String,
74    /// <p>The Amazon Resource Name (ARN) of the environment owner. This ARN can be the ARN of any AWS IAM principal. If this value is not specified, the ARN defaults to this environment's creator.</p>
75    #[serde(rename = "ownerArn")]
76    #[serde(skip_serializing_if = "Option::is_none")]
77    pub owner_arn: Option<String>,
78    /// <p>The ID of the subnet in Amazon VPC that AWS Cloud9 will use to communicate with the Amazon EC2 instance.</p>
79    #[serde(rename = "subnetId")]
80    #[serde(skip_serializing_if = "Option::is_none")]
81    pub subnet_id: Option<String>,
82    /// <p>An array of key-value pairs that will be associated with the new AWS Cloud9 development environment.</p>
83    #[serde(rename = "tags")]
84    #[serde(skip_serializing_if = "Option::is_none")]
85    pub tags: Option<Vec<Tag>>,
86}
87
88#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
89#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
90pub struct CreateEnvironmentEC2Result {
91    /// <p>The ID of the environment that was created.</p>
92    #[serde(rename = "environmentId")]
93    #[serde(skip_serializing_if = "Option::is_none")]
94    pub environment_id: Option<String>,
95}
96
97#[derive(Clone, Debug, Default, PartialEq, Serialize)]
98#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
99pub struct CreateEnvironmentMembershipRequest {
100    /// <p>The ID of the environment that contains the environment member you want to add.</p>
101    #[serde(rename = "environmentId")]
102    pub environment_id: String,
103    /// <p><p>The type of environment member permissions you want to associate with this environment member. Available values include:</p> <ul> <li> <p> <code>read-only</code>: Has read-only access to the environment.</p> </li> <li> <p> <code>read-write</code>: Has read-write access to the environment.</p> </li> </ul></p>
104    #[serde(rename = "permissions")]
105    pub permissions: String,
106    /// <p>The Amazon Resource Name (ARN) of the environment member you want to add.</p>
107    #[serde(rename = "userArn")]
108    pub user_arn: String,
109}
110
111#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
112#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
113pub struct CreateEnvironmentMembershipResult {
114    /// <p>Information about the environment member that was added.</p>
115    #[serde(rename = "membership")]
116    #[serde(skip_serializing_if = "Option::is_none")]
117    pub membership: Option<EnvironmentMember>,
118}
119
120#[derive(Clone, Debug, Default, PartialEq, Serialize)]
121#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
122pub struct DeleteEnvironmentMembershipRequest {
123    /// <p>The ID of the environment to delete the environment member from.</p>
124    #[serde(rename = "environmentId")]
125    pub environment_id: String,
126    /// <p>The Amazon Resource Name (ARN) of the environment member to delete from the environment.</p>
127    #[serde(rename = "userArn")]
128    pub user_arn: String,
129}
130
131#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
132#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
133pub struct DeleteEnvironmentMembershipResult {}
134
135#[derive(Clone, Debug, Default, PartialEq, Serialize)]
136#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
137pub struct DeleteEnvironmentRequest {
138    /// <p>The ID of the environment to delete.</p>
139    #[serde(rename = "environmentId")]
140    pub environment_id: String,
141}
142
143#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
144#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
145pub struct DeleteEnvironmentResult {}
146
147#[derive(Clone, Debug, Default, PartialEq, Serialize)]
148#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
149pub struct DescribeEnvironmentMembershipsRequest {
150    /// <p>The ID of the environment to get environment member information about.</p>
151    #[serde(rename = "environmentId")]
152    #[serde(skip_serializing_if = "Option::is_none")]
153    pub environment_id: Option<String>,
154    /// <p>The maximum number of environment members to get information about.</p>
155    #[serde(rename = "maxResults")]
156    #[serde(skip_serializing_if = "Option::is_none")]
157    pub max_results: Option<i64>,
158    /// <p>During a previous call, if there are more than 25 items in the list, only the first 25 items are returned, along with a unique string called a <i>next token</i>. To get the next batch of items in the list, call this operation again, adding the next token to the call. To get all of the items in the list, keep calling this operation with each subsequent next token that is returned, until no more next tokens are returned.</p>
159    #[serde(rename = "nextToken")]
160    #[serde(skip_serializing_if = "Option::is_none")]
161    pub next_token: Option<String>,
162    /// <p>The type of environment member permissions to get information about. Available values include:</p> <ul> <li> <p> <code>owner</code>: Owns the environment.</p> </li> <li> <p> <code>read-only</code>: Has read-only access to the environment.</p> </li> <li> <p> <code>read-write</code>: Has read-write access to the environment.</p> </li> </ul> <p>If no value is specified, information about all environment members are returned.</p>
163    #[serde(rename = "permissions")]
164    #[serde(skip_serializing_if = "Option::is_none")]
165    pub permissions: Option<Vec<String>>,
166    /// <p>The Amazon Resource Name (ARN) of an individual environment member to get information about. If no value is specified, information about all environment members are returned.</p>
167    #[serde(rename = "userArn")]
168    #[serde(skip_serializing_if = "Option::is_none")]
169    pub user_arn: Option<String>,
170}
171
172#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
173#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
174pub struct DescribeEnvironmentMembershipsResult {
175    /// <p>Information about the environment members for the environment.</p>
176    #[serde(rename = "memberships")]
177    #[serde(skip_serializing_if = "Option::is_none")]
178    pub memberships: Option<Vec<EnvironmentMember>>,
179    /// <p>If there are more than 25 items in the list, only the first 25 items are returned, along with a unique string called a <i>next token</i>. To get the next batch of items in the list, call this operation again, adding the next token to the call.</p>
180    #[serde(rename = "nextToken")]
181    #[serde(skip_serializing_if = "Option::is_none")]
182    pub next_token: Option<String>,
183}
184
185#[derive(Clone, Debug, Default, PartialEq, Serialize)]
186#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
187pub struct DescribeEnvironmentStatusRequest {
188    /// <p>The ID of the environment to get status information about.</p>
189    #[serde(rename = "environmentId")]
190    pub environment_id: String,
191}
192
193#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
194#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
195pub struct DescribeEnvironmentStatusResult {
196    /// <p>Any informational message about the status of the environment.</p>
197    #[serde(rename = "message")]
198    #[serde(skip_serializing_if = "Option::is_none")]
199    pub message: Option<String>,
200    /// <p><p>The status of the environment. Available values include:</p> <ul> <li> <p> <code>connecting</code>: The environment is connecting.</p> </li> <li> <p> <code>creating</code>: The environment is being created.</p> </li> <li> <p> <code>deleting</code>: The environment is being deleted.</p> </li> <li> <p> <code>error</code>: The environment is in an error state.</p> </li> <li> <p> <code>ready</code>: The environment is ready.</p> </li> <li> <p> <code>stopped</code>: The environment is stopped.</p> </li> <li> <p> <code>stopping</code>: The environment is stopping.</p> </li> </ul></p>
201    #[serde(rename = "status")]
202    #[serde(skip_serializing_if = "Option::is_none")]
203    pub status: Option<String>,
204}
205
206#[derive(Clone, Debug, Default, PartialEq, Serialize)]
207#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
208pub struct DescribeEnvironmentsRequest {
209    /// <p>The IDs of individual environments to get information about.</p>
210    #[serde(rename = "environmentIds")]
211    pub environment_ids: Vec<String>,
212}
213
214#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
215#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
216pub struct DescribeEnvironmentsResult {
217    /// <p>Information about the environments that are returned.</p>
218    #[serde(rename = "environments")]
219    #[serde(skip_serializing_if = "Option::is_none")]
220    pub environments: Option<Vec<Environment>>,
221}
222
223/// <p>Information about an AWS Cloud9 development environment.</p>
224#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
225#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
226pub struct Environment {
227    /// <p>The Amazon Resource Name (ARN) of the environment.</p>
228    #[serde(rename = "arn")]
229    #[serde(skip_serializing_if = "Option::is_none")]
230    pub arn: Option<String>,
231    /// <p>The description for the environment.</p>
232    #[serde(rename = "description")]
233    #[serde(skip_serializing_if = "Option::is_none")]
234    pub description: Option<String>,
235    /// <p>The ID of the environment.</p>
236    #[serde(rename = "id")]
237    #[serde(skip_serializing_if = "Option::is_none")]
238    pub id: Option<String>,
239    /// <p>The state of the environment in its creation or deletion lifecycle.</p>
240    #[serde(rename = "lifecycle")]
241    #[serde(skip_serializing_if = "Option::is_none")]
242    pub lifecycle: Option<EnvironmentLifecycle>,
243    /// <p>The name of the environment.</p>
244    #[serde(rename = "name")]
245    #[serde(skip_serializing_if = "Option::is_none")]
246    pub name: Option<String>,
247    /// <p>The Amazon Resource Name (ARN) of the environment owner.</p>
248    #[serde(rename = "ownerArn")]
249    #[serde(skip_serializing_if = "Option::is_none")]
250    pub owner_arn: Option<String>,
251    /// <p><p>The type of environment. Valid values include the following:</p> <ul> <li> <p> <code>ec2</code>: An Amazon Elastic Compute Cloud (Amazon EC2) instance connects to the environment.</p> </li> <li> <p> <code>ssh</code>: Your own server connects to the environment.</p> </li> </ul></p>
252    #[serde(rename = "type")]
253    #[serde(skip_serializing_if = "Option::is_none")]
254    pub type_: Option<String>,
255}
256
257/// <p>Information about the current creation or deletion lifecycle state of an AWS Cloud9 development environment.</p>
258#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
259#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
260pub struct EnvironmentLifecycle {
261    /// <p>If the environment failed to delete, the Amazon Resource Name (ARN) of the related AWS resource.</p>
262    #[serde(rename = "failureResource")]
263    #[serde(skip_serializing_if = "Option::is_none")]
264    pub failure_resource: Option<String>,
265    /// <p>Any informational message about the lifecycle state of the environment.</p>
266    #[serde(rename = "reason")]
267    #[serde(skip_serializing_if = "Option::is_none")]
268    pub reason: Option<String>,
269    /// <p><p>The current creation or deletion lifecycle state of the environment.</p> <ul> <li> <p> <code>CREATING</code>: The environment is in the process of being created.</p> </li> <li> <p> <code>CREATED</code>: The environment was successfully created.</p> </li> <li> <p> <code>CREATE<em>FAILED</code>: The environment failed to be created.</p> </li> <li> <p> <code>DELETING</code>: The environment is in the process of being deleted.</p> </li> <li> <p> <code>DELETE</em>FAILED</code>: The environment failed to delete.</p> </li> </ul></p>
270    #[serde(rename = "status")]
271    #[serde(skip_serializing_if = "Option::is_none")]
272    pub status: Option<String>,
273}
274
275/// <p>Information about an environment member for an AWS Cloud9 development environment.</p>
276#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
277#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
278pub struct EnvironmentMember {
279    /// <p>The ID of the environment for the environment member.</p>
280    #[serde(rename = "environmentId")]
281    #[serde(skip_serializing_if = "Option::is_none")]
282    pub environment_id: Option<String>,
283    /// <p>The time, expressed in epoch time format, when the environment member last opened the environment.</p>
284    #[serde(rename = "lastAccess")]
285    #[serde(skip_serializing_if = "Option::is_none")]
286    pub last_access: Option<f64>,
287    /// <p><p>The type of environment member permissions associated with this environment member. Available values include:</p> <ul> <li> <p> <code>owner</code>: Owns the environment.</p> </li> <li> <p> <code>read-only</code>: Has read-only access to the environment.</p> </li> <li> <p> <code>read-write</code>: Has read-write access to the environment.</p> </li> </ul></p>
288    #[serde(rename = "permissions")]
289    #[serde(skip_serializing_if = "Option::is_none")]
290    pub permissions: Option<String>,
291    /// <p>The Amazon Resource Name (ARN) of the environment member.</p>
292    #[serde(rename = "userArn")]
293    #[serde(skip_serializing_if = "Option::is_none")]
294    pub user_arn: Option<String>,
295    /// <p>The user ID in AWS Identity and Access Management (AWS IAM) of the environment member.</p>
296    #[serde(rename = "userId")]
297    #[serde(skip_serializing_if = "Option::is_none")]
298    pub user_id: Option<String>,
299}
300
301#[derive(Clone, Debug, Default, PartialEq, Serialize)]
302#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
303pub struct ListEnvironmentsRequest {
304    /// <p>The maximum number of environments to get identifiers for.</p>
305    #[serde(rename = "maxResults")]
306    #[serde(skip_serializing_if = "Option::is_none")]
307    pub max_results: Option<i64>,
308    /// <p>During a previous call, if there are more than 25 items in the list, only the first 25 items are returned, along with a unique string called a <i>next token</i>. To get the next batch of items in the list, call this operation again, adding the next token to the call. To get all of the items in the list, keep calling this operation with each subsequent next token that is returned, until no more next tokens are returned.</p>
309    #[serde(rename = "nextToken")]
310    #[serde(skip_serializing_if = "Option::is_none")]
311    pub next_token: Option<String>,
312}
313
314#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
315#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
316pub struct ListEnvironmentsResult {
317    /// <p>The list of environment identifiers.</p>
318    #[serde(rename = "environmentIds")]
319    #[serde(skip_serializing_if = "Option::is_none")]
320    pub environment_ids: Option<Vec<String>>,
321    /// <p>If there are more than 25 items in the list, only the first 25 items are returned, along with a unique string called a <i>next token</i>. To get the next batch of items in the list, call this operation again, adding the next token to the call.</p>
322    #[serde(rename = "nextToken")]
323    #[serde(skip_serializing_if = "Option::is_none")]
324    pub next_token: Option<String>,
325}
326
327#[derive(Clone, Debug, Default, PartialEq, Serialize)]
328#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
329pub struct ListTagsForResourceRequest {
330    /// <p>The Amazon Resource Name (ARN) of the AWS Cloud9 development environment to get the tags for.</p>
331    #[serde(rename = "ResourceARN")]
332    pub resource_arn: String,
333}
334
335#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
336#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
337pub struct ListTagsForResourceResponse {
338    /// <p>The list of tags associated with the AWS Cloud9 development environment.</p>
339    #[serde(rename = "Tags")]
340    #[serde(skip_serializing_if = "Option::is_none")]
341    pub tags: Option<Vec<Tag>>,
342}
343
344/// <p>Metadata that is associated with AWS resources. In particular, a name-value pair that can be associated with an AWS Cloud9 development environment. There are two types of tags: <i>user tags</i> and <i>system tags</i>. A user tag is created by the user. A system tag is automatically created by AWS services. A system tag is prefixed with "aws:" and cannot be modified by the user.</p>
345#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
346pub struct Tag {
347    /// <p>The <b>name</b> part of a tag.</p>
348    #[serde(rename = "Key")]
349    pub key: String,
350    /// <p>The <b>value</b> part of a tag.</p>
351    #[serde(rename = "Value")]
352    pub value: String,
353}
354
355#[derive(Clone, Debug, Default, PartialEq, Serialize)]
356#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
357pub struct TagResourceRequest {
358    /// <p>The Amazon Resource Name (ARN) of the AWS Cloud9 development environment to add tags to.</p>
359    #[serde(rename = "ResourceARN")]
360    pub resource_arn: String,
361    /// <p>The list of tags to add to the given AWS Cloud9 development environment.</p>
362    #[serde(rename = "Tags")]
363    pub tags: Vec<Tag>,
364}
365
366#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
367#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
368pub struct TagResourceResponse {}
369
370#[derive(Clone, Debug, Default, PartialEq, Serialize)]
371#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
372pub struct UntagResourceRequest {
373    /// <p>The Amazon Resource Name (ARN) of the AWS Cloud9 development environment to remove tags from.</p>
374    #[serde(rename = "ResourceARN")]
375    pub resource_arn: String,
376    /// <p>The tag names of the tags to remove from the given AWS Cloud9 development environment.</p>
377    #[serde(rename = "TagKeys")]
378    pub tag_keys: Vec<String>,
379}
380
381#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
382#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
383pub struct UntagResourceResponse {}
384
385#[derive(Clone, Debug, Default, PartialEq, Serialize)]
386#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
387pub struct UpdateEnvironmentMembershipRequest {
388    /// <p>The ID of the environment for the environment member whose settings you want to change.</p>
389    #[serde(rename = "environmentId")]
390    pub environment_id: String,
391    /// <p><p>The replacement type of environment member permissions you want to associate with this environment member. Available values include:</p> <ul> <li> <p> <code>read-only</code>: Has read-only access to the environment.</p> </li> <li> <p> <code>read-write</code>: Has read-write access to the environment.</p> </li> </ul></p>
392    #[serde(rename = "permissions")]
393    pub permissions: String,
394    /// <p>The Amazon Resource Name (ARN) of the environment member whose settings you want to change.</p>
395    #[serde(rename = "userArn")]
396    pub user_arn: String,
397}
398
399#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
400#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
401pub struct UpdateEnvironmentMembershipResult {
402    /// <p>Information about the environment member whose settings were changed.</p>
403    #[serde(rename = "membership")]
404    #[serde(skip_serializing_if = "Option::is_none")]
405    pub membership: Option<EnvironmentMember>,
406}
407
408#[derive(Clone, Debug, Default, PartialEq, Serialize)]
409#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
410pub struct UpdateEnvironmentRequest {
411    /// <p>Any new or replacement description for the environment.</p>
412    #[serde(rename = "description")]
413    #[serde(skip_serializing_if = "Option::is_none")]
414    pub description: Option<String>,
415    /// <p>The ID of the environment to change settings.</p>
416    #[serde(rename = "environmentId")]
417    pub environment_id: String,
418    /// <p>A replacement name for the environment.</p>
419    #[serde(rename = "name")]
420    #[serde(skip_serializing_if = "Option::is_none")]
421    pub name: Option<String>,
422}
423
424#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
425#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
426pub struct UpdateEnvironmentResult {}
427
428/// Errors returned by CreateEnvironmentEC2
429#[derive(Debug, PartialEq)]
430pub enum CreateEnvironmentEC2Error {
431    /// <p>The target request is invalid.</p>
432    BadRequest(String),
433    /// <p>A conflict occurred.</p>
434    Conflict(String),
435    /// <p>An access permissions issue occurred.</p>
436    Forbidden(String),
437    /// <p>An internal server error occurred.</p>
438    InternalServerError(String),
439    /// <p>A service limit was exceeded.</p>
440    LimitExceeded(String),
441    /// <p>The target resource cannot be found.</p>
442    NotFound(String),
443    /// <p>Too many service requests were made over the given time period.</p>
444    TooManyRequests(String),
445}
446
447impl CreateEnvironmentEC2Error {
448    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateEnvironmentEC2Error> {
449        if let Some(err) = proto::json::Error::parse(&res) {
450            match err.typ.as_str() {
451                "BadRequestException" => {
452                    return RusotoError::Service(CreateEnvironmentEC2Error::BadRequest(err.msg))
453                }
454                "ConflictException" => {
455                    return RusotoError::Service(CreateEnvironmentEC2Error::Conflict(err.msg))
456                }
457                "ForbiddenException" => {
458                    return RusotoError::Service(CreateEnvironmentEC2Error::Forbidden(err.msg))
459                }
460                "InternalServerErrorException" => {
461                    return RusotoError::Service(CreateEnvironmentEC2Error::InternalServerError(
462                        err.msg,
463                    ))
464                }
465                "LimitExceededException" => {
466                    return RusotoError::Service(CreateEnvironmentEC2Error::LimitExceeded(err.msg))
467                }
468                "NotFoundException" => {
469                    return RusotoError::Service(CreateEnvironmentEC2Error::NotFound(err.msg))
470                }
471                "TooManyRequestsException" => {
472                    return RusotoError::Service(CreateEnvironmentEC2Error::TooManyRequests(
473                        err.msg,
474                    ))
475                }
476                "ValidationException" => return RusotoError::Validation(err.msg),
477                _ => {}
478            }
479        }
480        RusotoError::Unknown(res)
481    }
482}
483impl fmt::Display for CreateEnvironmentEC2Error {
484    #[allow(unused_variables)]
485    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
486        match *self {
487            CreateEnvironmentEC2Error::BadRequest(ref cause) => write!(f, "{}", cause),
488            CreateEnvironmentEC2Error::Conflict(ref cause) => write!(f, "{}", cause),
489            CreateEnvironmentEC2Error::Forbidden(ref cause) => write!(f, "{}", cause),
490            CreateEnvironmentEC2Error::InternalServerError(ref cause) => write!(f, "{}", cause),
491            CreateEnvironmentEC2Error::LimitExceeded(ref cause) => write!(f, "{}", cause),
492            CreateEnvironmentEC2Error::NotFound(ref cause) => write!(f, "{}", cause),
493            CreateEnvironmentEC2Error::TooManyRequests(ref cause) => write!(f, "{}", cause),
494        }
495    }
496}
497impl Error for CreateEnvironmentEC2Error {}
498/// Errors returned by CreateEnvironmentMembership
499#[derive(Debug, PartialEq)]
500pub enum CreateEnvironmentMembershipError {
501    /// <p>The target request is invalid.</p>
502    BadRequest(String),
503    /// <p>A conflict occurred.</p>
504    Conflict(String),
505    /// <p>An access permissions issue occurred.</p>
506    Forbidden(String),
507    /// <p>An internal server error occurred.</p>
508    InternalServerError(String),
509    /// <p>A service limit was exceeded.</p>
510    LimitExceeded(String),
511    /// <p>The target resource cannot be found.</p>
512    NotFound(String),
513    /// <p>Too many service requests were made over the given time period.</p>
514    TooManyRequests(String),
515}
516
517impl CreateEnvironmentMembershipError {
518    pub fn from_response(
519        res: BufferedHttpResponse,
520    ) -> RusotoError<CreateEnvironmentMembershipError> {
521        if let Some(err) = proto::json::Error::parse(&res) {
522            match err.typ.as_str() {
523                "BadRequestException" => {
524                    return RusotoError::Service(CreateEnvironmentMembershipError::BadRequest(
525                        err.msg,
526                    ))
527                }
528                "ConflictException" => {
529                    return RusotoError::Service(CreateEnvironmentMembershipError::Conflict(
530                        err.msg,
531                    ))
532                }
533                "ForbiddenException" => {
534                    return RusotoError::Service(CreateEnvironmentMembershipError::Forbidden(
535                        err.msg,
536                    ))
537                }
538                "InternalServerErrorException" => {
539                    return RusotoError::Service(
540                        CreateEnvironmentMembershipError::InternalServerError(err.msg),
541                    )
542                }
543                "LimitExceededException" => {
544                    return RusotoError::Service(CreateEnvironmentMembershipError::LimitExceeded(
545                        err.msg,
546                    ))
547                }
548                "NotFoundException" => {
549                    return RusotoError::Service(CreateEnvironmentMembershipError::NotFound(
550                        err.msg,
551                    ))
552                }
553                "TooManyRequestsException" => {
554                    return RusotoError::Service(CreateEnvironmentMembershipError::TooManyRequests(
555                        err.msg,
556                    ))
557                }
558                "ValidationException" => return RusotoError::Validation(err.msg),
559                _ => {}
560            }
561        }
562        RusotoError::Unknown(res)
563    }
564}
565impl fmt::Display for CreateEnvironmentMembershipError {
566    #[allow(unused_variables)]
567    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
568        match *self {
569            CreateEnvironmentMembershipError::BadRequest(ref cause) => write!(f, "{}", cause),
570            CreateEnvironmentMembershipError::Conflict(ref cause) => write!(f, "{}", cause),
571            CreateEnvironmentMembershipError::Forbidden(ref cause) => write!(f, "{}", cause),
572            CreateEnvironmentMembershipError::InternalServerError(ref cause) => {
573                write!(f, "{}", cause)
574            }
575            CreateEnvironmentMembershipError::LimitExceeded(ref cause) => write!(f, "{}", cause),
576            CreateEnvironmentMembershipError::NotFound(ref cause) => write!(f, "{}", cause),
577            CreateEnvironmentMembershipError::TooManyRequests(ref cause) => write!(f, "{}", cause),
578        }
579    }
580}
581impl Error for CreateEnvironmentMembershipError {}
582/// Errors returned by DeleteEnvironment
583#[derive(Debug, PartialEq)]
584pub enum DeleteEnvironmentError {
585    /// <p>The target request is invalid.</p>
586    BadRequest(String),
587    /// <p>A conflict occurred.</p>
588    Conflict(String),
589    /// <p>An access permissions issue occurred.</p>
590    Forbidden(String),
591    /// <p>An internal server error occurred.</p>
592    InternalServerError(String),
593    /// <p>A service limit was exceeded.</p>
594    LimitExceeded(String),
595    /// <p>The target resource cannot be found.</p>
596    NotFound(String),
597    /// <p>Too many service requests were made over the given time period.</p>
598    TooManyRequests(String),
599}
600
601impl DeleteEnvironmentError {
602    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteEnvironmentError> {
603        if let Some(err) = proto::json::Error::parse(&res) {
604            match err.typ.as_str() {
605                "BadRequestException" => {
606                    return RusotoError::Service(DeleteEnvironmentError::BadRequest(err.msg))
607                }
608                "ConflictException" => {
609                    return RusotoError::Service(DeleteEnvironmentError::Conflict(err.msg))
610                }
611                "ForbiddenException" => {
612                    return RusotoError::Service(DeleteEnvironmentError::Forbidden(err.msg))
613                }
614                "InternalServerErrorException" => {
615                    return RusotoError::Service(DeleteEnvironmentError::InternalServerError(
616                        err.msg,
617                    ))
618                }
619                "LimitExceededException" => {
620                    return RusotoError::Service(DeleteEnvironmentError::LimitExceeded(err.msg))
621                }
622                "NotFoundException" => {
623                    return RusotoError::Service(DeleteEnvironmentError::NotFound(err.msg))
624                }
625                "TooManyRequestsException" => {
626                    return RusotoError::Service(DeleteEnvironmentError::TooManyRequests(err.msg))
627                }
628                "ValidationException" => return RusotoError::Validation(err.msg),
629                _ => {}
630            }
631        }
632        RusotoError::Unknown(res)
633    }
634}
635impl fmt::Display for DeleteEnvironmentError {
636    #[allow(unused_variables)]
637    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
638        match *self {
639            DeleteEnvironmentError::BadRequest(ref cause) => write!(f, "{}", cause),
640            DeleteEnvironmentError::Conflict(ref cause) => write!(f, "{}", cause),
641            DeleteEnvironmentError::Forbidden(ref cause) => write!(f, "{}", cause),
642            DeleteEnvironmentError::InternalServerError(ref cause) => write!(f, "{}", cause),
643            DeleteEnvironmentError::LimitExceeded(ref cause) => write!(f, "{}", cause),
644            DeleteEnvironmentError::NotFound(ref cause) => write!(f, "{}", cause),
645            DeleteEnvironmentError::TooManyRequests(ref cause) => write!(f, "{}", cause),
646        }
647    }
648}
649impl Error for DeleteEnvironmentError {}
650/// Errors returned by DeleteEnvironmentMembership
651#[derive(Debug, PartialEq)]
652pub enum DeleteEnvironmentMembershipError {
653    /// <p>The target request is invalid.</p>
654    BadRequest(String),
655    /// <p>A conflict occurred.</p>
656    Conflict(String),
657    /// <p>An access permissions issue occurred.</p>
658    Forbidden(String),
659    /// <p>An internal server error occurred.</p>
660    InternalServerError(String),
661    /// <p>A service limit was exceeded.</p>
662    LimitExceeded(String),
663    /// <p>The target resource cannot be found.</p>
664    NotFound(String),
665    /// <p>Too many service requests were made over the given time period.</p>
666    TooManyRequests(String),
667}
668
669impl DeleteEnvironmentMembershipError {
670    pub fn from_response(
671        res: BufferedHttpResponse,
672    ) -> RusotoError<DeleteEnvironmentMembershipError> {
673        if let Some(err) = proto::json::Error::parse(&res) {
674            match err.typ.as_str() {
675                "BadRequestException" => {
676                    return RusotoError::Service(DeleteEnvironmentMembershipError::BadRequest(
677                        err.msg,
678                    ))
679                }
680                "ConflictException" => {
681                    return RusotoError::Service(DeleteEnvironmentMembershipError::Conflict(
682                        err.msg,
683                    ))
684                }
685                "ForbiddenException" => {
686                    return RusotoError::Service(DeleteEnvironmentMembershipError::Forbidden(
687                        err.msg,
688                    ))
689                }
690                "InternalServerErrorException" => {
691                    return RusotoError::Service(
692                        DeleteEnvironmentMembershipError::InternalServerError(err.msg),
693                    )
694                }
695                "LimitExceededException" => {
696                    return RusotoError::Service(DeleteEnvironmentMembershipError::LimitExceeded(
697                        err.msg,
698                    ))
699                }
700                "NotFoundException" => {
701                    return RusotoError::Service(DeleteEnvironmentMembershipError::NotFound(
702                        err.msg,
703                    ))
704                }
705                "TooManyRequestsException" => {
706                    return RusotoError::Service(DeleteEnvironmentMembershipError::TooManyRequests(
707                        err.msg,
708                    ))
709                }
710                "ValidationException" => return RusotoError::Validation(err.msg),
711                _ => {}
712            }
713        }
714        RusotoError::Unknown(res)
715    }
716}
717impl fmt::Display for DeleteEnvironmentMembershipError {
718    #[allow(unused_variables)]
719    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
720        match *self {
721            DeleteEnvironmentMembershipError::BadRequest(ref cause) => write!(f, "{}", cause),
722            DeleteEnvironmentMembershipError::Conflict(ref cause) => write!(f, "{}", cause),
723            DeleteEnvironmentMembershipError::Forbidden(ref cause) => write!(f, "{}", cause),
724            DeleteEnvironmentMembershipError::InternalServerError(ref cause) => {
725                write!(f, "{}", cause)
726            }
727            DeleteEnvironmentMembershipError::LimitExceeded(ref cause) => write!(f, "{}", cause),
728            DeleteEnvironmentMembershipError::NotFound(ref cause) => write!(f, "{}", cause),
729            DeleteEnvironmentMembershipError::TooManyRequests(ref cause) => write!(f, "{}", cause),
730        }
731    }
732}
733impl Error for DeleteEnvironmentMembershipError {}
734/// Errors returned by DescribeEnvironmentMemberships
735#[derive(Debug, PartialEq)]
736pub enum DescribeEnvironmentMembershipsError {
737    /// <p>The target request is invalid.</p>
738    BadRequest(String),
739    /// <p>A conflict occurred.</p>
740    Conflict(String),
741    /// <p>An access permissions issue occurred.</p>
742    Forbidden(String),
743    /// <p>An internal server error occurred.</p>
744    InternalServerError(String),
745    /// <p>A service limit was exceeded.</p>
746    LimitExceeded(String),
747    /// <p>The target resource cannot be found.</p>
748    NotFound(String),
749    /// <p>Too many service requests were made over the given time period.</p>
750    TooManyRequests(String),
751}
752
753impl DescribeEnvironmentMembershipsError {
754    pub fn from_response(
755        res: BufferedHttpResponse,
756    ) -> RusotoError<DescribeEnvironmentMembershipsError> {
757        if let Some(err) = proto::json::Error::parse(&res) {
758            match err.typ.as_str() {
759                "BadRequestException" => {
760                    return RusotoError::Service(DescribeEnvironmentMembershipsError::BadRequest(
761                        err.msg,
762                    ))
763                }
764                "ConflictException" => {
765                    return RusotoError::Service(DescribeEnvironmentMembershipsError::Conflict(
766                        err.msg,
767                    ))
768                }
769                "ForbiddenException" => {
770                    return RusotoError::Service(DescribeEnvironmentMembershipsError::Forbidden(
771                        err.msg,
772                    ))
773                }
774                "InternalServerErrorException" => {
775                    return RusotoError::Service(
776                        DescribeEnvironmentMembershipsError::InternalServerError(err.msg),
777                    )
778                }
779                "LimitExceededException" => {
780                    return RusotoError::Service(
781                        DescribeEnvironmentMembershipsError::LimitExceeded(err.msg),
782                    )
783                }
784                "NotFoundException" => {
785                    return RusotoError::Service(DescribeEnvironmentMembershipsError::NotFound(
786                        err.msg,
787                    ))
788                }
789                "TooManyRequestsException" => {
790                    return RusotoError::Service(
791                        DescribeEnvironmentMembershipsError::TooManyRequests(err.msg),
792                    )
793                }
794                "ValidationException" => return RusotoError::Validation(err.msg),
795                _ => {}
796            }
797        }
798        RusotoError::Unknown(res)
799    }
800}
801impl fmt::Display for DescribeEnvironmentMembershipsError {
802    #[allow(unused_variables)]
803    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
804        match *self {
805            DescribeEnvironmentMembershipsError::BadRequest(ref cause) => write!(f, "{}", cause),
806            DescribeEnvironmentMembershipsError::Conflict(ref cause) => write!(f, "{}", cause),
807            DescribeEnvironmentMembershipsError::Forbidden(ref cause) => write!(f, "{}", cause),
808            DescribeEnvironmentMembershipsError::InternalServerError(ref cause) => {
809                write!(f, "{}", cause)
810            }
811            DescribeEnvironmentMembershipsError::LimitExceeded(ref cause) => write!(f, "{}", cause),
812            DescribeEnvironmentMembershipsError::NotFound(ref cause) => write!(f, "{}", cause),
813            DescribeEnvironmentMembershipsError::TooManyRequests(ref cause) => {
814                write!(f, "{}", cause)
815            }
816        }
817    }
818}
819impl Error for DescribeEnvironmentMembershipsError {}
820/// Errors returned by DescribeEnvironmentStatus
821#[derive(Debug, PartialEq)]
822pub enum DescribeEnvironmentStatusError {
823    /// <p>The target request is invalid.</p>
824    BadRequest(String),
825    /// <p>A conflict occurred.</p>
826    Conflict(String),
827    /// <p>An access permissions issue occurred.</p>
828    Forbidden(String),
829    /// <p>An internal server error occurred.</p>
830    InternalServerError(String),
831    /// <p>A service limit was exceeded.</p>
832    LimitExceeded(String),
833    /// <p>The target resource cannot be found.</p>
834    NotFound(String),
835    /// <p>Too many service requests were made over the given time period.</p>
836    TooManyRequests(String),
837}
838
839impl DescribeEnvironmentStatusError {
840    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeEnvironmentStatusError> {
841        if let Some(err) = proto::json::Error::parse(&res) {
842            match err.typ.as_str() {
843                "BadRequestException" => {
844                    return RusotoError::Service(DescribeEnvironmentStatusError::BadRequest(
845                        err.msg,
846                    ))
847                }
848                "ConflictException" => {
849                    return RusotoError::Service(DescribeEnvironmentStatusError::Conflict(err.msg))
850                }
851                "ForbiddenException" => {
852                    return RusotoError::Service(DescribeEnvironmentStatusError::Forbidden(err.msg))
853                }
854                "InternalServerErrorException" => {
855                    return RusotoError::Service(
856                        DescribeEnvironmentStatusError::InternalServerError(err.msg),
857                    )
858                }
859                "LimitExceededException" => {
860                    return RusotoError::Service(DescribeEnvironmentStatusError::LimitExceeded(
861                        err.msg,
862                    ))
863                }
864                "NotFoundException" => {
865                    return RusotoError::Service(DescribeEnvironmentStatusError::NotFound(err.msg))
866                }
867                "TooManyRequestsException" => {
868                    return RusotoError::Service(DescribeEnvironmentStatusError::TooManyRequests(
869                        err.msg,
870                    ))
871                }
872                "ValidationException" => return RusotoError::Validation(err.msg),
873                _ => {}
874            }
875        }
876        RusotoError::Unknown(res)
877    }
878}
879impl fmt::Display for DescribeEnvironmentStatusError {
880    #[allow(unused_variables)]
881    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
882        match *self {
883            DescribeEnvironmentStatusError::BadRequest(ref cause) => write!(f, "{}", cause),
884            DescribeEnvironmentStatusError::Conflict(ref cause) => write!(f, "{}", cause),
885            DescribeEnvironmentStatusError::Forbidden(ref cause) => write!(f, "{}", cause),
886            DescribeEnvironmentStatusError::InternalServerError(ref cause) => {
887                write!(f, "{}", cause)
888            }
889            DescribeEnvironmentStatusError::LimitExceeded(ref cause) => write!(f, "{}", cause),
890            DescribeEnvironmentStatusError::NotFound(ref cause) => write!(f, "{}", cause),
891            DescribeEnvironmentStatusError::TooManyRequests(ref cause) => write!(f, "{}", cause),
892        }
893    }
894}
895impl Error for DescribeEnvironmentStatusError {}
896/// Errors returned by DescribeEnvironments
897#[derive(Debug, PartialEq)]
898pub enum DescribeEnvironmentsError {
899    /// <p>The target request is invalid.</p>
900    BadRequest(String),
901    /// <p>A conflict occurred.</p>
902    Conflict(String),
903    /// <p>An access permissions issue occurred.</p>
904    Forbidden(String),
905    /// <p>An internal server error occurred.</p>
906    InternalServerError(String),
907    /// <p>A service limit was exceeded.</p>
908    LimitExceeded(String),
909    /// <p>The target resource cannot be found.</p>
910    NotFound(String),
911    /// <p>Too many service requests were made over the given time period.</p>
912    TooManyRequests(String),
913}
914
915impl DescribeEnvironmentsError {
916    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeEnvironmentsError> {
917        if let Some(err) = proto::json::Error::parse(&res) {
918            match err.typ.as_str() {
919                "BadRequestException" => {
920                    return RusotoError::Service(DescribeEnvironmentsError::BadRequest(err.msg))
921                }
922                "ConflictException" => {
923                    return RusotoError::Service(DescribeEnvironmentsError::Conflict(err.msg))
924                }
925                "ForbiddenException" => {
926                    return RusotoError::Service(DescribeEnvironmentsError::Forbidden(err.msg))
927                }
928                "InternalServerErrorException" => {
929                    return RusotoError::Service(DescribeEnvironmentsError::InternalServerError(
930                        err.msg,
931                    ))
932                }
933                "LimitExceededException" => {
934                    return RusotoError::Service(DescribeEnvironmentsError::LimitExceeded(err.msg))
935                }
936                "NotFoundException" => {
937                    return RusotoError::Service(DescribeEnvironmentsError::NotFound(err.msg))
938                }
939                "TooManyRequestsException" => {
940                    return RusotoError::Service(DescribeEnvironmentsError::TooManyRequests(
941                        err.msg,
942                    ))
943                }
944                "ValidationException" => return RusotoError::Validation(err.msg),
945                _ => {}
946            }
947        }
948        RusotoError::Unknown(res)
949    }
950}
951impl fmt::Display for DescribeEnvironmentsError {
952    #[allow(unused_variables)]
953    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
954        match *self {
955            DescribeEnvironmentsError::BadRequest(ref cause) => write!(f, "{}", cause),
956            DescribeEnvironmentsError::Conflict(ref cause) => write!(f, "{}", cause),
957            DescribeEnvironmentsError::Forbidden(ref cause) => write!(f, "{}", cause),
958            DescribeEnvironmentsError::InternalServerError(ref cause) => write!(f, "{}", cause),
959            DescribeEnvironmentsError::LimitExceeded(ref cause) => write!(f, "{}", cause),
960            DescribeEnvironmentsError::NotFound(ref cause) => write!(f, "{}", cause),
961            DescribeEnvironmentsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
962        }
963    }
964}
965impl Error for DescribeEnvironmentsError {}
966/// Errors returned by ListEnvironments
967#[derive(Debug, PartialEq)]
968pub enum ListEnvironmentsError {
969    /// <p>The target request is invalid.</p>
970    BadRequest(String),
971    /// <p>A conflict occurred.</p>
972    Conflict(String),
973    /// <p>An access permissions issue occurred.</p>
974    Forbidden(String),
975    /// <p>An internal server error occurred.</p>
976    InternalServerError(String),
977    /// <p>A service limit was exceeded.</p>
978    LimitExceeded(String),
979    /// <p>The target resource cannot be found.</p>
980    NotFound(String),
981    /// <p>Too many service requests were made over the given time period.</p>
982    TooManyRequests(String),
983}
984
985impl ListEnvironmentsError {
986    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListEnvironmentsError> {
987        if let Some(err) = proto::json::Error::parse(&res) {
988            match err.typ.as_str() {
989                "BadRequestException" => {
990                    return RusotoError::Service(ListEnvironmentsError::BadRequest(err.msg))
991                }
992                "ConflictException" => {
993                    return RusotoError::Service(ListEnvironmentsError::Conflict(err.msg))
994                }
995                "ForbiddenException" => {
996                    return RusotoError::Service(ListEnvironmentsError::Forbidden(err.msg))
997                }
998                "InternalServerErrorException" => {
999                    return RusotoError::Service(ListEnvironmentsError::InternalServerError(
1000                        err.msg,
1001                    ))
1002                }
1003                "LimitExceededException" => {
1004                    return RusotoError::Service(ListEnvironmentsError::LimitExceeded(err.msg))
1005                }
1006                "NotFoundException" => {
1007                    return RusotoError::Service(ListEnvironmentsError::NotFound(err.msg))
1008                }
1009                "TooManyRequestsException" => {
1010                    return RusotoError::Service(ListEnvironmentsError::TooManyRequests(err.msg))
1011                }
1012                "ValidationException" => return RusotoError::Validation(err.msg),
1013                _ => {}
1014            }
1015        }
1016        RusotoError::Unknown(res)
1017    }
1018}
1019impl fmt::Display for ListEnvironmentsError {
1020    #[allow(unused_variables)]
1021    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1022        match *self {
1023            ListEnvironmentsError::BadRequest(ref cause) => write!(f, "{}", cause),
1024            ListEnvironmentsError::Conflict(ref cause) => write!(f, "{}", cause),
1025            ListEnvironmentsError::Forbidden(ref cause) => write!(f, "{}", cause),
1026            ListEnvironmentsError::InternalServerError(ref cause) => write!(f, "{}", cause),
1027            ListEnvironmentsError::LimitExceeded(ref cause) => write!(f, "{}", cause),
1028            ListEnvironmentsError::NotFound(ref cause) => write!(f, "{}", cause),
1029            ListEnvironmentsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1030        }
1031    }
1032}
1033impl Error for ListEnvironmentsError {}
1034/// Errors returned by ListTagsForResource
1035#[derive(Debug, PartialEq)]
1036pub enum ListTagsForResourceError {
1037    /// <p>The target request is invalid.</p>
1038    BadRequest(String),
1039    /// <p>An internal server error occurred.</p>
1040    InternalServerError(String),
1041    /// <p>The target resource cannot be found.</p>
1042    NotFound(String),
1043}
1044
1045impl ListTagsForResourceError {
1046    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
1047        if let Some(err) = proto::json::Error::parse(&res) {
1048            match err.typ.as_str() {
1049                "BadRequestException" => {
1050                    return RusotoError::Service(ListTagsForResourceError::BadRequest(err.msg))
1051                }
1052                "InternalServerErrorException" => {
1053                    return RusotoError::Service(ListTagsForResourceError::InternalServerError(
1054                        err.msg,
1055                    ))
1056                }
1057                "NotFoundException" => {
1058                    return RusotoError::Service(ListTagsForResourceError::NotFound(err.msg))
1059                }
1060                "ValidationException" => return RusotoError::Validation(err.msg),
1061                _ => {}
1062            }
1063        }
1064        RusotoError::Unknown(res)
1065    }
1066}
1067impl fmt::Display for ListTagsForResourceError {
1068    #[allow(unused_variables)]
1069    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1070        match *self {
1071            ListTagsForResourceError::BadRequest(ref cause) => write!(f, "{}", cause),
1072            ListTagsForResourceError::InternalServerError(ref cause) => write!(f, "{}", cause),
1073            ListTagsForResourceError::NotFound(ref cause) => write!(f, "{}", cause),
1074        }
1075    }
1076}
1077impl Error for ListTagsForResourceError {}
1078/// Errors returned by TagResource
1079#[derive(Debug, PartialEq)]
1080pub enum TagResourceError {
1081    /// <p>The target request is invalid.</p>
1082    BadRequest(String),
1083    /// <p>An internal server error occurred.</p>
1084    InternalServerError(String),
1085    /// <p>The target resource cannot be found.</p>
1086    NotFound(String),
1087}
1088
1089impl TagResourceError {
1090    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
1091        if let Some(err) = proto::json::Error::parse(&res) {
1092            match err.typ.as_str() {
1093                "BadRequestException" => {
1094                    return RusotoError::Service(TagResourceError::BadRequest(err.msg))
1095                }
1096                "InternalServerErrorException" => {
1097                    return RusotoError::Service(TagResourceError::InternalServerError(err.msg))
1098                }
1099                "NotFoundException" => {
1100                    return RusotoError::Service(TagResourceError::NotFound(err.msg))
1101                }
1102                "ValidationException" => return RusotoError::Validation(err.msg),
1103                _ => {}
1104            }
1105        }
1106        RusotoError::Unknown(res)
1107    }
1108}
1109impl fmt::Display for TagResourceError {
1110    #[allow(unused_variables)]
1111    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1112        match *self {
1113            TagResourceError::BadRequest(ref cause) => write!(f, "{}", cause),
1114            TagResourceError::InternalServerError(ref cause) => write!(f, "{}", cause),
1115            TagResourceError::NotFound(ref cause) => write!(f, "{}", cause),
1116        }
1117    }
1118}
1119impl Error for TagResourceError {}
1120/// Errors returned by UntagResource
1121#[derive(Debug, PartialEq)]
1122pub enum UntagResourceError {
1123    /// <p>The target request is invalid.</p>
1124    BadRequest(String),
1125    /// <p>An internal server error occurred.</p>
1126    InternalServerError(String),
1127    /// <p>The target resource cannot be found.</p>
1128    NotFound(String),
1129}
1130
1131impl UntagResourceError {
1132    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
1133        if let Some(err) = proto::json::Error::parse(&res) {
1134            match err.typ.as_str() {
1135                "BadRequestException" => {
1136                    return RusotoError::Service(UntagResourceError::BadRequest(err.msg))
1137                }
1138                "InternalServerErrorException" => {
1139                    return RusotoError::Service(UntagResourceError::InternalServerError(err.msg))
1140                }
1141                "NotFoundException" => {
1142                    return RusotoError::Service(UntagResourceError::NotFound(err.msg))
1143                }
1144                "ValidationException" => return RusotoError::Validation(err.msg),
1145                _ => {}
1146            }
1147        }
1148        RusotoError::Unknown(res)
1149    }
1150}
1151impl fmt::Display for UntagResourceError {
1152    #[allow(unused_variables)]
1153    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1154        match *self {
1155            UntagResourceError::BadRequest(ref cause) => write!(f, "{}", cause),
1156            UntagResourceError::InternalServerError(ref cause) => write!(f, "{}", cause),
1157            UntagResourceError::NotFound(ref cause) => write!(f, "{}", cause),
1158        }
1159    }
1160}
1161impl Error for UntagResourceError {}
1162/// Errors returned by UpdateEnvironment
1163#[derive(Debug, PartialEq)]
1164pub enum UpdateEnvironmentError {
1165    /// <p>The target request is invalid.</p>
1166    BadRequest(String),
1167    /// <p>A conflict occurred.</p>
1168    Conflict(String),
1169    /// <p>An access permissions issue occurred.</p>
1170    Forbidden(String),
1171    /// <p>An internal server error occurred.</p>
1172    InternalServerError(String),
1173    /// <p>A service limit was exceeded.</p>
1174    LimitExceeded(String),
1175    /// <p>The target resource cannot be found.</p>
1176    NotFound(String),
1177    /// <p>Too many service requests were made over the given time period.</p>
1178    TooManyRequests(String),
1179}
1180
1181impl UpdateEnvironmentError {
1182    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateEnvironmentError> {
1183        if let Some(err) = proto::json::Error::parse(&res) {
1184            match err.typ.as_str() {
1185                "BadRequestException" => {
1186                    return RusotoError::Service(UpdateEnvironmentError::BadRequest(err.msg))
1187                }
1188                "ConflictException" => {
1189                    return RusotoError::Service(UpdateEnvironmentError::Conflict(err.msg))
1190                }
1191                "ForbiddenException" => {
1192                    return RusotoError::Service(UpdateEnvironmentError::Forbidden(err.msg))
1193                }
1194                "InternalServerErrorException" => {
1195                    return RusotoError::Service(UpdateEnvironmentError::InternalServerError(
1196                        err.msg,
1197                    ))
1198                }
1199                "LimitExceededException" => {
1200                    return RusotoError::Service(UpdateEnvironmentError::LimitExceeded(err.msg))
1201                }
1202                "NotFoundException" => {
1203                    return RusotoError::Service(UpdateEnvironmentError::NotFound(err.msg))
1204                }
1205                "TooManyRequestsException" => {
1206                    return RusotoError::Service(UpdateEnvironmentError::TooManyRequests(err.msg))
1207                }
1208                "ValidationException" => return RusotoError::Validation(err.msg),
1209                _ => {}
1210            }
1211        }
1212        RusotoError::Unknown(res)
1213    }
1214}
1215impl fmt::Display for UpdateEnvironmentError {
1216    #[allow(unused_variables)]
1217    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1218        match *self {
1219            UpdateEnvironmentError::BadRequest(ref cause) => write!(f, "{}", cause),
1220            UpdateEnvironmentError::Conflict(ref cause) => write!(f, "{}", cause),
1221            UpdateEnvironmentError::Forbidden(ref cause) => write!(f, "{}", cause),
1222            UpdateEnvironmentError::InternalServerError(ref cause) => write!(f, "{}", cause),
1223            UpdateEnvironmentError::LimitExceeded(ref cause) => write!(f, "{}", cause),
1224            UpdateEnvironmentError::NotFound(ref cause) => write!(f, "{}", cause),
1225            UpdateEnvironmentError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1226        }
1227    }
1228}
1229impl Error for UpdateEnvironmentError {}
1230/// Errors returned by UpdateEnvironmentMembership
1231#[derive(Debug, PartialEq)]
1232pub enum UpdateEnvironmentMembershipError {
1233    /// <p>The target request is invalid.</p>
1234    BadRequest(String),
1235    /// <p>A conflict occurred.</p>
1236    Conflict(String),
1237    /// <p>An access permissions issue occurred.</p>
1238    Forbidden(String),
1239    /// <p>An internal server error occurred.</p>
1240    InternalServerError(String),
1241    /// <p>A service limit was exceeded.</p>
1242    LimitExceeded(String),
1243    /// <p>The target resource cannot be found.</p>
1244    NotFound(String),
1245    /// <p>Too many service requests were made over the given time period.</p>
1246    TooManyRequests(String),
1247}
1248
1249impl UpdateEnvironmentMembershipError {
1250    pub fn from_response(
1251        res: BufferedHttpResponse,
1252    ) -> RusotoError<UpdateEnvironmentMembershipError> {
1253        if let Some(err) = proto::json::Error::parse(&res) {
1254            match err.typ.as_str() {
1255                "BadRequestException" => {
1256                    return RusotoError::Service(UpdateEnvironmentMembershipError::BadRequest(
1257                        err.msg,
1258                    ))
1259                }
1260                "ConflictException" => {
1261                    return RusotoError::Service(UpdateEnvironmentMembershipError::Conflict(
1262                        err.msg,
1263                    ))
1264                }
1265                "ForbiddenException" => {
1266                    return RusotoError::Service(UpdateEnvironmentMembershipError::Forbidden(
1267                        err.msg,
1268                    ))
1269                }
1270                "InternalServerErrorException" => {
1271                    return RusotoError::Service(
1272                        UpdateEnvironmentMembershipError::InternalServerError(err.msg),
1273                    )
1274                }
1275                "LimitExceededException" => {
1276                    return RusotoError::Service(UpdateEnvironmentMembershipError::LimitExceeded(
1277                        err.msg,
1278                    ))
1279                }
1280                "NotFoundException" => {
1281                    return RusotoError::Service(UpdateEnvironmentMembershipError::NotFound(
1282                        err.msg,
1283                    ))
1284                }
1285                "TooManyRequestsException" => {
1286                    return RusotoError::Service(UpdateEnvironmentMembershipError::TooManyRequests(
1287                        err.msg,
1288                    ))
1289                }
1290                "ValidationException" => return RusotoError::Validation(err.msg),
1291                _ => {}
1292            }
1293        }
1294        RusotoError::Unknown(res)
1295    }
1296}
1297impl fmt::Display for UpdateEnvironmentMembershipError {
1298    #[allow(unused_variables)]
1299    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1300        match *self {
1301            UpdateEnvironmentMembershipError::BadRequest(ref cause) => write!(f, "{}", cause),
1302            UpdateEnvironmentMembershipError::Conflict(ref cause) => write!(f, "{}", cause),
1303            UpdateEnvironmentMembershipError::Forbidden(ref cause) => write!(f, "{}", cause),
1304            UpdateEnvironmentMembershipError::InternalServerError(ref cause) => {
1305                write!(f, "{}", cause)
1306            }
1307            UpdateEnvironmentMembershipError::LimitExceeded(ref cause) => write!(f, "{}", cause),
1308            UpdateEnvironmentMembershipError::NotFound(ref cause) => write!(f, "{}", cause),
1309            UpdateEnvironmentMembershipError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1310        }
1311    }
1312}
1313impl Error for UpdateEnvironmentMembershipError {}
1314/// Trait representing the capabilities of the AWS Cloud9 API. AWS Cloud9 clients implement this trait.
1315#[async_trait]
1316pub trait Cloud9 {
1317    /// <p>Creates an AWS Cloud9 development environment, launches an Amazon Elastic Compute Cloud (Amazon EC2) instance, and then connects from the instance to the environment.</p>
1318    async fn create_environment_ec2(
1319        &self,
1320        input: CreateEnvironmentEC2Request,
1321    ) -> Result<CreateEnvironmentEC2Result, RusotoError<CreateEnvironmentEC2Error>>;
1322
1323    /// <p>Adds an environment member to an AWS Cloud9 development environment.</p>
1324    async fn create_environment_membership(
1325        &self,
1326        input: CreateEnvironmentMembershipRequest,
1327    ) -> Result<CreateEnvironmentMembershipResult, RusotoError<CreateEnvironmentMembershipError>>;
1328
1329    /// <p>Deletes an AWS Cloud9 development environment. If an Amazon EC2 instance is connected to the environment, also terminates the instance.</p>
1330    async fn delete_environment(
1331        &self,
1332        input: DeleteEnvironmentRequest,
1333    ) -> Result<DeleteEnvironmentResult, RusotoError<DeleteEnvironmentError>>;
1334
1335    /// <p>Deletes an environment member from an AWS Cloud9 development environment.</p>
1336    async fn delete_environment_membership(
1337        &self,
1338        input: DeleteEnvironmentMembershipRequest,
1339    ) -> Result<DeleteEnvironmentMembershipResult, RusotoError<DeleteEnvironmentMembershipError>>;
1340
1341    /// <p>Gets information about environment members for an AWS Cloud9 development environment.</p>
1342    async fn describe_environment_memberships(
1343        &self,
1344        input: DescribeEnvironmentMembershipsRequest,
1345    ) -> Result<
1346        DescribeEnvironmentMembershipsResult,
1347        RusotoError<DescribeEnvironmentMembershipsError>,
1348    >;
1349
1350    /// <p>Gets status information for an AWS Cloud9 development environment.</p>
1351    async fn describe_environment_status(
1352        &self,
1353        input: DescribeEnvironmentStatusRequest,
1354    ) -> Result<DescribeEnvironmentStatusResult, RusotoError<DescribeEnvironmentStatusError>>;
1355
1356    /// <p>Gets information about AWS Cloud9 development environments.</p>
1357    async fn describe_environments(
1358        &self,
1359        input: DescribeEnvironmentsRequest,
1360    ) -> Result<DescribeEnvironmentsResult, RusotoError<DescribeEnvironmentsError>>;
1361
1362    /// <p>Gets a list of AWS Cloud9 development environment identifiers.</p>
1363    async fn list_environments(
1364        &self,
1365        input: ListEnvironmentsRequest,
1366    ) -> Result<ListEnvironmentsResult, RusotoError<ListEnvironmentsError>>;
1367
1368    /// <p>Gets a list of the tags associated with an AWS Cloud9 development environment.</p>
1369    async fn list_tags_for_resource(
1370        &self,
1371        input: ListTagsForResourceRequest,
1372    ) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>>;
1373
1374    /// <p><p>Adds tags to an AWS Cloud9 development environment.</p> <important> <p>Tags that you add to an AWS Cloud9 environment by using this method will NOT be automatically propagated to underlying resources.</p> </important></p>
1375    async fn tag_resource(
1376        &self,
1377        input: TagResourceRequest,
1378    ) -> Result<TagResourceResponse, RusotoError<TagResourceError>>;
1379
1380    /// <p>Removes tags from an AWS Cloud9 development environment.</p>
1381    async fn untag_resource(
1382        &self,
1383        input: UntagResourceRequest,
1384    ) -> Result<UntagResourceResponse, RusotoError<UntagResourceError>>;
1385
1386    /// <p>Changes the settings of an existing AWS Cloud9 development environment.</p>
1387    async fn update_environment(
1388        &self,
1389        input: UpdateEnvironmentRequest,
1390    ) -> Result<UpdateEnvironmentResult, RusotoError<UpdateEnvironmentError>>;
1391
1392    /// <p>Changes the settings of an existing environment member for an AWS Cloud9 development environment.</p>
1393    async fn update_environment_membership(
1394        &self,
1395        input: UpdateEnvironmentMembershipRequest,
1396    ) -> Result<UpdateEnvironmentMembershipResult, RusotoError<UpdateEnvironmentMembershipError>>;
1397}
1398/// A client for the AWS Cloud9 API.
1399#[derive(Clone)]
1400pub struct Cloud9Client {
1401    client: Client,
1402    region: region::Region,
1403}
1404
1405impl Cloud9Client {
1406    /// Creates a client backed by the default tokio event loop.
1407    ///
1408    /// The client will use the default credentials provider and tls client.
1409    pub fn new(region: region::Region) -> Cloud9Client {
1410        Cloud9Client {
1411            client: Client::shared(),
1412            region,
1413        }
1414    }
1415
1416    pub fn new_with<P, D>(
1417        request_dispatcher: D,
1418        credentials_provider: P,
1419        region: region::Region,
1420    ) -> Cloud9Client
1421    where
1422        P: ProvideAwsCredentials + Send + Sync + 'static,
1423        D: DispatchSignedRequest + Send + Sync + 'static,
1424    {
1425        Cloud9Client {
1426            client: Client::new_with(credentials_provider, request_dispatcher),
1427            region,
1428        }
1429    }
1430
1431    pub fn new_with_client(client: Client, region: region::Region) -> Cloud9Client {
1432        Cloud9Client { client, region }
1433    }
1434}
1435
1436#[async_trait]
1437impl Cloud9 for Cloud9Client {
1438    /// <p>Creates an AWS Cloud9 development environment, launches an Amazon Elastic Compute Cloud (Amazon EC2) instance, and then connects from the instance to the environment.</p>
1439    async fn create_environment_ec2(
1440        &self,
1441        input: CreateEnvironmentEC2Request,
1442    ) -> Result<CreateEnvironmentEC2Result, RusotoError<CreateEnvironmentEC2Error>> {
1443        let mut request = self.new_signed_request("POST", "/");
1444        request.add_header(
1445            "x-amz-target",
1446            "AWSCloud9WorkspaceManagementService.CreateEnvironmentEC2",
1447        );
1448        let encoded = serde_json::to_string(&input).unwrap();
1449        request.set_payload(Some(encoded));
1450
1451        let response = self
1452            .sign_and_dispatch(request, CreateEnvironmentEC2Error::from_response)
1453            .await?;
1454        let mut response = response;
1455        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1456        proto::json::ResponsePayload::new(&response).deserialize::<CreateEnvironmentEC2Result, _>()
1457    }
1458
1459    /// <p>Adds an environment member to an AWS Cloud9 development environment.</p>
1460    async fn create_environment_membership(
1461        &self,
1462        input: CreateEnvironmentMembershipRequest,
1463    ) -> Result<CreateEnvironmentMembershipResult, RusotoError<CreateEnvironmentMembershipError>>
1464    {
1465        let mut request = self.new_signed_request("POST", "/");
1466        request.add_header(
1467            "x-amz-target",
1468            "AWSCloud9WorkspaceManagementService.CreateEnvironmentMembership",
1469        );
1470        let encoded = serde_json::to_string(&input).unwrap();
1471        request.set_payload(Some(encoded));
1472
1473        let response = self
1474            .sign_and_dispatch(request, CreateEnvironmentMembershipError::from_response)
1475            .await?;
1476        let mut response = response;
1477        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1478        proto::json::ResponsePayload::new(&response)
1479            .deserialize::<CreateEnvironmentMembershipResult, _>()
1480    }
1481
1482    /// <p>Deletes an AWS Cloud9 development environment. If an Amazon EC2 instance is connected to the environment, also terminates the instance.</p>
1483    async fn delete_environment(
1484        &self,
1485        input: DeleteEnvironmentRequest,
1486    ) -> Result<DeleteEnvironmentResult, RusotoError<DeleteEnvironmentError>> {
1487        let mut request = self.new_signed_request("POST", "/");
1488        request.add_header(
1489            "x-amz-target",
1490            "AWSCloud9WorkspaceManagementService.DeleteEnvironment",
1491        );
1492        let encoded = serde_json::to_string(&input).unwrap();
1493        request.set_payload(Some(encoded));
1494
1495        let response = self
1496            .sign_and_dispatch(request, DeleteEnvironmentError::from_response)
1497            .await?;
1498        let mut response = response;
1499        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1500        proto::json::ResponsePayload::new(&response).deserialize::<DeleteEnvironmentResult, _>()
1501    }
1502
1503    /// <p>Deletes an environment member from an AWS Cloud9 development environment.</p>
1504    async fn delete_environment_membership(
1505        &self,
1506        input: DeleteEnvironmentMembershipRequest,
1507    ) -> Result<DeleteEnvironmentMembershipResult, RusotoError<DeleteEnvironmentMembershipError>>
1508    {
1509        let mut request = self.new_signed_request("POST", "/");
1510        request.add_header(
1511            "x-amz-target",
1512            "AWSCloud9WorkspaceManagementService.DeleteEnvironmentMembership",
1513        );
1514        let encoded = serde_json::to_string(&input).unwrap();
1515        request.set_payload(Some(encoded));
1516
1517        let response = self
1518            .sign_and_dispatch(request, DeleteEnvironmentMembershipError::from_response)
1519            .await?;
1520        let mut response = response;
1521        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1522        proto::json::ResponsePayload::new(&response)
1523            .deserialize::<DeleteEnvironmentMembershipResult, _>()
1524    }
1525
1526    /// <p>Gets information about environment members for an AWS Cloud9 development environment.</p>
1527    async fn describe_environment_memberships(
1528        &self,
1529        input: DescribeEnvironmentMembershipsRequest,
1530    ) -> Result<
1531        DescribeEnvironmentMembershipsResult,
1532        RusotoError<DescribeEnvironmentMembershipsError>,
1533    > {
1534        let mut request = self.new_signed_request("POST", "/");
1535        request.add_header(
1536            "x-amz-target",
1537            "AWSCloud9WorkspaceManagementService.DescribeEnvironmentMemberships",
1538        );
1539        let encoded = serde_json::to_string(&input).unwrap();
1540        request.set_payload(Some(encoded));
1541
1542        let response = self
1543            .sign_and_dispatch(request, DescribeEnvironmentMembershipsError::from_response)
1544            .await?;
1545        let mut response = response;
1546        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1547        proto::json::ResponsePayload::new(&response)
1548            .deserialize::<DescribeEnvironmentMembershipsResult, _>()
1549    }
1550
1551    /// <p>Gets status information for an AWS Cloud9 development environment.</p>
1552    async fn describe_environment_status(
1553        &self,
1554        input: DescribeEnvironmentStatusRequest,
1555    ) -> Result<DescribeEnvironmentStatusResult, RusotoError<DescribeEnvironmentStatusError>> {
1556        let mut request = self.new_signed_request("POST", "/");
1557        request.add_header(
1558            "x-amz-target",
1559            "AWSCloud9WorkspaceManagementService.DescribeEnvironmentStatus",
1560        );
1561        let encoded = serde_json::to_string(&input).unwrap();
1562        request.set_payload(Some(encoded));
1563
1564        let response = self
1565            .sign_and_dispatch(request, DescribeEnvironmentStatusError::from_response)
1566            .await?;
1567        let mut response = response;
1568        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1569        proto::json::ResponsePayload::new(&response)
1570            .deserialize::<DescribeEnvironmentStatusResult, _>()
1571    }
1572
1573    /// <p>Gets information about AWS Cloud9 development environments.</p>
1574    async fn describe_environments(
1575        &self,
1576        input: DescribeEnvironmentsRequest,
1577    ) -> Result<DescribeEnvironmentsResult, RusotoError<DescribeEnvironmentsError>> {
1578        let mut request = self.new_signed_request("POST", "/");
1579        request.add_header(
1580            "x-amz-target",
1581            "AWSCloud9WorkspaceManagementService.DescribeEnvironments",
1582        );
1583        let encoded = serde_json::to_string(&input).unwrap();
1584        request.set_payload(Some(encoded));
1585
1586        let response = self
1587            .sign_and_dispatch(request, DescribeEnvironmentsError::from_response)
1588            .await?;
1589        let mut response = response;
1590        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1591        proto::json::ResponsePayload::new(&response).deserialize::<DescribeEnvironmentsResult, _>()
1592    }
1593
1594    /// <p>Gets a list of AWS Cloud9 development environment identifiers.</p>
1595    async fn list_environments(
1596        &self,
1597        input: ListEnvironmentsRequest,
1598    ) -> Result<ListEnvironmentsResult, RusotoError<ListEnvironmentsError>> {
1599        let mut request = self.new_signed_request("POST", "/");
1600        request.add_header(
1601            "x-amz-target",
1602            "AWSCloud9WorkspaceManagementService.ListEnvironments",
1603        );
1604        let encoded = serde_json::to_string(&input).unwrap();
1605        request.set_payload(Some(encoded));
1606
1607        let response = self
1608            .sign_and_dispatch(request, ListEnvironmentsError::from_response)
1609            .await?;
1610        let mut response = response;
1611        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1612        proto::json::ResponsePayload::new(&response).deserialize::<ListEnvironmentsResult, _>()
1613    }
1614
1615    /// <p>Gets a list of the tags associated with an AWS Cloud9 development environment.</p>
1616    async fn list_tags_for_resource(
1617        &self,
1618        input: ListTagsForResourceRequest,
1619    ) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>> {
1620        let mut request = self.new_signed_request("POST", "/");
1621        request.add_header(
1622            "x-amz-target",
1623            "AWSCloud9WorkspaceManagementService.ListTagsForResource",
1624        );
1625        let encoded = serde_json::to_string(&input).unwrap();
1626        request.set_payload(Some(encoded));
1627
1628        let response = self
1629            .sign_and_dispatch(request, ListTagsForResourceError::from_response)
1630            .await?;
1631        let mut response = response;
1632        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1633        proto::json::ResponsePayload::new(&response).deserialize::<ListTagsForResourceResponse, _>()
1634    }
1635
1636    /// <p><p>Adds tags to an AWS Cloud9 development environment.</p> <important> <p>Tags that you add to an AWS Cloud9 environment by using this method will NOT be automatically propagated to underlying resources.</p> </important></p>
1637    async fn tag_resource(
1638        &self,
1639        input: TagResourceRequest,
1640    ) -> Result<TagResourceResponse, RusotoError<TagResourceError>> {
1641        let mut request = self.new_signed_request("POST", "/");
1642        request.add_header(
1643            "x-amz-target",
1644            "AWSCloud9WorkspaceManagementService.TagResource",
1645        );
1646        let encoded = serde_json::to_string(&input).unwrap();
1647        request.set_payload(Some(encoded));
1648
1649        let response = self
1650            .sign_and_dispatch(request, TagResourceError::from_response)
1651            .await?;
1652        let mut response = response;
1653        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1654        proto::json::ResponsePayload::new(&response).deserialize::<TagResourceResponse, _>()
1655    }
1656
1657    /// <p>Removes tags from an AWS Cloud9 development environment.</p>
1658    async fn untag_resource(
1659        &self,
1660        input: UntagResourceRequest,
1661    ) -> Result<UntagResourceResponse, RusotoError<UntagResourceError>> {
1662        let mut request = self.new_signed_request("POST", "/");
1663        request.add_header(
1664            "x-amz-target",
1665            "AWSCloud9WorkspaceManagementService.UntagResource",
1666        );
1667        let encoded = serde_json::to_string(&input).unwrap();
1668        request.set_payload(Some(encoded));
1669
1670        let response = self
1671            .sign_and_dispatch(request, UntagResourceError::from_response)
1672            .await?;
1673        let mut response = response;
1674        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1675        proto::json::ResponsePayload::new(&response).deserialize::<UntagResourceResponse, _>()
1676    }
1677
1678    /// <p>Changes the settings of an existing AWS Cloud9 development environment.</p>
1679    async fn update_environment(
1680        &self,
1681        input: UpdateEnvironmentRequest,
1682    ) -> Result<UpdateEnvironmentResult, RusotoError<UpdateEnvironmentError>> {
1683        let mut request = self.new_signed_request("POST", "/");
1684        request.add_header(
1685            "x-amz-target",
1686            "AWSCloud9WorkspaceManagementService.UpdateEnvironment",
1687        );
1688        let encoded = serde_json::to_string(&input).unwrap();
1689        request.set_payload(Some(encoded));
1690
1691        let response = self
1692            .sign_and_dispatch(request, UpdateEnvironmentError::from_response)
1693            .await?;
1694        let mut response = response;
1695        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1696        proto::json::ResponsePayload::new(&response).deserialize::<UpdateEnvironmentResult, _>()
1697    }
1698
1699    /// <p>Changes the settings of an existing environment member for an AWS Cloud9 development environment.</p>
1700    async fn update_environment_membership(
1701        &self,
1702        input: UpdateEnvironmentMembershipRequest,
1703    ) -> Result<UpdateEnvironmentMembershipResult, RusotoError<UpdateEnvironmentMembershipError>>
1704    {
1705        let mut request = self.new_signed_request("POST", "/");
1706        request.add_header(
1707            "x-amz-target",
1708            "AWSCloud9WorkspaceManagementService.UpdateEnvironmentMembership",
1709        );
1710        let encoded = serde_json::to_string(&input).unwrap();
1711        request.set_payload(Some(encoded));
1712
1713        let response = self
1714            .sign_and_dispatch(request, UpdateEnvironmentMembershipError::from_response)
1715            .await?;
1716        let mut response = response;
1717        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1718        proto::json::ResponsePayload::new(&response)
1719            .deserialize::<UpdateEnvironmentMembershipResult, _>()
1720    }
1721}