Interface TaskOperations
-
- All Known Implementing Classes:
TaskTemplate
public interface TaskOperationsDefines operations for working with tasks and task lists of the authenticated user. Requires OAuth2 authentication with either "https://www.googleapis.com/auth/tasks" for read and write operations or "https://www.googleapis.com/auth/tasks.readonly" for read-only operations.- Author:
- Gabriel Axel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearCompletedTasks(TaskList taskList)Hides completed tasks from a task list.TaskcreateTaskAt(String taskListId, String parent, String previous, Task task)Creates a task at a specified position in a task list.voiddeleteTask(String taskId)Deletes a task from the default task list.voiddeleteTask(String taskListId, String taskId)Deletes a task from a task list.voiddeleteTask(String taskListId, Task task)Deletes a task from a task list.voiddeleteTask(Task task)Deletes a task from the default task list.voiddeleteTaskList(String taskListId)Deletes a task list.voiddeleteTaskList(TaskList taskList)Deletes a task list.TaskgetTask(String id)Retrieves a task from the default task list by its ID.TaskgetTask(String taskListId, String id)Retrieves a task by its containing task list ID and by the task ID.TaskListgetTaskList(String id)Retrieves a task list by its ID.TaskListsPagegetTaskLists()Retrieves up to 100 task lists.TaskListsPagegetTaskLists(String pageToken)Retrieves task lists pageTasksPagegetTasks()Retrieves up to 100 active tasks from the default task list.TasksPagegetTasks(String taskListId, String pageToken)Retrieved tasks from a task listTaskmoveTask(String taskListId, Task task, String parent, String previous)Moves a task to a new position in the task list.TasksaveTask(String taskListId, Task task)Creates or updates a task in a specified task list.TasksaveTask(Task task)Creates or updates a task in the default task list.TaskListsaveTaskList(TaskList taskList)Creates or updates a task list.TaskListQueryBuildertaskListQuery()Creates aTaskListQueryBuilder.TaskQueryBuildertaskQuery()Creates aTaskQueryBuilder.
-
-
-
Method Detail
-
getTaskLists
TaskListsPage getTaskLists()
Retrieves up to 100 task lists.- Returns:
TaskListsPagewith up to 100 items
-
getTaskLists
TaskListsPage getTaskLists(String pageToken)
Retrieves task lists page- Parameters:
pageToken- page token or null- Returns:
TaskLists page
-
getTaskList
TaskList getTaskList(String id)
Retrieves a task list by its ID.- Parameters:
id- the task list ID or "@default"- Returns:
- the retrieved
TaskList
-
saveTaskList
TaskList saveTaskList(TaskList taskList)
Creates or updates a task list.- Parameters:
taskList- the task list to create or update- Returns:
- the saved
TaskList
-
deleteTaskList
void deleteTaskList(String taskListId)
Deletes a task list.- Parameters:
taskListId- the ID of the task list to delete
-
deleteTaskList
void deleteTaskList(TaskList taskList)
Deletes a task list.- Parameters:
taskList- the task list to delete
-
taskListQuery
TaskListQueryBuilder taskListQuery()
Creates aTaskListQueryBuilder.- Returns:
- a new
TaskListQueryBuilder
-
getTasks
TasksPage getTasks()
Retrieves up to 100 active tasks from the default task list.- Returns:
TasksPagewith up to 100 items
-
getTasks
TasksPage getTasks(String taskListId, String pageToken)
Retrieved tasks from a task list- Parameters:
taskListId- ID of the task listpageToken- page token or null- Returns:
Tasks page
-
getTask
Task getTask(String id)
Retrieves a task from the default task list by its ID.- Parameters:
id- the task ID- Returns:
- the retrieved
Task
-
getTask
Task getTask(String taskListId, String id)
Retrieves a task by its containing task list ID and by the task ID.- Parameters:
taskListId- the containing task list IDid- the task ID- Returns:
- the retrieved
Task
-
saveTask
Task saveTask(Task task)
Creates or updates a task in the default task list.- Parameters:
task- the task to create or update- Returns:
- the saved
Task
-
saveTask
Task saveTask(String taskListId, Task task)
Creates or updates a task in a specified task list.- Parameters:
taskListId- the containing task list IDtask- the task to create or update- Returns:
- the saved
Task
-
deleteTask
void deleteTask(String taskId)
Deletes a task from the default task list. Deleted tasks can be retrieved usingTaskQueryBuilder.includeDeleted(boolean).- Parameters:
taskId- the ID of the task to delete
-
deleteTask
void deleteTask(Task task)
Deletes a task from the default task list. Deleted tasks can be retrieved usingTaskQueryBuilder.includeDeleted(boolean).- Parameters:
task- the task to delete
-
deleteTask
void deleteTask(String taskListId, String taskId)
Deletes a task from a task list. Deleted tasks can be retrieved usingTaskQueryBuilder.includeDeleted(boolean).- Parameters:
taskListId- the containing task list IDtaskId- the ID of the task to delete
-
deleteTask
void deleteTask(String taskListId, Task task)
Deletes a task from a task list. Deleted tasks can be retrieved usingTaskQueryBuilder.includeDeleted(boolean).- Parameters:
taskListId- the containing task list IDtask- the task to delete
-
taskQuery
TaskQueryBuilder taskQuery()
Creates aTaskQueryBuilder.- Returns:
- a new
TaskQueryBuilder
-
createTaskAt
Task createTaskAt(String taskListId, String parent, String previous, Task task)
Creates a task at a specified position in a task list.- Parameters:
taskListId- the containing task listparent- task ID to become parent of the new taskprevious- the task ID after which the new task will be appendedtask- the task to create- Returns:
- the created
Task
-
moveTask
Task moveTask(String taskListId, Task task, String parent, String previous)
Moves a task to a new position in the task list.- Parameters:
taskListId- the containing task list IDtask- the task to moveparent- the task ID to become parent of the moved taskprevious- the task ID after which the moved task will be appended- Returns:
- the moved
Task - Throws:
IllegalStateException- if both 'parent' and 'previous' arguments are empty
-
clearCompletedTasks
void clearCompletedTasks(TaskList taskList)
Hides completed tasks from a task list. Hidden tasks can be retrieved usingTaskQueryBuilder.includeHidden(boolean).- Parameters:
taskList- the task list to clear
-
-