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 PubsubLite (v1).
24 *
25 * <p>
26</p>
27 *
28 * <p>
29 * For more information about this service, see the API
30 * <a href="https://cloud.google.com/pubsub/lite/docs" target="_blank">Documentation</a>
31 * </p>
32 *
33 * @author Google, Inc.
34 */
35class PubsubLite 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 $admin_projects_locations_operations;
42  public $admin_projects_locations_reservations;
43  public $admin_projects_locations_reservations_topics;
44  public $admin_projects_locations_subscriptions;
45  public $admin_projects_locations_topics;
46  public $admin_projects_locations_topics_subscriptions;
47  public $cursor_projects_locations_subscriptions;
48  public $cursor_projects_locations_subscriptions_cursors;
49  public $topicStats_projects_locations_topics;
50
51  /**
52   * Constructs the internal representation of the PubsubLite service.
53   *
54   * @param Client|array $clientOrConfig The client used to deliver requests, or a
55   *                                     config array to pass to a new Client instance.
56   * @param string $rootUrl The root URL used for requests to the service.
57   */
58  public function __construct($clientOrConfig = [], $rootUrl = null)
59  {
60    parent::__construct($clientOrConfig);
61    $this->rootUrl = $rootUrl ?: 'https://pubsublite.googleapis.com/';
62    $this->servicePath = '';
63    $this->batchPath = 'batch';
64    $this->version = 'v1';
65    $this->serviceName = 'pubsublite';
66
67    $this->admin_projects_locations_operations = new PubsubLite\Resource\AdminProjectsLocationsOperations(
68        $this,
69        $this->serviceName,
70        'operations',
71        [
72          'methods' => [
73            'cancel' => [
74              'path' => 'v1/admin/{+name}:cancel',
75              'httpMethod' => 'POST',
76              'parameters' => [
77                'name' => [
78                  'location' => 'path',
79                  'type' => 'string',
80                  'required' => true,
81                ],
82              ],
83            ],'delete' => [
84              'path' => 'v1/admin/{+name}',
85              'httpMethod' => 'DELETE',
86              'parameters' => [
87                'name' => [
88                  'location' => 'path',
89                  'type' => 'string',
90                  'required' => true,
91                ],
92              ],
93            ],'get' => [
94              'path' => 'v1/admin/{+name}',
95              'httpMethod' => 'GET',
96              'parameters' => [
97                'name' => [
98                  'location' => 'path',
99                  'type' => 'string',
100                  'required' => true,
101                ],
102              ],
103            ],'list' => [
104              'path' => 'v1/admin/{+name}/operations',
105              'httpMethod' => 'GET',
106              'parameters' => [
107                'name' => [
108                  'location' => 'path',
109                  'type' => 'string',
110                  'required' => true,
111                ],
112                'filter' => [
113                  'location' => 'query',
114                  'type' => 'string',
115                ],
116                'pageSize' => [
117                  'location' => 'query',
118                  'type' => 'integer',
119                ],
120                'pageToken' => [
121                  'location' => 'query',
122                  'type' => 'string',
123                ],
124              ],
125            ],
126          ]
127        ]
128    );
129    $this->admin_projects_locations_reservations = new PubsubLite\Resource\AdminProjectsLocationsReservations(
130        $this,
131        $this->serviceName,
132        'reservations',
133        [
134          'methods' => [
135            'create' => [
136              'path' => 'v1/admin/{+parent}/reservations',
137              'httpMethod' => 'POST',
138              'parameters' => [
139                'parent' => [
140                  'location' => 'path',
141                  'type' => 'string',
142                  'required' => true,
143                ],
144                'reservationId' => [
145                  'location' => 'query',
146                  'type' => 'string',
147                ],
148              ],
149            ],'delete' => [
150              'path' => 'v1/admin/{+name}',
151              'httpMethod' => 'DELETE',
152              'parameters' => [
153                'name' => [
154                  'location' => 'path',
155                  'type' => 'string',
156                  'required' => true,
157                ],
158              ],
159            ],'get' => [
160              'path' => 'v1/admin/{+name}',
161              'httpMethod' => 'GET',
162              'parameters' => [
163                'name' => [
164                  'location' => 'path',
165                  'type' => 'string',
166                  'required' => true,
167                ],
168              ],
169            ],'list' => [
170              'path' => 'v1/admin/{+parent}/reservations',
171              'httpMethod' => 'GET',
172              'parameters' => [
173                'parent' => [
174                  'location' => 'path',
175                  'type' => 'string',
176                  'required' => true,
177                ],
178                'pageSize' => [
179                  'location' => 'query',
180                  'type' => 'integer',
181                ],
182                'pageToken' => [
183                  'location' => 'query',
184                  'type' => 'string',
185                ],
186              ],
187            ],'patch' => [
188              'path' => 'v1/admin/{+name}',
189              'httpMethod' => 'PATCH',
190              'parameters' => [
191                'name' => [
192                  'location' => 'path',
193                  'type' => 'string',
194                  'required' => true,
195                ],
196                'updateMask' => [
197                  'location' => 'query',
198                  'type' => 'string',
199                ],
200              ],
201            ],
202          ]
203        ]
204    );
205    $this->admin_projects_locations_reservations_topics = new PubsubLite\Resource\AdminProjectsLocationsReservationsTopics(
206        $this,
207        $this->serviceName,
208        'topics',
209        [
210          'methods' => [
211            'list' => [
212              'path' => 'v1/admin/{+name}/topics',
213              'httpMethod' => 'GET',
214              'parameters' => [
215                'name' => [
216                  'location' => 'path',
217                  'type' => 'string',
218                  'required' => true,
219                ],
220                'pageSize' => [
221                  'location' => 'query',
222                  'type' => 'integer',
223                ],
224                'pageToken' => [
225                  'location' => 'query',
226                  'type' => 'string',
227                ],
228              ],
229            ],
230          ]
231        ]
232    );
233    $this->admin_projects_locations_subscriptions = new PubsubLite\Resource\AdminProjectsLocationsSubscriptions(
234        $this,
235        $this->serviceName,
236        'subscriptions',
237        [
238          'methods' => [
239            'create' => [
240              'path' => 'v1/admin/{+parent}/subscriptions',
241              'httpMethod' => 'POST',
242              'parameters' => [
243                'parent' => [
244                  'location' => 'path',
245                  'type' => 'string',
246                  'required' => true,
247                ],
248                'skipBacklog' => [
249                  'location' => 'query',
250                  'type' => 'boolean',
251                ],
252                'subscriptionId' => [
253                  'location' => 'query',
254                  'type' => 'string',
255                ],
256              ],
257            ],'delete' => [
258              'path' => 'v1/admin/{+name}',
259              'httpMethod' => 'DELETE',
260              'parameters' => [
261                'name' => [
262                  'location' => 'path',
263                  'type' => 'string',
264                  'required' => true,
265                ],
266              ],
267            ],'get' => [
268              'path' => 'v1/admin/{+name}',
269              'httpMethod' => 'GET',
270              'parameters' => [
271                'name' => [
272                  'location' => 'path',
273                  'type' => 'string',
274                  'required' => true,
275                ],
276              ],
277            ],'list' => [
278              'path' => 'v1/admin/{+parent}/subscriptions',
279              'httpMethod' => 'GET',
280              'parameters' => [
281                'parent' => [
282                  'location' => 'path',
283                  'type' => 'string',
284                  'required' => true,
285                ],
286                'pageSize' => [
287                  'location' => 'query',
288                  'type' => 'integer',
289                ],
290                'pageToken' => [
291                  'location' => 'query',
292                  'type' => 'string',
293                ],
294              ],
295            ],'patch' => [
296              'path' => 'v1/admin/{+name}',
297              'httpMethod' => 'PATCH',
298              'parameters' => [
299                'name' => [
300                  'location' => 'path',
301                  'type' => 'string',
302                  'required' => true,
303                ],
304                'updateMask' => [
305                  'location' => 'query',
306                  'type' => 'string',
307                ],
308              ],
309            ],'seek' => [
310              'path' => 'v1/admin/{+name}:seek',
311              'httpMethod' => 'POST',
312              'parameters' => [
313                'name' => [
314                  'location' => 'path',
315                  'type' => 'string',
316                  'required' => true,
317                ],
318              ],
319            ],
320          ]
321        ]
322    );
323    $this->admin_projects_locations_topics = new PubsubLite\Resource\AdminProjectsLocationsTopics(
324        $this,
325        $this->serviceName,
326        'topics',
327        [
328          'methods' => [
329            'create' => [
330              'path' => 'v1/admin/{+parent}/topics',
331              'httpMethod' => 'POST',
332              'parameters' => [
333                'parent' => [
334                  'location' => 'path',
335                  'type' => 'string',
336                  'required' => true,
337                ],
338                'topicId' => [
339                  'location' => 'query',
340                  'type' => 'string',
341                ],
342              ],
343            ],'delete' => [
344              'path' => 'v1/admin/{+name}',
345              'httpMethod' => 'DELETE',
346              'parameters' => [
347                'name' => [
348                  'location' => 'path',
349                  'type' => 'string',
350                  'required' => true,
351                ],
352              ],
353            ],'get' => [
354              'path' => 'v1/admin/{+name}',
355              'httpMethod' => 'GET',
356              'parameters' => [
357                'name' => [
358                  'location' => 'path',
359                  'type' => 'string',
360                  'required' => true,
361                ],
362              ],
363            ],'getPartitions' => [
364              'path' => 'v1/admin/{+name}/partitions',
365              'httpMethod' => 'GET',
366              'parameters' => [
367                'name' => [
368                  'location' => 'path',
369                  'type' => 'string',
370                  'required' => true,
371                ],
372              ],
373            ],'list' => [
374              'path' => 'v1/admin/{+parent}/topics',
375              'httpMethod' => 'GET',
376              'parameters' => [
377                'parent' => [
378                  'location' => 'path',
379                  'type' => 'string',
380                  'required' => true,
381                ],
382                'pageSize' => [
383                  'location' => 'query',
384                  'type' => 'integer',
385                ],
386                'pageToken' => [
387                  'location' => 'query',
388                  'type' => 'string',
389                ],
390              ],
391            ],'patch' => [
392              'path' => 'v1/admin/{+name}',
393              'httpMethod' => 'PATCH',
394              'parameters' => [
395                'name' => [
396                  'location' => 'path',
397                  'type' => 'string',
398                  'required' => true,
399                ],
400                'updateMask' => [
401                  'location' => 'query',
402                  'type' => 'string',
403                ],
404              ],
405            ],
406          ]
407        ]
408    );
409    $this->admin_projects_locations_topics_subscriptions = new PubsubLite\Resource\AdminProjectsLocationsTopicsSubscriptions(
410        $this,
411        $this->serviceName,
412        'subscriptions',
413        [
414          'methods' => [
415            'list' => [
416              'path' => 'v1/admin/{+name}/subscriptions',
417              'httpMethod' => 'GET',
418              'parameters' => [
419                'name' => [
420                  'location' => 'path',
421                  'type' => 'string',
422                  'required' => true,
423                ],
424                'pageSize' => [
425                  'location' => 'query',
426                  'type' => 'integer',
427                ],
428                'pageToken' => [
429                  'location' => 'query',
430                  'type' => 'string',
431                ],
432              ],
433            ],
434          ]
435        ]
436    );
437    $this->cursor_projects_locations_subscriptions = new PubsubLite\Resource\CursorProjectsLocationsSubscriptions(
438        $this,
439        $this->serviceName,
440        'subscriptions',
441        [
442          'methods' => [
443            'commitCursor' => [
444              'path' => 'v1/cursor/{+subscription}:commitCursor',
445              'httpMethod' => 'POST',
446              'parameters' => [
447                'subscription' => [
448                  'location' => 'path',
449                  'type' => 'string',
450                  'required' => true,
451                ],
452              ],
453            ],
454          ]
455        ]
456    );
457    $this->cursor_projects_locations_subscriptions_cursors = new PubsubLite\Resource\CursorProjectsLocationsSubscriptionsCursors(
458        $this,
459        $this->serviceName,
460        'cursors',
461        [
462          'methods' => [
463            'list' => [
464              'path' => 'v1/cursor/{+parent}/cursors',
465              'httpMethod' => 'GET',
466              'parameters' => [
467                'parent' => [
468                  'location' => 'path',
469                  'type' => 'string',
470                  'required' => true,
471                ],
472                'pageSize' => [
473                  'location' => 'query',
474                  'type' => 'integer',
475                ],
476                'pageToken' => [
477                  'location' => 'query',
478                  'type' => 'string',
479                ],
480              ],
481            ],
482          ]
483        ]
484    );
485    $this->topicStats_projects_locations_topics = new PubsubLite\Resource\TopicStatsProjectsLocationsTopics(
486        $this,
487        $this->serviceName,
488        'topics',
489        [
490          'methods' => [
491            'computeHeadCursor' => [
492              'path' => 'v1/topicStats/{+topic}:computeHeadCursor',
493              'httpMethod' => 'POST',
494              'parameters' => [
495                'topic' => [
496                  'location' => 'path',
497                  'type' => 'string',
498                  'required' => true,
499                ],
500              ],
501            ],'computeMessageStats' => [
502              'path' => 'v1/topicStats/{+topic}:computeMessageStats',
503              'httpMethod' => 'POST',
504              'parameters' => [
505                'topic' => [
506                  'location' => 'path',
507                  'type' => 'string',
508                  'required' => true,
509                ],
510              ],
511            ],'computeTimeCursor' => [
512              'path' => 'v1/topicStats/{+topic}:computeTimeCursor',
513              'httpMethod' => 'POST',
514              'parameters' => [
515                'topic' => [
516                  'location' => 'path',
517                  'type' => 'string',
518                  'required' => true,
519                ],
520              ],
521            ],
522          ]
523        ]
524    );
525  }
526}
527
528// Adding a class alias for backwards compatibility with the previous class name.
529class_alias(PubsubLite::class, 'Google_Service_PubsubLite');
530