tagResource method
Adds the specified tags to the specified resource. If a tag key already exists, the existing value is replaced with the new value.
May throw NotFoundException. May throw BadRequestException. May throw ConflictException. May throw InternalFailureException. May throw LimitExceededException.
Parameter resourceArn
:
The Amazon Resource Name (ARN) of the bot, bot alias, or bot channel to
tag.
Parameter tags
:
A list of tag keys to add to the resource. If a tag key already exists,
the existing value is replaced with the new value.
Implementation
Future<void> tagResource({
required String resourceArn,
required List<Tag> tags,
}) async {
ArgumentError.checkNotNull(resourceArn, 'resourceArn');
_s.validateStringLength(
'resourceArn',
resourceArn,
1,
1011,
isRequired: true,
);
ArgumentError.checkNotNull(tags, 'tags');
final $payload = <String, dynamic>{
'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/tags/${Uri.encodeComponent(resourceArn)}',
exceptionFnMap: _exceptionFns,
);
}