aws-sdk-resourcegroupstagging 1.97.0

AWS SDK for AWS Resource Groups Tagging API
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
    /// Constructs a fluent builder for the [`GetResources`](crate::operation::get_resources::builders::GetResourcesFluentBuilder) operation.
    /// This operation supports pagination; See [`into_paginator()`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::into_paginator).
    ///
    /// - The fluent builder is configurable:
    ///   - [`pagination_token(impl Into<String>)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::pagination_token) / [`set_pagination_token(Option<String>)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::set_pagination_token):<br>required: **false**<br><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><br>
    ///   - [`tag_filters(TagFilter)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::tag_filters) / [`set_tag_filters(Option<Vec::<TagFilter>>)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::set_tag_filters):<br>required: **false**<br><p>Specifies a list of TagFilters (keys and values) to restrict the output to only those resources that have tags with the specified keys and, if included, the specified values. 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>You can't specify both this parameter and the <code>ResourceArnList</code> parameter in the same request. If you do, you get an <code>Invalid Parameter</code> exception.</p> <p>Note the following when deciding how to use TagFilters:</p> <ul>  <li>   <p>If you <i>don't</i> specify a <code>TagFilter</code>, the response includes all resources that are currently tagged or ever had a tag. Resources that were previously tagged, <i>but do not currently</i> have tags, are shown with an empty tag set, like this: <code>"Tags": \[\]</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 <i>any</i> of the specified values for that key.</p></li>  <li>   <p>If you don't specify a value for a key, the response returns all resources that are tagged with that key, with any or no value.</p>   <p>For example, for the following filters: <code>filter1= {key1,{value1}}</code>, <code>filter2={key2,{value2,value3,value4}}</code>, <code>filter3= {key3}</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><br>
    ///   - [`resources_per_page(i32)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::resources_per_page) / [`set_resources_per_page(Option<i32>)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::set_resources_per_page):<br>required: **false**<br><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><br>
    ///   - [`tags_per_page(i32)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::tags_per_page) / [`set_tags_per_page(Option<i32>)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::set_tags_per_page):<br>required: **false**<br><p>Amazon Web Services 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><br>
    ///   - [`resource_type_filters(impl Into<String>)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::resource_type_filters) / [`set_resource_type_filters(Option<Vec::<String>>)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::set_resource_type_filters):<br>required: **false**<br><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 service 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>You can't specify both this parameter and the <code>ResourceArnList</code> parameter in the same request. If you do, you get an <code>Invalid Parameter</code> exception.</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).</p><note>  <p>For the list of services whose resources you can tag using the Resource Groups Tagging API, see <a href="https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/supported-services.html">Services that support the Resource Groups Tagging API</a>. If an Amazon Web Services service isn't listed on that page, you might still be able to tag that service's resources by using that service's native tagging operations instead of using Resource Groups Tagging API operations. All tagged resources, whether the tagging used the Resource Groups Tagging API or not, are returned by the <code>Get*</code> operation.</p> </note> <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. For example, the following string would limit the response to only Amazon EC2 instances, Amazon S3 buckets, or any Audit Manager resource:</p> <p><code>ec2:instance,s3:bucket,auditmanager</code></p><br>
    ///   - [`include_compliance_details(bool)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::include_compliance_details) / [`set_include_compliance_details(Option<bool>)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::set_include_compliance_details):<br>required: **false**<br><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><br>
    ///   - [`exclude_compliant_resources(bool)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::exclude_compliant_resources) / [`set_exclude_compliant_resources(Option<bool>)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::set_exclude_compliant_resources):<br>required: **false**<br><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><br>
    ///   - [`resource_arn_list(impl Into<String>)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::resource_arn_list) / [`set_resource_arn_list(Option<Vec::<String>>)`](crate::operation::get_resources::builders::GetResourcesFluentBuilder::set_resource_arn_list):<br>required: **false**<br><p>Specifies a list of ARNs of resources for which you want to retrieve tag data.</p> <p>You can't specify both this parameter and the <code>ResourceTypeFilters</code> parameter in the same request. If you do, you get an <code>Invalid Parameter</code> exception.</p> <p>You can't specify both this parameter and the <code>TagFilters</code> parameter in the same request. If you do, you get an <code>Invalid Parameter</code> exception.</p> <p>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 do, 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="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces</a> in the <i>Amazon Web Services General Reference</i>.</p><br>
    /// - On success, responds with [`GetResourcesOutput`](crate::operation::get_resources::GetResourcesOutput) with field(s):
    ///   - [`pagination_token(Option<String>)`](crate::operation::get_resources::GetResourcesOutput::pagination_token): <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>
    ///   - [`resource_tag_mapping_list(Option<Vec::<ResourceTagMapping>>)`](crate::operation::get_resources::GetResourcesOutput::resource_tag_mapping_list): <p>A list of resource ARNs and the tags (keys and values) associated with each.</p>
    /// - On failure, responds with [`SdkError<GetResourcesError>`](crate::operation::get_resources::GetResourcesError)
    pub fn get_resources(&self) -> crate::operation::get_resources::builders::GetResourcesFluentBuilder {
        crate::operation::get_resources::builders::GetResourcesFluentBuilder::new(self.handle.clone())
    }
}