PluginProbe
ManageWP Worker / 3.9.28
ManageWP Worker v3.9.28
4.9.38 4.9.37 4.9.36 4.9.35 4.9.34 3.8.7 3.8.8 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.18 3.9.19 3.9.2 3.9.20 3.9.21 3.9.22 3.9.23 3.9.24 All 73 releases
worker / lib / google-api-client / contrib / Google_TaskqueueService.php

Google_TaskqueueService.php in ManageWP Worker 3.9.28, at lib/google-api-client/contrib/Google_TaskqueueService.php

424 lines 18.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 * use this file except in compliance with the License. You may obtain a copy of
5 * the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 * License for the specific language governing permissions and limitations under
13 * the License.
14 */
15
16
17 /**
18 * The "taskqueues" collection of methods.
19 * Typical usage is:
20 * <code>
21 * $taskqueueService = new Google_TaskqueueService(...);
22 * $taskqueues = $taskqueueService->taskqueues;
23 * </code>
24 */
25 class Google_TaskqueuesServiceResource extends Google_ServiceResource {
26
27
28 /**
29 * Get detailed information about a TaskQueue. (taskqueues.get)
30 *
31 * @param string $project The project under which the queue lies.
32 * @param string $taskqueue The id of the taskqueue to get the properties of.
33 * @param array $optParams Optional parameters.
34 *
35 * @opt_param bool getStats Whether to get stats. Optional.
36 * @return Google_TaskQueue
37 */
38 public function get($project, $taskqueue, $optParams = array()) {
39 $params = array('project' => $project, 'taskqueue' => $taskqueue);
40 $params = array_merge($params, $optParams);
41 $data = $this->__call('get', array($params));
42 if ($this->useObjects()) {
43 return new Google_TaskQueue($data);
44 } else {
45 return $data;
46 }
47 }
48 }
49
50 /**
51 * The "tasks" collection of methods.
52 * Typical usage is:
53 * <code>
54 * $taskqueueService = new Google_TaskqueueService(...);
55 * $tasks = $taskqueueService->tasks;
56 * </code>
57 */
58 class Google_TasksServiceResource extends Google_ServiceResource {
59
60
61 /**
62 * Insert a new task in a TaskQueue (tasks.insert)
63 *
64 * @param string $project The project under which the queue lies
65 * @param string $taskqueue The taskqueue to insert the task into
66 * @param Google_Task $postBody
67 * @param array $optParams Optional parameters.
68 * @return Google_Task
69 */
70 public function insert($project, $taskqueue, Google_Task $postBody, $optParams = array()) {
71 $params = array('project' => $project, 'taskqueue' => $taskqueue, 'postBody' => $postBody);
72 $params = array_merge($params, $optParams);
73 $data = $this->__call('insert', array($params));
74 if ($this->useObjects()) {
75 return new Google_Task($data);
76 } else {
77 return $data;
78 }
79 }
80 /**
81 * Get a particular task from a TaskQueue. (tasks.get)
82 *
83 * @param string $project The project under which the queue lies.
84 * @param string $taskqueue The taskqueue in which the task belongs.
85 * @param string $task The task to get properties of.
86 * @param array $optParams Optional parameters.
87 * @return Google_Task
88 */
89 public function get($project, $taskqueue, $task, $optParams = array()) {
90 $params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task);
91 $params = array_merge($params, $optParams);
92 $data = $this->__call('get', array($params));
93 if ($this->useObjects()) {
94 return new Google_Task($data);
95 } else {
96 return $data;
97 }
98 }
99 /**
100 * List Tasks in a TaskQueue (tasks.list)
101 *
102 * @param string $project The project under which the queue lies.
103 * @param string $taskqueue The id of the taskqueue to list tasks from.
104 * @param array $optParams Optional parameters.
105 * @return Google_Tasks2
106 */
107 public function listTasks($project, $taskqueue, $optParams = array()) {
108 $params = array('project' => $project, 'taskqueue' => $taskqueue);
109 $params = array_merge($params, $optParams);
110 $data = $this->__call('list', array($params));
111 if ($this->useObjects()) {
112 return new Google_Tasks2($data);
113 } else {
114 return $data;
115 }
116 }
117 /**
118 * Update tasks that are leased out of a TaskQueue. (tasks.update)
119 *
120 * @param string $project The project under which the queue lies.
121 * @param string $taskqueue
122 * @param string $task
123 * @param int $newLeaseSeconds The new lease in seconds.
124 * @param Google_Task $postBody
125 * @param array $optParams Optional parameters.
126 * @return Google_Task
127 */
128 public function update($project, $taskqueue, $task, $newLeaseSeconds, Google_Task $postBody, $optParams = array()) {
129 $params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task, 'newLeaseSeconds' => $newLeaseSeconds, 'postBody' => $postBody);
130 $params = array_merge($params, $optParams);
131 $data = $this->__call('update', array($params));
132 if ($this->useObjects()) {
133 return new Google_Task($data);
134 } else {
135 return $data;
136 }
137 }
138 /**
139 * Update tasks that are leased out of a TaskQueue. This method supports patch semantics.
140 * (tasks.patch)
141 *
142 * @param string $project The project under which the queue lies.
143 * @param string $taskqueue
144 * @param string $task
145 * @param int $newLeaseSeconds The new lease in seconds.
146 * @param Google_Task $postBody
147 * @param array $optParams Optional parameters.
148 * @return Google_Task
149 */
150 public function patch($project, $taskqueue, $task, $newLeaseSeconds, Google_Task $postBody, $optParams = array()) {
151 $params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task, 'newLeaseSeconds' => $newLeaseSeconds, 'postBody' => $postBody);
152 $params = array_merge($params, $optParams);
153 $data = $this->__call('patch', array($params));
154 if ($this->useObjects()) {
155 return new Google_Task($data);
156 } else {
157 return $data;
158 }
159 }
160 /**
161 * Delete a task from a TaskQueue. (tasks.delete)
162 *
163 * @param string $project The project under which the queue lies.
164 * @param string $taskqueue The taskqueue to delete a task from.
165 * @param string $task The id of the task to delete.
166 * @param array $optParams Optional parameters.
167 */
168 public function delete($project, $taskqueue, $task, $optParams = array()) {
169 $params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task);
170 $params = array_merge($params, $optParams);
171 $data = $this->__call('delete', array($params));
172 return $data;
173 }
174 /**
175 * Lease 1 or more tasks from a TaskQueue. (tasks.lease)
176 *
177 * @param string $project The project under which the queue lies.
178 * @param string $taskqueue The taskqueue to lease a task from.
179 * @param int $numTasks The number of tasks to lease.
180 * @param int $leaseSecs The lease in seconds.
181 * @param array $optParams Optional parameters.
182 *
183 * @opt_param bool groupByTag When true, all returned tasks will have the same tag
184 * @opt_param string tag The tag allowed for tasks in the response. Must only be specified if group_by_tag is true. If group_by_tag is true and tag is not specified the tag will be that of the oldest task by eta, i.e. the first available tag
185 * @return Google_Tasks
186 */
187 public function lease($project, $taskqueue, $numTasks, $leaseSecs, $optParams = array()) {
188 $params = array('project' => $project, 'taskqueue' => $taskqueue, 'numTasks' => $numTasks, 'leaseSecs' => $leaseSecs);
189 $params = array_merge($params, $optParams);
190 $data = $this->__call('lease', array($params));
191 if ($this->useObjects()) {
192 return new Google_Tasks($data);
193 } else {
194 return $data;
195 }
196 }
197 }
198
199 /**
200 * Service definition for Google_Taskqueue (v1beta2).
201 *
202 * <p>
203 * Lets you access a Google App Engine Pull Task Queue over REST.
204 * </p>
205 *
206 * <p>
207 * For more information about this service, see the
208 * <a href="http://code.google.com/appengine/docs/python/taskqueue/rest.html" target="_blank">API Documentation</a>
209 * </p>
210 *
211 * @author Google, Inc.
212 */
213 class Google_TaskqueueService extends Google_Service {
214 public $taskqueues;
215 public $tasks;
216 /**
217 * Constructs the internal representation of the Taskqueue service.
218 *
219 * @param Google_Client $client
220 */
221 public function __construct(Google_Client $client) {
222 $this->servicePath = 'taskqueue/v1beta2/projects/';
223 $this->version = 'v1beta2';
224 $this->serviceName = 'taskqueue';
225
226 $client->addService($this->serviceName, $this->version);
227 $this->taskqueues = new Google_TaskqueuesServiceResource($this, $this->serviceName, 'taskqueues', json_decode('{"methods": {"get": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "getStats": {"type": "boolean", "location": "query"}}, "id": "taskqueue.taskqueues.get", "httpMethod": "GET", "path": "{project}/taskqueues/{taskqueue}", "response": {"$ref": "TaskQueue"}}}}', true));
228 $this->tasks = new Google_TasksServiceResource($this, $this->serviceName, 'tasks', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "POST", "path": "{project}/taskqueues/{taskqueue}/tasks", "id": "taskqueue.tasks.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "id": "taskqueue.tasks.get", "httpMethod": "GET", "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "response": {"$ref": "Task"}}, "list": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}}, "id": "taskqueue.tasks.list", "httpMethod": "GET", "path": "{project}/taskqueues/{taskqueue}/tasks", "response": {"$ref": "Tasks2"}}, "update": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}, "newLeaseSeconds": {"required": true, "type": "integer", "location": "query", "format": "int32"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "POST", "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "id": "taskqueue.tasks.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}, "newLeaseSeconds": {"required": true, "type": "integer", "location": "query", "format": "int32"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "PATCH", "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "id": "taskqueue.tasks.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "id": "taskqueue.tasks.delete", "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}, "lease": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"groupByTag": {"type": "boolean", "location": "query"}, "leaseSecs": {"required": true, "type": "integer", "location": "query", "format": "int32"}, "project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "tag": {"type": "string", "location": "query"}, "numTasks": {"required": true, "type": "integer", "location": "query", "format": "int32"}}, "id": "taskqueue.tasks.lease", "httpMethod": "POST", "path": "{project}/taskqueues/{taskqueue}/tasks/lease", "response": {"$ref": "Tasks"}}}}', true));
229
230 }
231 }
232
233 class Google_Task extends Google_Model {
234 public $kind;
235 public $leaseTimestamp;
236 public $id;
237 public $tag;
238 public $payloadBase64;
239 public $queueName;
240 public $enqueueTimestamp;
241 public function setKind($kind) {
242 $this->kind = $kind;
243 }
244 public function getKind() {
245 return $this->kind;
246 }
247 public function setLeaseTimestamp($leaseTimestamp) {
248 $this->leaseTimestamp = $leaseTimestamp;
249 }
250 public function getLeaseTimestamp() {
251 return $this->leaseTimestamp;
252 }
253 public function setId($id) {
254 $this->id = $id;
255 }
256 public function getId() {
257 return $this->id;
258 }
259 public function setTag($tag) {
260 $this->tag = $tag;
261 }
262 public function getTag() {
263 return $this->tag;
264 }
265 public function setPayloadBase64($payloadBase64) {
266 $this->payloadBase64 = $payloadBase64;
267 }
268 public function getPayloadBase64() {
269 return $this->payloadBase64;
270 }
271 public function setQueueName($queueName) {
272 $this->queueName = $queueName;
273 }
274 public function getQueueName() {
275 return $this->queueName;
276 }
277 public function setEnqueueTimestamp($enqueueTimestamp) {
278 $this->enqueueTimestamp = $enqueueTimestamp;
279 }
280 public function getEnqueueTimestamp() {
281 return $this->enqueueTimestamp;
282 }
283 }
284
285 class Google_TaskQueue extends Google_Model {
286 public $kind;
287 protected $__statsType = 'Google_TaskQueueStats';
288 protected $__statsDataType = '';
289 public $stats;
290 public $id;
291 public $maxLeases;
292 protected $__aclType = 'Google_TaskQueueAcl';
293 protected $__aclDataType = '';
294 public $acl;
295 public function setKind($kind) {
296 $this->kind = $kind;
297 }
298 public function getKind() {
299 return $this->kind;
300 }
301 public function setStats(Google_TaskQueueStats $stats) {
302 $this->stats = $stats;
303 }
304 public function getStats() {
305 return $this->stats;
306 }
307 public function setId($id) {
308 $this->id = $id;
309 }
310 public function getId() {
311 return $this->id;
312 }
313 public function setMaxLeases($maxLeases) {
314 $this->maxLeases = $maxLeases;
315 }
316 public function getMaxLeases() {
317 return $this->maxLeases;
318 }
319 public function setAcl(Google_TaskQueueAcl $acl) {
320 $this->acl = $acl;
321 }
322 public function getAcl() {
323 return $this->acl;
324 }
325 }
326
327 class Google_TaskQueueAcl extends Google_Model {
328 public $consumerEmails;
329 public $producerEmails;
330 public $adminEmails;
331 public function setConsumerEmails(/* array(Google_string) */ $consumerEmails) {
332 $this->assertIsArray($consumerEmails, 'Google_string', __METHOD__);
333 $this->consumerEmails = $consumerEmails;
334 }
335 public function getConsumerEmails() {
336 return $this->consumerEmails;
337 }
338 public function setProducerEmails(/* array(Google_string) */ $producerEmails) {
339 $this->assertIsArray($producerEmails, 'Google_string', __METHOD__);
340 $this->producerEmails = $producerEmails;
341 }
342 public function getProducerEmails() {
343 return $this->producerEmails;
344 }
345 public function setAdminEmails(/* array(Google_string) */ $adminEmails) {
346 $this->assertIsArray($adminEmails, 'Google_string', __METHOD__);
347 $this->adminEmails = $adminEmails;
348 }
349 public function getAdminEmails() {
350 return $this->adminEmails;
351 }
352 }
353
354 class Google_TaskQueueStats extends Google_Model {
355 public $oldestTask;
356 public $leasedLastMinute;
357 public $totalTasks;
358 public $leasedLastHour;
359 public function setOldestTask($oldestTask) {
360 $this->oldestTask = $oldestTask;
361 }
362 public function getOldestTask() {
363 return $this->oldestTask;
364 }
365 public function setLeasedLastMinute($leasedLastMinute) {
366 $this->leasedLastMinute = $leasedLastMinute;
367 }
368 public function getLeasedLastMinute() {
369 return $this->leasedLastMinute;
370 }
371 public function setTotalTasks($totalTasks) {
372 $this->totalTasks = $totalTasks;
373 }
374 public function getTotalTasks() {
375 return $this->totalTasks;
376 }
377 public function setLeasedLastHour($leasedLastHour) {
378 $this->leasedLastHour = $leasedLastHour;
379 }
380 public function getLeasedLastHour() {
381 return $this->leasedLastHour;
382 }
383 }
384
385 class Google_Tasks extends Google_Model {
386 protected $__itemsType = 'Google_Task';
387 protected $__itemsDataType = 'array';
388 public $items;
389 public $kind;
390 public function setItems(/* array(Google_Task) */ $items) {
391 $this->assertIsArray($items, 'Google_Task', __METHOD__);
392 $this->items = $items;
393 }
394 public function getItems() {
395 return $this->items;
396 }
397 public function setKind($kind) {
398 $this->kind = $kind;
399 }
400 public function getKind() {
401 return $this->kind;
402 }
403 }
404
405 class Google_Tasks2 extends Google_Model {
406 protected $__itemsType = 'Google_Task';
407 protected $__itemsDataType = 'array';
408 public $items;
409 public $kind;
410 public function setItems(/* array(Google_Task) */ $items) {
411 $this->assertIsArray($items, 'Google_Task', __METHOD__);
412 $this->items = $items;
413 }
414 public function getItems() {
415 return $this->items;
416 }
417 public function setKind($kind) {
418 $this->kind = $kind;
419 }
420 public function getKind() {
421 return $this->kind;
422 }
423 }
424