tagResource method
Adds or updates a tag on a given resource.
May throw BadRequestException. May throw UnauthorizedException. May throw TooManyRequestsException. May throw NotFoundException. May throw LimitExceededException. May throw ConflictException.
Parameter resourceArn
:
Required
The ARN of a resource that can be tagged.
Parameter tags
:
Required
The key-value map of strings. The valid character set is
a-zA-Z+-=._:/
. The tag key can be up to 128 characters and must not
start with aws:
. The tag value can be up to 256 characters.
Implementation
Future<void> tagResource({
required String resourceArn,
required Map<String, String> tags,
}) async {
ArgumentError.checkNotNull(resourceArn, 'resourceArn');
ArgumentError.checkNotNull(tags, 'tags');
final $payload = <String, dynamic>{
'tags': tags,
};
await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/tags/${Uri.encodeComponent(resourceArn)}',
exceptionFnMap: _exceptionFns,
);
}