tag method
Adds tags to a resource group with the specified ARN. Existing tags on a resource group are not changed if they are not specified in the request parameters. Minimum permissions
To run this command, you must have the following permissions:
-
resource-groups:Tag
May throw BadRequestException. May throw ForbiddenException. May throw NotFoundException. May throw MethodNotAllowedException. May throw TooManyRequestsException. May throw InternalServerErrorException.
Parameter arn
:
The ARN of the resource group to which to add tags.
Parameter tags
:
The tags to add to the specified resource group. A tag is a
string-to-string map of key-value pairs.
Implementation
Future<TagOutput> tag({
required String arn,
required Map<String, String> tags,
}) async {
ArgumentError.checkNotNull(arn, 'arn');
_s.validateStringLength(
'arn',
arn,
12,
1600,
isRequired: true,
);
ArgumentError.checkNotNull(tags, 'tags');
final $payload = <String, dynamic>{
'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/resources/${Uri.encodeComponent(arn)}/tags',
exceptionFnMap: _exceptionFns,
);
return TagOutput.fromJson(response);
}