batchUpdateTask method

Future<BatchUpdateTaskResponse> batchUpdateTask({
  1. required List<BatchUpdateTaskItem> tasks,
  2. String? clientToken,
})

Updates multiple tasks in a single request. This is a batch version of the UpdateTask API.

The result of updating each task is reported individually in the response. Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of 200.

May throw AccessDeniedException. May throw InternalServerErrorException. May throw ThrottlingException. May throw ValidationException.

Parameter tasks : The list of tasks to update. You can specify up to 100 tasks per request.

Parameter clientToken : The unique token which the server uses to recognize retries of the same request.

Implementation

Future<BatchUpdateTaskResponse> batchUpdateTask({
  required List<BatchUpdateTaskItem> tasks,
  String? clientToken,
}) async {
  final headers = <String, String>{
    if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(),
  };
  final $payload = <String, dynamic>{
    'tasks': tasks,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/2023-10-12/batch-update-task',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return BatchUpdateTaskResponse.fromJson(response);
}