1<?php 2/* 3 * Copyright 2014 Google Inc. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 * use this file except in compliance with the License. You may obtain a copy of 7 * the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 * License for the specific language governing permissions and limitations under 15 * the License. 16 */ 17 18namespace Google\Service\Tasks\Resource; 19 20use Google\Service\Tasks\TaskList; 21use Google\Service\Tasks\TaskLists as TaskListsModel; 22 23/** 24 * The "tasklists" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $tasksService = new Google\Service\Tasks(...); 28 * $tasklists = $tasksService->tasklists; 29 * </code> 30 */ 31class Tasklists extends \Google\Service\Resource 32{ 33 /** 34 * Deletes the authenticated user's specified task list. (tasklists.delete) 35 * 36 * @param string $tasklist Task list identifier. 37 * @param array $optParams Optional parameters. 38 */ 39 public function delete($tasklist, $optParams = []) 40 { 41 $params = ['tasklist' => $tasklist]; 42 $params = array_merge($params, $optParams); 43 return $this->call('delete', [$params]); 44 } 45 /** 46 * Returns the authenticated user's specified task list. (tasklists.get) 47 * 48 * @param string $tasklist Task list identifier. 49 * @param array $optParams Optional parameters. 50 * @return TaskList 51 */ 52 public function get($tasklist, $optParams = []) 53 { 54 $params = ['tasklist' => $tasklist]; 55 $params = array_merge($params, $optParams); 56 return $this->call('get', [$params], TaskList::class); 57 } 58 /** 59 * Creates a new task list and adds it to the authenticated user's task lists. 60 * (tasklists.insert) 61 * 62 * @param TaskList $postBody 63 * @param array $optParams Optional parameters. 64 * @return TaskList 65 */ 66 public function insert(TaskList $postBody, $optParams = []) 67 { 68 $params = ['postBody' => $postBody]; 69 $params = array_merge($params, $optParams); 70 return $this->call('insert', [$params], TaskList::class); 71 } 72 /** 73 * Returns all the authenticated user's task lists. (tasklists.listTasklists) 74 * 75 * @param array $optParams Optional parameters. 76 * 77 * @opt_param int maxResults Maximum number of task lists returned on one page. 78 * Optional. The default is 20 (max allowed: 100). 79 * @opt_param string pageToken Token specifying the result page to return. 80 * Optional. 81 * @return TaskListsModel 82 */ 83 public function listTasklists($optParams = []) 84 { 85 $params = []; 86 $params = array_merge($params, $optParams); 87 return $this->call('list', [$params], TaskListsModel::class); 88 } 89 /** 90 * Updates the authenticated user's specified task list. This method supports 91 * patch semantics. (tasklists.patch) 92 * 93 * @param string $tasklist Task list identifier. 94 * @param TaskList $postBody 95 * @param array $optParams Optional parameters. 96 * @return TaskList 97 */ 98 public function patch($tasklist, TaskList $postBody, $optParams = []) 99 { 100 $params = ['tasklist' => $tasklist, 'postBody' => $postBody]; 101 $params = array_merge($params, $optParams); 102 return $this->call('patch', [$params], TaskList::class); 103 } 104 /** 105 * Updates the authenticated user's specified task list. (tasklists.update) 106 * 107 * @param string $tasklist Task list identifier. 108 * @param TaskList $postBody 109 * @param array $optParams Optional parameters. 110 * @return TaskList 111 */ 112 public function update($tasklist, TaskList $postBody, $optParams = []) 113 { 114 $params = ['tasklist' => $tasklist, 'postBody' => $postBody]; 115 $params = array_merge($params, $optParams); 116 return $this->call('update', [$params], TaskList::class); 117 } 118} 119 120// Adding a class alias for backwards compatibility with the previous class name. 121class_alias(Tasklists::class, 'Google_Service_Tasks_Resource_Tasklists'); 122