PluginProbe
Gianism / 1.1
Gianism v1.1
4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.4.0 5.0.0 5.0.1 5.0.2 5.1.0 5.2.1 5.2.2 5.3.0 6.0.0 6.0.1 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 All 65 releases
gianism / sdks / google / contrib / apiTasksService.php

apiTasksService.php in Gianism 1.1, at sdks/google/contrib/apiTasksService.php

572 lines 22.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * Copyright (c) 2010 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
18 require_once 'service/apiModel.php';
19 require_once 'service/apiService.php';
20 require_once 'service/apiServiceRequest.php';
21
22
23 /**
24 * The "tasks" collection of methods.
25 * Typical usage is:
26 * <code>
27 * $tasksService = new apiTasksService(...);
28 * $tasks = $tasksService->tasks;
29 * </code>
30 */
31 class TasksServiceResource extends apiServiceResource {
32
33
34 /**
35 * Creates a new task on the specified task list. (tasks.insert)
36 *
37 * @param string $tasklist Task list identifier.
38 * @param Task $postBody
39 * @param array $optParams Optional parameters. Valid optional parameters are listed below.
40 *
41 * @opt_param string parent Parent task identifier. If the task is created at the top level, this parameter is omitted. Optional.
42 * @opt_param string previous Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted. Optional.
43 * @return Task
44 */
45 public function insert($tasklist, Task $postBody, $optParams = array()) {
46 $params = array('tasklist' => $tasklist, 'postBody' => $postBody);
47 $params = array_merge($params, $optParams);
48 $data = $this->__call('insert', array($params));
49 if ($this->useObjects()) {
50 return new Task($data);
51 } else {
52 return $data;
53 }
54 }
55 /**
56 * Returns the specified task. (tasks.get)
57 *
58 * @param string $tasklist Task list identifier.
59 * @param string $task Task identifier.
60 * @return Task
61 */
62 public function get($tasklist, $task, $optParams = array()) {
63 $params = array('tasklist' => $tasklist, 'task' => $task);
64 $params = array_merge($params, $optParams);
65 $data = $this->__call('get', array($params));
66 if ($this->useObjects()) {
67 return new Task($data);
68 } else {
69 return $data;
70 }
71 }
72 /**
73 * Clears all completed tasks from the specified task list. The affected tasks will be marked as
74 * 'hidden' and no longer be returned by default when retrieving all tasks for a task list.
75 * (tasks.clear)
76 *
77 * @param string $tasklist Task list identifier.
78 */
79 public function clear($tasklist, $optParams = array()) {
80 $params = array('tasklist' => $tasklist);
81 $params = array_merge($params, $optParams);
82 $data = $this->__call('clear', array($params));
83 return $data;
84 }
85 /**
86 * Moves the specified task to another position in the task list. This can include putting it as a
87 * child task under a new parent and/or move it to a different position among its sibling tasks.
88 * (tasks.move)
89 *
90 * @param string $tasklist Task list identifier.
91 * @param string $task Task identifier.
92 * @param array $optParams Optional parameters. Valid optional parameters are listed below.
93 *
94 * @opt_param string parent New parent task identifier. If the task is moved to the top level, this parameter is omitted. Optional.
95 * @opt_param string previous New previous sibling task identifier. If the task is moved to the first position among its siblings, this parameter is omitted. Optional.
96 * @return Task
97 */
98 public function move($tasklist, $task, $optParams = array()) {
99 $params = array('tasklist' => $tasklist, 'task' => $task);
100 $params = array_merge($params, $optParams);
101 $data = $this->__call('move', array($params));
102 if ($this->useObjects()) {
103 return new Task($data);
104 } else {
105 return $data;
106 }
107 }
108 /**
109 * Returns all tasks in the specified task list. (tasks.list)
110 *
111 * @param string $tasklist Task list identifier.
112 * @param array $optParams Optional parameters. Valid optional parameters are listed below.
113 *
114 * @opt_param string dueMax Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date.
115 * @opt_param bool showDeleted Flag indicating whether deleted tasks are returned in the result. Optional. The default is False.
116 * @opt_param string updatedMin Lower bound for a task's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time.
117 * @opt_param string completedMin Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date.
118 * @opt_param string maxResults Maximum number of task lists returned on one page. Optional. The default is 100.
119 * @opt_param bool showCompleted Flag indicating whether completed tasks are returned in the result. Optional. The default is True.
120 * @opt_param string pageToken Token specifying the result page to return. Optional.
121 * @opt_param string completedMax Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date.
122 * @opt_param bool showHidden Flag indicating whether hidden tasks are returned in the result. Optional. The default is False.
123 * @opt_param string dueMin Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date.
124 * @return Tasks
125 */
126 public function listTasks($tasklist, $optParams = array()) {
127 $params = array('tasklist' => $tasklist);
128 $params = array_merge($params, $optParams);
129 $data = $this->__call('list', array($params));
130 if ($this->useObjects()) {
131 return new Tasks($data);
132 } else {
133 return $data;
134 }
135 }
136 /**
137 * Updates the specified task. (tasks.update)
138 *
139 * @param string $tasklist Task list identifier.
140 * @param string $task Task identifier.
141 * @param Task $postBody
142 * @return Task
143 */
144 public function update($tasklist, $task, Task $postBody, $optParams = array()) {
145 $params = array('tasklist' => $tasklist, 'task' => $task, 'postBody' => $postBody);
146 $params = array_merge($params, $optParams);
147 $data = $this->__call('update', array($params));
148 if ($this->useObjects()) {
149 return new Task($data);
150 } else {
151 return $data;
152 }
153 }
154 /**
155 * Updates the specified task. This method supports patch semantics. (tasks.patch)
156 *
157 * @param string $tasklist Task list identifier.
158 * @param string $task Task identifier.
159 * @param Task $postBody
160 * @return Task
161 */
162 public function patch($tasklist, $task, Task $postBody, $optParams = array()) {
163 $params = array('tasklist' => $tasklist, 'task' => $task, 'postBody' => $postBody);
164 $params = array_merge($params, $optParams);
165 $data = $this->__call('patch', array($params));
166 if ($this->useObjects()) {
167 return new Task($data);
168 } else {
169 return $data;
170 }
171 }
172 /**
173 * Deletes the specified task from the task list. (tasks.delete)
174 *
175 * @param string $tasklist Task list identifier.
176 * @param string $task Task identifier.
177 */
178 public function delete($tasklist, $task, $optParams = array()) {
179 $params = array('tasklist' => $tasklist, 'task' => $task);
180 $params = array_merge($params, $optParams);
181 $data = $this->__call('delete', array($params));
182 return $data;
183 }
184 }
185
186 /**
187 * The "tasklists" collection of methods.
188 * Typical usage is:
189 * <code>
190 * $tasksService = new apiTasksService(...);
191 * $tasklists = $tasksService->tasklists;
192 * </code>
193 */
194 class TasklistsServiceResource extends apiServiceResource {
195
196
197 /**
198 * Creates a new task list and adds it to the authenticated user's task lists. (tasklists.insert)
199 *
200 * @param TaskList $postBody
201 * @return TaskList
202 */
203 public function insert(TaskList $postBody, $optParams = array()) {
204 $params = array('postBody' => $postBody);
205 $params = array_merge($params, $optParams);
206 $data = $this->__call('insert', array($params));
207 if ($this->useObjects()) {
208 return new TaskList($data);
209 } else {
210 return $data;
211 }
212 }
213 /**
214 * Returns the authenticated user's specified task list. (tasklists.get)
215 *
216 * @param string $tasklist Task list identifier.
217 * @return TaskList
218 */
219 public function get($tasklist, $optParams = array()) {
220 $params = array('tasklist' => $tasklist);
221 $params = array_merge($params, $optParams);
222 $data = $this->__call('get', array($params));
223 if ($this->useObjects()) {
224 return new TaskList($data);
225 } else {
226 return $data;
227 }
228 }
229 /**
230 * Returns all the authenticated user's task lists. (tasklists.list)
231 *
232 * @param array $optParams Optional parameters. Valid optional parameters are listed below.
233 *
234 * @opt_param string pageToken Token specifying the result page to return. Optional.
235 * @opt_param string maxResults Maximum number of task lists returned on one page. Optional. The default is 100.
236 * @return TaskLists
237 */
238 public function listTasklists($optParams = array()) {
239 $params = array();
240 $params = array_merge($params, $optParams);
241 $data = $this->__call('list', array($params));
242 if ($this->useObjects()) {
243 return new TaskLists($data);
244 } else {
245 return $data;
246 }
247 }
248 /**
249 * Updates the authenticated user's specified task list. (tasklists.update)
250 *
251 * @param string $tasklist Task list identifier.
252 * @param TaskList $postBody
253 * @return TaskList
254 */
255 public function update($tasklist, TaskList $postBody, $optParams = array()) {
256 $params = array('tasklist' => $tasklist, 'postBody' => $postBody);
257 $params = array_merge($params, $optParams);
258 $data = $this->__call('update', array($params));
259 if ($this->useObjects()) {
260 return new TaskList($data);
261 } else {
262 return $data;
263 }
264 }
265 /**
266 * Updates the authenticated user's specified task list. This method supports patch semantics.
267 * (tasklists.patch)
268 *
269 * @param string $tasklist Task list identifier.
270 * @param TaskList $postBody
271 * @return TaskList
272 */
273 public function patch($tasklist, TaskList $postBody, $optParams = array()) {
274 $params = array('tasklist' => $tasklist, 'postBody' => $postBody);
275 $params = array_merge($params, $optParams);
276 $data = $this->__call('patch', array($params));
277 if ($this->useObjects()) {
278 return new TaskList($data);
279 } else {
280 return $data;
281 }
282 }
283 /**
284 * Deletes the authenticated user's specified task list. (tasklists.delete)
285 *
286 * @param string $tasklist Task list identifier.
287 */
288 public function delete($tasklist, $optParams = array()) {
289 $params = array('tasklist' => $tasklist);
290 $params = array_merge($params, $optParams);
291 $data = $this->__call('delete', array($params));
292 return $data;
293 }
294 }
295
296
297
298 /**
299 * Service definition for Tasks (v1).
300 *
301 * <p>
302 * Lets you manage your tasks and task lists.
303 * </p>
304 *
305 * <p>
306 * For more information about this service, see the
307 * <a href="http://code.google.com/apis/tasks/v1/using.html" target="_blank">API Documentation</a>
308 * </p>
309 *
310 * @author Google, Inc.
311 */
312 class apiTasksService extends apiService {
313 public $tasks;
314 public $tasklists;
315 /**
316 * Constructs the internal representation of the Tasks service.
317 *
318 * @param apiClient apiClient
319 */
320 public function __construct(apiClient $apiClient) {
321 $this->rpcPath = '/rpc';
322 $this->restBasePath = '/tasks/v1/';
323 $this->version = 'v1';
324 $this->serviceName = 'tasks';
325
326 $apiClient->addService($this->serviceName, $this->version);
327 $this->tasks = new TasksServiceResource($this, $this->serviceName, 'tasks', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "parent": {"type": "string", "location": "query"}, "previous": {"type": "string", "location": "query"}}, "request": {"$ref": "Task"}, "id": "tasks.tasks.insert", "httpMethod": "POST", "path": "lists/{tasklist}/tasks", "response": {"$ref": "Task"}}, "get": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "id": "tasks.tasks.get", "httpMethod": "GET", "path": "lists/{tasklist}/tasks/{task}", "response": {"$ref": "Task"}}, "clear": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "POST", "path": "lists/{tasklist}/clear", "id": "tasks.tasks.clear"}, "move": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"previous": {"type": "string", "location": "query"}, "tasklist": {"required": true, "type": "string", "location": "path"}, "parent": {"type": "string", "location": "query"}, "task": {"required": true, "type": "string", "location": "path"}}, "id": "tasks.tasks.move", "httpMethod": "POST", "path": "lists/{tasklist}/tasks/{task}/move", "response": {"$ref": "Task"}}, "list": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"dueMax": {"type": "string", "location": "query"}, "tasklist": {"required": true, "type": "string", "location": "path"}, "pageToken": {"type": "string", "location": "query"}, "updatedMin": {"type": "string", "location": "query"}, "completedMin": {"type": "string", "location": "query"}, "maxResults": {"format": "int64", "type": "string", "location": "query"}, "showCompleted": {"type": "boolean", "location": "query"}, "showDeleted": {"type": "boolean", "location": "query"}, "completedMax": {"type": "string", "location": "query"}, "showHidden": {"type": "boolean", "location": "query"}, "dueMin": {"type": "string", "location": "query"}}, "id": "tasks.tasks.list", "httpMethod": "GET", "path": "lists/{tasklist}/tasks", "response": {"$ref": "Tasks"}}, "update": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Task"}, "id": "tasks.tasks.update", "httpMethod": "PUT", "path": "lists/{tasklist}/tasks/{task}", "response": {"$ref": "Task"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Task"}, "id": "tasks.tasks.patch", "httpMethod": "PATCH", "path": "lists/{tasklist}/tasks/{task}", "response": {"$ref": "Task"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "lists/{tasklist}/tasks/{task}", "id": "tasks.tasks.delete"}}}', true));
328 $this->tasklists = new TasklistsServiceResource($this, $this->serviceName, 'tasklists', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/tasks"], "request": {"$ref": "TaskList"}, "response": {"$ref": "TaskList"}, "httpMethod": "POST", "path": "users/@me/lists", "id": "tasks.tasklists.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "id": "tasks.tasklists.get", "httpMethod": "GET", "path": "users/@me/lists/{tasklist}", "response": {"$ref": "TaskList"}}, "list": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"format": "int64", "type": "string", "location": "query"}}, "response": {"$ref": "TaskLists"}, "httpMethod": "GET", "path": "users/@me/lists", "id": "tasks.tasklists.list"}, "update": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "TaskList"}, "id": "tasks.tasklists.update", "httpMethod": "PUT", "path": "users/@me/lists/{tasklist}", "response": {"$ref": "TaskList"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "TaskList"}, "id": "tasks.tasklists.patch", "httpMethod": "PATCH", "path": "users/@me/lists/{tasklist}", "response": {"$ref": "TaskList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "users/@me/lists/{tasklist}", "id": "tasks.tasklists.delete"}}}', true));
329 }
330 }
331
332 class Task extends apiModel {
333 public $status;
334 public $kind;
335 public $updated;
336 public $parent;
337 protected $__linksType = 'TaskLinks';
338 protected $__linksDataType = 'array';
339 public $links;
340 public $title;
341 public $deleted;
342 public $completed;
343 public $due;
344 public $etag;
345 public $notes;
346 public $position;
347 public $hidden;
348 public $id;
349 public $selfLink;
350 public function setStatus($status) {
351 $this->status = $status;
352 }
353 public function getStatus() {
354 return $this->status;
355 }
356 public function setKind($kind) {
357 $this->kind = $kind;
358 }
359 public function getKind() {
360 return $this->kind;
361 }
362 public function setUpdated($updated) {
363 $this->updated = $updated;
364 }
365 public function getUpdated() {
366 return $this->updated;
367 }
368 public function setParent($parent) {
369 $this->parent = $parent;
370 }
371 public function getParent() {
372 return $this->parent;
373 }
374 public function setLinks(/* array(TaskLinks) */ $links) {
375 $this->assertIsArray($links, 'TaskLinks', __METHOD__);
376 $this->links = $links;
377 }
378 public function getLinks() {
379 return $this->links;
380 }
381 public function setTitle($title) {
382 $this->title = $title;
383 }
384 public function getTitle() {
385 return $this->title;
386 }
387 public function setDeleted($deleted) {
388 $this->deleted = $deleted;
389 }
390 public function getDeleted() {
391 return $this->deleted;
392 }
393 public function setCompleted($completed) {
394 $this->completed = $completed;
395 }
396 public function getCompleted() {
397 return $this->completed;
398 }
399 public function setDue($due) {
400 $this->due = $due;
401 }
402 public function getDue() {
403 return $this->due;
404 }
405 public function setEtag($etag) {
406 $this->etag = $etag;
407 }
408 public function getEtag() {
409 return $this->etag;
410 }
411 public function setNotes($notes) {
412 $this->notes = $notes;
413 }
414 public function getNotes() {
415 return $this->notes;
416 }
417 public function setPosition($position) {
418 $this->position = $position;
419 }
420 public function getPosition() {
421 return $this->position;
422 }
423 public function setHidden($hidden) {
424 $this->hidden = $hidden;
425 }
426 public function getHidden() {
427 return $this->hidden;
428 }
429 public function setId($id) {
430 $this->id = $id;
431 }
432 public function getId() {
433 return $this->id;
434 }
435 public function setSelfLink($selfLink) {
436 $this->selfLink = $selfLink;
437 }
438 public function getSelfLink() {
439 return $this->selfLink;
440 }
441 }
442
443 class TaskLinks extends apiModel {
444 public $type;
445 public $link;
446 public $description;
447 public function setType($type) {
448 $this->type = $type;
449 }
450 public function getType() {
451 return $this->type;
452 }
453 public function setLink($link) {
454 $this->link = $link;
455 }
456 public function getLink() {
457 return $this->link;
458 }
459 public function setDescription($description) {
460 $this->description = $description;
461 }
462 public function getDescription() {
463 return $this->description;
464 }
465 }
466
467 class TaskList extends apiModel {
468 public $kind;
469 public $etag;
470 public $id;
471 public $selfLink;
472 public $title;
473 public function setKind($kind) {
474 $this->kind = $kind;
475 }
476 public function getKind() {
477 return $this->kind;
478 }
479 public function setEtag($etag) {
480 $this->etag = $etag;
481 }
482 public function getEtag() {
483 return $this->etag;
484 }
485 public function setId($id) {
486 $this->id = $id;
487 }
488 public function getId() {
489 return $this->id;
490 }
491 public function setSelfLink($selfLink) {
492 $this->selfLink = $selfLink;
493 }
494 public function getSelfLink() {
495 return $this->selfLink;
496 }
497 public function setTitle($title) {
498 $this->title = $title;
499 }
500 public function getTitle() {
501 return $this->title;
502 }
503 }
504
505 class TaskLists extends apiModel {
506 public $nextPageToken;
507 protected $__itemsType = 'TaskList';
508 protected $__itemsDataType = 'array';
509 public $items;
510 public $kind;
511 public $etag;
512 public function setNextPageToken($nextPageToken) {
513 $this->nextPageToken = $nextPageToken;
514 }
515 public function getNextPageToken() {
516 return $this->nextPageToken;
517 }
518 public function setItems(/* array(TaskList) */ $items) {
519 $this->assertIsArray($items, 'TaskList', __METHOD__);
520 $this->items = $items;
521 }
522 public function getItems() {
523 return $this->items;
524 }
525 public function setKind($kind) {
526 $this->kind = $kind;
527 }
528 public function getKind() {
529 return $this->kind;
530 }
531 public function setEtag($etag) {
532 $this->etag = $etag;
533 }
534 public function getEtag() {
535 return $this->etag;
536 }
537 }
538
539 class Tasks extends apiModel {
540 public $nextPageToken;
541 protected $__itemsType = 'Task';
542 protected $__itemsDataType = 'array';
543 public $items;
544 public $kind;
545 public $etag;
546 public function setNextPageToken($nextPageToken) {
547 $this->nextPageToken = $nextPageToken;
548 }
549 public function getNextPageToken() {
550 return $this->nextPageToken;
551 }
552 public function setItems(/* array(Task) */ $items) {
553 $this->assertIsArray($items, 'Task', __METHOD__);
554 $this->items = $items;
555 }
556 public function getItems() {
557 return $this->items;
558 }
559 public function setKind($kind) {
560 $this->kind = $kind;
561 }
562 public function getKind() {
563 return $this->kind;
564 }
565 public function setEtag($etag) {
566 $this->etag = $etag;
567 }
568 public function getEtag() {
569 return $this->etag;
570 }
571 }
572