Class TaskTemplate
- java.lang.Object
-
- org.springframework.social.google.api.impl.AbstractGoogleApiOperations
-
- org.springframework.social.google.api.tasks.impl.TaskTemplate
-
- All Implemented Interfaces:
TaskOperations
public class TaskTemplate extends AbstractGoogleApiOperations implements TaskOperations
TaskOperationsimplementation.- Author:
- Gabriel Axel
-
-
Field Summary
-
Fields inherited from class org.springframework.social.google.api.impl.AbstractGoogleApiOperations
isAuthorized, restTemplate
-
-
Constructor Summary
Constructors Constructor Description TaskTemplate(org.springframework.web.client.RestTemplate restTemplate, boolean isAuthorized)
-
Method Summary
All Methods Instance Methods Concrete 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.-
Methods inherited from class org.springframework.social.google.api.impl.AbstractGoogleApiOperations
deleteEntity, deleteEntity, getEntity, patch, requireAuthorization, saveEntity
-
-
-
-
Method Detail
-
getTaskLists
public TaskListsPage getTaskLists()
Description copied from interface:TaskOperationsRetrieves up to 100 task lists.- Specified by:
getTaskListsin interfaceTaskOperations- Returns:
TaskListsPagewith up to 100 items
-
getTaskLists
public TaskListsPage getTaskLists(String pageToken)
Description copied from interface:TaskOperationsRetrieves task lists page- Specified by:
getTaskListsin interfaceTaskOperations- Parameters:
pageToken- page token or null- Returns:
TaskLists page
-
getTaskList
public TaskList getTaskList(String id)
Description copied from interface:TaskOperationsRetrieves a task list by its ID.- Specified by:
getTaskListin interfaceTaskOperations- Parameters:
id- the task list ID or "@default"- Returns:
- the retrieved
TaskList
-
saveTaskList
public TaskList saveTaskList(TaskList taskList)
Description copied from interface:TaskOperationsCreates or updates a task list.- Specified by:
saveTaskListin interfaceTaskOperations- Parameters:
taskList- the task list to create or update- Returns:
- the saved
TaskList
-
deleteTaskList
public void deleteTaskList(TaskList taskList)
Description copied from interface:TaskOperationsDeletes a task list.- Specified by:
deleteTaskListin interfaceTaskOperations- Parameters:
taskList- the task list to delete
-
deleteTaskList
public void deleteTaskList(String taskListId)
Description copied from interface:TaskOperationsDeletes a task list.- Specified by:
deleteTaskListin interfaceTaskOperations- Parameters:
taskListId- the ID of the task list to delete
-
taskListQuery
public TaskListQueryBuilder taskListQuery()
Description copied from interface:TaskOperationsCreates aTaskListQueryBuilder.- Specified by:
taskListQueryin interfaceTaskOperations- Returns:
- a new
TaskListQueryBuilder
-
getTasks
public TasksPage getTasks()
Description copied from interface:TaskOperationsRetrieves up to 100 active tasks from the default task list.- Specified by:
getTasksin interfaceTaskOperations- Returns:
TasksPagewith up to 100 items
-
getTasks
public TasksPage getTasks(String taskListId, String pageToken)
Description copied from interface:TaskOperationsRetrieved tasks from a task list- Specified by:
getTasksin interfaceTaskOperations- Parameters:
taskListId- ID of the task listpageToken- page token or null- Returns:
Tasks page
-
getTask
public Task getTask(String id)
Description copied from interface:TaskOperationsRetrieves a task from the default task list by its ID.- Specified by:
getTaskin interfaceTaskOperations- Parameters:
id- the task ID- Returns:
- the retrieved
Task
-
getTask
public Task getTask(String taskListId, String id)
Description copied from interface:TaskOperationsRetrieves a task by its containing task list ID and by the task ID.- Specified by:
getTaskin interfaceTaskOperations- Parameters:
taskListId- the containing task list IDid- the task ID- Returns:
- the retrieved
Task
-
saveTask
public Task saveTask(Task task)
Description copied from interface:TaskOperationsCreates or updates a task in the default task list.- Specified by:
saveTaskin interfaceTaskOperations- Parameters:
task- the task to create or update- Returns:
- the saved
Task
-
saveTask
public Task saveTask(String taskListId, Task task)
Description copied from interface:TaskOperationsCreates or updates a task in a specified task list.- Specified by:
saveTaskin interfaceTaskOperations- Parameters:
taskListId- the containing task list IDtask- the task to create or update- Returns:
- the saved
Task
-
createTaskAt
public Task createTaskAt(String taskListId, String parent, String previous, Task task)
Description copied from interface:TaskOperationsCreates a task at a specified position in a task list.- Specified by:
createTaskAtin interfaceTaskOperations- 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
public Task moveTask(String taskListId, Task task, String parent, String previous)
Description copied from interface:TaskOperationsMoves a task to a new position in the task list.- Specified by:
moveTaskin interfaceTaskOperations- 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
-
deleteTask
public void deleteTask(String taskId)
Description copied from interface:TaskOperationsDeletes a task from the default task list. Deleted tasks can be retrieved usingTaskQueryBuilder.includeDeleted(boolean).- Specified by:
deleteTaskin interfaceTaskOperations- Parameters:
taskId- the ID of the task to delete
-
deleteTask
public void deleteTask(Task task)
Description copied from interface:TaskOperationsDeletes a task from the default task list. Deleted tasks can be retrieved usingTaskQueryBuilder.includeDeleted(boolean).- Specified by:
deleteTaskin interfaceTaskOperations- Parameters:
task- the task to delete
-
deleteTask
public void deleteTask(String taskListId, String taskId)
Description copied from interface:TaskOperationsDeletes a task from a task list. Deleted tasks can be retrieved usingTaskQueryBuilder.includeDeleted(boolean).- Specified by:
deleteTaskin interfaceTaskOperations- Parameters:
taskListId- the containing task list IDtaskId- the ID of the task to delete
-
deleteTask
public void deleteTask(String taskListId, Task task)
Description copied from interface:TaskOperationsDeletes a task from a task list. Deleted tasks can be retrieved usingTaskQueryBuilder.includeDeleted(boolean).- Specified by:
deleteTaskin interfaceTaskOperations- Parameters:
taskListId- the containing task list IDtask- the task to delete
-
taskQuery
public TaskQueryBuilder taskQuery()
Description copied from interface:TaskOperationsCreates aTaskQueryBuilder.- Specified by:
taskQueryin interfaceTaskOperations- Returns:
- a new
TaskQueryBuilder
-
clearCompletedTasks
public void clearCompletedTasks(TaskList taskList)
Description copied from interface:TaskOperationsHides completed tasks from a task list. Hidden tasks can be retrieved usingTaskQueryBuilder.includeHidden(boolean).- Specified by:
clearCompletedTasksin interfaceTaskOperations- Parameters:
taskList- the task list to clear
-
-