createTask method

Future<Task> createTask(
  1. CreateTaskRequest request
)

Creates a task and adds it to a queue.

Tasks cannot be updated after creation; there is no UpdateTask command.

  • The maximum task size is 100KB.

Throws a http.ClientException if there were problems communicating with the API service. Throws a ServiceException if the API method failed for any reason.

Implementation

Future<Task> createTask(CreateTaskRequest request) async {
  final url = _endPoint.replace(path: '/v2/${request.parent}/tasks');
  final response = await _client.post(url, body: request);
  return Task.fromJson(response);
}