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
18/**
19 * Service definition for Firestore (v1).
20 *
21 * <p>
22 * Accesses the NoSQL document database built for automatic scaling, high
23 * performance, and ease of application development.</p>
24 *
25 * <p>
26 * For more information about this service, see the API
27 * <a href="https://cloud.google.com/firestore" target="_blank">Documentation</a>
28 * </p>
29 *
30 * @author Google, Inc.
31 */
32class Google_Service_Firestore extends Google_Service
33{
34  /** View and manage your data across Google Cloud Platform services. */
35  const CLOUD_PLATFORM =
36      "https://www.googleapis.com/auth/cloud-platform";
37  /** View and manage your Google Cloud Datastore data. */
38  const DATASTORE =
39      "https://www.googleapis.com/auth/datastore";
40
41  public $projects_databases;
42  public $projects_databases_collectionGroups_fields;
43  public $projects_databases_collectionGroups_indexes;
44  public $projects_databases_documents;
45  public $projects_databases_operations;
46  public $projects_locations;
47
48  /**
49   * Constructs the internal representation of the Firestore service.
50   *
51   * @param Google_Client $client
52   */
53  public function __construct(Google_Client $client)
54  {
55    parent::__construct($client);
56    $this->rootUrl = 'https://firestore.googleapis.com/';
57    $this->servicePath = '';
58    $this->batchPath = 'batch';
59    $this->version = 'v1';
60    $this->serviceName = 'firestore';
61
62    $this->projects_databases = new Google_Service_Firestore_Resource_ProjectsDatabases(
63        $this,
64        $this->serviceName,
65        'databases',
66        array(
67          'methods' => array(
68            'exportDocuments' => array(
69              'path' => 'v1/{+name}:exportDocuments',
70              'httpMethod' => 'POST',
71              'parameters' => array(
72                'name' => array(
73                  'location' => 'path',
74                  'type' => 'string',
75                  'required' => true,
76                ),
77              ),
78            ),'importDocuments' => array(
79              'path' => 'v1/{+name}:importDocuments',
80              'httpMethod' => 'POST',
81              'parameters' => array(
82                'name' => array(
83                  'location' => 'path',
84                  'type' => 'string',
85                  'required' => true,
86                ),
87              ),
88            ),
89          )
90        )
91    );
92    $this->projects_databases_collectionGroups_fields = new Google_Service_Firestore_Resource_ProjectsDatabasesCollectionGroupsFields(
93        $this,
94        $this->serviceName,
95        'fields',
96        array(
97          'methods' => array(
98            'get' => array(
99              'path' => 'v1/{+name}',
100              'httpMethod' => 'GET',
101              'parameters' => array(
102                'name' => array(
103                  'location' => 'path',
104                  'type' => 'string',
105                  'required' => true,
106                ),
107              ),
108            ),'list' => array(
109              'path' => 'v1/{+parent}/fields',
110              'httpMethod' => 'GET',
111              'parameters' => array(
112                'parent' => array(
113                  'location' => 'path',
114                  'type' => 'string',
115                  'required' => true,
116                ),
117                'filter' => array(
118                  'location' => 'query',
119                  'type' => 'string',
120                ),
121                'pageToken' => array(
122                  'location' => 'query',
123                  'type' => 'string',
124                ),
125                'pageSize' => array(
126                  'location' => 'query',
127                  'type' => 'integer',
128                ),
129              ),
130            ),'patch' => array(
131              'path' => 'v1/{+name}',
132              'httpMethod' => 'PATCH',
133              'parameters' => array(
134                'name' => array(
135                  'location' => 'path',
136                  'type' => 'string',
137                  'required' => true,
138                ),
139                'updateMask' => array(
140                  'location' => 'query',
141                  'type' => 'string',
142                ),
143              ),
144            ),
145          )
146        )
147    );
148    $this->projects_databases_collectionGroups_indexes = new Google_Service_Firestore_Resource_ProjectsDatabasesCollectionGroupsIndexes(
149        $this,
150        $this->serviceName,
151        'indexes',
152        array(
153          'methods' => array(
154            'create' => array(
155              'path' => 'v1/{+parent}/indexes',
156              'httpMethod' => 'POST',
157              'parameters' => array(
158                'parent' => array(
159                  'location' => 'path',
160                  'type' => 'string',
161                  'required' => true,
162                ),
163              ),
164            ),'delete' => array(
165              'path' => 'v1/{+name}',
166              'httpMethod' => 'DELETE',
167              'parameters' => array(
168                'name' => array(
169                  'location' => 'path',
170                  'type' => 'string',
171                  'required' => true,
172                ),
173              ),
174            ),'get' => array(
175              'path' => 'v1/{+name}',
176              'httpMethod' => 'GET',
177              'parameters' => array(
178                'name' => array(
179                  'location' => 'path',
180                  'type' => 'string',
181                  'required' => true,
182                ),
183              ),
184            ),'list' => array(
185              'path' => 'v1/{+parent}/indexes',
186              'httpMethod' => 'GET',
187              'parameters' => array(
188                'parent' => array(
189                  'location' => 'path',
190                  'type' => 'string',
191                  'required' => true,
192                ),
193                'pageToken' => array(
194                  'location' => 'query',
195                  'type' => 'string',
196                ),
197                'pageSize' => array(
198                  'location' => 'query',
199                  'type' => 'integer',
200                ),
201                'filter' => array(
202                  'location' => 'query',
203                  'type' => 'string',
204                ),
205              ),
206            ),
207          )
208        )
209    );
210    $this->projects_databases_documents = new Google_Service_Firestore_Resource_ProjectsDatabasesDocuments(
211        $this,
212        $this->serviceName,
213        'documents',
214        array(
215          'methods' => array(
216            'batchGet' => array(
217              'path' => 'v1/{+database}/documents:batchGet',
218              'httpMethod' => 'POST',
219              'parameters' => array(
220                'database' => array(
221                  'location' => 'path',
222                  'type' => 'string',
223                  'required' => true,
224                ),
225              ),
226            ),'beginTransaction' => array(
227              'path' => 'v1/{+database}/documents:beginTransaction',
228              'httpMethod' => 'POST',
229              'parameters' => array(
230                'database' => array(
231                  'location' => 'path',
232                  'type' => 'string',
233                  'required' => true,
234                ),
235              ),
236            ),'commit' => array(
237              'path' => 'v1/{+database}/documents:commit',
238              'httpMethod' => 'POST',
239              'parameters' => array(
240                'database' => array(
241                  'location' => 'path',
242                  'type' => 'string',
243                  'required' => true,
244                ),
245              ),
246            ),'createDocument' => array(
247              'path' => 'v1/{+parent}/{collectionId}',
248              'httpMethod' => 'POST',
249              'parameters' => array(
250                'parent' => array(
251                  'location' => 'path',
252                  'type' => 'string',
253                  'required' => true,
254                ),
255                'collectionId' => array(
256                  'location' => 'path',
257                  'type' => 'string',
258                  'required' => true,
259                ),
260                'mask.fieldPaths' => array(
261                  'location' => 'query',
262                  'type' => 'string',
263                  'repeated' => true,
264                ),
265                'documentId' => array(
266                  'location' => 'query',
267                  'type' => 'string',
268                ),
269              ),
270            ),'delete' => array(
271              'path' => 'v1/{+name}',
272              'httpMethod' => 'DELETE',
273              'parameters' => array(
274                'name' => array(
275                  'location' => 'path',
276                  'type' => 'string',
277                  'required' => true,
278                ),
279                'currentDocument.exists' => array(
280                  'location' => 'query',
281                  'type' => 'boolean',
282                ),
283                'currentDocument.updateTime' => array(
284                  'location' => 'query',
285                  'type' => 'string',
286                ),
287              ),
288            ),'get' => array(
289              'path' => 'v1/{+name}',
290              'httpMethod' => 'GET',
291              'parameters' => array(
292                'name' => array(
293                  'location' => 'path',
294                  'type' => 'string',
295                  'required' => true,
296                ),
297                'transaction' => array(
298                  'location' => 'query',
299                  'type' => 'string',
300                ),
301                'mask.fieldPaths' => array(
302                  'location' => 'query',
303                  'type' => 'string',
304                  'repeated' => true,
305                ),
306                'readTime' => array(
307                  'location' => 'query',
308                  'type' => 'string',
309                ),
310              ),
311            ),'list' => array(
312              'path' => 'v1/{+parent}/{collectionId}',
313              'httpMethod' => 'GET',
314              'parameters' => array(
315                'parent' => array(
316                  'location' => 'path',
317                  'type' => 'string',
318                  'required' => true,
319                ),
320                'collectionId' => array(
321                  'location' => 'path',
322                  'type' => 'string',
323                  'required' => true,
324                ),
325                'showMissing' => array(
326                  'location' => 'query',
327                  'type' => 'boolean',
328                ),
329                'mask.fieldPaths' => array(
330                  'location' => 'query',
331                  'type' => 'string',
332                  'repeated' => true,
333                ),
334                'pageToken' => array(
335                  'location' => 'query',
336                  'type' => 'string',
337                ),
338                'pageSize' => array(
339                  'location' => 'query',
340                  'type' => 'integer',
341                ),
342                'transaction' => array(
343                  'location' => 'query',
344                  'type' => 'string',
345                ),
346                'orderBy' => array(
347                  'location' => 'query',
348                  'type' => 'string',
349                ),
350                'readTime' => array(
351                  'location' => 'query',
352                  'type' => 'string',
353                ),
354              ),
355            ),'listCollectionIds' => array(
356              'path' => 'v1/{+parent}:listCollectionIds',
357              'httpMethod' => 'POST',
358              'parameters' => array(
359                'parent' => array(
360                  'location' => 'path',
361                  'type' => 'string',
362                  'required' => true,
363                ),
364              ),
365            ),'listen' => array(
366              'path' => 'v1/{+database}/documents:listen',
367              'httpMethod' => 'POST',
368              'parameters' => array(
369                'database' => array(
370                  'location' => 'path',
371                  'type' => 'string',
372                  'required' => true,
373                ),
374              ),
375            ),'patch' => array(
376              'path' => 'v1/{+name}',
377              'httpMethod' => 'PATCH',
378              'parameters' => array(
379                'name' => array(
380                  'location' => 'path',
381                  'type' => 'string',
382                  'required' => true,
383                ),
384                'currentDocument.exists' => array(
385                  'location' => 'query',
386                  'type' => 'boolean',
387                ),
388                'updateMask.fieldPaths' => array(
389                  'location' => 'query',
390                  'type' => 'string',
391                  'repeated' => true,
392                ),
393                'mask.fieldPaths' => array(
394                  'location' => 'query',
395                  'type' => 'string',
396                  'repeated' => true,
397                ),
398                'currentDocument.updateTime' => array(
399                  'location' => 'query',
400                  'type' => 'string',
401                ),
402              ),
403            ),'rollback' => array(
404              'path' => 'v1/{+database}/documents:rollback',
405              'httpMethod' => 'POST',
406              'parameters' => array(
407                'database' => array(
408                  'location' => 'path',
409                  'type' => 'string',
410                  'required' => true,
411                ),
412              ),
413            ),'runQuery' => array(
414              'path' => 'v1/{+parent}:runQuery',
415              'httpMethod' => 'POST',
416              'parameters' => array(
417                'parent' => array(
418                  'location' => 'path',
419                  'type' => 'string',
420                  'required' => true,
421                ),
422              ),
423            ),'write' => array(
424              'path' => 'v1/{+database}/documents:write',
425              'httpMethod' => 'POST',
426              'parameters' => array(
427                'database' => array(
428                  'location' => 'path',
429                  'type' => 'string',
430                  'required' => true,
431                ),
432              ),
433            ),
434          )
435        )
436    );
437    $this->projects_databases_operations = new Google_Service_Firestore_Resource_ProjectsDatabasesOperations(
438        $this,
439        $this->serviceName,
440        'operations',
441        array(
442          'methods' => array(
443            'cancel' => array(
444              'path' => 'v1/{+name}:cancel',
445              'httpMethod' => 'POST',
446              'parameters' => array(
447                'name' => array(
448                  'location' => 'path',
449                  'type' => 'string',
450                  'required' => true,
451                ),
452              ),
453            ),'delete' => array(
454              'path' => 'v1/{+name}',
455              'httpMethod' => 'DELETE',
456              'parameters' => array(
457                'name' => array(
458                  'location' => 'path',
459                  'type' => 'string',
460                  'required' => true,
461                ),
462              ),
463            ),'get' => array(
464              'path' => 'v1/{+name}',
465              'httpMethod' => 'GET',
466              'parameters' => array(
467                'name' => array(
468                  'location' => 'path',
469                  'type' => 'string',
470                  'required' => true,
471                ),
472              ),
473            ),'list' => array(
474              'path' => 'v1/{+name}/operations',
475              'httpMethod' => 'GET',
476              'parameters' => array(
477                'name' => array(
478                  'location' => 'path',
479                  'type' => 'string',
480                  'required' => true,
481                ),
482                'filter' => array(
483                  'location' => 'query',
484                  'type' => 'string',
485                ),
486                'pageToken' => array(
487                  'location' => 'query',
488                  'type' => 'string',
489                ),
490                'pageSize' => array(
491                  'location' => 'query',
492                  'type' => 'integer',
493                ),
494              ),
495            ),
496          )
497        )
498    );
499    $this->projects_locations = new Google_Service_Firestore_Resource_ProjectsLocations(
500        $this,
501        $this->serviceName,
502        'locations',
503        array(
504          'methods' => array(
505            'get' => array(
506              'path' => 'v1/{+name}',
507              'httpMethod' => 'GET',
508              'parameters' => array(
509                'name' => array(
510                  'location' => 'path',
511                  'type' => 'string',
512                  'required' => true,
513                ),
514              ),
515            ),'list' => array(
516              'path' => 'v1/{+name}/locations',
517              'httpMethod' => 'GET',
518              'parameters' => array(
519                'name' => array(
520                  'location' => 'path',
521                  'type' => 'string',
522                  'required' => true,
523                ),
524                'pageToken' => array(
525                  'location' => 'query',
526                  'type' => 'string',
527                ),
528                'pageSize' => array(
529                  'location' => 'query',
530                  'type' => 'integer',
531                ),
532                'filter' => array(
533                  'location' => 'query',
534                  'type' => 'string',
535                ),
536              ),
537            ),
538          )
539        )
540    );
541  }
542}
543