tagResource method
Adds or updates the tags associated with the resource ARN. See AWS IoT 1-Click Service Limits for the maximum number of tags allowed per resource.
May throw ResourceNotFoundException. May throw InvalidRequestException. May throw InternalFailureException.
Parameter resourceArn
:
The ARN of the resource.
Parameter tags
:
A collection of key/value pairs defining the resource tags. For example, {
"tags": {"key1": "value1", "key2": "value2"} }. For more information, see
AWS
Tagging Strategies.
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: 'POST',
requestUri: '/tags/${Uri.encodeComponent(resourceArn)}',
exceptionFnMap: _exceptionFns,
);
}