tagResource method

Future<void> tagResource({
  1. required String resourceArn,
  2. required Map<String, String> tags,
})

Creates or modifies tags for a resource. Tags are key/value pairs (metadata) that can be used to manage a resource. For more information, see AWS Tagging Strategies.

May throw InternalFailureException. May throw InvalidRequestException. May throw ResourceNotFoundException.

Parameter resourceArn : The ARN of the resouce for which tag(s) should be added or modified.

Parameter tags : The new or modifying tag(s) for the resource. See AWS IoT 1-Click Service Limits for the maximum number of tags allowed per resource.

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,
  );
}