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;
19
20use Google\Client;
21
22/**
23 * Service definition for Tasks (v1).
24 *
25 * <p>
26 * The Google Tasks API lets you manage your tasks and task lists.</p>
27 *
28 * <p>
29 * For more information about this service, see the API
30 * <a href="https://developers.google.com/tasks/" target="_blank">Documentation</a>
31 * </p>
32 *
33 * @author Google, Inc.
34 */
35class Tasks extends \Google\Service
36{
37  /** Create, edit, organize, and delete all your tasks. */
38  const TASKS =
39      "https://www.googleapis.com/auth/tasks";
40  /** View your tasks. */
41  const TASKS_READONLY =
42      "https://www.googleapis.com/auth/tasks.readonly";
43
44  public $tasklists;
45  public $tasks;
46
47  /**
48   * Constructs the internal representation of the Tasks service.
49   *
50   * @param Client|array $clientOrConfig The client used to deliver requests, or a
51   *                                     config array to pass to a new Client instance.
52   * @param string $rootUrl The root URL used for requests to the service.
53   */
54  public function __construct($clientOrConfig = [], $rootUrl = null)
55  {
56    parent::__construct($clientOrConfig);
57    $this->rootUrl = $rootUrl ?: 'https://tasks.googleapis.com/';
58    $this->servicePath = '';
59    $this->batchPath = 'batch';
60    $this->version = 'v1';
61    $this->serviceName = 'tasks';
62
63    $this->tasklists = new Tasks\Resource\Tasklists(
64        $this,
65        $this->serviceName,
66        'tasklists',
67        [
68          'methods' => [
69            'delete' => [
70              'path' => 'tasks/v1/users/@me/lists/{tasklist}',
71              'httpMethod' => 'DELETE',
72              'parameters' => [
73                'tasklist' => [
74                  'location' => 'path',
75                  'type' => 'string',
76                  'required' => true,
77                ],
78              ],
79            ],'get' => [
80              'path' => 'tasks/v1/users/@me/lists/{tasklist}',
81              'httpMethod' => 'GET',
82              'parameters' => [
83                'tasklist' => [
84                  'location' => 'path',
85                  'type' => 'string',
86                  'required' => true,
87                ],
88              ],
89            ],'insert' => [
90              'path' => 'tasks/v1/users/@me/lists',
91              'httpMethod' => 'POST',
92              'parameters' => [],
93            ],'list' => [
94              'path' => 'tasks/v1/users/@me/lists',
95              'httpMethod' => 'GET',
96              'parameters' => [
97                'maxResults' => [
98                  'location' => 'query',
99                  'type' => 'integer',
100                ],
101                'pageToken' => [
102                  'location' => 'query',
103                  'type' => 'string',
104                ],
105              ],
106            ],'patch' => [
107              'path' => 'tasks/v1/users/@me/lists/{tasklist}',
108              'httpMethod' => 'PATCH',
109              'parameters' => [
110                'tasklist' => [
111                  'location' => 'path',
112                  'type' => 'string',
113                  'required' => true,
114                ],
115              ],
116            ],'update' => [
117              'path' => 'tasks/v1/users/@me/lists/{tasklist}',
118              'httpMethod' => 'PUT',
119              'parameters' => [
120                'tasklist' => [
121                  'location' => 'path',
122                  'type' => 'string',
123                  'required' => true,
124                ],
125              ],
126            ],
127          ]
128        ]
129    );
130    $this->tasks = new Tasks\Resource\Tasks(
131        $this,
132        $this->serviceName,
133        'tasks',
134        [
135          'methods' => [
136            'clear' => [
137              'path' => 'tasks/v1/lists/{tasklist}/clear',
138              'httpMethod' => 'POST',
139              'parameters' => [
140                'tasklist' => [
141                  'location' => 'path',
142                  'type' => 'string',
143                  'required' => true,
144                ],
145              ],
146            ],'delete' => [
147              'path' => 'tasks/v1/lists/{tasklist}/tasks/{task}',
148              'httpMethod' => 'DELETE',
149              'parameters' => [
150                'tasklist' => [
151                  'location' => 'path',
152                  'type' => 'string',
153                  'required' => true,
154                ],
155                'task' => [
156                  'location' => 'path',
157                  'type' => 'string',
158                  'required' => true,
159                ],
160              ],
161            ],'get' => [
162              'path' => 'tasks/v1/lists/{tasklist}/tasks/{task}',
163              'httpMethod' => 'GET',
164              'parameters' => [
165                'tasklist' => [
166                  'location' => 'path',
167                  'type' => 'string',
168                  'required' => true,
169                ],
170                'task' => [
171                  'location' => 'path',
172                  'type' => 'string',
173                  'required' => true,
174                ],
175              ],
176            ],'insert' => [
177              'path' => 'tasks/v1/lists/{tasklist}/tasks',
178              'httpMethod' => 'POST',
179              'parameters' => [
180                'tasklist' => [
181                  'location' => 'path',
182                  'type' => 'string',
183                  'required' => true,
184                ],
185                'parent' => [
186                  'location' => 'query',
187                  'type' => 'string',
188                ],
189                'previous' => [
190                  'location' => 'query',
191                  'type' => 'string',
192                ],
193              ],
194            ],'list' => [
195              'path' => 'tasks/v1/lists/{tasklist}/tasks',
196              'httpMethod' => 'GET',
197              'parameters' => [
198                'tasklist' => [
199                  'location' => 'path',
200                  'type' => 'string',
201                  'required' => true,
202                ],
203                'completedMax' => [
204                  'location' => 'query',
205                  'type' => 'string',
206                ],
207                'completedMin' => [
208                  'location' => 'query',
209                  'type' => 'string',
210                ],
211                'dueMax' => [
212                  'location' => 'query',
213                  'type' => 'string',
214                ],
215                'dueMin' => [
216                  'location' => 'query',
217                  'type' => 'string',
218                ],
219                'maxResults' => [
220                  'location' => 'query',
221                  'type' => 'integer',
222                ],
223                'pageToken' => [
224                  'location' => 'query',
225                  'type' => 'string',
226                ],
227                'showCompleted' => [
228                  'location' => 'query',
229                  'type' => 'boolean',
230                ],
231                'showDeleted' => [
232                  'location' => 'query',
233                  'type' => 'boolean',
234                ],
235                'showHidden' => [
236                  'location' => 'query',
237                  'type' => 'boolean',
238                ],
239                'updatedMin' => [
240                  'location' => 'query',
241                  'type' => 'string',
242                ],
243              ],
244            ],'move' => [
245              'path' => 'tasks/v1/lists/{tasklist}/tasks/{task}/move',
246              'httpMethod' => 'POST',
247              'parameters' => [
248                'tasklist' => [
249                  'location' => 'path',
250                  'type' => 'string',
251                  'required' => true,
252                ],
253                'task' => [
254                  'location' => 'path',
255                  'type' => 'string',
256                  'required' => true,
257                ],
258                'parent' => [
259                  'location' => 'query',
260                  'type' => 'string',
261                ],
262                'previous' => [
263                  'location' => 'query',
264                  'type' => 'string',
265                ],
266              ],
267            ],'patch' => [
268              'path' => 'tasks/v1/lists/{tasklist}/tasks/{task}',
269              'httpMethod' => 'PATCH',
270              'parameters' => [
271                'tasklist' => [
272                  'location' => 'path',
273                  'type' => 'string',
274                  'required' => true,
275                ],
276                'task' => [
277                  'location' => 'path',
278                  'type' => 'string',
279                  'required' => true,
280                ],
281              ],
282            ],'update' => [
283              'path' => 'tasks/v1/lists/{tasklist}/tasks/{task}',
284              'httpMethod' => 'PUT',
285              'parameters' => [
286                'tasklist' => [
287                  'location' => 'path',
288                  'type' => 'string',
289                  'required' => true,
290                ],
291                'task' => [
292                  'location' => 'path',
293                  'type' => 'string',
294                  'required' => true,
295                ],
296              ],
297            ],
298          ]
299        ]
300    );
301  }
302}
303
304// Adding a class alias for backwards compatibility with the previous class name.
305class_alias(Tasks::class, 'Google_Service_Tasks');
306