getTask method

Future<Task> getTask(
  1. GetTaskRequest request
)

Gets a task.

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> getTask(GetTaskRequest request) async {
  final url = _endPoint.replace(
    path: '/v2/${request.name}',
    queryParameters: {
      if (request.responseView case final $1 when $1.isNotDefault)
        'responseView': $1.value,
    },
  );
  final response = await _client.get(url);
  return Task.fromJson(response);
}