tagResource method

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

Adds a tag to the specified resource.

May throw ResourceNotFoundException. May throw ValidationException. May throw InternalServerException. May throw ThrottlingException. May throw AccessDeniedException.

Parameter resourceArn : The ARN of the resource to add the tag to.

Parameter tags : The tags to add to the 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,
  );
}