Google Tasks API PHP:如何在任务列表中完成已完成的任务?

How to get the completed tasks in a tasklist? I have tried the following:

  • $serviceTasks->tasks->clearTasks($listId);

    Call to undefined method Google_Service_Tasks_Resource_Tasks::clearTasks()
    
  • $tasks = $serviceTasks->tasks->listTasks($listId); foreach ($tasks->getItems() as $task) { var_dump($task->getHidden()); }

This return NULL for each task not completed. Completed tasks in this tasklist are not iterated in this loop.

  • $tasks = $serviceTasks->tasks->listTasks($listId); foreach ($tasks->getItems() as $task) { var_dump($task->getCompleted()); }

This return NULL for each task not completed. Completed tasks in this tasklist are not iterated in this loop.

  • $tasks = $serviceTasks->tasks->listTasks($listId); foreach ($tasks->getItems() as $task) { var_dump($task->getStatus()); }

This return needsAction for each task not completed. Completed tasks in this tasklist are not iterated in this loop.

Question: Only the not-completed tasks are considered. In fact, in the reference we read:

Tasks: clear

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.

How to get the completed tasks in a tasklist?

Thank you