tagResource method
Adds tags to an AWS IoT Greengrass resource. If a tag already exists for the resource, this operation updates the tag's value.
May throw InternalServerException. May throw ValidationException. May throw ResourceNotFoundException.
Parameter resourceArn
:
The ARN
of the resource to tag.
Parameter tags
:
A list of key-value pairs that contain metadata for the resource. For more
information, see Tag
your resources in the AWS IoT Greengrass V2 Developer Guide.
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,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/tags/${Uri.encodeComponent(resourceArn)}',
exceptionFnMap: _exceptionFns,
);
}