rusoto_resource_groups/
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::param::{Params, ServiceParams};
23use rusoto_core::proto;
24use rusoto_core::signature::SignedRequest;
25#[allow(unused_imports)]
26use serde::{Deserialize, Serialize};
27use serde_json;
28#[derive(Clone, Debug, Default, PartialEq, Serialize)]
29#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
30pub struct CreateGroupInput {
31    /// <p>The description of the resource group. Descriptions can have a maximum of 511 characters, including letters, numbers, hyphens, underscores, punctuation, and spaces.</p>
32    #[serde(rename = "Description")]
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub description: Option<String>,
35    /// <p>The name of the group, which is the identifier of the group in other operations. A resource group name cannot be updated after it is created. A resource group name can have a maximum of 128 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with <code>AWS</code> or <code>aws</code>; these are reserved. A resource group name must be unique within your account.</p>
36    #[serde(rename = "Name")]
37    pub name: String,
38    /// <p>The resource query that determines which AWS resources are members of this group.</p>
39    #[serde(rename = "ResourceQuery")]
40    pub resource_query: ResourceQuery,
41    /// <p>The tags to add to the group. A tag is a string-to-string map of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
42    #[serde(rename = "Tags")]
43    #[serde(skip_serializing_if = "Option::is_none")]
44    pub tags: Option<::std::collections::HashMap<String, String>>,
45}
46
47#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
48#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
49pub struct CreateGroupOutput {
50    /// <p>A full description of the resource group after it is created.</p>
51    #[serde(rename = "Group")]
52    #[serde(skip_serializing_if = "Option::is_none")]
53    pub group: Option<Group>,
54    /// <p>The resource query associated with the group.</p>
55    #[serde(rename = "ResourceQuery")]
56    #[serde(skip_serializing_if = "Option::is_none")]
57    pub resource_query: Option<ResourceQuery>,
58    /// <p>The tags associated with the group.</p>
59    #[serde(rename = "Tags")]
60    #[serde(skip_serializing_if = "Option::is_none")]
61    pub tags: Option<::std::collections::HashMap<String, String>>,
62}
63
64#[derive(Clone, Debug, Default, PartialEq, Serialize)]
65#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
66pub struct DeleteGroupInput {
67    /// <p>The name of the resource group to delete.</p>
68    #[serde(rename = "GroupName")]
69    pub group_name: String,
70}
71
72#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
73#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
74pub struct DeleteGroupOutput {
75    /// <p>A full description of the deleted resource group.</p>
76    #[serde(rename = "Group")]
77    #[serde(skip_serializing_if = "Option::is_none")]
78    pub group: Option<Group>,
79}
80
81#[derive(Clone, Debug, Default, PartialEq, Serialize)]
82#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
83pub struct GetGroupInput {
84    /// <p>The name of the resource group.</p>
85    #[serde(rename = "GroupName")]
86    pub group_name: String,
87}
88
89#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
90#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
91pub struct GetGroupOutput {
92    /// <p>A full description of the resource group.</p>
93    #[serde(rename = "Group")]
94    #[serde(skip_serializing_if = "Option::is_none")]
95    pub group: Option<Group>,
96}
97
98#[derive(Clone, Debug, Default, PartialEq, Serialize)]
99#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
100pub struct GetGroupQueryInput {
101    /// <p>The name of the resource group.</p>
102    #[serde(rename = "GroupName")]
103    pub group_name: String,
104}
105
106#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
107#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
108pub struct GetGroupQueryOutput {
109    /// <p>The resource query associated with the specified group.</p>
110    #[serde(rename = "GroupQuery")]
111    #[serde(skip_serializing_if = "Option::is_none")]
112    pub group_query: Option<GroupQuery>,
113}
114
115#[derive(Clone, Debug, Default, PartialEq, Serialize)]
116#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
117pub struct GetTagsInput {
118    /// <p>The ARN of the resource group for which you want a list of tags. The resource must exist within the account you are using.</p>
119    #[serde(rename = "Arn")]
120    pub arn: String,
121}
122
123#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
124#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
125pub struct GetTagsOutput {
126    /// <p>The ARN of the tagged resource group.</p>
127    #[serde(rename = "Arn")]
128    #[serde(skip_serializing_if = "Option::is_none")]
129    pub arn: Option<String>,
130    /// <p>The tags associated with the specified resource group.</p>
131    #[serde(rename = "Tags")]
132    #[serde(skip_serializing_if = "Option::is_none")]
133    pub tags: Option<::std::collections::HashMap<String, String>>,
134}
135
136/// <p>A resource group.</p>
137#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
138#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
139pub struct Group {
140    /// <p>The description of the resource group.</p>
141    #[serde(rename = "Description")]
142    #[serde(skip_serializing_if = "Option::is_none")]
143    pub description: Option<String>,
144    /// <p>The ARN of a resource group.</p>
145    #[serde(rename = "GroupArn")]
146    pub group_arn: String,
147    /// <p>The name of a resource group.</p>
148    #[serde(rename = "Name")]
149    pub name: String,
150}
151
152/// <p>A filter name and value pair that is used to obtain more specific results from a list of groups.</p>
153#[derive(Clone, Debug, Default, PartialEq, Serialize)]
154#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
155pub struct GroupFilter {
156    /// <p>The name of the filter. Filter names are case-sensitive.</p>
157    #[serde(rename = "Name")]
158    pub name: String,
159    /// <p>One or more filter values. Allowed filter values vary by group filter name, and are case-sensitive.</p>
160    #[serde(rename = "Values")]
161    pub values: Vec<String>,
162}
163
164/// <p>The ARN and group name of a group.</p>
165#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
166#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
167pub struct GroupIdentifier {
168    /// <p>The ARN of a resource group.</p>
169    #[serde(rename = "GroupArn")]
170    #[serde(skip_serializing_if = "Option::is_none")]
171    pub group_arn: Option<String>,
172    /// <p>The name of a resource group.</p>
173    #[serde(rename = "GroupName")]
174    #[serde(skip_serializing_if = "Option::is_none")]
175    pub group_name: Option<String>,
176}
177
178/// <p>The underlying resource query of a resource group. Resources that match query results are part of the group.</p>
179#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
180#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
181pub struct GroupQuery {
182    /// <p>The name of a resource group that is associated with a specific resource query.</p>
183    #[serde(rename = "GroupName")]
184    pub group_name: String,
185    /// <p>The resource query which determines which AWS resources are members of the associated resource group.</p>
186    #[serde(rename = "ResourceQuery")]
187    pub resource_query: ResourceQuery,
188}
189
190#[derive(Clone, Debug, Default, PartialEq, Serialize)]
191#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
192pub struct ListGroupResourcesInput {
193    /// <p><p>Filters, formatted as ResourceFilter objects, that you want to apply to a ListGroupResources operation.</p> <ul> <li> <p> <code>resource-type</code> - Filter resources by their type. Specify up to five resource types in the format AWS::ServiceCode::ResourceType. For example, AWS::EC2::Instance, or AWS::S3::Bucket.</p> </li> </ul></p>
194    #[serde(rename = "Filters")]
195    #[serde(skip_serializing_if = "Option::is_none")]
196    pub filters: Option<Vec<ResourceFilter>>,
197    /// <p>The name of the resource group.</p>
198    #[serde(rename = "GroupName")]
199    pub group_name: String,
200    /// <p>The maximum number of group member ARNs that are returned in a single call by ListGroupResources, in paginated output. By default, this number is 50.</p>
201    #[serde(rename = "MaxResults")]
202    #[serde(skip_serializing_if = "Option::is_none")]
203    pub max_results: Option<i64>,
204    /// <p>The NextToken value that is returned in a paginated ListGroupResources request. To get the next page of results, run the call again, add the NextToken parameter, and specify the NextToken value.</p>
205    #[serde(rename = "NextToken")]
206    #[serde(skip_serializing_if = "Option::is_none")]
207    pub next_token: Option<String>,
208}
209
210#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
211#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
212pub struct ListGroupResourcesOutput {
213    /// <p>The NextToken value to include in a subsequent <code>ListGroupResources</code> request, to get more results.</p>
214    #[serde(rename = "NextToken")]
215    #[serde(skip_serializing_if = "Option::is_none")]
216    pub next_token: Option<String>,
217    /// <p>A list of <code>QueryError</code> objects. Each error is an object that contains <code>ErrorCode</code> and <code>Message</code> structures. Possible values for <code>ErrorCode</code> are <code>CLOUDFORMATION_STACK_INACTIVE</code> and <code>CLOUDFORMATION_STACK_NOT_EXISTING</code>.</p>
218    #[serde(rename = "QueryErrors")]
219    #[serde(skip_serializing_if = "Option::is_none")]
220    pub query_errors: Option<Vec<QueryError>>,
221    /// <p>The ARNs and resource types of resources that are members of the group that you specified.</p>
222    #[serde(rename = "ResourceIdentifiers")]
223    #[serde(skip_serializing_if = "Option::is_none")]
224    pub resource_identifiers: Option<Vec<ResourceIdentifier>>,
225}
226
227#[derive(Clone, Debug, Default, PartialEq, Serialize)]
228#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
229pub struct ListGroupsInput {
230    /// <p><p>Filters, formatted as GroupFilter objects, that you want to apply to a ListGroups operation.</p> <ul> <li> <p> <code>resource-type</code> - Filter groups by resource type. Specify up to five resource types in the format AWS::ServiceCode::ResourceType. For example, AWS::EC2::Instance, or AWS::S3::Bucket.</p> </li> </ul></p>
231    #[serde(rename = "Filters")]
232    #[serde(skip_serializing_if = "Option::is_none")]
233    pub filters: Option<Vec<GroupFilter>>,
234    /// <p>The maximum number of resource group results that are returned by ListGroups in paginated output. By default, this number is 50.</p>
235    #[serde(rename = "MaxResults")]
236    #[serde(skip_serializing_if = "Option::is_none")]
237    pub max_results: Option<i64>,
238    /// <p>The NextToken value that is returned in a paginated <code>ListGroups</code> request. To get the next page of results, run the call again, add the NextToken parameter, and specify the NextToken value.</p>
239    #[serde(rename = "NextToken")]
240    #[serde(skip_serializing_if = "Option::is_none")]
241    pub next_token: Option<String>,
242}
243
244#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
245#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
246pub struct ListGroupsOutput {
247    /// <p>A list of GroupIdentifier objects. Each identifier is an object that contains both the GroupName and the GroupArn.</p>
248    #[serde(rename = "GroupIdentifiers")]
249    #[serde(skip_serializing_if = "Option::is_none")]
250    pub group_identifiers: Option<Vec<GroupIdentifier>>,
251    /// <p>The NextToken value to include in a subsequent <code>ListGroups</code> request, to get more results.</p>
252    #[serde(rename = "NextToken")]
253    #[serde(skip_serializing_if = "Option::is_none")]
254    pub next_token: Option<String>,
255}
256
257/// <p>A two-part error structure that can occur in <code>ListGroupResources</code> or <code>SearchResources</code> operations on CloudFormation stack-based queries. The error occurs if the CloudFormation stack on which the query is based either does not exist, or has a status that renders the stack inactive. A <code>QueryError</code> occurrence does not necessarily mean that AWS Resource Groups could not complete the operation, but the resulting group might have no member resources.</p>
258#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
259#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
260pub struct QueryError {
261    /// <p>Possible values are <code>CLOUDFORMATION_STACK_INACTIVE</code> and <code>CLOUDFORMATION_STACK_NOT_EXISTING</code>.</p>
262    #[serde(rename = "ErrorCode")]
263    #[serde(skip_serializing_if = "Option::is_none")]
264    pub error_code: Option<String>,
265    /// <p>A message that explains the <code>ErrorCode</code> value. Messages might state that the specified CloudFormation stack does not exist (or no longer exists). For <code>CLOUDFORMATION_STACK_INACTIVE</code>, the message typically states that the CloudFormation stack has a status that is not (or no longer) active, such as <code>CREATE_FAILED</code>.</p>
266    #[serde(rename = "Message")]
267    #[serde(skip_serializing_if = "Option::is_none")]
268    pub message: Option<String>,
269}
270
271/// <p>A filter name and value pair that is used to obtain more specific results from a list of resources.</p>
272#[derive(Clone, Debug, Default, PartialEq, Serialize)]
273#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
274pub struct ResourceFilter {
275    /// <p>The name of the filter. Filter names are case-sensitive.</p>
276    #[serde(rename = "Name")]
277    pub name: String,
278    /// <p>One or more filter values. Allowed filter values vary by resource filter name, and are case-sensitive.</p>
279    #[serde(rename = "Values")]
280    pub values: Vec<String>,
281}
282
283/// <p>The ARN of a resource, and its resource type.</p>
284#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
285#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
286pub struct ResourceIdentifier {
287    /// <p>The ARN of a resource.</p>
288    #[serde(rename = "ResourceArn")]
289    #[serde(skip_serializing_if = "Option::is_none")]
290    pub resource_arn: Option<String>,
291    /// <p>The resource type of a resource, such as <code>AWS::EC2::Instance</code>.</p>
292    #[serde(rename = "ResourceType")]
293    #[serde(skip_serializing_if = "Option::is_none")]
294    pub resource_type: Option<String>,
295}
296
297/// <p>The query that is used to define a resource group or a search for resources.</p>
298#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
299pub struct ResourceQuery {
300    /// <p>The query that defines a group or a search.</p>
301    #[serde(rename = "Query")]
302    pub query: String,
303    /// <p>The type of the query. The valid values in this release are <code>TAG_FILTERS_1_0</code> and <code>CLOUDFORMATION_STACK_1_0</code>.</p> <p> <i> <code>TAG_FILTERS_1_0:</code> </i> A JSON syntax that lets you specify a collection of simple tag filters for resource types and tags, as supported by the AWS Tagging API <a href="https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html">GetResources</a> operation. If you specify more than one tag key, only resources that match all tag keys, and at least one value of each specified tag key, are returned in your query. If you specify more than one value for a tag key, a resource matches the filter if it has a tag key value that matches <i>any</i> of the specified values.</p> <p>For example, consider the following sample query for resources that have two tags, <code>Stage</code> and <code>Version</code>, with two values each. (<code>[{"Key":"Stage","Values":["Test","Deploy"]},{"Key":"Version","Values":["1","2"]}]</code>) The results of this query might include the following.</p> <ul> <li> <p>An EC2 instance that has the following two tags: <code>{"Key":"Stage","Value":"Deploy"}</code>, and <code>{"Key":"Version","Value":"2"}</code> </p> </li> <li> <p>An S3 bucket that has the following two tags: {"Key":"Stage","Value":"Test"}, and {"Key":"Version","Value":"1"}</p> </li> </ul> <p>The query would not return the following results, however. The following EC2 instance does not have all tag keys specified in the filter, so it is rejected. The RDS database has all of the tag keys, but no values that match at least one of the specified tag key values in the filter.</p> <ul> <li> <p>An EC2 instance that has only the following tag: <code>{"Key":"Stage","Value":"Deploy"}</code>.</p> </li> <li> <p>An RDS database that has the following two tags: <code>{"Key":"Stage","Value":"Archived"}</code>, and <code>{"Key":"Version","Value":"4"}</code> </p> </li> </ul> <p> <i> <code>CLOUDFORMATION_STACK_1_0:</code> </i> A JSON syntax that lets you specify a CloudFormation stack ARN.</p>
304    #[serde(rename = "Type")]
305    pub type_: String,
306}
307
308#[derive(Clone, Debug, Default, PartialEq, Serialize)]
309#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
310pub struct SearchResourcesInput {
311    /// <p>The maximum number of group member ARNs returned by <code>SearchResources</code> in paginated output. By default, this number is 50.</p>
312    #[serde(rename = "MaxResults")]
313    #[serde(skip_serializing_if = "Option::is_none")]
314    pub max_results: Option<i64>,
315    /// <p>The NextToken value that is returned in a paginated <code>SearchResources</code> request. To get the next page of results, run the call again, add the NextToken parameter, and specify the NextToken value.</p>
316    #[serde(rename = "NextToken")]
317    #[serde(skip_serializing_if = "Option::is_none")]
318    pub next_token: Option<String>,
319    /// <p>The search query, using the same formats that are supported for resource group definition.</p>
320    #[serde(rename = "ResourceQuery")]
321    pub resource_query: ResourceQuery,
322}
323
324#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
325#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
326pub struct SearchResourcesOutput {
327    /// <p>The NextToken value to include in a subsequent <code>SearchResources</code> request, to get more results.</p>
328    #[serde(rename = "NextToken")]
329    #[serde(skip_serializing_if = "Option::is_none")]
330    pub next_token: Option<String>,
331    /// <p>A list of <code>QueryError</code> objects. Each error is an object that contains <code>ErrorCode</code> and <code>Message</code> structures. Possible values for <code>ErrorCode</code> are <code>CLOUDFORMATION_STACK_INACTIVE</code> and <code>CLOUDFORMATION_STACK_NOT_EXISTING</code>.</p>
332    #[serde(rename = "QueryErrors")]
333    #[serde(skip_serializing_if = "Option::is_none")]
334    pub query_errors: Option<Vec<QueryError>>,
335    /// <p>The ARNs and resource types of resources that are members of the group that you specified.</p>
336    #[serde(rename = "ResourceIdentifiers")]
337    #[serde(skip_serializing_if = "Option::is_none")]
338    pub resource_identifiers: Option<Vec<ResourceIdentifier>>,
339}
340
341#[derive(Clone, Debug, Default, PartialEq, Serialize)]
342#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
343pub struct TagInput {
344    /// <p>The ARN of the resource to which to add tags.</p>
345    #[serde(rename = "Arn")]
346    pub arn: String,
347    /// <p>The tags to add to the specified resource. A tag is a string-to-string map of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
348    #[serde(rename = "Tags")]
349    pub tags: ::std::collections::HashMap<String, String>,
350}
351
352#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
353#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
354pub struct TagOutput {
355    /// <p>The ARN of the tagged resource.</p>
356    #[serde(rename = "Arn")]
357    #[serde(skip_serializing_if = "Option::is_none")]
358    pub arn: Option<String>,
359    /// <p>The tags that have been added to the specified resource.</p>
360    #[serde(rename = "Tags")]
361    #[serde(skip_serializing_if = "Option::is_none")]
362    pub tags: Option<::std::collections::HashMap<String, String>>,
363}
364
365#[derive(Clone, Debug, Default, PartialEq, Serialize)]
366#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
367pub struct UntagInput {
368    /// <p>The ARN of the resource from which to remove tags.</p>
369    #[serde(rename = "Arn")]
370    pub arn: String,
371    /// <p>The keys of the tags to be removed.</p>
372    #[serde(rename = "Keys")]
373    pub keys: Vec<String>,
374}
375
376#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
377#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
378pub struct UntagOutput {
379    /// <p>The ARN of the resource from which tags have been removed.</p>
380    #[serde(rename = "Arn")]
381    #[serde(skip_serializing_if = "Option::is_none")]
382    pub arn: Option<String>,
383    /// <p>The keys of tags that have been removed.</p>
384    #[serde(rename = "Keys")]
385    #[serde(skip_serializing_if = "Option::is_none")]
386    pub keys: Option<Vec<String>>,
387}
388
389#[derive(Clone, Debug, Default, PartialEq, Serialize)]
390#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
391pub struct UpdateGroupInput {
392    /// <p>The description of the resource group. Descriptions can have a maximum of 511 characters, including letters, numbers, hyphens, underscores, punctuation, and spaces.</p>
393    #[serde(rename = "Description")]
394    #[serde(skip_serializing_if = "Option::is_none")]
395    pub description: Option<String>,
396    /// <p>The name of the resource group for which you want to update its description.</p>
397    #[serde(rename = "GroupName")]
398    pub group_name: String,
399}
400
401#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
402#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
403pub struct UpdateGroupOutput {
404    /// <p>The full description of the resource group after it has been updated.</p>
405    #[serde(rename = "Group")]
406    #[serde(skip_serializing_if = "Option::is_none")]
407    pub group: Option<Group>,
408}
409
410#[derive(Clone, Debug, Default, PartialEq, Serialize)]
411#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
412pub struct UpdateGroupQueryInput {
413    /// <p>The name of the resource group for which you want to edit the query.</p>
414    #[serde(rename = "GroupName")]
415    pub group_name: String,
416    /// <p>The resource query that determines which AWS resources are members of the resource group.</p>
417    #[serde(rename = "ResourceQuery")]
418    pub resource_query: ResourceQuery,
419}
420
421#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
422#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
423pub struct UpdateGroupQueryOutput {
424    /// <p>The resource query associated with the resource group after the update.</p>
425    #[serde(rename = "GroupQuery")]
426    #[serde(skip_serializing_if = "Option::is_none")]
427    pub group_query: Option<GroupQuery>,
428}
429
430/// Errors returned by CreateGroup
431#[derive(Debug, PartialEq)]
432pub enum CreateGroupError {
433    /// <p>The request does not comply with validation rules that are defined for the request parameters.</p>
434    BadRequest(String),
435    /// <p>The caller is not authorized to make the request.</p>
436    Forbidden(String),
437    /// <p>An internal error occurred while processing the request.</p>
438    InternalServerError(String),
439    /// <p>The request uses an HTTP method which is not allowed for the specified resource.</p>
440    MethodNotAllowed(String),
441    /// <p>The caller has exceeded throttling limits.</p>
442    TooManyRequests(String),
443}
444
445impl CreateGroupError {
446    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateGroupError> {
447        if let Some(err) = proto::json::Error::parse_rest(&res) {
448            match err.typ.as_str() {
449                "BadRequestException" => {
450                    return RusotoError::Service(CreateGroupError::BadRequest(err.msg))
451                }
452                "ForbiddenException" => {
453                    return RusotoError::Service(CreateGroupError::Forbidden(err.msg))
454                }
455                "InternalServerErrorException" => {
456                    return RusotoError::Service(CreateGroupError::InternalServerError(err.msg))
457                }
458                "MethodNotAllowedException" => {
459                    return RusotoError::Service(CreateGroupError::MethodNotAllowed(err.msg))
460                }
461                "TooManyRequestsException" => {
462                    return RusotoError::Service(CreateGroupError::TooManyRequests(err.msg))
463                }
464                "ValidationException" => return RusotoError::Validation(err.msg),
465                _ => {}
466            }
467        }
468        RusotoError::Unknown(res)
469    }
470}
471impl fmt::Display for CreateGroupError {
472    #[allow(unused_variables)]
473    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
474        match *self {
475            CreateGroupError::BadRequest(ref cause) => write!(f, "{}", cause),
476            CreateGroupError::Forbidden(ref cause) => write!(f, "{}", cause),
477            CreateGroupError::InternalServerError(ref cause) => write!(f, "{}", cause),
478            CreateGroupError::MethodNotAllowed(ref cause) => write!(f, "{}", cause),
479            CreateGroupError::TooManyRequests(ref cause) => write!(f, "{}", cause),
480        }
481    }
482}
483impl Error for CreateGroupError {}
484/// Errors returned by DeleteGroup
485#[derive(Debug, PartialEq)]
486pub enum DeleteGroupError {
487    /// <p>The request does not comply with validation rules that are defined for the request parameters.</p>
488    BadRequest(String),
489    /// <p>The caller is not authorized to make the request.</p>
490    Forbidden(String),
491    /// <p>An internal error occurred while processing the request.</p>
492    InternalServerError(String),
493    /// <p>The request uses an HTTP method which is not allowed for the specified resource.</p>
494    MethodNotAllowed(String),
495    /// <p>One or more resources specified in the request do not exist.</p>
496    NotFound(String),
497    /// <p>The caller has exceeded throttling limits.</p>
498    TooManyRequests(String),
499}
500
501impl DeleteGroupError {
502    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteGroupError> {
503        if let Some(err) = proto::json::Error::parse_rest(&res) {
504            match err.typ.as_str() {
505                "BadRequestException" => {
506                    return RusotoError::Service(DeleteGroupError::BadRequest(err.msg))
507                }
508                "ForbiddenException" => {
509                    return RusotoError::Service(DeleteGroupError::Forbidden(err.msg))
510                }
511                "InternalServerErrorException" => {
512                    return RusotoError::Service(DeleteGroupError::InternalServerError(err.msg))
513                }
514                "MethodNotAllowedException" => {
515                    return RusotoError::Service(DeleteGroupError::MethodNotAllowed(err.msg))
516                }
517                "NotFoundException" => {
518                    return RusotoError::Service(DeleteGroupError::NotFound(err.msg))
519                }
520                "TooManyRequestsException" => {
521                    return RusotoError::Service(DeleteGroupError::TooManyRequests(err.msg))
522                }
523                "ValidationException" => return RusotoError::Validation(err.msg),
524                _ => {}
525            }
526        }
527        RusotoError::Unknown(res)
528    }
529}
530impl fmt::Display for DeleteGroupError {
531    #[allow(unused_variables)]
532    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
533        match *self {
534            DeleteGroupError::BadRequest(ref cause) => write!(f, "{}", cause),
535            DeleteGroupError::Forbidden(ref cause) => write!(f, "{}", cause),
536            DeleteGroupError::InternalServerError(ref cause) => write!(f, "{}", cause),
537            DeleteGroupError::MethodNotAllowed(ref cause) => write!(f, "{}", cause),
538            DeleteGroupError::NotFound(ref cause) => write!(f, "{}", cause),
539            DeleteGroupError::TooManyRequests(ref cause) => write!(f, "{}", cause),
540        }
541    }
542}
543impl Error for DeleteGroupError {}
544/// Errors returned by GetGroup
545#[derive(Debug, PartialEq)]
546pub enum GetGroupError {
547    /// <p>The request does not comply with validation rules that are defined for the request parameters.</p>
548    BadRequest(String),
549    /// <p>The caller is not authorized to make the request.</p>
550    Forbidden(String),
551    /// <p>An internal error occurred while processing the request.</p>
552    InternalServerError(String),
553    /// <p>The request uses an HTTP method which is not allowed for the specified resource.</p>
554    MethodNotAllowed(String),
555    /// <p>One or more resources specified in the request do not exist.</p>
556    NotFound(String),
557    /// <p>The caller has exceeded throttling limits.</p>
558    TooManyRequests(String),
559}
560
561impl GetGroupError {
562    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetGroupError> {
563        if let Some(err) = proto::json::Error::parse_rest(&res) {
564            match err.typ.as_str() {
565                "BadRequestException" => {
566                    return RusotoError::Service(GetGroupError::BadRequest(err.msg))
567                }
568                "ForbiddenException" => {
569                    return RusotoError::Service(GetGroupError::Forbidden(err.msg))
570                }
571                "InternalServerErrorException" => {
572                    return RusotoError::Service(GetGroupError::InternalServerError(err.msg))
573                }
574                "MethodNotAllowedException" => {
575                    return RusotoError::Service(GetGroupError::MethodNotAllowed(err.msg))
576                }
577                "NotFoundException" => {
578                    return RusotoError::Service(GetGroupError::NotFound(err.msg))
579                }
580                "TooManyRequestsException" => {
581                    return RusotoError::Service(GetGroupError::TooManyRequests(err.msg))
582                }
583                "ValidationException" => return RusotoError::Validation(err.msg),
584                _ => {}
585            }
586        }
587        RusotoError::Unknown(res)
588    }
589}
590impl fmt::Display for GetGroupError {
591    #[allow(unused_variables)]
592    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
593        match *self {
594            GetGroupError::BadRequest(ref cause) => write!(f, "{}", cause),
595            GetGroupError::Forbidden(ref cause) => write!(f, "{}", cause),
596            GetGroupError::InternalServerError(ref cause) => write!(f, "{}", cause),
597            GetGroupError::MethodNotAllowed(ref cause) => write!(f, "{}", cause),
598            GetGroupError::NotFound(ref cause) => write!(f, "{}", cause),
599            GetGroupError::TooManyRequests(ref cause) => write!(f, "{}", cause),
600        }
601    }
602}
603impl Error for GetGroupError {}
604/// Errors returned by GetGroupQuery
605#[derive(Debug, PartialEq)]
606pub enum GetGroupQueryError {
607    /// <p>The request does not comply with validation rules that are defined for the request parameters.</p>
608    BadRequest(String),
609    /// <p>The caller is not authorized to make the request.</p>
610    Forbidden(String),
611    /// <p>An internal error occurred while processing the request.</p>
612    InternalServerError(String),
613    /// <p>The request uses an HTTP method which is not allowed for the specified resource.</p>
614    MethodNotAllowed(String),
615    /// <p>One or more resources specified in the request do not exist.</p>
616    NotFound(String),
617    /// <p>The caller has exceeded throttling limits.</p>
618    TooManyRequests(String),
619}
620
621impl GetGroupQueryError {
622    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetGroupQueryError> {
623        if let Some(err) = proto::json::Error::parse_rest(&res) {
624            match err.typ.as_str() {
625                "BadRequestException" => {
626                    return RusotoError::Service(GetGroupQueryError::BadRequest(err.msg))
627                }
628                "ForbiddenException" => {
629                    return RusotoError::Service(GetGroupQueryError::Forbidden(err.msg))
630                }
631                "InternalServerErrorException" => {
632                    return RusotoError::Service(GetGroupQueryError::InternalServerError(err.msg))
633                }
634                "MethodNotAllowedException" => {
635                    return RusotoError::Service(GetGroupQueryError::MethodNotAllowed(err.msg))
636                }
637                "NotFoundException" => {
638                    return RusotoError::Service(GetGroupQueryError::NotFound(err.msg))
639                }
640                "TooManyRequestsException" => {
641                    return RusotoError::Service(GetGroupQueryError::TooManyRequests(err.msg))
642                }
643                "ValidationException" => return RusotoError::Validation(err.msg),
644                _ => {}
645            }
646        }
647        RusotoError::Unknown(res)
648    }
649}
650impl fmt::Display for GetGroupQueryError {
651    #[allow(unused_variables)]
652    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
653        match *self {
654            GetGroupQueryError::BadRequest(ref cause) => write!(f, "{}", cause),
655            GetGroupQueryError::Forbidden(ref cause) => write!(f, "{}", cause),
656            GetGroupQueryError::InternalServerError(ref cause) => write!(f, "{}", cause),
657            GetGroupQueryError::MethodNotAllowed(ref cause) => write!(f, "{}", cause),
658            GetGroupQueryError::NotFound(ref cause) => write!(f, "{}", cause),
659            GetGroupQueryError::TooManyRequests(ref cause) => write!(f, "{}", cause),
660        }
661    }
662}
663impl Error for GetGroupQueryError {}
664/// Errors returned by GetTags
665#[derive(Debug, PartialEq)]
666pub enum GetTagsError {
667    /// <p>The request does not comply with validation rules that are defined for the request parameters.</p>
668    BadRequest(String),
669    /// <p>The caller is not authorized to make the request.</p>
670    Forbidden(String),
671    /// <p>An internal error occurred while processing the request.</p>
672    InternalServerError(String),
673    /// <p>The request uses an HTTP method which is not allowed for the specified resource.</p>
674    MethodNotAllowed(String),
675    /// <p>One or more resources specified in the request do not exist.</p>
676    NotFound(String),
677    /// <p>The caller has exceeded throttling limits.</p>
678    TooManyRequests(String),
679}
680
681impl GetTagsError {
682    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetTagsError> {
683        if let Some(err) = proto::json::Error::parse_rest(&res) {
684            match err.typ.as_str() {
685                "BadRequestException" => {
686                    return RusotoError::Service(GetTagsError::BadRequest(err.msg))
687                }
688                "ForbiddenException" => {
689                    return RusotoError::Service(GetTagsError::Forbidden(err.msg))
690                }
691                "InternalServerErrorException" => {
692                    return RusotoError::Service(GetTagsError::InternalServerError(err.msg))
693                }
694                "MethodNotAllowedException" => {
695                    return RusotoError::Service(GetTagsError::MethodNotAllowed(err.msg))
696                }
697                "NotFoundException" => {
698                    return RusotoError::Service(GetTagsError::NotFound(err.msg))
699                }
700                "TooManyRequestsException" => {
701                    return RusotoError::Service(GetTagsError::TooManyRequests(err.msg))
702                }
703                "ValidationException" => return RusotoError::Validation(err.msg),
704                _ => {}
705            }
706        }
707        RusotoError::Unknown(res)
708    }
709}
710impl fmt::Display for GetTagsError {
711    #[allow(unused_variables)]
712    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
713        match *self {
714            GetTagsError::BadRequest(ref cause) => write!(f, "{}", cause),
715            GetTagsError::Forbidden(ref cause) => write!(f, "{}", cause),
716            GetTagsError::InternalServerError(ref cause) => write!(f, "{}", cause),
717            GetTagsError::MethodNotAllowed(ref cause) => write!(f, "{}", cause),
718            GetTagsError::NotFound(ref cause) => write!(f, "{}", cause),
719            GetTagsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
720        }
721    }
722}
723impl Error for GetTagsError {}
724/// Errors returned by ListGroupResources
725#[derive(Debug, PartialEq)]
726pub enum ListGroupResourcesError {
727    /// <p>The request does not comply with validation rules that are defined for the request parameters.</p>
728    BadRequest(String),
729    /// <p>The caller is not authorized to make the request.</p>
730    Forbidden(String),
731    /// <p>An internal error occurred while processing the request.</p>
732    InternalServerError(String),
733    /// <p>The request uses an HTTP method which is not allowed for the specified resource.</p>
734    MethodNotAllowed(String),
735    /// <p>One or more resources specified in the request do not exist.</p>
736    NotFound(String),
737    /// <p>The caller has exceeded throttling limits.</p>
738    TooManyRequests(String),
739    /// <p>The request has not been applied because it lacks valid authentication credentials for the target resource.</p>
740    Unauthorized(String),
741}
742
743impl ListGroupResourcesError {
744    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListGroupResourcesError> {
745        if let Some(err) = proto::json::Error::parse_rest(&res) {
746            match err.typ.as_str() {
747                "BadRequestException" => {
748                    return RusotoError::Service(ListGroupResourcesError::BadRequest(err.msg))
749                }
750                "ForbiddenException" => {
751                    return RusotoError::Service(ListGroupResourcesError::Forbidden(err.msg))
752                }
753                "InternalServerErrorException" => {
754                    return RusotoError::Service(ListGroupResourcesError::InternalServerError(
755                        err.msg,
756                    ))
757                }
758                "MethodNotAllowedException" => {
759                    return RusotoError::Service(ListGroupResourcesError::MethodNotAllowed(err.msg))
760                }
761                "NotFoundException" => {
762                    return RusotoError::Service(ListGroupResourcesError::NotFound(err.msg))
763                }
764                "TooManyRequestsException" => {
765                    return RusotoError::Service(ListGroupResourcesError::TooManyRequests(err.msg))
766                }
767                "UnauthorizedException" => {
768                    return RusotoError::Service(ListGroupResourcesError::Unauthorized(err.msg))
769                }
770                "ValidationException" => return RusotoError::Validation(err.msg),
771                _ => {}
772            }
773        }
774        RusotoError::Unknown(res)
775    }
776}
777impl fmt::Display for ListGroupResourcesError {
778    #[allow(unused_variables)]
779    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
780        match *self {
781            ListGroupResourcesError::BadRequest(ref cause) => write!(f, "{}", cause),
782            ListGroupResourcesError::Forbidden(ref cause) => write!(f, "{}", cause),
783            ListGroupResourcesError::InternalServerError(ref cause) => write!(f, "{}", cause),
784            ListGroupResourcesError::MethodNotAllowed(ref cause) => write!(f, "{}", cause),
785            ListGroupResourcesError::NotFound(ref cause) => write!(f, "{}", cause),
786            ListGroupResourcesError::TooManyRequests(ref cause) => write!(f, "{}", cause),
787            ListGroupResourcesError::Unauthorized(ref cause) => write!(f, "{}", cause),
788        }
789    }
790}
791impl Error for ListGroupResourcesError {}
792/// Errors returned by ListGroups
793#[derive(Debug, PartialEq)]
794pub enum ListGroupsError {
795    /// <p>The request does not comply with validation rules that are defined for the request parameters.</p>
796    BadRequest(String),
797    /// <p>The caller is not authorized to make the request.</p>
798    Forbidden(String),
799    /// <p>An internal error occurred while processing the request.</p>
800    InternalServerError(String),
801    /// <p>The request uses an HTTP method which is not allowed for the specified resource.</p>
802    MethodNotAllowed(String),
803    /// <p>The caller has exceeded throttling limits.</p>
804    TooManyRequests(String),
805}
806
807impl ListGroupsError {
808    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListGroupsError> {
809        if let Some(err) = proto::json::Error::parse_rest(&res) {
810            match err.typ.as_str() {
811                "BadRequestException" => {
812                    return RusotoError::Service(ListGroupsError::BadRequest(err.msg))
813                }
814                "ForbiddenException" => {
815                    return RusotoError::Service(ListGroupsError::Forbidden(err.msg))
816                }
817                "InternalServerErrorException" => {
818                    return RusotoError::Service(ListGroupsError::InternalServerError(err.msg))
819                }
820                "MethodNotAllowedException" => {
821                    return RusotoError::Service(ListGroupsError::MethodNotAllowed(err.msg))
822                }
823                "TooManyRequestsException" => {
824                    return RusotoError::Service(ListGroupsError::TooManyRequests(err.msg))
825                }
826                "ValidationException" => return RusotoError::Validation(err.msg),
827                _ => {}
828            }
829        }
830        RusotoError::Unknown(res)
831    }
832}
833impl fmt::Display for ListGroupsError {
834    #[allow(unused_variables)]
835    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
836        match *self {
837            ListGroupsError::BadRequest(ref cause) => write!(f, "{}", cause),
838            ListGroupsError::Forbidden(ref cause) => write!(f, "{}", cause),
839            ListGroupsError::InternalServerError(ref cause) => write!(f, "{}", cause),
840            ListGroupsError::MethodNotAllowed(ref cause) => write!(f, "{}", cause),
841            ListGroupsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
842        }
843    }
844}
845impl Error for ListGroupsError {}
846/// Errors returned by SearchResources
847#[derive(Debug, PartialEq)]
848pub enum SearchResourcesError {
849    /// <p>The request does not comply with validation rules that are defined for the request parameters.</p>
850    BadRequest(String),
851    /// <p>The caller is not authorized to make the request.</p>
852    Forbidden(String),
853    /// <p>An internal error occurred while processing the request.</p>
854    InternalServerError(String),
855    /// <p>The request uses an HTTP method which is not allowed for the specified resource.</p>
856    MethodNotAllowed(String),
857    /// <p>The caller has exceeded throttling limits.</p>
858    TooManyRequests(String),
859    /// <p>The request has not been applied because it lacks valid authentication credentials for the target resource.</p>
860    Unauthorized(String),
861}
862
863impl SearchResourcesError {
864    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SearchResourcesError> {
865        if let Some(err) = proto::json::Error::parse_rest(&res) {
866            match err.typ.as_str() {
867                "BadRequestException" => {
868                    return RusotoError::Service(SearchResourcesError::BadRequest(err.msg))
869                }
870                "ForbiddenException" => {
871                    return RusotoError::Service(SearchResourcesError::Forbidden(err.msg))
872                }
873                "InternalServerErrorException" => {
874                    return RusotoError::Service(SearchResourcesError::InternalServerError(err.msg))
875                }
876                "MethodNotAllowedException" => {
877                    return RusotoError::Service(SearchResourcesError::MethodNotAllowed(err.msg))
878                }
879                "TooManyRequestsException" => {
880                    return RusotoError::Service(SearchResourcesError::TooManyRequests(err.msg))
881                }
882                "UnauthorizedException" => {
883                    return RusotoError::Service(SearchResourcesError::Unauthorized(err.msg))
884                }
885                "ValidationException" => return RusotoError::Validation(err.msg),
886                _ => {}
887            }
888        }
889        RusotoError::Unknown(res)
890    }
891}
892impl fmt::Display for SearchResourcesError {
893    #[allow(unused_variables)]
894    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
895        match *self {
896            SearchResourcesError::BadRequest(ref cause) => write!(f, "{}", cause),
897            SearchResourcesError::Forbidden(ref cause) => write!(f, "{}", cause),
898            SearchResourcesError::InternalServerError(ref cause) => write!(f, "{}", cause),
899            SearchResourcesError::MethodNotAllowed(ref cause) => write!(f, "{}", cause),
900            SearchResourcesError::TooManyRequests(ref cause) => write!(f, "{}", cause),
901            SearchResourcesError::Unauthorized(ref cause) => write!(f, "{}", cause),
902        }
903    }
904}
905impl Error for SearchResourcesError {}
906/// Errors returned by Tag
907#[derive(Debug, PartialEq)]
908pub enum TagError {
909    /// <p>The request does not comply with validation rules that are defined for the request parameters.</p>
910    BadRequest(String),
911    /// <p>The caller is not authorized to make the request.</p>
912    Forbidden(String),
913    /// <p>An internal error occurred while processing the request.</p>
914    InternalServerError(String),
915    /// <p>The request uses an HTTP method which is not allowed for the specified resource.</p>
916    MethodNotAllowed(String),
917    /// <p>One or more resources specified in the request do not exist.</p>
918    NotFound(String),
919    /// <p>The caller has exceeded throttling limits.</p>
920    TooManyRequests(String),
921}
922
923impl TagError {
924    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagError> {
925        if let Some(err) = proto::json::Error::parse_rest(&res) {
926            match err.typ.as_str() {
927                "BadRequestException" => {
928                    return RusotoError::Service(TagError::BadRequest(err.msg))
929                }
930                "ForbiddenException" => return RusotoError::Service(TagError::Forbidden(err.msg)),
931                "InternalServerErrorException" => {
932                    return RusotoError::Service(TagError::InternalServerError(err.msg))
933                }
934                "MethodNotAllowedException" => {
935                    return RusotoError::Service(TagError::MethodNotAllowed(err.msg))
936                }
937                "NotFoundException" => return RusotoError::Service(TagError::NotFound(err.msg)),
938                "TooManyRequestsException" => {
939                    return RusotoError::Service(TagError::TooManyRequests(err.msg))
940                }
941                "ValidationException" => return RusotoError::Validation(err.msg),
942                _ => {}
943            }
944        }
945        RusotoError::Unknown(res)
946    }
947}
948impl fmt::Display for TagError {
949    #[allow(unused_variables)]
950    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
951        match *self {
952            TagError::BadRequest(ref cause) => write!(f, "{}", cause),
953            TagError::Forbidden(ref cause) => write!(f, "{}", cause),
954            TagError::InternalServerError(ref cause) => write!(f, "{}", cause),
955            TagError::MethodNotAllowed(ref cause) => write!(f, "{}", cause),
956            TagError::NotFound(ref cause) => write!(f, "{}", cause),
957            TagError::TooManyRequests(ref cause) => write!(f, "{}", cause),
958        }
959    }
960}
961impl Error for TagError {}
962/// Errors returned by Untag
963#[derive(Debug, PartialEq)]
964pub enum UntagError {
965    /// <p>The request does not comply with validation rules that are defined for the request parameters.</p>
966    BadRequest(String),
967    /// <p>The caller is not authorized to make the request.</p>
968    Forbidden(String),
969    /// <p>An internal error occurred while processing the request.</p>
970    InternalServerError(String),
971    /// <p>The request uses an HTTP method which is not allowed for the specified resource.</p>
972    MethodNotAllowed(String),
973    /// <p>One or more resources specified in the request do not exist.</p>
974    NotFound(String),
975    /// <p>The caller has exceeded throttling limits.</p>
976    TooManyRequests(String),
977}
978
979impl UntagError {
980    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagError> {
981        if let Some(err) = proto::json::Error::parse_rest(&res) {
982            match err.typ.as_str() {
983                "BadRequestException" => {
984                    return RusotoError::Service(UntagError::BadRequest(err.msg))
985                }
986                "ForbiddenException" => {
987                    return RusotoError::Service(UntagError::Forbidden(err.msg))
988                }
989                "InternalServerErrorException" => {
990                    return RusotoError::Service(UntagError::InternalServerError(err.msg))
991                }
992                "MethodNotAllowedException" => {
993                    return RusotoError::Service(UntagError::MethodNotAllowed(err.msg))
994                }
995                "NotFoundException" => return RusotoError::Service(UntagError::NotFound(err.msg)),
996                "TooManyRequestsException" => {
997                    return RusotoError::Service(UntagError::TooManyRequests(err.msg))
998                }
999                "ValidationException" => return RusotoError::Validation(err.msg),
1000                _ => {}
1001            }
1002        }
1003        RusotoError::Unknown(res)
1004    }
1005}
1006impl fmt::Display for UntagError {
1007    #[allow(unused_variables)]
1008    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1009        match *self {
1010            UntagError::BadRequest(ref cause) => write!(f, "{}", cause),
1011            UntagError::Forbidden(ref cause) => write!(f, "{}", cause),
1012            UntagError::InternalServerError(ref cause) => write!(f, "{}", cause),
1013            UntagError::MethodNotAllowed(ref cause) => write!(f, "{}", cause),
1014            UntagError::NotFound(ref cause) => write!(f, "{}", cause),
1015            UntagError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1016        }
1017    }
1018}
1019impl Error for UntagError {}
1020/// Errors returned by UpdateGroup
1021#[derive(Debug, PartialEq)]
1022pub enum UpdateGroupError {
1023    /// <p>The request does not comply with validation rules that are defined for the request parameters.</p>
1024    BadRequest(String),
1025    /// <p>The caller is not authorized to make the request.</p>
1026    Forbidden(String),
1027    /// <p>An internal error occurred while processing the request.</p>
1028    InternalServerError(String),
1029    /// <p>The request uses an HTTP method which is not allowed for the specified resource.</p>
1030    MethodNotAllowed(String),
1031    /// <p>One or more resources specified in the request do not exist.</p>
1032    NotFound(String),
1033    /// <p>The caller has exceeded throttling limits.</p>
1034    TooManyRequests(String),
1035}
1036
1037impl UpdateGroupError {
1038    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateGroupError> {
1039        if let Some(err) = proto::json::Error::parse_rest(&res) {
1040            match err.typ.as_str() {
1041                "BadRequestException" => {
1042                    return RusotoError::Service(UpdateGroupError::BadRequest(err.msg))
1043                }
1044                "ForbiddenException" => {
1045                    return RusotoError::Service(UpdateGroupError::Forbidden(err.msg))
1046                }
1047                "InternalServerErrorException" => {
1048                    return RusotoError::Service(UpdateGroupError::InternalServerError(err.msg))
1049                }
1050                "MethodNotAllowedException" => {
1051                    return RusotoError::Service(UpdateGroupError::MethodNotAllowed(err.msg))
1052                }
1053                "NotFoundException" => {
1054                    return RusotoError::Service(UpdateGroupError::NotFound(err.msg))
1055                }
1056                "TooManyRequestsException" => {
1057                    return RusotoError::Service(UpdateGroupError::TooManyRequests(err.msg))
1058                }
1059                "ValidationException" => return RusotoError::Validation(err.msg),
1060                _ => {}
1061            }
1062        }
1063        RusotoError::Unknown(res)
1064    }
1065}
1066impl fmt::Display for UpdateGroupError {
1067    #[allow(unused_variables)]
1068    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1069        match *self {
1070            UpdateGroupError::BadRequest(ref cause) => write!(f, "{}", cause),
1071            UpdateGroupError::Forbidden(ref cause) => write!(f, "{}", cause),
1072            UpdateGroupError::InternalServerError(ref cause) => write!(f, "{}", cause),
1073            UpdateGroupError::MethodNotAllowed(ref cause) => write!(f, "{}", cause),
1074            UpdateGroupError::NotFound(ref cause) => write!(f, "{}", cause),
1075            UpdateGroupError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1076        }
1077    }
1078}
1079impl Error for UpdateGroupError {}
1080/// Errors returned by UpdateGroupQuery
1081#[derive(Debug, PartialEq)]
1082pub enum UpdateGroupQueryError {
1083    /// <p>The request does not comply with validation rules that are defined for the request parameters.</p>
1084    BadRequest(String),
1085    /// <p>The caller is not authorized to make the request.</p>
1086    Forbidden(String),
1087    /// <p>An internal error occurred while processing the request.</p>
1088    InternalServerError(String),
1089    /// <p>The request uses an HTTP method which is not allowed for the specified resource.</p>
1090    MethodNotAllowed(String),
1091    /// <p>One or more resources specified in the request do not exist.</p>
1092    NotFound(String),
1093    /// <p>The caller has exceeded throttling limits.</p>
1094    TooManyRequests(String),
1095}
1096
1097impl UpdateGroupQueryError {
1098    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateGroupQueryError> {
1099        if let Some(err) = proto::json::Error::parse_rest(&res) {
1100            match err.typ.as_str() {
1101                "BadRequestException" => {
1102                    return RusotoError::Service(UpdateGroupQueryError::BadRequest(err.msg))
1103                }
1104                "ForbiddenException" => {
1105                    return RusotoError::Service(UpdateGroupQueryError::Forbidden(err.msg))
1106                }
1107                "InternalServerErrorException" => {
1108                    return RusotoError::Service(UpdateGroupQueryError::InternalServerError(
1109                        err.msg,
1110                    ))
1111                }
1112                "MethodNotAllowedException" => {
1113                    return RusotoError::Service(UpdateGroupQueryError::MethodNotAllowed(err.msg))
1114                }
1115                "NotFoundException" => {
1116                    return RusotoError::Service(UpdateGroupQueryError::NotFound(err.msg))
1117                }
1118                "TooManyRequestsException" => {
1119                    return RusotoError::Service(UpdateGroupQueryError::TooManyRequests(err.msg))
1120                }
1121                "ValidationException" => return RusotoError::Validation(err.msg),
1122                _ => {}
1123            }
1124        }
1125        RusotoError::Unknown(res)
1126    }
1127}
1128impl fmt::Display for UpdateGroupQueryError {
1129    #[allow(unused_variables)]
1130    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1131        match *self {
1132            UpdateGroupQueryError::BadRequest(ref cause) => write!(f, "{}", cause),
1133            UpdateGroupQueryError::Forbidden(ref cause) => write!(f, "{}", cause),
1134            UpdateGroupQueryError::InternalServerError(ref cause) => write!(f, "{}", cause),
1135            UpdateGroupQueryError::MethodNotAllowed(ref cause) => write!(f, "{}", cause),
1136            UpdateGroupQueryError::NotFound(ref cause) => write!(f, "{}", cause),
1137            UpdateGroupQueryError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1138        }
1139    }
1140}
1141impl Error for UpdateGroupQueryError {}
1142/// Trait representing the capabilities of the Resource Groups API. Resource Groups clients implement this trait.
1143#[async_trait]
1144pub trait ResourceGroups {
1145    /// <p>Creates a group with a specified name, description, and resource query.</p>
1146    async fn create_group(
1147        &self,
1148        input: CreateGroupInput,
1149    ) -> Result<CreateGroupOutput, RusotoError<CreateGroupError>>;
1150
1151    /// <p>Deletes a specified resource group. Deleting a resource group does not delete resources that are members of the group; it only deletes the group structure.</p>
1152    async fn delete_group(
1153        &self,
1154        input: DeleteGroupInput,
1155    ) -> Result<DeleteGroupOutput, RusotoError<DeleteGroupError>>;
1156
1157    /// <p>Returns information about a specified resource group.</p>
1158    async fn get_group(
1159        &self,
1160        input: GetGroupInput,
1161    ) -> Result<GetGroupOutput, RusotoError<GetGroupError>>;
1162
1163    /// <p>Returns the resource query associated with the specified resource group.</p>
1164    async fn get_group_query(
1165        &self,
1166        input: GetGroupQueryInput,
1167    ) -> Result<GetGroupQueryOutput, RusotoError<GetGroupQueryError>>;
1168
1169    /// <p>Returns a list of tags that are associated with a resource group, specified by an ARN.</p>
1170    async fn get_tags(
1171        &self,
1172        input: GetTagsInput,
1173    ) -> Result<GetTagsOutput, RusotoError<GetTagsError>>;
1174
1175    /// <p>Returns a list of ARNs of resources that are members of a specified resource group.</p>
1176    async fn list_group_resources(
1177        &self,
1178        input: ListGroupResourcesInput,
1179    ) -> Result<ListGroupResourcesOutput, RusotoError<ListGroupResourcesError>>;
1180
1181    /// <p>Returns a list of existing resource groups in your account.</p>
1182    async fn list_groups(
1183        &self,
1184        input: ListGroupsInput,
1185    ) -> Result<ListGroupsOutput, RusotoError<ListGroupsError>>;
1186
1187    /// <p>Returns a list of AWS resource identifiers that matches a specified query. The query uses the same format as a resource query in a CreateGroup or UpdateGroupQuery operation.</p>
1188    async fn search_resources(
1189        &self,
1190        input: SearchResourcesInput,
1191    ) -> Result<SearchResourcesOutput, RusotoError<SearchResourcesError>>;
1192
1193    /// <p>Adds tags to a resource group with the specified ARN. Existing tags on a resource group are not changed if they are not specified in the request parameters.</p>
1194    async fn tag(&self, input: TagInput) -> Result<TagOutput, RusotoError<TagError>>;
1195
1196    /// <p>Deletes specified tags from a specified resource.</p>
1197    async fn untag(&self, input: UntagInput) -> Result<UntagOutput, RusotoError<UntagError>>;
1198
1199    /// <p>Updates an existing group with a new or changed description. You cannot update the name of a resource group.</p>
1200    async fn update_group(
1201        &self,
1202        input: UpdateGroupInput,
1203    ) -> Result<UpdateGroupOutput, RusotoError<UpdateGroupError>>;
1204
1205    /// <p>Updates the resource query of a group.</p>
1206    async fn update_group_query(
1207        &self,
1208        input: UpdateGroupQueryInput,
1209    ) -> Result<UpdateGroupQueryOutput, RusotoError<UpdateGroupQueryError>>;
1210}
1211/// A client for the Resource Groups API.
1212#[derive(Clone)]
1213pub struct ResourceGroupsClient {
1214    client: Client,
1215    region: region::Region,
1216}
1217
1218impl ResourceGroupsClient {
1219    /// Creates a client backed by the default tokio event loop.
1220    ///
1221    /// The client will use the default credentials provider and tls client.
1222    pub fn new(region: region::Region) -> ResourceGroupsClient {
1223        ResourceGroupsClient {
1224            client: Client::shared(),
1225            region,
1226        }
1227    }
1228
1229    pub fn new_with<P, D>(
1230        request_dispatcher: D,
1231        credentials_provider: P,
1232        region: region::Region,
1233    ) -> ResourceGroupsClient
1234    where
1235        P: ProvideAwsCredentials + Send + Sync + 'static,
1236        D: DispatchSignedRequest + Send + Sync + 'static,
1237    {
1238        ResourceGroupsClient {
1239            client: Client::new_with(credentials_provider, request_dispatcher),
1240            region,
1241        }
1242    }
1243
1244    pub fn new_with_client(client: Client, region: region::Region) -> ResourceGroupsClient {
1245        ResourceGroupsClient { client, region }
1246    }
1247}
1248
1249#[async_trait]
1250impl ResourceGroups for ResourceGroupsClient {
1251    /// <p>Creates a group with a specified name, description, and resource query.</p>
1252    #[allow(unused_mut)]
1253    async fn create_group(
1254        &self,
1255        input: CreateGroupInput,
1256    ) -> Result<CreateGroupOutput, RusotoError<CreateGroupError>> {
1257        let request_uri = "/groups";
1258
1259        let mut request = SignedRequest::new("POST", "resource-groups", &self.region, &request_uri);
1260        request.set_content_type("application/x-amz-json-1.1".to_owned());
1261
1262        let encoded = Some(serde_json::to_vec(&input).unwrap());
1263        request.set_payload(encoded);
1264
1265        let mut response = self
1266            .client
1267            .sign_and_dispatch(request)
1268            .await
1269            .map_err(RusotoError::from)?;
1270        if response.status.is_success() {
1271            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1272            let result = proto::json::ResponsePayload::new(&response)
1273                .deserialize::<CreateGroupOutput, _>()?;
1274
1275            Ok(result)
1276        } else {
1277            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1278            Err(CreateGroupError::from_response(response))
1279        }
1280    }
1281
1282    /// <p>Deletes a specified resource group. Deleting a resource group does not delete resources that are members of the group; it only deletes the group structure.</p>
1283    #[allow(unused_mut)]
1284    async fn delete_group(
1285        &self,
1286        input: DeleteGroupInput,
1287    ) -> Result<DeleteGroupOutput, RusotoError<DeleteGroupError>> {
1288        let request_uri = format!("/groups/{group_name}", group_name = input.group_name);
1289
1290        let mut request =
1291            SignedRequest::new("DELETE", "resource-groups", &self.region, &request_uri);
1292        request.set_content_type("application/x-amz-json-1.1".to_owned());
1293
1294        let mut response = self
1295            .client
1296            .sign_and_dispatch(request)
1297            .await
1298            .map_err(RusotoError::from)?;
1299        if response.status.is_success() {
1300            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1301            let result = proto::json::ResponsePayload::new(&response)
1302                .deserialize::<DeleteGroupOutput, _>()?;
1303
1304            Ok(result)
1305        } else {
1306            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1307            Err(DeleteGroupError::from_response(response))
1308        }
1309    }
1310
1311    /// <p>Returns information about a specified resource group.</p>
1312    #[allow(unused_mut)]
1313    async fn get_group(
1314        &self,
1315        input: GetGroupInput,
1316    ) -> Result<GetGroupOutput, RusotoError<GetGroupError>> {
1317        let request_uri = format!("/groups/{group_name}", group_name = input.group_name);
1318
1319        let mut request = SignedRequest::new("GET", "resource-groups", &self.region, &request_uri);
1320        request.set_content_type("application/x-amz-json-1.1".to_owned());
1321
1322        let mut response = self
1323            .client
1324            .sign_and_dispatch(request)
1325            .await
1326            .map_err(RusotoError::from)?;
1327        if response.status.is_success() {
1328            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1329            let result =
1330                proto::json::ResponsePayload::new(&response).deserialize::<GetGroupOutput, _>()?;
1331
1332            Ok(result)
1333        } else {
1334            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1335            Err(GetGroupError::from_response(response))
1336        }
1337    }
1338
1339    /// <p>Returns the resource query associated with the specified resource group.</p>
1340    #[allow(unused_mut)]
1341    async fn get_group_query(
1342        &self,
1343        input: GetGroupQueryInput,
1344    ) -> Result<GetGroupQueryOutput, RusotoError<GetGroupQueryError>> {
1345        let request_uri = format!("/groups/{group_name}/query", group_name = input.group_name);
1346
1347        let mut request = SignedRequest::new("GET", "resource-groups", &self.region, &request_uri);
1348        request.set_content_type("application/x-amz-json-1.1".to_owned());
1349
1350        let mut response = self
1351            .client
1352            .sign_and_dispatch(request)
1353            .await
1354            .map_err(RusotoError::from)?;
1355        if response.status.is_success() {
1356            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1357            let result = proto::json::ResponsePayload::new(&response)
1358                .deserialize::<GetGroupQueryOutput, _>()?;
1359
1360            Ok(result)
1361        } else {
1362            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1363            Err(GetGroupQueryError::from_response(response))
1364        }
1365    }
1366
1367    /// <p>Returns a list of tags that are associated with a resource group, specified by an ARN.</p>
1368    #[allow(unused_mut)]
1369    async fn get_tags(
1370        &self,
1371        input: GetTagsInput,
1372    ) -> Result<GetTagsOutput, RusotoError<GetTagsError>> {
1373        let request_uri = format!("/resources/{arn}/tags", arn = input.arn);
1374
1375        let mut request = SignedRequest::new("GET", "resource-groups", &self.region, &request_uri);
1376        request.set_content_type("application/x-amz-json-1.1".to_owned());
1377
1378        let mut response = self
1379            .client
1380            .sign_and_dispatch(request)
1381            .await
1382            .map_err(RusotoError::from)?;
1383        if response.status.is_success() {
1384            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1385            let result =
1386                proto::json::ResponsePayload::new(&response).deserialize::<GetTagsOutput, _>()?;
1387
1388            Ok(result)
1389        } else {
1390            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1391            Err(GetTagsError::from_response(response))
1392        }
1393    }
1394
1395    /// <p>Returns a list of ARNs of resources that are members of a specified resource group.</p>
1396    #[allow(unused_mut)]
1397    async fn list_group_resources(
1398        &self,
1399        input: ListGroupResourcesInput,
1400    ) -> Result<ListGroupResourcesOutput, RusotoError<ListGroupResourcesError>> {
1401        let request_uri = format!(
1402            "/groups/{group_name}/resource-identifiers-list",
1403            group_name = input.group_name
1404        );
1405
1406        let mut request = SignedRequest::new("POST", "resource-groups", &self.region, &request_uri);
1407        request.set_content_type("application/x-amz-json-1.1".to_owned());
1408
1409        let encoded = Some(serde_json::to_vec(&input).unwrap());
1410        request.set_payload(encoded);
1411
1412        let mut params = Params::new();
1413        if let Some(ref x) = input.max_results {
1414            params.put("maxResults", x);
1415        }
1416        if let Some(ref x) = input.next_token {
1417            params.put("nextToken", x);
1418        }
1419        request.set_params(params);
1420
1421        let mut response = self
1422            .client
1423            .sign_and_dispatch(request)
1424            .await
1425            .map_err(RusotoError::from)?;
1426        if response.status.is_success() {
1427            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1428            let result = proto::json::ResponsePayload::new(&response)
1429                .deserialize::<ListGroupResourcesOutput, _>()?;
1430
1431            Ok(result)
1432        } else {
1433            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1434            Err(ListGroupResourcesError::from_response(response))
1435        }
1436    }
1437
1438    /// <p>Returns a list of existing resource groups in your account.</p>
1439    #[allow(unused_mut)]
1440    async fn list_groups(
1441        &self,
1442        input: ListGroupsInput,
1443    ) -> Result<ListGroupsOutput, RusotoError<ListGroupsError>> {
1444        let request_uri = "/groups-list";
1445
1446        let mut request = SignedRequest::new("POST", "resource-groups", &self.region, &request_uri);
1447        request.set_content_type("application/x-amz-json-1.1".to_owned());
1448
1449        let encoded = Some(serde_json::to_vec(&input).unwrap());
1450        request.set_payload(encoded);
1451
1452        let mut params = Params::new();
1453        if let Some(ref x) = input.max_results {
1454            params.put("maxResults", x);
1455        }
1456        if let Some(ref x) = input.next_token {
1457            params.put("nextToken", x);
1458        }
1459        request.set_params(params);
1460
1461        let mut response = self
1462            .client
1463            .sign_and_dispatch(request)
1464            .await
1465            .map_err(RusotoError::from)?;
1466        if response.status.is_success() {
1467            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1468            let result = proto::json::ResponsePayload::new(&response)
1469                .deserialize::<ListGroupsOutput, _>()?;
1470
1471            Ok(result)
1472        } else {
1473            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1474            Err(ListGroupsError::from_response(response))
1475        }
1476    }
1477
1478    /// <p>Returns a list of AWS resource identifiers that matches a specified query. The query uses the same format as a resource query in a CreateGroup or UpdateGroupQuery operation.</p>
1479    #[allow(unused_mut)]
1480    async fn search_resources(
1481        &self,
1482        input: SearchResourcesInput,
1483    ) -> Result<SearchResourcesOutput, RusotoError<SearchResourcesError>> {
1484        let request_uri = "/resources/search";
1485
1486        let mut request = SignedRequest::new("POST", "resource-groups", &self.region, &request_uri);
1487        request.set_content_type("application/x-amz-json-1.1".to_owned());
1488
1489        let encoded = Some(serde_json::to_vec(&input).unwrap());
1490        request.set_payload(encoded);
1491
1492        let mut response = self
1493            .client
1494            .sign_and_dispatch(request)
1495            .await
1496            .map_err(RusotoError::from)?;
1497        if response.status.is_success() {
1498            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1499            let result = proto::json::ResponsePayload::new(&response)
1500                .deserialize::<SearchResourcesOutput, _>()?;
1501
1502            Ok(result)
1503        } else {
1504            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1505            Err(SearchResourcesError::from_response(response))
1506        }
1507    }
1508
1509    /// <p>Adds tags to a resource group with the specified ARN. Existing tags on a resource group are not changed if they are not specified in the request parameters.</p>
1510    #[allow(unused_mut)]
1511    async fn tag(&self, input: TagInput) -> Result<TagOutput, RusotoError<TagError>> {
1512        let request_uri = format!("/resources/{arn}/tags", arn = input.arn);
1513
1514        let mut request = SignedRequest::new("PUT", "resource-groups", &self.region, &request_uri);
1515        request.set_content_type("application/x-amz-json-1.1".to_owned());
1516
1517        let encoded = Some(serde_json::to_vec(&input).unwrap());
1518        request.set_payload(encoded);
1519
1520        let mut response = self
1521            .client
1522            .sign_and_dispatch(request)
1523            .await
1524            .map_err(RusotoError::from)?;
1525        if response.status.is_success() {
1526            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1527            let result =
1528                proto::json::ResponsePayload::new(&response).deserialize::<TagOutput, _>()?;
1529
1530            Ok(result)
1531        } else {
1532            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1533            Err(TagError::from_response(response))
1534        }
1535    }
1536
1537    /// <p>Deletes specified tags from a specified resource.</p>
1538    #[allow(unused_mut)]
1539    async fn untag(&self, input: UntagInput) -> Result<UntagOutput, RusotoError<UntagError>> {
1540        let request_uri = format!("/resources/{arn}/tags", arn = input.arn);
1541
1542        let mut request =
1543            SignedRequest::new("PATCH", "resource-groups", &self.region, &request_uri);
1544        request.set_content_type("application/x-amz-json-1.1".to_owned());
1545
1546        let encoded = Some(serde_json::to_vec(&input).unwrap());
1547        request.set_payload(encoded);
1548
1549        let mut response = self
1550            .client
1551            .sign_and_dispatch(request)
1552            .await
1553            .map_err(RusotoError::from)?;
1554        if response.status.is_success() {
1555            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1556            let result =
1557                proto::json::ResponsePayload::new(&response).deserialize::<UntagOutput, _>()?;
1558
1559            Ok(result)
1560        } else {
1561            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1562            Err(UntagError::from_response(response))
1563        }
1564    }
1565
1566    /// <p>Updates an existing group with a new or changed description. You cannot update the name of a resource group.</p>
1567    #[allow(unused_mut)]
1568    async fn update_group(
1569        &self,
1570        input: UpdateGroupInput,
1571    ) -> Result<UpdateGroupOutput, RusotoError<UpdateGroupError>> {
1572        let request_uri = format!("/groups/{group_name}", group_name = input.group_name);
1573
1574        let mut request = SignedRequest::new("PUT", "resource-groups", &self.region, &request_uri);
1575        request.set_content_type("application/x-amz-json-1.1".to_owned());
1576
1577        let encoded = Some(serde_json::to_vec(&input).unwrap());
1578        request.set_payload(encoded);
1579
1580        let mut response = self
1581            .client
1582            .sign_and_dispatch(request)
1583            .await
1584            .map_err(RusotoError::from)?;
1585        if response.status.is_success() {
1586            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1587            let result = proto::json::ResponsePayload::new(&response)
1588                .deserialize::<UpdateGroupOutput, _>()?;
1589
1590            Ok(result)
1591        } else {
1592            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1593            Err(UpdateGroupError::from_response(response))
1594        }
1595    }
1596
1597    /// <p>Updates the resource query of a group.</p>
1598    #[allow(unused_mut)]
1599    async fn update_group_query(
1600        &self,
1601        input: UpdateGroupQueryInput,
1602    ) -> Result<UpdateGroupQueryOutput, RusotoError<UpdateGroupQueryError>> {
1603        let request_uri = format!("/groups/{group_name}/query", group_name = input.group_name);
1604
1605        let mut request = SignedRequest::new("PUT", "resource-groups", &self.region, &request_uri);
1606        request.set_content_type("application/x-amz-json-1.1".to_owned());
1607
1608        let encoded = Some(serde_json::to_vec(&input).unwrap());
1609        request.set_payload(encoded);
1610
1611        let mut response = self
1612            .client
1613            .sign_and_dispatch(request)
1614            .await
1615            .map_err(RusotoError::from)?;
1616        if response.status.is_success() {
1617            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1618            let result = proto::json::ResponsePayload::new(&response)
1619                .deserialize::<UpdateGroupQueryOutput, _>()?;
1620
1621            Ok(result)
1622        } else {
1623            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1624            Err(UpdateGroupQueryError::from_response(response))
1625        }
1626    }
1627}