tagResource method

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

Applies a tag to an Amazon Web Services resource. Tags are key-value pairs that can help you manage, filter, and search for your resources.

These include DataSync resources, such as locations, tasks, and task executions.

May throw InternalException. May throw InvalidRequestException.

Parameter resourceArn : Specifies the Amazon Resource Name (ARN) of the resource to apply the tag to.

Parameter tags : Specifies the tags that you want to apply to the resource.

Implementation

Future<void> tagResource({
  required String resourceArn,
  required List<TagListEntry> tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'FmrsService.TagResource'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceArn': resourceArn,
      'Tags': tags,
    },
  );
}