Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402]

   1  <?php
   2  /*
   3   * Copyright 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  /**
  19   * Service definition for Taskqueue (v1beta2).
  20   *
  21   * <p>
  22   * Lets you access a Google App Engine Pull Task Queue over REST.</p>
  23   *
  24   * <p>
  25   * For more information about this service, see the API
  26   * <a href="https://developers.google.com/appengine/docs/python/taskqueue/rest" target="_blank">Documentation</a>
  27   * </p>
  28   *
  29   * @author Google, Inc.
  30   */
  31  #[AllowDynamicProperties]
  32  class Google_Service_Taskqueue extends Google_Service
  33  {
  34    /** Manage your Tasks and Taskqueues. */
  35    const TASKQUEUE =
  36        "https://www.googleapis.com/auth/taskqueue";
  37    /** Consume Tasks from your Taskqueues. */
  38    const TASKQUEUE_CONSUMER =
  39        "https://www.googleapis.com/auth/taskqueue.consumer";
  40  
  41    public $taskqueues;
  42    public $tasks;
  43    
  44  
  45    /**
  46     * Constructs the internal representation of the Taskqueue service.
  47     *
  48     * @param Google_Client $client
  49     */
  50    public function __construct(Google_Client $client)
  51    {
  52      parent::__construct($client);
  53      $this->rootUrl = 'https://www.googleapis.com/';
  54      $this->servicePath = 'taskqueue/v1beta2/projects/';
  55      $this->version = 'v1beta2';
  56      $this->serviceName = 'taskqueue';
  57  
  58      $this->taskqueues = new Google_Service_Taskqueue_Taskqueues_Resource(
  59          $this,
  60          $this->serviceName,
  61          'taskqueues',
  62          array(
  63            'methods' => array(
  64              'get' => array(
  65                'path' => '{project}/taskqueues/{taskqueue}',
  66                'httpMethod' => 'GET',
  67                'parameters' => array(
  68                  'project' => array(
  69                    'location' => 'path',
  70                    'type' => 'string',
  71                    'required' => true,
  72                  ),
  73                  'taskqueue' => array(
  74                    'location' => 'path',
  75                    'type' => 'string',
  76                    'required' => true,
  77                  ),
  78                  'getStats' => array(
  79                    'location' => 'query',
  80                    'type' => 'boolean',
  81                  ),
  82                ),
  83              ),
  84            )
  85          )
  86      );
  87      $this->tasks = new Google_Service_Taskqueue_Tasks_Resource(
  88          $this,
  89          $this->serviceName,
  90          'tasks',
  91          array(
  92            'methods' => array(
  93              'delete' => array(
  94                'path' => '{project}/taskqueues/{taskqueue}/tasks/{task}',
  95                'httpMethod' => 'DELETE',
  96                'parameters' => array(
  97                  'project' => array(
  98                    'location' => 'path',
  99                    'type' => 'string',
 100                    'required' => true,
 101                  ),
 102                  'taskqueue' => array(
 103                    'location' => 'path',
 104                    'type' => 'string',
 105                    'required' => true,
 106                  ),
 107                  'task' => array(
 108                    'location' => 'path',
 109                    'type' => 'string',
 110                    'required' => true,
 111                  ),
 112                ),
 113              ),'get' => array(
 114                'path' => '{project}/taskqueues/{taskqueue}/tasks/{task}',
 115                'httpMethod' => 'GET',
 116                'parameters' => array(
 117                  'project' => array(
 118                    'location' => 'path',
 119                    'type' => 'string',
 120                    'required' => true,
 121                  ),
 122                  'taskqueue' => array(
 123                    'location' => 'path',
 124                    'type' => 'string',
 125                    'required' => true,
 126                  ),
 127                  'task' => array(
 128                    'location' => 'path',
 129                    'type' => 'string',
 130                    'required' => true,
 131                  ),
 132                ),
 133              ),'insert' => array(
 134                'path' => '{project}/taskqueues/{taskqueue}/tasks',
 135                'httpMethod' => 'POST',
 136                'parameters' => array(
 137                  'project' => array(
 138                    'location' => 'path',
 139                    'type' => 'string',
 140                    'required' => true,
 141                  ),
 142                  'taskqueue' => array(
 143                    'location' => 'path',
 144                    'type' => 'string',
 145                    'required' => true,
 146                  ),
 147                ),
 148              ),'lease' => array(
 149                'path' => '{project}/taskqueues/{taskqueue}/tasks/lease',
 150                'httpMethod' => 'POST',
 151                'parameters' => array(
 152                  'project' => array(
 153                    'location' => 'path',
 154                    'type' => 'string',
 155                    'required' => true,
 156                  ),
 157                  'taskqueue' => array(
 158                    'location' => 'path',
 159                    'type' => 'string',
 160                    'required' => true,
 161                  ),
 162                  'numTasks' => array(
 163                    'location' => 'query',
 164                    'type' => 'integer',
 165                    'required' => true,
 166                  ),
 167                  'leaseSecs' => array(
 168                    'location' => 'query',
 169                    'type' => 'integer',
 170                    'required' => true,
 171                  ),
 172                  'groupByTag' => array(
 173                    'location' => 'query',
 174                    'type' => 'boolean',
 175                  ),
 176                  'tag' => array(
 177                    'location' => 'query',
 178                    'type' => 'string',
 179                  ),
 180                ),
 181              ),'list' => array(
 182                'path' => '{project}/taskqueues/{taskqueue}/tasks',
 183                'httpMethod' => 'GET',
 184                'parameters' => array(
 185                  'project' => array(
 186                    'location' => 'path',
 187                    'type' => 'string',
 188                    'required' => true,
 189                  ),
 190                  'taskqueue' => array(
 191                    'location' => 'path',
 192                    'type' => 'string',
 193                    'required' => true,
 194                  ),
 195                ),
 196              ),'patch' => array(
 197                'path' => '{project}/taskqueues/{taskqueue}/tasks/{task}',
 198                'httpMethod' => 'PATCH',
 199                'parameters' => array(
 200                  'project' => array(
 201                    'location' => 'path',
 202                    'type' => 'string',
 203                    'required' => true,
 204                  ),
 205                  'taskqueue' => array(
 206                    'location' => 'path',
 207                    'type' => 'string',
 208                    'required' => true,
 209                  ),
 210                  'task' => array(
 211                    'location' => 'path',
 212                    'type' => 'string',
 213                    'required' => true,
 214                  ),
 215                  'newLeaseSeconds' => array(
 216                    'location' => 'query',
 217                    'type' => 'integer',
 218                    'required' => true,
 219                  ),
 220                ),
 221              ),'update' => array(
 222                'path' => '{project}/taskqueues/{taskqueue}/tasks/{task}',
 223                'httpMethod' => 'POST',
 224                'parameters' => array(
 225                  'project' => array(
 226                    'location' => 'path',
 227                    'type' => 'string',
 228                    'required' => true,
 229                  ),
 230                  'taskqueue' => array(
 231                    'location' => 'path',
 232                    'type' => 'string',
 233                    'required' => true,
 234                  ),
 235                  'task' => array(
 236                    'location' => 'path',
 237                    'type' => 'string',
 238                    'required' => true,
 239                  ),
 240                  'newLeaseSeconds' => array(
 241                    'location' => 'query',
 242                    'type' => 'integer',
 243                    'required' => true,
 244                  ),
 245                ),
 246              ),
 247            )
 248          )
 249      );
 250    }
 251  }
 252  
 253  
 254  /**
 255   * The "taskqueues" collection of methods.
 256   * Typical usage is:
 257   *  <code>
 258   *   $taskqueueService = new Google_Service_Taskqueue(...);
 259   *   $taskqueues = $taskqueueService->taskqueues;
 260   *  </code>
 261   */
 262  #[AllowDynamicProperties]
 263  class Google_Service_Taskqueue_Taskqueues_Resource extends Google_Service_Resource
 264  {
 265  
 266    /**
 267     * Get detailed information about a TaskQueue. (taskqueues.get)
 268     *
 269     * @param string $project The project under which the queue lies.
 270     * @param string $taskqueue The id of the taskqueue to get the properties of.
 271     * @param array $optParams Optional parameters.
 272     *
 273     * @opt_param bool getStats Whether to get stats. Optional.
 274     * @return Google_Service_Taskqueue_TaskQueue
 275     */
 276    public function get($project, $taskqueue, $optParams = array())
 277    {
 278      $params = array('project' => $project, 'taskqueue' => $taskqueue);
 279      $params = array_merge($params, $optParams);
 280      return $this->call('get', array($params), "Google_Service_Taskqueue_TaskQueue");
 281    }
 282  }
 283  
 284  /**
 285   * The "tasks" collection of methods.
 286   * Typical usage is:
 287   *  <code>
 288   *   $taskqueueService = new Google_Service_Taskqueue(...);
 289   *   $tasks = $taskqueueService->tasks;
 290   *  </code>
 291   */
 292  #[AllowDynamicProperties]
 293  class Google_Service_Taskqueue_Tasks_Resource extends Google_Service_Resource
 294  {
 295  
 296    /**
 297     * Delete a task from a TaskQueue. (tasks.delete)
 298     *
 299     * @param string $project The project under which the queue lies.
 300     * @param string $taskqueue The taskqueue to delete a task from.
 301     * @param string $task The id of the task to delete.
 302     * @param array $optParams Optional parameters.
 303     */
 304    public function delete($project, $taskqueue, $task, $optParams = array())
 305    {
 306      $params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task);
 307      $params = array_merge($params, $optParams);
 308      return $this->call('delete', array($params));
 309    }
 310  
 311    /**
 312     * Get a particular task from a TaskQueue. (tasks.get)
 313     *
 314     * @param string $project The project under which the queue lies.
 315     * @param string $taskqueue The taskqueue in which the task belongs.
 316     * @param string $task The task to get properties of.
 317     * @param array $optParams Optional parameters.
 318     * @return Google_Service_Taskqueue_Task
 319     */
 320    public function get($project, $taskqueue, $task, $optParams = array())
 321    {
 322      $params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task);
 323      $params = array_merge($params, $optParams);
 324      return $this->call('get', array($params), "Google_Service_Taskqueue_Task");
 325    }
 326  
 327    /**
 328     * Insert a new task in a TaskQueue (tasks.insert)
 329     *
 330     * @param string $project The project under which the queue lies
 331     * @param string $taskqueue The taskqueue to insert the task into
 332     * @param Google_Task $postBody
 333     * @param array $optParams Optional parameters.
 334     * @return Google_Service_Taskqueue_Task
 335     */
 336    public function insert($project, $taskqueue, Google_Service_Taskqueue_Task $postBody, $optParams = array())
 337    {
 338      $params = array('project' => $project, 'taskqueue' => $taskqueue, 'postBody' => $postBody);
 339      $params = array_merge($params, $optParams);
 340      return $this->call('insert', array($params), "Google_Service_Taskqueue_Task");
 341    }
 342  
 343    /**
 344     * Lease 1 or more tasks from a TaskQueue. (tasks.lease)
 345     *
 346     * @param string $project The project under which the queue lies.
 347     * @param string $taskqueue The taskqueue to lease a task from.
 348     * @param int $numTasks The number of tasks to lease.
 349     * @param int $leaseSecs The lease in seconds.
 350     * @param array $optParams Optional parameters.
 351     *
 352     * @opt_param bool groupByTag When true, all returned tasks will have the same
 353     * tag
 354     * @opt_param string tag The tag allowed for tasks in the response. Must only be
 355     * specified if group_by_tag is true. If group_by_tag is true and tag is not
 356     * specified the tag will be that of the oldest task by eta, i.e. the first
 357     * available tag
 358     * @return Google_Service_Taskqueue_Tasks
 359     */
 360    public function lease($project, $taskqueue, $numTasks, $leaseSecs, $optParams = array())
 361    {
 362      $params = array('project' => $project, 'taskqueue' => $taskqueue, 'numTasks' => $numTasks, 'leaseSecs' => $leaseSecs);
 363      $params = array_merge($params, $optParams);
 364      return $this->call('lease', array($params), "Google_Service_Taskqueue_Tasks");
 365    }
 366  
 367    /**
 368     * List Tasks in a TaskQueue (tasks.listTasks)
 369     *
 370     * @param string $project The project under which the queue lies.
 371     * @param string $taskqueue The id of the taskqueue to list tasks from.
 372     * @param array $optParams Optional parameters.
 373     * @return Google_Service_Taskqueue_Tasks2
 374     */
 375    public function listTasks($project, $taskqueue, $optParams = array())
 376    {
 377      $params = array('project' => $project, 'taskqueue' => $taskqueue);
 378      $params = array_merge($params, $optParams);
 379      return $this->call('list', array($params), "Google_Service_Taskqueue_Tasks2");
 380    }
 381  
 382    /**
 383     * Update tasks that are leased out of a TaskQueue. This method supports patch
 384     * semantics. (tasks.patch)
 385     *
 386     * @param string $project The project under which the queue lies.
 387     * @param string $taskqueue
 388     * @param string $task
 389     * @param int $newLeaseSeconds The new lease in seconds.
 390     * @param Google_Task $postBody
 391     * @param array $optParams Optional parameters.
 392     * @return Google_Service_Taskqueue_Task
 393     */
 394    public function patch($project, $taskqueue, $task, $newLeaseSeconds, Google_Service_Taskqueue_Task $postBody, $optParams = array())
 395    {
 396      $params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task, 'newLeaseSeconds' => $newLeaseSeconds, 'postBody' => $postBody);
 397      $params = array_merge($params, $optParams);
 398      return $this->call('patch', array($params), "Google_Service_Taskqueue_Task");
 399    }
 400  
 401    /**
 402     * Update tasks that are leased out of a TaskQueue. (tasks.update)
 403     *
 404     * @param string $project The project under which the queue lies.
 405     * @param string $taskqueue
 406     * @param string $task
 407     * @param int $newLeaseSeconds The new lease in seconds.
 408     * @param Google_Task $postBody
 409     * @param array $optParams Optional parameters.
 410     * @return Google_Service_Taskqueue_Task
 411     */
 412    public function update($project, $taskqueue, $task, $newLeaseSeconds, Google_Service_Taskqueue_Task $postBody, $optParams = array())
 413    {
 414      $params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task, 'newLeaseSeconds' => $newLeaseSeconds, 'postBody' => $postBody);
 415      $params = array_merge($params, $optParams);
 416      return $this->call('update', array($params), "Google_Service_Taskqueue_Task");
 417    }
 418  }
 419  
 420  
 421  
 422  
 423  #[AllowDynamicProperties]
 424  class Google_Service_Taskqueue_Task extends Google_Model
 425  {
 426    protected $internal_gapi_mappings = array(
 427          "retryCount" => "retry_count",
 428    );
 429    public $enqueueTimestamp;
 430    public $id;
 431    public $kind;
 432    public $leaseTimestamp;
 433    public $payloadBase64;
 434    public $queueName;
 435    public $retryCount;
 436    public $tag;
 437  
 438  
 439    public function setEnqueueTimestamp($enqueueTimestamp)
 440    {
 441      $this->enqueueTimestamp = $enqueueTimestamp;
 442    }
 443    public function getEnqueueTimestamp()
 444    {
 445      return $this->enqueueTimestamp;
 446    }
 447    public function setId($id)
 448    {
 449      $this->id = $id;
 450    }
 451    public function getId()
 452    {
 453      return $this->id;
 454    }
 455    public function setKind($kind)
 456    {
 457      $this->kind = $kind;
 458    }
 459    public function getKind()
 460    {
 461      return $this->kind;
 462    }
 463    public function setLeaseTimestamp($leaseTimestamp)
 464    {
 465      $this->leaseTimestamp = $leaseTimestamp;
 466    }
 467    public function getLeaseTimestamp()
 468    {
 469      return $this->leaseTimestamp;
 470    }
 471    public function setPayloadBase64($payloadBase64)
 472    {
 473      $this->payloadBase64 = $payloadBase64;
 474    }
 475    public function getPayloadBase64()
 476    {
 477      return $this->payloadBase64;
 478    }
 479    public function setQueueName($queueName)
 480    {
 481      $this->queueName = $queueName;
 482    }
 483    public function getQueueName()
 484    {
 485      return $this->queueName;
 486    }
 487    public function setRetryCount($retryCount)
 488    {
 489      $this->retryCount = $retryCount;
 490    }
 491    public function getRetryCount()
 492    {
 493      return $this->retryCount;
 494    }
 495    public function setTag($tag)
 496    {
 497      $this->tag = $tag;
 498    }
 499    public function getTag()
 500    {
 501      return $this->tag;
 502    }
 503  }
 504  
 505  #[AllowDynamicProperties]
 506  class Google_Service_Taskqueue_TaskQueue extends Google_Model
 507  {
 508    protected $internal_gapi_mappings = array(
 509    );
 510    protected $aclType = 'Google_Service_Taskqueue_TaskQueueAcl';
 511    protected $aclDataType = '';
 512    public $id;
 513    public $kind;
 514    public $maxLeases;
 515    protected $statsType = 'Google_Service_Taskqueue_TaskQueueStats';
 516    protected $statsDataType = '';
 517  
 518  
 519    public function setAcl(Google_Service_Taskqueue_TaskQueueAcl $acl)
 520    {
 521      $this->acl = $acl;
 522    }
 523    public function getAcl()
 524    {
 525      return $this->acl;
 526    }
 527    public function setId($id)
 528    {
 529      $this->id = $id;
 530    }
 531    public function getId()
 532    {
 533      return $this->id;
 534    }
 535    public function setKind($kind)
 536    {
 537      $this->kind = $kind;
 538    }
 539    public function getKind()
 540    {
 541      return $this->kind;
 542    }
 543    public function setMaxLeases($maxLeases)
 544    {
 545      $this->maxLeases = $maxLeases;
 546    }
 547    public function getMaxLeases()
 548    {
 549      return $this->maxLeases;
 550    }
 551    public function setStats(Google_Service_Taskqueue_TaskQueueStats $stats)
 552    {
 553      $this->stats = $stats;
 554    }
 555    public function getStats()
 556    {
 557      return $this->stats;
 558    }
 559  }
 560  
 561  #[AllowDynamicProperties]
 562  class Google_Service_Taskqueue_TaskQueueAcl extends Google_Collection
 563  {
 564    protected $collection_key = 'producerEmails';
 565    protected $internal_gapi_mappings = array(
 566    );
 567    public $adminEmails;
 568    public $consumerEmails;
 569    public $producerEmails;
 570  
 571  
 572    public function setAdminEmails($adminEmails)
 573    {
 574      $this->adminEmails = $adminEmails;
 575    }
 576    public function getAdminEmails()
 577    {
 578      return $this->adminEmails;
 579    }
 580    public function setConsumerEmails($consumerEmails)
 581    {
 582      $this->consumerEmails = $consumerEmails;
 583    }
 584    public function getConsumerEmails()
 585    {
 586      return $this->consumerEmails;
 587    }
 588    public function setProducerEmails($producerEmails)
 589    {
 590      $this->producerEmails = $producerEmails;
 591    }
 592    public function getProducerEmails()
 593    {
 594      return $this->producerEmails;
 595    }
 596  }
 597  
 598  #[AllowDynamicProperties]
 599  class Google_Service_Taskqueue_TaskQueueStats extends Google_Model
 600  {
 601    protected $internal_gapi_mappings = array(
 602    );
 603    public $leasedLastHour;
 604    public $leasedLastMinute;
 605    public $oldestTask;
 606    public $totalTasks;
 607  
 608  
 609    public function setLeasedLastHour($leasedLastHour)
 610    {
 611      $this->leasedLastHour = $leasedLastHour;
 612    }
 613    public function getLeasedLastHour()
 614    {
 615      return $this->leasedLastHour;
 616    }
 617    public function setLeasedLastMinute($leasedLastMinute)
 618    {
 619      $this->leasedLastMinute = $leasedLastMinute;
 620    }
 621    public function getLeasedLastMinute()
 622    {
 623      return $this->leasedLastMinute;
 624    }
 625    public function setOldestTask($oldestTask)
 626    {
 627      $this->oldestTask = $oldestTask;
 628    }
 629    public function getOldestTask()
 630    {
 631      return $this->oldestTask;
 632    }
 633    public function setTotalTasks($totalTasks)
 634    {
 635      $this->totalTasks = $totalTasks;
 636    }
 637    public function getTotalTasks()
 638    {
 639      return $this->totalTasks;
 640    }
 641  }
 642  
 643  #[AllowDynamicProperties]
 644  class Google_Service_Taskqueue_Tasks extends Google_Collection
 645  {
 646    protected $collection_key = 'items';
 647    protected $internal_gapi_mappings = array(
 648    );
 649    protected $itemsType = 'Google_Service_Taskqueue_Task';
 650    protected $itemsDataType = 'array';
 651    public $kind;
 652  
 653  
 654    public function setItems($items)
 655    {
 656      $this->items = $items;
 657    }
 658    public function getItems()
 659    {
 660      return $this->items;
 661    }
 662    public function setKind($kind)
 663    {
 664      $this->kind = $kind;
 665    }
 666    public function getKind()
 667    {
 668      return $this->kind;
 669    }
 670  }
 671  
 672  #[AllowDynamicProperties]
 673  class Google_Service_Taskqueue_Tasks2 extends Google_Collection
 674  {
 675    protected $collection_key = 'items';
 676    protected $internal_gapi_mappings = array(
 677    );
 678    protected $itemsType = 'Google_Service_Taskqueue_Task';
 679    protected $itemsDataType = 'array';
 680    public $kind;
 681  
 682  
 683    public function setItems($items)
 684    {
 685      $this->items = $items;
 686    }
 687    public function getItems()
 688    {
 689      return $this->items;
 690    }
 691    public function setKind($kind)
 692    {
 693      $this->kind = $kind;
 694    }
 695    public function getKind()
 696    {
 697      return $this->kind;
 698    }
 699  }