tagResource method

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

Adds a tag to a resource.

May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw TooManyTagsException. May throw ValidationException.

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

Parameter tags : Adds to or modifies the tags of the given resource. Tags are metadata that you can use to manage a resource.

Implementation

Future<void> tagResource({
  required String resourceArn,
  required List<Tag> tags,
}) async {
  final $query = <String, List<String>>{
    'resourceArn': [resourceArn],
  };
  final $payload = <String, dynamic>{
    'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/tags',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
}