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