tagResource method
Add one or more tags (keys and values) to a specified resource. A tag is a label that you optionally define and associate with a resource. Tags can help you categorize and manage resources in different ways, such as by purpose, owner, environment, or other criteria. A resource can have as many as 50 tags.
Each tag consists of a required tag key and an associated tag value, both of which you define. A tag key is a general label that acts as a category for more specific tag values. A tag value acts as a descriptor within a tag key.
May throw BadRequestException. May throw ConcurrentModificationException. May throw NotFoundException. May throw TooManyRequestsException.
Parameter resourceArn
:
The Amazon Resource Name (ARN) of the resource that you want to add one or
more tags to.
Parameter tags
:
A list of the tags that you want to add to the resource. A tag consists of
a required tag key (Key
) and an associated tag value
(Value
). The maximum length of a tag key is 128 characters.
The maximum length of a tag value is 256 characters.
Implementation
Future<void> tagResource({
required String resourceArn,
required List<Tag> tags,
}) async {
ArgumentError.checkNotNull(resourceArn, 'resourceArn');
ArgumentError.checkNotNull(tags, 'tags');
final $payload = <String, dynamic>{
'ResourceArn': resourceArn,
'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v2/email/tags',
exceptionFnMap: _exceptionFns,
);
}