class Tasks extends Resource (View source)

The "tasks" collection of methods.

Typical usage is:

 $tasksService = new Google\Service\Tasks(...);
 $tasks = $tasksService->tasks;

Methods

clear(string $tasklist, array $optParams = [])

Clears all completed tasks from the specified task list. The affected tasks will be marked as 'hidden' and no longer be returned by default when retrieving all tasks for a task list. (tasks.clear)

delete(string $tasklist, string $task, array $optParams = [])

Deletes the specified task from the task list. If the task is assigned, both the assigned task and the original task (in Docs, Chat Spaces) are deleted.

get(string $tasklist, string $task, array $optParams = [])

Returns the specified task. (tasks.get)

insert(string $tasklist, Task $postBody, array $optParams = [])

Creates a new task on the specified task list. Tasks assigned from Docs or Chat Spaces cannot be inserted from Tasks Public API; they can only be created by assigning them from Docs or Chat Spaces. A user can have up to 20,000 non-hidden tasks per list and up to 100,000 tasks in total at a time.

listTasks(string $tasklist, array $optParams = [])

Returns all tasks in the specified task list. Does not return assigned tasks be default (from Docs, Chat Spaces). A user can have up to 20,000 non-hidden tasks per list and up to 100,000 tasks in total at a time. (tasks.listTasks)

move(string $tasklist, string $task, array $optParams = [])

Moves the specified task to another position in the destination task list. If the destination list is not specified, the task is moved within its current list. This can include putting it as a child task under a new parent and/or move it to a different position among its sibling tasks. A user can have up to 2,000 subtasks per task. (tasks.move)

patch(string $tasklist, string $task, Task $postBody, array $optParams = [])

Updates the specified task. This method supports patch semantics.

update(string $tasklist, string $task, Task $postBody, array $optParams = [])

Updates the specified task. (tasks.update)

Details

clear(string $tasklist, array $optParams = [])

Clears all completed tasks from the specified task list. The affected tasks will be marked as 'hidden' and no longer be returned by default when retrieving all tasks for a task list. (tasks.clear)

Parameters

string $tasklist

Task list identifier.

array $optParams

Optional parameters.

Exceptions

Exception

delete(string $tasklist, string $task, array $optParams = [])

Deletes the specified task from the task list. If the task is assigned, both the assigned task and the original task (in Docs, Chat Spaces) are deleted.

To delete the assigned task only, navigate to the assignment surface and unassign the task from there. (tasks.delete)

Parameters

string $tasklist

Task list identifier.

string $task

Task identifier.

array $optParams

Optional parameters.

Exceptions

Exception

Task get(string $tasklist, string $task, array $optParams = [])

Returns the specified task. (tasks.get)

Parameters

string $tasklist

Task list identifier.

string $task

Task identifier.

array $optParams

Optional parameters.

Return Value

Task

Exceptions

Exception

Task insert(string $tasklist, Task $postBody, array $optParams = [])

Creates a new task on the specified task list. Tasks assigned from Docs or Chat Spaces cannot be inserted from Tasks Public API; they can only be created by assigning them from Docs or Chat Spaces. A user can have up to 20,000 non-hidden tasks per list and up to 100,000 tasks in total at a time.

(tasks.insert)

Parameters

string $tasklist

Task list identifier.

Task $postBody
array $optParams

Optional parameters.

Return Value

Task

Exceptions

Exception

Tasks listTasks(string $tasklist, array $optParams = [])

Returns all tasks in the specified task list. Does not return assigned tasks be default (from Docs, Chat Spaces). A user can have up to 20,000 non-hidden tasks per list and up to 100,000 tasks in total at a time. (tasks.listTasks)

Parameters

string $tasklist

Task list identifier.

array $optParams

Optional parameters.

Return Value

Tasks

Exceptions

Exception

Task move(string $tasklist, string $task, array $optParams = [])

Moves the specified task to another position in the destination task list. If the destination list is not specified, the task is moved within its current list. This can include putting it as a child task under a new parent and/or move it to a different position among its sibling tasks. A user can have up to 2,000 subtasks per task. (tasks.move)

Parameters

string $tasklist

Task list identifier.

string $task

Task identifier.

array $optParams

Optional parameters.

Return Value

Task

Exceptions

Exception

Task patch(string $tasklist, string $task, Task $postBody, array $optParams = [])

Updates the specified task. This method supports patch semantics.

(tasks.patch)

Parameters

string $tasklist

Task list identifier.

string $task

Task identifier.

Task $postBody
array $optParams

Optional parameters.

Return Value

Task

Exceptions

Exception

Task update(string $tasklist, string $task, Task $postBody, array $optParams = [])

Updates the specified task. (tasks.update)

Parameters

string $tasklist

Task list identifier.

string $task

Task identifier.

Task $postBody
array $optParams

Optional parameters.

Return Value

Task

Exceptions

Exception