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