tagResource method

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

Attaches a key-value pair to a resource, as identified by its Amazon Resource Name (ARN). Resources are users, servers, roles, and other entities.

There is no response returned from this call.

May throw InternalServiceError. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ServiceUnavailableException.

Parameter arn : An Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a server, user, or role.

Parameter tags : Key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (servers, users, workflows, and so on) for any purpose.

Implementation

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