Skip to main content

rusoto_resourcegroupstaggingapi/
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 ResourceGroupsTaggingApiClient {
29    fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
30        let mut request = SignedRequest::new(http_method, "tagging", &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/// <p>Information that shows whether a resource is compliant with the effective tag policy, including details on any noncompliant tag keys.</p>
54#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
55#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
56pub struct ComplianceDetails {
57    /// <p>Whether a resource is compliant with the effective tag policy.</p>
58    #[serde(rename = "ComplianceStatus")]
59    #[serde(skip_serializing_if = "Option::is_none")]
60    pub compliance_status: Option<bool>,
61    /// <p>These are keys defined in the effective policy that are on the resource with either incorrect case treatment or noncompliant values. </p>
62    #[serde(rename = "KeysWithNoncompliantValues")]
63    #[serde(skip_serializing_if = "Option::is_none")]
64    pub keys_with_noncompliant_values: Option<Vec<String>>,
65    /// <p>These tag keys on the resource are noncompliant with the effective tag policy.</p>
66    #[serde(rename = "NoncompliantKeys")]
67    #[serde(skip_serializing_if = "Option::is_none")]
68    pub noncompliant_keys: Option<Vec<String>>,
69}
70
71#[derive(Clone, Debug, Default, PartialEq, Serialize)]
72#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
73pub struct DescribeReportCreationInput {}
74
75#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
76#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
77pub struct DescribeReportCreationOutput {
78    /// <p>Details of the common errors that all operations return.</p>
79    #[serde(rename = "ErrorMessage")]
80    #[serde(skip_serializing_if = "Option::is_none")]
81    pub error_message: Option<String>,
82    /// <p>The path to the Amazon S3 bucket where the report was stored on creation.</p>
83    #[serde(rename = "S3Location")]
84    #[serde(skip_serializing_if = "Option::is_none")]
85    pub s3_location: Option<String>,
86    /// <p><p>Reports the status of the operation.</p> <p>The operation status can be one of the following:</p> <ul> <li> <p> <code>RUNNING</code> - Report creation is in progress.</p> </li> <li> <p> <code>SUCCEEDED</code> - Report creation is complete. You can open the report from the Amazon S3 bucket that you specified when you ran <code>StartReportCreation</code>.</p> </li> <li> <p> <code>FAILED</code> - Report creation timed out or the Amazon S3 bucket is not accessible. </p> </li> <li> <p> <code>NO REPORT</code> - No report was generated in the last 90 days.</p> </li> </ul></p>
87    #[serde(rename = "Status")]
88    #[serde(skip_serializing_if = "Option::is_none")]
89    pub status: Option<String>,
90}
91
92/// <p>Information about the errors that are returned for each failed resource. This information can include <code>InternalServiceException</code> and <code>InvalidParameterException</code> errors. It can also include any valid error code returned by the AWS service that hosts the resource that the ARN key represents.</p> <p>The following are common error codes that you might receive from other AWS services:</p> <ul> <li> <p> <b>InternalServiceException</b> – This can mean that the Resource Groups Tagging API didn't receive a response from another AWS service. It can also mean the the resource type in the request is not supported by the Resource Groups Tagging API. In these cases, it's safe to retry the request and then call <a href="http://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html">GetResources</a> to verify the changes.</p> </li> <li> <p> <b>AccessDeniedException</b> – This can mean that you need permission to calling tagging operations in the AWS service that contains the resource. For example, to use the Resource Groups Tagging API to tag a CloudWatch alarm resource, you need permission to call <a href="http://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_TagResources.html"> <code>TagResources</code> </a> <i>and</i> <a href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html"> <code>TagResource</code> </a> in the CloudWatch API. </p> </li> </ul> <p>For more information on errors that are generated from other AWS services, see the documentation for that service. </p>
93#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
94#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
95pub struct FailureInfo {
96    /// <p>The code of the common error. Valid values include <code>InternalServiceException</code>, <code>InvalidParameterException</code>, and any valid error code returned by the AWS service that hosts the resource that you want to tag.</p>
97    #[serde(rename = "ErrorCode")]
98    #[serde(skip_serializing_if = "Option::is_none")]
99    pub error_code: Option<String>,
100    /// <p>The message of the common error.</p>
101    #[serde(rename = "ErrorMessage")]
102    #[serde(skip_serializing_if = "Option::is_none")]
103    pub error_message: Option<String>,
104    /// <p>The HTTP status code of the common error.</p>
105    #[serde(rename = "StatusCode")]
106    #[serde(skip_serializing_if = "Option::is_none")]
107    pub status_code: Option<i64>,
108}
109
110#[derive(Clone, Debug, Default, PartialEq, Serialize)]
111#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
112pub struct GetComplianceSummaryInput {
113    /// <p>Specifies a list of attributes to group the counts of noncompliant resources by. If supplied, the counts are sorted by those attributes.</p>
114    #[serde(rename = "GroupBy")]
115    #[serde(skip_serializing_if = "Option::is_none")]
116    pub group_by: Option<Vec<String>>,
117    /// <p>Specifies the maximum number of results to be returned in each page. A query can return fewer than this maximum, even if there are more results still to return. You should always check the <code>PaginationToken</code> response value to see if there are more results. You can specify a minimum of 1 and a maximum value of 100.</p>
118    #[serde(rename = "MaxResults")]
119    #[serde(skip_serializing_if = "Option::is_none")]
120    pub max_results: Option<i64>,
121    /// <p>Specifies a <code>PaginationToken</code> response value from a previous request to indicate that you want the next page of results. Leave this parameter empty in your initial request.</p>
122    #[serde(rename = "PaginationToken")]
123    #[serde(skip_serializing_if = "Option::is_none")]
124    pub pagination_token: Option<String>,
125    /// <p>Specifies a list of AWS Regions to limit the output by. If you use this parameter, the count of returned noncompliant resources includes only resources in the specified Regions.</p>
126    #[serde(rename = "RegionFilters")]
127    #[serde(skip_serializing_if = "Option::is_none")]
128    pub region_filters: Option<Vec<String>>,
129    /// <p>Specifies that you want the response to include information for only resources of the specified types. The format of each resource type is <code>service[:resourceType]</code>. For example, specifying a resource type of <code>ec2</code> returns all Amazon EC2 resources (which includes EC2 instances). Specifying a resource type of <code>ec2:instance</code> returns only EC2 instances. </p> <p>The string for each service name and resource type is the same as that embedded in a resource's Amazon Resource Name (ARN). Consult the <i>AWS General Reference</i> for the following:</p> <ul> <li> <p>For a list of service name strings, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces">AWS Service Namespaces</a>.</p> </li> <li> <p>For resource type strings, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arns-syntax">Example ARNs</a>.</p> </li> <li> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a>.</p> </li> </ul> <p>You can specify multiple resource types by using a comma separated array. The array can include up to 100 items. Note that the length constraint requirement applies to each resource type filter. </p>
130    #[serde(rename = "ResourceTypeFilters")]
131    #[serde(skip_serializing_if = "Option::is_none")]
132    pub resource_type_filters: Option<Vec<String>>,
133    /// <p>Specifies that you want the response to include information for only resources that have tags with the specified tag keys. If you use this parameter, the count of returned noncompliant resources includes only resources that have the specified tag keys.</p>
134    #[serde(rename = "TagKeyFilters")]
135    #[serde(skip_serializing_if = "Option::is_none")]
136    pub tag_key_filters: Option<Vec<String>>,
137    /// <p>Specifies target identifiers (usually, specific account IDs) to limit the output by. If you use this parameter, the count of returned noncompliant resources includes only resources with the specified target IDs.</p>
138    #[serde(rename = "TargetIdFilters")]
139    #[serde(skip_serializing_if = "Option::is_none")]
140    pub target_id_filters: Option<Vec<String>>,
141}
142
143#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
144#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
145pub struct GetComplianceSummaryOutput {
146    /// <p>A string that indicates that there is more data available than this response contains. To receive the next part of the response, specify this response value as the <code>PaginationToken</code> value in the request for the next page.</p>
147    #[serde(rename = "PaginationToken")]
148    #[serde(skip_serializing_if = "Option::is_none")]
149    pub pagination_token: Option<String>,
150    /// <p>A table that shows counts of noncompliant resources.</p>
151    #[serde(rename = "SummaryList")]
152    #[serde(skip_serializing_if = "Option::is_none")]
153    pub summary_list: Option<Vec<Summary>>,
154}
155
156#[derive(Clone, Debug, Default, PartialEq, Serialize)]
157#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
158pub struct GetResourcesInput {
159    /// <p>Specifies whether to exclude resources that are compliant with the tag policy. Set this to <code>true</code> if you are interested in retrieving information on noncompliant resources only.</p> <p>You can use this parameter only if the <code>IncludeComplianceDetails</code> parameter is also set to <code>true</code>.</p>
160    #[serde(rename = "ExcludeCompliantResources")]
161    #[serde(skip_serializing_if = "Option::is_none")]
162    pub exclude_compliant_resources: Option<bool>,
163    /// <p>Specifies whether to include details regarding the compliance with the effective tag policy. Set this to <code>true</code> to determine whether resources are compliant with the tag policy and to get details.</p>
164    #[serde(rename = "IncludeComplianceDetails")]
165    #[serde(skip_serializing_if = "Option::is_none")]
166    pub include_compliance_details: Option<bool>,
167    /// <p>Specifies a <code>PaginationToken</code> response value from a previous request to indicate that you want the next page of results. Leave this parameter empty in your initial request.</p>
168    #[serde(rename = "PaginationToken")]
169    #[serde(skip_serializing_if = "Option::is_none")]
170    pub pagination_token: Option<String>,
171    /// <p>Specifies a list of ARNs of resources for which you want to retrieve tag data. You can't specify both this parameter and any of the pagination parameters (<code>ResourcesPerPage</code>, <code>TagsPerPage</code>, <code>PaginationToken</code>) in the same request. If you specify both, you get an <code>Invalid Parameter</code> exception.</p> <p>If a resource specified by this parameter doesn't exist, it doesn't generate an error; it simply isn't included in the response.</p> <p>An ARN (Amazon Resource Name) uniquely identifies a resource. For more information, see <a href="http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</p>
172    #[serde(rename = "ResourceARNList")]
173    #[serde(skip_serializing_if = "Option::is_none")]
174    pub resource_arn_list: Option<Vec<String>>,
175    /// <p>Specifies the resource types that you want included in the response. The format of each resource type is <code>service[:resourceType]</code>. For example, specifying a resource type of <code>ec2</code> returns all Amazon EC2 resources (which includes EC2 instances). Specifying a resource type of <code>ec2:instance</code> returns only EC2 instances. </p> <p>The string for each service name and resource type is the same as that embedded in a resource's Amazon Resource Name (ARN). Consult the <i>AWS General Reference</i> for the following:</p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a>.</p> <p>You can specify multiple resource types by using an array. The array can include up to 100 items. Note that the length constraint requirement applies to each resource type filter. </p>
176    #[serde(rename = "ResourceTypeFilters")]
177    #[serde(skip_serializing_if = "Option::is_none")]
178    pub resource_type_filters: Option<Vec<String>>,
179    /// <p>Specifies the maximum number of results to be returned in each page. A query can return fewer than this maximum, even if there are more results still to return. You should always check the <code>PaginationToken</code> response value to see if there are more results. You can specify a minimum of 1 and a maximum value of 100.</p>
180    #[serde(rename = "ResourcesPerPage")]
181    #[serde(skip_serializing_if = "Option::is_none")]
182    pub resources_per_page: Option<i64>,
183    /// <p><p>Specifies a list of TagFilters (keys and values) to restrict the output to only those resources that have the specified tag and, if included, the specified value. Each <code>TagFilter</code> must contain a key with values optional. A request can include up to 50 keys, and each key can include up to 20 values. </p> <p>Note the following when deciding how to use TagFilters:</p> <ul> <li> <p>If you <i>don&#39;t</i> specify a <code>TagFilter</code>, the response includes all resources that are currently tagged or ever had a tag. Resources that currently don&#39;t have tags are shown with an empty tag set, like this: <code>&quot;Tags&quot;: []</code>.</p> </li> <li> <p>If you specify more than one filter in a single request, the response returns only those resources that satisfy all filters.</p> </li> <li> <p>If you specify a filter that contains more than one value for a key, the response returns resources that match any of the specified values for that key.</p> </li> <li> <p>If you don&#39;t specify any values for a key, the response returns resources that are tagged with that key and any or no value.</p> <p>For example, for the following filters: <code>filter1= {keyA,{value1}}</code>, <code>filter2={keyB,{value2,value3,value4}}</code>, <code>filter3= {keyC}</code>:</p> <ul> <li> <p> <code>GetResources({filter1})</code> returns resources tagged with <code>key1=value1</code> </p> </li> <li> <p> <code>GetResources({filter2})</code> returns resources tagged with <code>key2=value2</code> or <code>key2=value3</code> or <code>key2=value4</code> </p> </li> <li> <p> <code>GetResources({filter3})</code> returns resources tagged with any tag with the key <code>key3</code>, and with any or no value</p> </li> <li> <p> <code>GetResources({filter1,filter2,filter3})</code> returns resources tagged with <code>(key1=value1) and (key2=value2 or key2=value3 or key2=value4) and (key3, any or no value)</code> </p> </li> </ul> </li> </ul></p>
184    #[serde(rename = "TagFilters")]
185    #[serde(skip_serializing_if = "Option::is_none")]
186    pub tag_filters: Option<Vec<TagFilter>>,
187    /// <p>AWS recommends using <code>ResourcesPerPage</code> instead of this parameter.</p> <p>A limit that restricts the number of tags (key and value pairs) returned by <code>GetResources</code> in paginated output. A resource with no tags is counted as having one tag (one key and value pair).</p> <p> <code>GetResources</code> does not split a resource and its associated tags across pages. If the specified <code>TagsPerPage</code> would cause such a break, a <code>PaginationToken</code> is returned in place of the affected resource and its tags. Use that token in another request to get the remaining data. For example, if you specify a <code>TagsPerPage</code> of <code>100</code> and the account has 22 resources with 10 tags each (meaning that each resource has 10 key and value pairs), the output will consist of three pages. The first page displays the first 10 resources, each with its 10 tags. The second page displays the next 10 resources, each with its 10 tags. The third page displays the remaining 2 resources, each with its 10 tags.</p> <p>You can set <code>TagsPerPage</code> to a minimum of 100 items up to a maximum of 500 items.</p>
188    #[serde(rename = "TagsPerPage")]
189    #[serde(skip_serializing_if = "Option::is_none")]
190    pub tags_per_page: Option<i64>,
191}
192
193#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
194#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
195pub struct GetResourcesOutput {
196    /// <p>A string that indicates that there is more data available than this response contains. To receive the next part of the response, specify this response value as the <code>PaginationToken</code> value in the request for the next page.</p>
197    #[serde(rename = "PaginationToken")]
198    #[serde(skip_serializing_if = "Option::is_none")]
199    pub pagination_token: Option<String>,
200    /// <p>A list of resource ARNs and the tags (keys and values) associated with those ARNs.</p>
201    #[serde(rename = "ResourceTagMappingList")]
202    #[serde(skip_serializing_if = "Option::is_none")]
203    pub resource_tag_mapping_list: Option<Vec<ResourceTagMapping>>,
204}
205
206#[derive(Clone, Debug, Default, PartialEq, Serialize)]
207#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
208pub struct GetTagKeysInput {
209    /// <p>Specifies a <code>PaginationToken</code> response value from a previous request to indicate that you want the next page of results. Leave this parameter empty in your initial request.</p>
210    #[serde(rename = "PaginationToken")]
211    #[serde(skip_serializing_if = "Option::is_none")]
212    pub pagination_token: Option<String>,
213}
214
215#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
216#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
217pub struct GetTagKeysOutput {
218    /// <p>A string that indicates that there is more data available than this response contains. To receive the next part of the response, specify this response value as the <code>PaginationToken</code> value in the request for the next page.</p>
219    #[serde(rename = "PaginationToken")]
220    #[serde(skip_serializing_if = "Option::is_none")]
221    pub pagination_token: Option<String>,
222    /// <p>A list of all tag keys in the AWS account.</p>
223    #[serde(rename = "TagKeys")]
224    #[serde(skip_serializing_if = "Option::is_none")]
225    pub tag_keys: Option<Vec<String>>,
226}
227
228#[derive(Clone, Debug, Default, PartialEq, Serialize)]
229#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
230pub struct GetTagValuesInput {
231    /// <p>Specifies the tag key for which you want to list all existing values that are currently used in the specified AWS Region for the calling AWS account.</p>
232    #[serde(rename = "Key")]
233    pub key: String,
234    /// <p>Specifies a <code>PaginationToken</code> response value from a previous request to indicate that you want the next page of results. Leave this parameter empty in your initial request.</p>
235    #[serde(rename = "PaginationToken")]
236    #[serde(skip_serializing_if = "Option::is_none")]
237    pub pagination_token: Option<String>,
238}
239
240#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
241#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
242pub struct GetTagValuesOutput {
243    /// <p>A string that indicates that there is more data available than this response contains. To receive the next part of the response, specify this response value as the <code>PaginationToken</code> value in the request for the next page.</p>
244    #[serde(rename = "PaginationToken")]
245    #[serde(skip_serializing_if = "Option::is_none")]
246    pub pagination_token: Option<String>,
247    /// <p>A list of all tag values for the specified key currently used in the specified AWS Region for the calling AWS account.</p>
248    #[serde(rename = "TagValues")]
249    #[serde(skip_serializing_if = "Option::is_none")]
250    pub tag_values: Option<Vec<String>>,
251}
252
253/// <p>A list of resource ARNs and the tags (keys and values) that are associated with each.</p>
254#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
255#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
256pub struct ResourceTagMapping {
257    /// <p>Information that shows whether a resource is compliant with the effective tag policy, including details on any noncompliant tag keys.</p>
258    #[serde(rename = "ComplianceDetails")]
259    #[serde(skip_serializing_if = "Option::is_none")]
260    pub compliance_details: Option<ComplianceDetails>,
261    /// <p>The ARN of the resource.</p>
262    #[serde(rename = "ResourceARN")]
263    #[serde(skip_serializing_if = "Option::is_none")]
264    pub resource_arn: Option<String>,
265    /// <p>The tags that have been applied to one or more AWS resources.</p>
266    #[serde(rename = "Tags")]
267    #[serde(skip_serializing_if = "Option::is_none")]
268    pub tags: Option<Vec<Tag>>,
269}
270
271#[derive(Clone, Debug, Default, PartialEq, Serialize)]
272#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
273pub struct StartReportCreationInput {
274    /// <p>The name of the Amazon S3 bucket where the report will be stored; for example:</p> <p> <code>awsexamplebucket</code> </p> <p>For more information on S3 bucket requirements, including an example bucket policy, see the example S3 bucket policy on this page.</p>
275    #[serde(rename = "S3Bucket")]
276    pub s3_bucket: String,
277}
278
279#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
280#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
281pub struct StartReportCreationOutput {}
282
283/// <p>A count of noncompliant resources.</p>
284#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
285#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
286pub struct Summary {
287    /// <p>The timestamp that shows when this summary was generated in this Region. </p>
288    #[serde(rename = "LastUpdated")]
289    #[serde(skip_serializing_if = "Option::is_none")]
290    pub last_updated: Option<String>,
291    /// <p>The count of noncompliant resources.</p>
292    #[serde(rename = "NonCompliantResources")]
293    #[serde(skip_serializing_if = "Option::is_none")]
294    pub non_compliant_resources: Option<i64>,
295    /// <p>The AWS Region that the summary applies to.</p>
296    #[serde(rename = "Region")]
297    #[serde(skip_serializing_if = "Option::is_none")]
298    pub region: Option<String>,
299    /// <p>The AWS resource type.</p>
300    #[serde(rename = "ResourceType")]
301    #[serde(skip_serializing_if = "Option::is_none")]
302    pub resource_type: Option<String>,
303    /// <p>The account identifier or the root identifier of the organization. If you don't know the root ID, you can call the AWS Organizations <a href="http://docs.aws.amazon.com/organizations/latest/APIReference/API_ListRoots.html">ListRoots</a> API.</p>
304    #[serde(rename = "TargetId")]
305    #[serde(skip_serializing_if = "Option::is_none")]
306    pub target_id: Option<String>,
307    /// <p>Whether the target is an account, an OU, or the organization root.</p>
308    #[serde(rename = "TargetIdType")]
309    #[serde(skip_serializing_if = "Option::is_none")]
310    pub target_id_type: Option<String>,
311}
312
313/// <p>The metadata that you apply to AWS resources to help you categorize and organize them. Each tag consists of a key and a value, both of which you define. For more information, see <a href="http://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging AWS Resources</a> in the <i>AWS General Reference</i>.</p>
314#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
315#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
316pub struct Tag {
317    /// <p>One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.</p>
318    #[serde(rename = "Key")]
319    pub key: String,
320    /// <p>One part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null.</p>
321    #[serde(rename = "Value")]
322    pub value: String,
323}
324
325/// <p>A list of tags (keys and values) that are used to specify the associated resources.</p>
326#[derive(Clone, Debug, Default, PartialEq, Serialize)]
327#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
328pub struct TagFilter {
329    /// <p>One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.</p>
330    #[serde(rename = "Key")]
331    #[serde(skip_serializing_if = "Option::is_none")]
332    pub key: Option<String>,
333    /// <p>One part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null.</p>
334    #[serde(rename = "Values")]
335    #[serde(skip_serializing_if = "Option::is_none")]
336    pub values: Option<Vec<String>>,
337}
338
339#[derive(Clone, Debug, Default, PartialEq, Serialize)]
340#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
341pub struct TagResourcesInput {
342    /// <p>Specifies the list of ARNs of the resources that you want to apply tags to.</p> <p>An ARN (Amazon Resource Name) uniquely identifies a resource. For more information, see <a href="http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</p>
343    #[serde(rename = "ResourceARNList")]
344    pub resource_arn_list: Vec<String>,
345    /// <p>Specifies a list of tags that you want to add to the specified resources. A tag consists of a key and a value that you define.</p>
346    #[serde(rename = "Tags")]
347    pub tags: ::std::collections::HashMap<String, String>,
348}
349
350#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
351#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
352pub struct TagResourcesOutput {
353    /// <p>A map containing a key-value pair for each failed item that couldn't be tagged. The key is the ARN of the failed resource. The value is a <code>FailureInfo</code> object that contains an error code, a status code, and an error message. If there are no errors, the <code>FailedResourcesMap</code> is empty.</p>
354    #[serde(rename = "FailedResourcesMap")]
355    #[serde(skip_serializing_if = "Option::is_none")]
356    pub failed_resources_map: Option<::std::collections::HashMap<String, FailureInfo>>,
357}
358
359#[derive(Clone, Debug, Default, PartialEq, Serialize)]
360#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
361pub struct UntagResourcesInput {
362    /// <p>Specifies a list of ARNs of the resources that you want to remove tags from.</p> <p>An ARN (Amazon Resource Name) uniquely identifies a resource. For more information, see <a href="http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</p>
363    #[serde(rename = "ResourceARNList")]
364    pub resource_arn_list: Vec<String>,
365    /// <p>Specifies a list of tag keys that you want to remove from the specified resources.</p>
366    #[serde(rename = "TagKeys")]
367    pub tag_keys: Vec<String>,
368}
369
370#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
371#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
372pub struct UntagResourcesOutput {
373    /// <p>A map containing a key-value pair for each failed item that couldn't be untagged. The key is the ARN of the failed resource. The value is a <code>FailureInfo</code> object that contains an error code, a status code, and an error message. If there are no errors, the <code>FailedResourcesMap</code> is empty.</p>
374    #[serde(rename = "FailedResourcesMap")]
375    #[serde(skip_serializing_if = "Option::is_none")]
376    pub failed_resources_map: Option<::std::collections::HashMap<String, FailureInfo>>,
377}
378
379/// Errors returned by DescribeReportCreation
380#[derive(Debug, PartialEq)]
381pub enum DescribeReportCreationError {
382    /// <p><p>The request was denied because performing this operation violates a constraint. </p> <p>Some of the reasons in the following list might not apply to this specific operation.</p> <ul> <li> <p>You must meet the prerequisites for using tag policies. For information, see <a href="http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html">Prerequisites and Permissions for Using Tag Policies</a> in the <i>AWS Organizations User Guide.</i> </p> </li> <li> <p>You must enable the tag policies service principal (<code>tagpolicies.tag.amazonaws.com</code>) to integrate with AWS Organizations For information, see <a href="http://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html">EnableAWSServiceAccess</a>.</p> </li> <li> <p>You must have a tag policy attached to the organization root, an OU, or an account.</p> </li> </ul></p>
383    ConstraintViolation(String),
384    /// <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p>
385    InternalService(String),
386    /// <p><p>This error indicates one of the following:</p> <ul> <li> <p>A parameter is missing.</p> </li> <li> <p>A malformed string was supplied for the request parameter.</p> </li> <li> <p>An out-of-range value was supplied for the request parameter.</p> </li> <li> <p>The target ID is invalid, unsupported, or doesn&#39;t exist.</p> </li> <li> <p>You can&#39;t access the Amazon S3 bucket for report storage. For more information, see <a href="http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report">Additional Requirements for Organization-wide Tag Compliance Reports</a> in the <i>AWS Organizations User Guide.</i> </p> </li> </ul></p>
387    InvalidParameter(String),
388    /// <p>The request was denied to limit the frequency of submitted requests.</p>
389    Throttled(String),
390}
391
392impl DescribeReportCreationError {
393    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeReportCreationError> {
394        if let Some(err) = proto::json::Error::parse(&res) {
395            match err.typ.as_str() {
396                "ConstraintViolationException" => {
397                    return RusotoError::Service(DescribeReportCreationError::ConstraintViolation(
398                        err.msg,
399                    ))
400                }
401                "InternalServiceException" => {
402                    return RusotoError::Service(DescribeReportCreationError::InternalService(
403                        err.msg,
404                    ))
405                }
406                "InvalidParameterException" => {
407                    return RusotoError::Service(DescribeReportCreationError::InvalidParameter(
408                        err.msg,
409                    ))
410                }
411                "ThrottledException" => {
412                    return RusotoError::Service(DescribeReportCreationError::Throttled(err.msg))
413                }
414                "ValidationException" => return RusotoError::Validation(err.msg),
415                _ => {}
416            }
417        }
418        RusotoError::Unknown(res)
419    }
420}
421impl fmt::Display for DescribeReportCreationError {
422    #[allow(unused_variables)]
423    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
424        match *self {
425            DescribeReportCreationError::ConstraintViolation(ref cause) => write!(f, "{}", cause),
426            DescribeReportCreationError::InternalService(ref cause) => write!(f, "{}", cause),
427            DescribeReportCreationError::InvalidParameter(ref cause) => write!(f, "{}", cause),
428            DescribeReportCreationError::Throttled(ref cause) => write!(f, "{}", cause),
429        }
430    }
431}
432impl Error for DescribeReportCreationError {}
433/// Errors returned by GetComplianceSummary
434#[derive(Debug, PartialEq)]
435pub enum GetComplianceSummaryError {
436    /// <p><p>The request was denied because performing this operation violates a constraint. </p> <p>Some of the reasons in the following list might not apply to this specific operation.</p> <ul> <li> <p>You must meet the prerequisites for using tag policies. For information, see <a href="http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html">Prerequisites and Permissions for Using Tag Policies</a> in the <i>AWS Organizations User Guide.</i> </p> </li> <li> <p>You must enable the tag policies service principal (<code>tagpolicies.tag.amazonaws.com</code>) to integrate with AWS Organizations For information, see <a href="http://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html">EnableAWSServiceAccess</a>.</p> </li> <li> <p>You must have a tag policy attached to the organization root, an OU, or an account.</p> </li> </ul></p>
437    ConstraintViolation(String),
438    /// <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p>
439    InternalService(String),
440    /// <p><p>This error indicates one of the following:</p> <ul> <li> <p>A parameter is missing.</p> </li> <li> <p>A malformed string was supplied for the request parameter.</p> </li> <li> <p>An out-of-range value was supplied for the request parameter.</p> </li> <li> <p>The target ID is invalid, unsupported, or doesn&#39;t exist.</p> </li> <li> <p>You can&#39;t access the Amazon S3 bucket for report storage. For more information, see <a href="http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report">Additional Requirements for Organization-wide Tag Compliance Reports</a> in the <i>AWS Organizations User Guide.</i> </p> </li> </ul></p>
441    InvalidParameter(String),
442    /// <p>The request was denied to limit the frequency of submitted requests.</p>
443    Throttled(String),
444}
445
446impl GetComplianceSummaryError {
447    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetComplianceSummaryError> {
448        if let Some(err) = proto::json::Error::parse(&res) {
449            match err.typ.as_str() {
450                "ConstraintViolationException" => {
451                    return RusotoError::Service(GetComplianceSummaryError::ConstraintViolation(
452                        err.msg,
453                    ))
454                }
455                "InternalServiceException" => {
456                    return RusotoError::Service(GetComplianceSummaryError::InternalService(
457                        err.msg,
458                    ))
459                }
460                "InvalidParameterException" => {
461                    return RusotoError::Service(GetComplianceSummaryError::InvalidParameter(
462                        err.msg,
463                    ))
464                }
465                "ThrottledException" => {
466                    return RusotoError::Service(GetComplianceSummaryError::Throttled(err.msg))
467                }
468                "ValidationException" => return RusotoError::Validation(err.msg),
469                _ => {}
470            }
471        }
472        RusotoError::Unknown(res)
473    }
474}
475impl fmt::Display for GetComplianceSummaryError {
476    #[allow(unused_variables)]
477    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
478        match *self {
479            GetComplianceSummaryError::ConstraintViolation(ref cause) => write!(f, "{}", cause),
480            GetComplianceSummaryError::InternalService(ref cause) => write!(f, "{}", cause),
481            GetComplianceSummaryError::InvalidParameter(ref cause) => write!(f, "{}", cause),
482            GetComplianceSummaryError::Throttled(ref cause) => write!(f, "{}", cause),
483        }
484    }
485}
486impl Error for GetComplianceSummaryError {}
487/// Errors returned by GetResources
488#[derive(Debug, PartialEq)]
489pub enum GetResourcesError {
490    /// <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p>
491    InternalService(String),
492    /// <p><p>This error indicates one of the following:</p> <ul> <li> <p>A parameter is missing.</p> </li> <li> <p>A malformed string was supplied for the request parameter.</p> </li> <li> <p>An out-of-range value was supplied for the request parameter.</p> </li> <li> <p>The target ID is invalid, unsupported, or doesn&#39;t exist.</p> </li> <li> <p>You can&#39;t access the Amazon S3 bucket for report storage. For more information, see <a href="http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report">Additional Requirements for Organization-wide Tag Compliance Reports</a> in the <i>AWS Organizations User Guide.</i> </p> </li> </ul></p>
493    InvalidParameter(String),
494    /// <p>A <code>PaginationToken</code> is valid for a maximum of 15 minutes. Your request was denied because the specified <code>PaginationToken</code> has expired.</p>
495    PaginationTokenExpired(String),
496    /// <p>The request was denied to limit the frequency of submitted requests.</p>
497    Throttled(String),
498}
499
500impl GetResourcesError {
501    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetResourcesError> {
502        if let Some(err) = proto::json::Error::parse(&res) {
503            match err.typ.as_str() {
504                "InternalServiceException" => {
505                    return RusotoError::Service(GetResourcesError::InternalService(err.msg))
506                }
507                "InvalidParameterException" => {
508                    return RusotoError::Service(GetResourcesError::InvalidParameter(err.msg))
509                }
510                "PaginationTokenExpiredException" => {
511                    return RusotoError::Service(GetResourcesError::PaginationTokenExpired(err.msg))
512                }
513                "ThrottledException" => {
514                    return RusotoError::Service(GetResourcesError::Throttled(err.msg))
515                }
516                "ValidationException" => return RusotoError::Validation(err.msg),
517                _ => {}
518            }
519        }
520        RusotoError::Unknown(res)
521    }
522}
523impl fmt::Display for GetResourcesError {
524    #[allow(unused_variables)]
525    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
526        match *self {
527            GetResourcesError::InternalService(ref cause) => write!(f, "{}", cause),
528            GetResourcesError::InvalidParameter(ref cause) => write!(f, "{}", cause),
529            GetResourcesError::PaginationTokenExpired(ref cause) => write!(f, "{}", cause),
530            GetResourcesError::Throttled(ref cause) => write!(f, "{}", cause),
531        }
532    }
533}
534impl Error for GetResourcesError {}
535/// Errors returned by GetTagKeys
536#[derive(Debug, PartialEq)]
537pub enum GetTagKeysError {
538    /// <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p>
539    InternalService(String),
540    /// <p><p>This error indicates one of the following:</p> <ul> <li> <p>A parameter is missing.</p> </li> <li> <p>A malformed string was supplied for the request parameter.</p> </li> <li> <p>An out-of-range value was supplied for the request parameter.</p> </li> <li> <p>The target ID is invalid, unsupported, or doesn&#39;t exist.</p> </li> <li> <p>You can&#39;t access the Amazon S3 bucket for report storage. For more information, see <a href="http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report">Additional Requirements for Organization-wide Tag Compliance Reports</a> in the <i>AWS Organizations User Guide.</i> </p> </li> </ul></p>
541    InvalidParameter(String),
542    /// <p>A <code>PaginationToken</code> is valid for a maximum of 15 minutes. Your request was denied because the specified <code>PaginationToken</code> has expired.</p>
543    PaginationTokenExpired(String),
544    /// <p>The request was denied to limit the frequency of submitted requests.</p>
545    Throttled(String),
546}
547
548impl GetTagKeysError {
549    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetTagKeysError> {
550        if let Some(err) = proto::json::Error::parse(&res) {
551            match err.typ.as_str() {
552                "InternalServiceException" => {
553                    return RusotoError::Service(GetTagKeysError::InternalService(err.msg))
554                }
555                "InvalidParameterException" => {
556                    return RusotoError::Service(GetTagKeysError::InvalidParameter(err.msg))
557                }
558                "PaginationTokenExpiredException" => {
559                    return RusotoError::Service(GetTagKeysError::PaginationTokenExpired(err.msg))
560                }
561                "ThrottledException" => {
562                    return RusotoError::Service(GetTagKeysError::Throttled(err.msg))
563                }
564                "ValidationException" => return RusotoError::Validation(err.msg),
565                _ => {}
566            }
567        }
568        RusotoError::Unknown(res)
569    }
570}
571impl fmt::Display for GetTagKeysError {
572    #[allow(unused_variables)]
573    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
574        match *self {
575            GetTagKeysError::InternalService(ref cause) => write!(f, "{}", cause),
576            GetTagKeysError::InvalidParameter(ref cause) => write!(f, "{}", cause),
577            GetTagKeysError::PaginationTokenExpired(ref cause) => write!(f, "{}", cause),
578            GetTagKeysError::Throttled(ref cause) => write!(f, "{}", cause),
579        }
580    }
581}
582impl Error for GetTagKeysError {}
583/// Errors returned by GetTagValues
584#[derive(Debug, PartialEq)]
585pub enum GetTagValuesError {
586    /// <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p>
587    InternalService(String),
588    /// <p><p>This error indicates one of the following:</p> <ul> <li> <p>A parameter is missing.</p> </li> <li> <p>A malformed string was supplied for the request parameter.</p> </li> <li> <p>An out-of-range value was supplied for the request parameter.</p> </li> <li> <p>The target ID is invalid, unsupported, or doesn&#39;t exist.</p> </li> <li> <p>You can&#39;t access the Amazon S3 bucket for report storage. For more information, see <a href="http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report">Additional Requirements for Organization-wide Tag Compliance Reports</a> in the <i>AWS Organizations User Guide.</i> </p> </li> </ul></p>
589    InvalidParameter(String),
590    /// <p>A <code>PaginationToken</code> is valid for a maximum of 15 minutes. Your request was denied because the specified <code>PaginationToken</code> has expired.</p>
591    PaginationTokenExpired(String),
592    /// <p>The request was denied to limit the frequency of submitted requests.</p>
593    Throttled(String),
594}
595
596impl GetTagValuesError {
597    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetTagValuesError> {
598        if let Some(err) = proto::json::Error::parse(&res) {
599            match err.typ.as_str() {
600                "InternalServiceException" => {
601                    return RusotoError::Service(GetTagValuesError::InternalService(err.msg))
602                }
603                "InvalidParameterException" => {
604                    return RusotoError::Service(GetTagValuesError::InvalidParameter(err.msg))
605                }
606                "PaginationTokenExpiredException" => {
607                    return RusotoError::Service(GetTagValuesError::PaginationTokenExpired(err.msg))
608                }
609                "ThrottledException" => {
610                    return RusotoError::Service(GetTagValuesError::Throttled(err.msg))
611                }
612                "ValidationException" => return RusotoError::Validation(err.msg),
613                _ => {}
614            }
615        }
616        RusotoError::Unknown(res)
617    }
618}
619impl fmt::Display for GetTagValuesError {
620    #[allow(unused_variables)]
621    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
622        match *self {
623            GetTagValuesError::InternalService(ref cause) => write!(f, "{}", cause),
624            GetTagValuesError::InvalidParameter(ref cause) => write!(f, "{}", cause),
625            GetTagValuesError::PaginationTokenExpired(ref cause) => write!(f, "{}", cause),
626            GetTagValuesError::Throttled(ref cause) => write!(f, "{}", cause),
627        }
628    }
629}
630impl Error for GetTagValuesError {}
631/// Errors returned by StartReportCreation
632#[derive(Debug, PartialEq)]
633pub enum StartReportCreationError {
634    /// <p>The target of the operation is currently being modified by a different request. Try again later.</p>
635    ConcurrentModification(String),
636    /// <p><p>The request was denied because performing this operation violates a constraint. </p> <p>Some of the reasons in the following list might not apply to this specific operation.</p> <ul> <li> <p>You must meet the prerequisites for using tag policies. For information, see <a href="http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html">Prerequisites and Permissions for Using Tag Policies</a> in the <i>AWS Organizations User Guide.</i> </p> </li> <li> <p>You must enable the tag policies service principal (<code>tagpolicies.tag.amazonaws.com</code>) to integrate with AWS Organizations For information, see <a href="http://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html">EnableAWSServiceAccess</a>.</p> </li> <li> <p>You must have a tag policy attached to the organization root, an OU, or an account.</p> </li> </ul></p>
637    ConstraintViolation(String),
638    /// <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p>
639    InternalService(String),
640    /// <p><p>This error indicates one of the following:</p> <ul> <li> <p>A parameter is missing.</p> </li> <li> <p>A malformed string was supplied for the request parameter.</p> </li> <li> <p>An out-of-range value was supplied for the request parameter.</p> </li> <li> <p>The target ID is invalid, unsupported, or doesn&#39;t exist.</p> </li> <li> <p>You can&#39;t access the Amazon S3 bucket for report storage. For more information, see <a href="http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report">Additional Requirements for Organization-wide Tag Compliance Reports</a> in the <i>AWS Organizations User Guide.</i> </p> </li> </ul></p>
641    InvalidParameter(String),
642    /// <p>The request was denied to limit the frequency of submitted requests.</p>
643    Throttled(String),
644}
645
646impl StartReportCreationError {
647    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartReportCreationError> {
648        if let Some(err) = proto::json::Error::parse(&res) {
649            match err.typ.as_str() {
650                "ConcurrentModificationException" => {
651                    return RusotoError::Service(StartReportCreationError::ConcurrentModification(
652                        err.msg,
653                    ))
654                }
655                "ConstraintViolationException" => {
656                    return RusotoError::Service(StartReportCreationError::ConstraintViolation(
657                        err.msg,
658                    ))
659                }
660                "InternalServiceException" => {
661                    return RusotoError::Service(StartReportCreationError::InternalService(err.msg))
662                }
663                "InvalidParameterException" => {
664                    return RusotoError::Service(StartReportCreationError::InvalidParameter(
665                        err.msg,
666                    ))
667                }
668                "ThrottledException" => {
669                    return RusotoError::Service(StartReportCreationError::Throttled(err.msg))
670                }
671                "ValidationException" => return RusotoError::Validation(err.msg),
672                _ => {}
673            }
674        }
675        RusotoError::Unknown(res)
676    }
677}
678impl fmt::Display for StartReportCreationError {
679    #[allow(unused_variables)]
680    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
681        match *self {
682            StartReportCreationError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
683            StartReportCreationError::ConstraintViolation(ref cause) => write!(f, "{}", cause),
684            StartReportCreationError::InternalService(ref cause) => write!(f, "{}", cause),
685            StartReportCreationError::InvalidParameter(ref cause) => write!(f, "{}", cause),
686            StartReportCreationError::Throttled(ref cause) => write!(f, "{}", cause),
687        }
688    }
689}
690impl Error for StartReportCreationError {}
691/// Errors returned by TagResources
692#[derive(Debug, PartialEq)]
693pub enum TagResourcesError {
694    /// <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p>
695    InternalService(String),
696    /// <p><p>This error indicates one of the following:</p> <ul> <li> <p>A parameter is missing.</p> </li> <li> <p>A malformed string was supplied for the request parameter.</p> </li> <li> <p>An out-of-range value was supplied for the request parameter.</p> </li> <li> <p>The target ID is invalid, unsupported, or doesn&#39;t exist.</p> </li> <li> <p>You can&#39;t access the Amazon S3 bucket for report storage. For more information, see <a href="http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report">Additional Requirements for Organization-wide Tag Compliance Reports</a> in the <i>AWS Organizations User Guide.</i> </p> </li> </ul></p>
697    InvalidParameter(String),
698    /// <p>The request was denied to limit the frequency of submitted requests.</p>
699    Throttled(String),
700}
701
702impl TagResourcesError {
703    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourcesError> {
704        if let Some(err) = proto::json::Error::parse(&res) {
705            match err.typ.as_str() {
706                "InternalServiceException" => {
707                    return RusotoError::Service(TagResourcesError::InternalService(err.msg))
708                }
709                "InvalidParameterException" => {
710                    return RusotoError::Service(TagResourcesError::InvalidParameter(err.msg))
711                }
712                "ThrottledException" => {
713                    return RusotoError::Service(TagResourcesError::Throttled(err.msg))
714                }
715                "ValidationException" => return RusotoError::Validation(err.msg),
716                _ => {}
717            }
718        }
719        RusotoError::Unknown(res)
720    }
721}
722impl fmt::Display for TagResourcesError {
723    #[allow(unused_variables)]
724    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
725        match *self {
726            TagResourcesError::InternalService(ref cause) => write!(f, "{}", cause),
727            TagResourcesError::InvalidParameter(ref cause) => write!(f, "{}", cause),
728            TagResourcesError::Throttled(ref cause) => write!(f, "{}", cause),
729        }
730    }
731}
732impl Error for TagResourcesError {}
733/// Errors returned by UntagResources
734#[derive(Debug, PartialEq)]
735pub enum UntagResourcesError {
736    /// <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p>
737    InternalService(String),
738    /// <p><p>This error indicates one of the following:</p> <ul> <li> <p>A parameter is missing.</p> </li> <li> <p>A malformed string was supplied for the request parameter.</p> </li> <li> <p>An out-of-range value was supplied for the request parameter.</p> </li> <li> <p>The target ID is invalid, unsupported, or doesn&#39;t exist.</p> </li> <li> <p>You can&#39;t access the Amazon S3 bucket for report storage. For more information, see <a href="http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report">Additional Requirements for Organization-wide Tag Compliance Reports</a> in the <i>AWS Organizations User Guide.</i> </p> </li> </ul></p>
739    InvalidParameter(String),
740    /// <p>The request was denied to limit the frequency of submitted requests.</p>
741    Throttled(String),
742}
743
744impl UntagResourcesError {
745    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourcesError> {
746        if let Some(err) = proto::json::Error::parse(&res) {
747            match err.typ.as_str() {
748                "InternalServiceException" => {
749                    return RusotoError::Service(UntagResourcesError::InternalService(err.msg))
750                }
751                "InvalidParameterException" => {
752                    return RusotoError::Service(UntagResourcesError::InvalidParameter(err.msg))
753                }
754                "ThrottledException" => {
755                    return RusotoError::Service(UntagResourcesError::Throttled(err.msg))
756                }
757                "ValidationException" => return RusotoError::Validation(err.msg),
758                _ => {}
759            }
760        }
761        RusotoError::Unknown(res)
762    }
763}
764impl fmt::Display for UntagResourcesError {
765    #[allow(unused_variables)]
766    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
767        match *self {
768            UntagResourcesError::InternalService(ref cause) => write!(f, "{}", cause),
769            UntagResourcesError::InvalidParameter(ref cause) => write!(f, "{}", cause),
770            UntagResourcesError::Throttled(ref cause) => write!(f, "{}", cause),
771        }
772    }
773}
774impl Error for UntagResourcesError {}
775/// Trait representing the capabilities of the AWS Resource Groups Tagging API API. AWS Resource Groups Tagging API clients implement this trait.
776#[async_trait]
777pub trait ResourceGroupsTaggingApi {
778    /// <p>Describes the status of the <code>StartReportCreation</code> operation. </p> <p>You can call this operation only from the organization's management account and from the us-east-1 Region.</p>
779    async fn describe_report_creation(
780        &self,
781    ) -> Result<DescribeReportCreationOutput, RusotoError<DescribeReportCreationError>>;
782
783    /// <p>Returns a table that shows counts of resources that are noncompliant with their tag policies.</p> <p>For more information on tag policies, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html">Tag Policies</a> in the <i>AWS Organizations User Guide.</i> </p> <p>You can call this operation only from the organization's management account and from the us-east-1 Region.</p> <p>This operation supports pagination, where the response can be sent in multiple pages. You should check the <code>PaginationToken</code> response parameter to determine if there are additional results available to return. Repeat the query, passing the <code>PaginationToken</code> response parameter value as an input to the next request until you recieve a <code>null</code> value. A null value for <code>PaginationToken</code> indicates that there are no more results waiting to be returned.</p>
784    async fn get_compliance_summary(
785        &self,
786        input: GetComplianceSummaryInput,
787    ) -> Result<GetComplianceSummaryOutput, RusotoError<GetComplianceSummaryError>>;
788
789    /// <p>Returns all the tagged or previously tagged resources that are located in the specified Region for the AWS account.</p> <p>Depending on what information you want returned, you can also specify the following:</p> <ul> <li> <p> <i>Filters</i> that specify what tags and resource types you want returned. The response includes all tags that are associated with the requested resources.</p> </li> <li> <p>Information about compliance with the account's effective tag policy. For more information on tag policies, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html">Tag Policies</a> in the <i>AWS Organizations User Guide.</i> </p> </li> </ul> <p>This operation supports pagination, where the response can be sent in multiple pages. You should check the <code>PaginationToken</code> response parameter to determine if there are additional results available to return. Repeat the query, passing the <code>PaginationToken</code> response parameter value as an input to the next request until you recieve a <code>null</code> value. A null value for <code>PaginationToken</code> indicates that there are no more results waiting to be returned.</p>
790    async fn get_resources(
791        &self,
792        input: GetResourcesInput,
793    ) -> Result<GetResourcesOutput, RusotoError<GetResourcesError>>;
794
795    /// <p>Returns all tag keys currently in use in the specified Region for the calling AWS account.</p> <p>This operation supports pagination, where the response can be sent in multiple pages. You should check the <code>PaginationToken</code> response parameter to determine if there are additional results available to return. Repeat the query, passing the <code>PaginationToken</code> response parameter value as an input to the next request until you recieve a <code>null</code> value. A null value for <code>PaginationToken</code> indicates that there are no more results waiting to be returned.</p>
796    async fn get_tag_keys(
797        &self,
798        input: GetTagKeysInput,
799    ) -> Result<GetTagKeysOutput, RusotoError<GetTagKeysError>>;
800
801    /// <p>Returns all tag values for the specified key that are used in the specified AWS Region for the calling AWS account.</p> <p>This operation supports pagination, where the response can be sent in multiple pages. You should check the <code>PaginationToken</code> response parameter to determine if there are additional results available to return. Repeat the query, passing the <code>PaginationToken</code> response parameter value as an input to the next request until you recieve a <code>null</code> value. A null value for <code>PaginationToken</code> indicates that there are no more results waiting to be returned.</p>
802    async fn get_tag_values(
803        &self,
804        input: GetTagValuesInput,
805    ) -> Result<GetTagValuesOutput, RusotoError<GetTagValuesError>>;
806
807    /// <p>Generates a report that lists all tagged resources in the accounts across your organization and tells whether each resource is compliant with the effective tag policy. Compliance data is refreshed daily. The report is generated asynchronously.</p> <p>The generated report is saved to the following location:</p> <p> <code>s3://example-bucket/AwsTagPolicies/o-exampleorgid/YYYY-MM-ddTHH:mm:ssZ/report.csv</code> </p> <p>You can call this operation only from the organization's management account and from the us-east-1 Region.</p>
808    async fn start_report_creation(
809        &self,
810        input: StartReportCreationInput,
811    ) -> Result<StartReportCreationOutput, RusotoError<StartReportCreationError>>;
812
813    /// <p><p>Applies one or more tags to the specified resources. Note the following:</p> <ul> <li> <p>Not all resources can have tags. For a list of services with resources that support tagging using this operation, see <a href="https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/supported-services.html">Services that support the Resource Groups Tagging API</a>.</p> </li> <li> <p>Each resource can have up to 50 tags. For other limits, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html#tag-conventions">Tag Naming and Usage Conventions</a> in the <i>AWS General Reference.</i> </p> </li> <li> <p>You can only tag resources that are located in the specified AWS Region for the AWS account.</p> </li> <li> <p>To add tags to a resource, you need the necessary permissions for the service that the resource belongs to as well as permissions for adding tags. For more information, see the documentation for each service.</p> </li> </ul> <important> <p>Do not store personally identifiable information (PII) or other confidential or sensitive information in tags. We use tags to provide you with billing and administration services. Tags are not intended to be used for private or sensitive data.</p> </important></p>
814    async fn tag_resources(
815        &self,
816        input: TagResourcesInput,
817    ) -> Result<TagResourcesOutput, RusotoError<TagResourcesError>>;
818
819    /// <p><p>Removes the specified tags from the specified resources. When you specify a tag key, the action removes both that key and its associated value. The operation succeeds even if you attempt to remove tags from a resource that were already removed. Note the following:</p> <ul> <li> <p>To remove tags from a resource, you need the necessary permissions for the service that the resource belongs to as well as permissions for removing tags. For more information, see the documentation for the service whose resource you want to untag.</p> </li> <li> <p>You can only tag resources that are located in the specified AWS Region for the calling AWS account.</p> </li> </ul></p>
820    async fn untag_resources(
821        &self,
822        input: UntagResourcesInput,
823    ) -> Result<UntagResourcesOutput, RusotoError<UntagResourcesError>>;
824}
825/// A client for the AWS Resource Groups Tagging API API.
826#[derive(Clone)]
827pub struct ResourceGroupsTaggingApiClient {
828    client: Client,
829    region: region::Region,
830}
831
832impl ResourceGroupsTaggingApiClient {
833    /// Creates a client backed by the default tokio event loop.
834    ///
835    /// The client will use the default credentials provider and tls client.
836    pub fn new(region: region::Region) -> ResourceGroupsTaggingApiClient {
837        ResourceGroupsTaggingApiClient {
838            client: Client::shared(),
839            region,
840        }
841    }
842
843    pub fn new_with<P, D>(
844        request_dispatcher: D,
845        credentials_provider: P,
846        region: region::Region,
847    ) -> ResourceGroupsTaggingApiClient
848    where
849        P: ProvideAwsCredentials + Send + Sync + 'static,
850        D: DispatchSignedRequest + Send + Sync + 'static,
851    {
852        ResourceGroupsTaggingApiClient {
853            client: Client::new_with(credentials_provider, request_dispatcher),
854            region,
855        }
856    }
857
858    pub fn new_with_client(
859        client: Client,
860        region: region::Region,
861    ) -> ResourceGroupsTaggingApiClient {
862        ResourceGroupsTaggingApiClient { client, region }
863    }
864}
865
866#[async_trait]
867impl ResourceGroupsTaggingApi for ResourceGroupsTaggingApiClient {
868    /// <p>Describes the status of the <code>StartReportCreation</code> operation. </p> <p>You can call this operation only from the organization's management account and from the us-east-1 Region.</p>
869    async fn describe_report_creation(
870        &self,
871    ) -> Result<DescribeReportCreationOutput, RusotoError<DescribeReportCreationError>> {
872        let mut request = self.new_signed_request("POST", "/");
873        request.add_header(
874            "x-amz-target",
875            "ResourceGroupsTaggingAPI_20170126.DescribeReportCreation",
876        );
877        request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
878
879        let response = self
880            .sign_and_dispatch(request, DescribeReportCreationError::from_response)
881            .await?;
882        let mut response = response;
883        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
884        proto::json::ResponsePayload::new(&response)
885            .deserialize::<DescribeReportCreationOutput, _>()
886    }
887
888    /// <p>Returns a table that shows counts of resources that are noncompliant with their tag policies.</p> <p>For more information on tag policies, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html">Tag Policies</a> in the <i>AWS Organizations User Guide.</i> </p> <p>You can call this operation only from the organization's management account and from the us-east-1 Region.</p> <p>This operation supports pagination, where the response can be sent in multiple pages. You should check the <code>PaginationToken</code> response parameter to determine if there are additional results available to return. Repeat the query, passing the <code>PaginationToken</code> response parameter value as an input to the next request until you recieve a <code>null</code> value. A null value for <code>PaginationToken</code> indicates that there are no more results waiting to be returned.</p>
889    async fn get_compliance_summary(
890        &self,
891        input: GetComplianceSummaryInput,
892    ) -> Result<GetComplianceSummaryOutput, RusotoError<GetComplianceSummaryError>> {
893        let mut request = self.new_signed_request("POST", "/");
894        request.add_header(
895            "x-amz-target",
896            "ResourceGroupsTaggingAPI_20170126.GetComplianceSummary",
897        );
898        let encoded = serde_json::to_string(&input).unwrap();
899        request.set_payload(Some(encoded));
900
901        let response = self
902            .sign_and_dispatch(request, GetComplianceSummaryError::from_response)
903            .await?;
904        let mut response = response;
905        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
906        proto::json::ResponsePayload::new(&response).deserialize::<GetComplianceSummaryOutput, _>()
907    }
908
909    /// <p>Returns all the tagged or previously tagged resources that are located in the specified Region for the AWS account.</p> <p>Depending on what information you want returned, you can also specify the following:</p> <ul> <li> <p> <i>Filters</i> that specify what tags and resource types you want returned. The response includes all tags that are associated with the requested resources.</p> </li> <li> <p>Information about compliance with the account's effective tag policy. For more information on tag policies, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html">Tag Policies</a> in the <i>AWS Organizations User Guide.</i> </p> </li> </ul> <p>This operation supports pagination, where the response can be sent in multiple pages. You should check the <code>PaginationToken</code> response parameter to determine if there are additional results available to return. Repeat the query, passing the <code>PaginationToken</code> response parameter value as an input to the next request until you recieve a <code>null</code> value. A null value for <code>PaginationToken</code> indicates that there are no more results waiting to be returned.</p>
910    async fn get_resources(
911        &self,
912        input: GetResourcesInput,
913    ) -> Result<GetResourcesOutput, RusotoError<GetResourcesError>> {
914        let mut request = self.new_signed_request("POST", "/");
915        request.add_header(
916            "x-amz-target",
917            "ResourceGroupsTaggingAPI_20170126.GetResources",
918        );
919        let encoded = serde_json::to_string(&input).unwrap();
920        request.set_payload(Some(encoded));
921
922        let response = self
923            .sign_and_dispatch(request, GetResourcesError::from_response)
924            .await?;
925        let mut response = response;
926        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
927        proto::json::ResponsePayload::new(&response).deserialize::<GetResourcesOutput, _>()
928    }
929
930    /// <p>Returns all tag keys currently in use in the specified Region for the calling AWS account.</p> <p>This operation supports pagination, where the response can be sent in multiple pages. You should check the <code>PaginationToken</code> response parameter to determine if there are additional results available to return. Repeat the query, passing the <code>PaginationToken</code> response parameter value as an input to the next request until you recieve a <code>null</code> value. A null value for <code>PaginationToken</code> indicates that there are no more results waiting to be returned.</p>
931    async fn get_tag_keys(
932        &self,
933        input: GetTagKeysInput,
934    ) -> Result<GetTagKeysOutput, RusotoError<GetTagKeysError>> {
935        let mut request = self.new_signed_request("POST", "/");
936        request.add_header(
937            "x-amz-target",
938            "ResourceGroupsTaggingAPI_20170126.GetTagKeys",
939        );
940        let encoded = serde_json::to_string(&input).unwrap();
941        request.set_payload(Some(encoded));
942
943        let response = self
944            .sign_and_dispatch(request, GetTagKeysError::from_response)
945            .await?;
946        let mut response = response;
947        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
948        proto::json::ResponsePayload::new(&response).deserialize::<GetTagKeysOutput, _>()
949    }
950
951    /// <p>Returns all tag values for the specified key that are used in the specified AWS Region for the calling AWS account.</p> <p>This operation supports pagination, where the response can be sent in multiple pages. You should check the <code>PaginationToken</code> response parameter to determine if there are additional results available to return. Repeat the query, passing the <code>PaginationToken</code> response parameter value as an input to the next request until you recieve a <code>null</code> value. A null value for <code>PaginationToken</code> indicates that there are no more results waiting to be returned.</p>
952    async fn get_tag_values(
953        &self,
954        input: GetTagValuesInput,
955    ) -> Result<GetTagValuesOutput, RusotoError<GetTagValuesError>> {
956        let mut request = self.new_signed_request("POST", "/");
957        request.add_header(
958            "x-amz-target",
959            "ResourceGroupsTaggingAPI_20170126.GetTagValues",
960        );
961        let encoded = serde_json::to_string(&input).unwrap();
962        request.set_payload(Some(encoded));
963
964        let response = self
965            .sign_and_dispatch(request, GetTagValuesError::from_response)
966            .await?;
967        let mut response = response;
968        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
969        proto::json::ResponsePayload::new(&response).deserialize::<GetTagValuesOutput, _>()
970    }
971
972    /// <p>Generates a report that lists all tagged resources in the accounts across your organization and tells whether each resource is compliant with the effective tag policy. Compliance data is refreshed daily. The report is generated asynchronously.</p> <p>The generated report is saved to the following location:</p> <p> <code>s3://example-bucket/AwsTagPolicies/o-exampleorgid/YYYY-MM-ddTHH:mm:ssZ/report.csv</code> </p> <p>You can call this operation only from the organization's management account and from the us-east-1 Region.</p>
973    async fn start_report_creation(
974        &self,
975        input: StartReportCreationInput,
976    ) -> Result<StartReportCreationOutput, RusotoError<StartReportCreationError>> {
977        let mut request = self.new_signed_request("POST", "/");
978        request.add_header(
979            "x-amz-target",
980            "ResourceGroupsTaggingAPI_20170126.StartReportCreation",
981        );
982        let encoded = serde_json::to_string(&input).unwrap();
983        request.set_payload(Some(encoded));
984
985        let response = self
986            .sign_and_dispatch(request, StartReportCreationError::from_response)
987            .await?;
988        let mut response = response;
989        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
990        proto::json::ResponsePayload::new(&response).deserialize::<StartReportCreationOutput, _>()
991    }
992
993    /// <p><p>Applies one or more tags to the specified resources. Note the following:</p> <ul> <li> <p>Not all resources can have tags. For a list of services with resources that support tagging using this operation, see <a href="https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/supported-services.html">Services that support the Resource Groups Tagging API</a>.</p> </li> <li> <p>Each resource can have up to 50 tags. For other limits, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html#tag-conventions">Tag Naming and Usage Conventions</a> in the <i>AWS General Reference.</i> </p> </li> <li> <p>You can only tag resources that are located in the specified AWS Region for the AWS account.</p> </li> <li> <p>To add tags to a resource, you need the necessary permissions for the service that the resource belongs to as well as permissions for adding tags. For more information, see the documentation for each service.</p> </li> </ul> <important> <p>Do not store personally identifiable information (PII) or other confidential or sensitive information in tags. We use tags to provide you with billing and administration services. Tags are not intended to be used for private or sensitive data.</p> </important></p>
994    async fn tag_resources(
995        &self,
996        input: TagResourcesInput,
997    ) -> Result<TagResourcesOutput, RusotoError<TagResourcesError>> {
998        let mut request = self.new_signed_request("POST", "/");
999        request.add_header(
1000            "x-amz-target",
1001            "ResourceGroupsTaggingAPI_20170126.TagResources",
1002        );
1003        let encoded = serde_json::to_string(&input).unwrap();
1004        request.set_payload(Some(encoded));
1005
1006        let response = self
1007            .sign_and_dispatch(request, TagResourcesError::from_response)
1008            .await?;
1009        let mut response = response;
1010        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1011        proto::json::ResponsePayload::new(&response).deserialize::<TagResourcesOutput, _>()
1012    }
1013
1014    /// <p><p>Removes the specified tags from the specified resources. When you specify a tag key, the action removes both that key and its associated value. The operation succeeds even if you attempt to remove tags from a resource that were already removed. Note the following:</p> <ul> <li> <p>To remove tags from a resource, you need the necessary permissions for the service that the resource belongs to as well as permissions for removing tags. For more information, see the documentation for the service whose resource you want to untag.</p> </li> <li> <p>You can only tag resources that are located in the specified AWS Region for the calling AWS account.</p> </li> </ul></p>
1015    async fn untag_resources(
1016        &self,
1017        input: UntagResourcesInput,
1018    ) -> Result<UntagResourcesOutput, RusotoError<UntagResourcesError>> {
1019        let mut request = self.new_signed_request("POST", "/");
1020        request.add_header(
1021            "x-amz-target",
1022            "ResourceGroupsTaggingAPI_20170126.UntagResources",
1023        );
1024        let encoded = serde_json::to_string(&input).unwrap();
1025        request.set_payload(Some(encoded));
1026
1027        let response = self
1028            .sign_and_dispatch(request, UntagResourcesError::from_response)
1029            .await?;
1030        let mut response = response;
1031        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1032        proto::json::ResponsePayload::new(&response).deserialize::<UntagResourcesOutput, _>()
1033    }
1034}