list method
Returns all tasks in the specified task list.
A user can have up to 20,000 non-hidden tasks per list and up to 100,000 tasks in total at a time.
Request parameters:
tasklist
- Task list identifier.
completedMax
- Upper bound for a task's completion date (as a RFC 3339
timestamp) to filter by. Optional. The default is not to filter by
completion date.
completedMin
- Lower bound for a task's completion date (as a RFC 3339
timestamp) to filter by. Optional. The default is not to filter by
completion date.
dueMax
- Upper bound for a task's due date (as a RFC 3339 timestamp) to
filter by. Optional. The default is not to filter by due date.
dueMin
- Lower bound for a task's due date (as a RFC 3339 timestamp) to
filter by. Optional. The default is not to filter by due date.
maxResults
- Maximum number of tasks returned on one page. Optional. The
default is 20 (max allowed: 100).
pageToken
- Token specifying the result page to return. Optional.
showCompleted
- Flag indicating whether completed tasks are returned in
the result. Optional. The default is True. Note that showHidden must also
be True to show tasks completed in first party clients, such as the web UI
and Google's mobile apps.
showDeleted
- Flag indicating whether deleted tasks are returned in the
result. Optional. The default is False.
showHidden
- Flag indicating whether hidden tasks are returned in the
result. Optional. The default is False.
updatedMin
- Lower bound for a task's last modification time (as a RFC
3339 timestamp) to filter by. Optional. The default is not to filter by
last modification time.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Tasks.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<Tasks> list(
core.String tasklist, {
core.String? completedMax,
core.String? completedMin,
core.String? dueMax,
core.String? dueMin,
core.int? maxResults,
core.String? pageToken,
core.bool? showCompleted,
core.bool? showDeleted,
core.bool? showHidden,
core.String? updatedMin,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (completedMax != null) 'completedMax': [completedMax],
if (completedMin != null) 'completedMin': [completedMin],
if (dueMax != null) 'dueMax': [dueMax],
if (dueMin != null) 'dueMin': [dueMin],
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (pageToken != null) 'pageToken': [pageToken],
if (showCompleted != null) 'showCompleted': ['${showCompleted}'],
if (showDeleted != null) 'showDeleted': ['${showDeleted}'],
if (showHidden != null) 'showHidden': ['${showHidden}'],
if (updatedMin != null) 'updatedMin': [updatedMin],
if ($fields != null) 'fields': [$fields],
};
final url_ =
'tasks/v1/lists/' + commons.escapeVariable('$tasklist') + '/tasks';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Tasks.fromJson(response_ as core.Map<core.String, core.dynamic>);
}