listTasks method
Lists the tasks in a queue.
By default, only the BASIC view is
retrieved due to performance considerations;
response_view
controls the subset of information which is returned.
The tasks may be returned in any order. The ordering may change at any time.
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<ListTasksResponse> listTasks(ListTasksRequest request) async {
final url = _endPoint.replace(
path: '/v2/${request.parent}/tasks',
queryParameters: {
if (request.responseView case final $1 when $1.isNotDefault)
'responseView': $1.value,
if (request.pageSize case final $1 when $1.isNotDefault)
'pageSize': '${$1}',
if (request.pageToken case final $1 when $1.isNotDefault)
'pageToken': $1,
},
);
final response = await _client.get(url);
return ListTasksResponse.fromJson(response);
}