pub struct Client { /* private fields */ }
Expand description
Client for AWS Resource Groups Tagging API
Client for invoking operations on AWS Resource Groups Tagging API. Each operation on AWS Resource Groups Tagging API is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_resourcegroupstagging::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Builder
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_resourcegroupstagging::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the GetComplianceSummary
operation has
a Client::get_compliance_summary
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.get_compliance_summary()
.pagination_token("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
Source§impl Client
impl Client
Sourcepub fn describe_report_creation(&self) -> DescribeReportCreationFluentBuilder
pub fn describe_report_creation(&self) -> DescribeReportCreationFluentBuilder
Constructs a fluent builder for the DescribeReportCreation
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
DescribeReportCreationOutput
with field(s):status(Option<String>)
:Reports the status of the operation.
The operation status can be one of the following:
-
RUNNING
- Report creation is in progress. -
SUCCEEDED
- Report creation is complete. You can open the report from the Amazon S3 bucket that you specified when you ranStartReportCreation
. -
FAILED
- Report creation timed out or the Amazon S3 bucket is not accessible. -
NO REPORT
- No report was generated in the last 90 days.
-
s3_location(Option<String>)
:The path to the Amazon S3 bucket where the report was stored on creation.
start_date(Option<String>)
:The date and time that the report was started.
error_message(Option<String>)
:Details of the common errors that all operations return.
- On failure, responds with
SdkError<DescribeReportCreationError>
Source§impl Client
impl Client
Sourcepub fn get_compliance_summary(&self) -> GetComplianceSummaryFluentBuilder
pub fn get_compliance_summary(&self) -> GetComplianceSummaryFluentBuilder
Constructs a fluent builder for the GetComplianceSummary
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
target_id_filters(impl Into<String>)
/set_target_id_filters(Option<Vec::<String>>)
:
required: falseSpecifies 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.
region_filters(impl Into<String>)
/set_region_filters(Option<Vec::<String>>)
:
required: falseSpecifies a list of Amazon Web Services Regions to limit the output to. If you use this parameter, the count of returned noncompliant resources includes only resources in the specified Regions.
resource_type_filters(impl Into<String>)
/set_resource_type_filters(Option<Vec::<String>>)
:
required: falseSpecifies that you want the response to include information for only resources of the specified types. The format of each resource type is
service[:resourceType]
. For example, specifying a resource type ofec2
returns all Amazon EC2 resources (which includes EC2 instances). Specifying a resource type ofec2:instance
returns only EC2 instances.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 Amazon Web Services General Reference for the following:
-
For a list of service name strings, see Amazon Web Services Service Namespaces.
-
For resource type strings, see Example ARNs.
-
For more information about ARNs, see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces.
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.
-
tag_key_filters(impl Into<String>)
/set_tag_key_filters(Option<Vec::<String>>)
:
required: falseSpecifies 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.
group_by(GroupByAttribute)
/set_group_by(Option<Vec::<GroupByAttribute>>)
:
required: falseSpecifies a list of attributes to group the counts of noncompliant resources by. If supplied, the counts are sorted by those attributes.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseSpecifies 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
PaginationToken
response value to see if there are more results. You can specify a minimum of 1 and a maximum value of 100.pagination_token(impl Into<String>)
/set_pagination_token(Option<String>)
:
required: falseSpecifies a
PaginationToken
response value from a previous request to indicate that you want the next page of results. Leave this parameter empty in your initial request.
- On success, responds with
GetComplianceSummaryOutput
with field(s):summary_list(Option<Vec::<Summary>>)
:A table that shows counts of noncompliant resources.
pagination_token(Option<String>)
: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
PaginationToken
value in the request for the next page.
- On failure, responds with
SdkError<GetComplianceSummaryError>
Source§impl Client
impl Client
Sourcepub fn get_resources(&self) -> GetResourcesFluentBuilder
pub fn get_resources(&self) -> GetResourcesFluentBuilder
Constructs a fluent builder for the GetResources
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
pagination_token(impl Into<String>)
/set_pagination_token(Option<String>)
:
required: falseSpecifies a
PaginationToken
response value from a previous request to indicate that you want the next page of results. Leave this parameter empty in your initial request.tag_filters(TagFilter)
/set_tag_filters(Option<Vec::<TagFilter>>)
:
required: falseSpecifies 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
TagFilter
must contain a key with values optional. A request can include up to 50 keys, and each key can include up to 20 values.Note the following when deciding how to use TagFilters:
-
If you don’t specify a
TagFilter
, the response includes all resources that are currently tagged or ever had a tag. Resources that currently don’t have tags are shown with an empty tag set, like this:“Tags”: []
. -
If you specify more than one filter in a single request, the response returns only those resources that satisfy all filters.
-
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.
-
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.
For example, for the following filters:
filter1= {keyA,{value1}}
,filter2={keyB,{value2,value3,value4}}
,filter3= {keyC}
:-
GetResources({filter1})
returns resources tagged withkey1=value1
-
GetResources({filter2})
returns resources tagged withkey2=value2
orkey2=value3
orkey2=value4
-
GetResources({filter3})
returns resources tagged with any tag with the keykey3
, and with any or no value -
GetResources({filter1,filter2,filter3})
returns resources tagged with(key1=value1) and (key2=value2 or key2=value3 or key2=value4) and (key3, any or no value)
-
-
resources_per_page(i32)
/set_resources_per_page(Option<i32>)
:
required: falseSpecifies 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
PaginationToken
response value to see if there are more results. You can specify a minimum of 1 and a maximum value of 100.tags_per_page(i32)
/set_tags_per_page(Option<i32>)
:
required: falseAmazon Web Services recommends using
ResourcesPerPage
instead of this parameter.A limit that restricts the number of tags (key and value pairs) returned by
GetResources
in paginated output. A resource with no tags is counted as having one tag (one key and value pair).GetResources
does not split a resource and its associated tags across pages. If the specifiedTagsPerPage
would cause such a break, aPaginationToken
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 aTagsPerPage
of100
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.You can set
TagsPerPage
to a minimum of 100 items up to a maximum of 500 items.resource_type_filters(impl Into<String>)
/set_resource_type_filters(Option<Vec::<String>>)
:
required: falseSpecifies the resource types that you want included in the response. The format of each resource type is
service[:resourceType]
. For example, specifying a resource type ofec2
returns all Amazon EC2 resources (which includes EC2 instances). Specifying a resource type ofec2:instance
returns only EC2 instances.The string for each service name and resource type is the same as that embedded in a resource’s Amazon Resource Name (ARN). For the list of services whose resources you can use in this parameter, see Services that support the Resource Groups Tagging API.
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:
ec2:instance,s3:bucket,auditmanager
include_compliance_details(bool)
/set_include_compliance_details(Option<bool>)
:
required: falseSpecifies whether to include details regarding the compliance with the effective tag policy. Set this to
true
to determine whether resources are compliant with the tag policy and to get details.exclude_compliant_resources(bool)
/set_exclude_compliant_resources(Option<bool>)
:
required: falseSpecifies whether to exclude resources that are compliant with the tag policy. Set this to
true
if you are interested in retrieving information on noncompliant resources only.You can use this parameter only if the
IncludeComplianceDetails
parameter is also set totrue
.resource_arn_list(impl Into<String>)
/set_resource_arn_list(Option<Vec::<String>>)
:
required: falseSpecifies 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 (
ResourcesPerPage
,TagsPerPage
,PaginationToken
) in the same request. If you specify both, you get anInvalid Parameter
exception.If a resource specified by this parameter doesn’t exist, it doesn’t generate an error; it simply isn’t included in the response.
An ARN (Amazon Resource Name) uniquely identifies a resource. For more information, see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces in the Amazon Web Services General Reference.
- On success, responds with
GetResourcesOutput
with field(s):pagination_token(Option<String>)
: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
PaginationToken
value in the request for the next page.resource_tag_mapping_list(Option<Vec::<ResourceTagMapping>>)
:A list of resource ARNs and the tags (keys and values) associated with each.
- On failure, responds with
SdkError<GetResourcesError>
Source§impl Client
impl Client
Sourcepub fn get_tag_keys(&self) -> GetTagKeysFluentBuilder
pub fn get_tag_keys(&self) -> GetTagKeysFluentBuilder
Constructs a fluent builder for the GetTagKeys
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
pagination_token(impl Into<String>)
/set_pagination_token(Option<String>)
:
required: falseSpecifies a
PaginationToken
response value from a previous request to indicate that you want the next page of results. Leave this parameter empty in your initial request.
- On success, responds with
GetTagKeysOutput
with field(s):pagination_token(Option<String>)
: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
PaginationToken
value in the request for the next page.tag_keys(Option<Vec::<String>>)
:A list of all tag keys in the Amazon Web Services account.
- On failure, responds with
SdkError<GetTagKeysError>
Source§impl Client
impl Client
Sourcepub fn get_tag_values(&self) -> GetTagValuesFluentBuilder
pub fn get_tag_values(&self) -> GetTagValuesFluentBuilder
Constructs a fluent builder for the GetTagValues
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
pagination_token(impl Into<String>)
/set_pagination_token(Option<String>)
:
required: falseSpecifies a
PaginationToken
response value from a previous request to indicate that you want the next page of results. Leave this parameter empty in your initial request.key(impl Into<String>)
/set_key(Option<String>)
:
required: trueSpecifies the tag key for which you want to list all existing values that are currently used in the specified Amazon Web Services Region for the calling account.
- On success, responds with
GetTagValuesOutput
with field(s):pagination_token(Option<String>)
: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
PaginationToken
value in the request for the next page.tag_values(Option<Vec::<String>>)
:A list of all tag values for the specified key currently used in the specified Amazon Web Services Region for the calling account.
- On failure, responds with
SdkError<GetTagValuesError>
Source§impl Client
impl Client
Sourcepub fn start_report_creation(&self) -> StartReportCreationFluentBuilder
pub fn start_report_creation(&self) -> StartReportCreationFluentBuilder
Constructs a fluent builder for the StartReportCreation
operation.
- The fluent builder is configurable:
s3_bucket(impl Into<String>)
/set_s3_bucket(Option<String>)
:
required: trueThe name of the Amazon S3 bucket where the report will be stored; for example:
awsexamplebucket
For more information on S3 bucket requirements, including an example bucket policy, see the example S3 bucket policy on this page.
- On success, responds with
StartReportCreationOutput
- On failure, responds with
SdkError<StartReportCreationError>
Source§impl Client
impl Client
Sourcepub fn tag_resources(&self) -> TagResourcesFluentBuilder
pub fn tag_resources(&self) -> TagResourcesFluentBuilder
Constructs a fluent builder for the TagResources
operation.
- The fluent builder is configurable:
resource_arn_list(impl Into<String>)
/set_resource_arn_list(Option<Vec::<String>>)
:
required: trueSpecifies the list of ARNs of the resources that you want to apply tags to.
An ARN (Amazon Resource Name) uniquely identifies a resource. For more information, see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces in the Amazon Web Services General Reference.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: trueSpecifies 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.
- On success, responds with
TagResourcesOutput
with field(s):failed_resources_map(Option<HashMap::<String, FailureInfo>>)
: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
FailureInfo
object that contains an error code, a status code, and an error message. If there are no errors, theFailedResourcesMap
is empty.
- On failure, responds with
SdkError<TagResourcesError>
Source§impl Client
impl Client
Sourcepub fn untag_resources(&self) -> UntagResourcesFluentBuilder
pub fn untag_resources(&self) -> UntagResourcesFluentBuilder
Constructs a fluent builder for the UntagResources
operation.
- The fluent builder is configurable:
resource_arn_list(impl Into<String>)
/set_resource_arn_list(Option<Vec::<String>>)
:
required: trueSpecifies a list of ARNs of the resources that you want to remove tags from.
An ARN (Amazon Resource Name) uniquely identifies a resource. For more information, see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces in the Amazon Web Services General Reference.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueSpecifies a list of tag keys that you want to remove from the specified resources.
- On success, responds with
UntagResourcesOutput
with field(s):failed_resources_map(Option<HashMap::<String, FailureInfo>>)
: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
FailureInfo
object that contains an error code, a status code, and an error message. If there are no errors, theFailedResourcesMap
is empty.
- On failure, responds with
SdkError<UntagResourcesError>
Source§impl Client
impl Client
Sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
Source§impl Client
impl Client
Sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);