tagResource method
Adds the specified tag keys and values to a resource share or managed permission. If you choose a resource share, the tags are attached to only the resource share, not to the resources that are in the resource share.
The tags on a managed permission are the same for all versions of the managed permission.
May throw InvalidParameterException.
May throw MalformedArnException.
May throw ResourceArnNotFoundException.
May throw ServerInternalException.
May throw ServiceUnavailableException.
May throw TagLimitExceededException.
May throw TagPolicyViolationException.
May throw UnknownResourceException.
Parameter tags :
A list of one or more tag key and value pairs. The tag key must be present
and not be an empty string. The tag value must be present but can be an
empty string.
Parameter resourceArn :
Specifies the Amazon
Resource Name (ARN) of the managed permission that you want to add
tags to. You must specify either resourceArn, or
resourceShareArn, but not both.
Parameter resourceShareArn :
Specifies the Amazon
Resource Name (ARN) of the resource share that you want to add tags
to. You must specify either resourceShareArn, or
resourceArn, but not both.
Implementation
Future<void> tagResource({
required List<Tag> tags,
String? resourceArn,
String? resourceShareArn,
}) async {
final $payload = <String, dynamic>{
'tags': tags,
if (resourceArn != null) 'resourceArn': resourceArn,
if (resourceShareArn != null) 'resourceShareArn': resourceShareArn,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/tagresource',
exceptionFnMap: _exceptionFns,
);
}