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 TPU (v1).
24 *
25 * <p>
26 * TPU API provides customers with access to Google TPU technology.</p>
27 *
28 * <p>
29 * For more information about this service, see the API
30 * <a href="https://cloud.google.com/tpu/" target="_blank">Documentation</a>
31 * </p>
32 *
33 * @author Google, Inc.
34 */
35class TPU 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_acceleratorTypes;
43  public $projects_locations_nodes;
44  public $projects_locations_operations;
45  public $projects_locations_tensorflowVersions;
46
47  /**
48   * Constructs the internal representation of the TPU service.
49   *
50   * @param Client|array $clientOrConfig The client used to deliver requests, or a
51   *                                     config array to pass to a new Client instance.
52   * @param string $rootUrl The root URL used for requests to the service.
53   */
54  public function __construct($clientOrConfig = [], $rootUrl = null)
55  {
56    parent::__construct($clientOrConfig);
57    $this->rootUrl = $rootUrl ?: 'https://tpu.googleapis.com/';
58    $this->servicePath = '';
59    $this->batchPath = 'batch';
60    $this->version = 'v1';
61    $this->serviceName = 'tpu';
62
63    $this->projects_locations = new TPU\Resource\ProjectsLocations(
64        $this,
65        $this->serviceName,
66        'locations',
67        [
68          'methods' => [
69            'get' => [
70              'path' => 'v1/{+name}',
71              'httpMethod' => 'GET',
72              'parameters' => [
73                'name' => [
74                  'location' => 'path',
75                  'type' => 'string',
76                  'required' => true,
77                ],
78              ],
79            ],'list' => [
80              'path' => 'v1/{+name}/locations',
81              'httpMethod' => 'GET',
82              'parameters' => [
83                'name' => [
84                  'location' => 'path',
85                  'type' => 'string',
86                  'required' => true,
87                ],
88                'filter' => [
89                  'location' => 'query',
90                  'type' => 'string',
91                ],
92                'pageSize' => [
93                  'location' => 'query',
94                  'type' => 'integer',
95                ],
96                'pageToken' => [
97                  'location' => 'query',
98                  'type' => 'string',
99                ],
100              ],
101            ],
102          ]
103        ]
104    );
105    $this->projects_locations_acceleratorTypes = new TPU\Resource\ProjectsLocationsAcceleratorTypes(
106        $this,
107        $this->serviceName,
108        'acceleratorTypes',
109        [
110          'methods' => [
111            'get' => [
112              'path' => 'v1/{+name}',
113              'httpMethod' => 'GET',
114              'parameters' => [
115                'name' => [
116                  'location' => 'path',
117                  'type' => 'string',
118                  'required' => true,
119                ],
120              ],
121            ],'list' => [
122              'path' => 'v1/{+parent}/acceleratorTypes',
123              'httpMethod' => 'GET',
124              'parameters' => [
125                'parent' => [
126                  'location' => 'path',
127                  'type' => 'string',
128                  'required' => true,
129                ],
130                'filter' => [
131                  'location' => 'query',
132                  'type' => 'string',
133                ],
134                'orderBy' => [
135                  'location' => 'query',
136                  'type' => 'string',
137                ],
138                'pageSize' => [
139                  'location' => 'query',
140                  'type' => 'integer',
141                ],
142                'pageToken' => [
143                  'location' => 'query',
144                  'type' => 'string',
145                ],
146              ],
147            ],
148          ]
149        ]
150    );
151    $this->projects_locations_nodes = new TPU\Resource\ProjectsLocationsNodes(
152        $this,
153        $this->serviceName,
154        'nodes',
155        [
156          'methods' => [
157            'create' => [
158              'path' => 'v1/{+parent}/nodes',
159              'httpMethod' => 'POST',
160              'parameters' => [
161                'parent' => [
162                  'location' => 'path',
163                  'type' => 'string',
164                  'required' => true,
165                ],
166                'nodeId' => [
167                  'location' => 'query',
168                  'type' => 'string',
169                ],
170              ],
171            ],'delete' => [
172              'path' => 'v1/{+name}',
173              'httpMethod' => 'DELETE',
174              'parameters' => [
175                'name' => [
176                  'location' => 'path',
177                  'type' => 'string',
178                  'required' => true,
179                ],
180              ],
181            ],'get' => [
182              'path' => 'v1/{+name}',
183              'httpMethod' => 'GET',
184              'parameters' => [
185                'name' => [
186                  'location' => 'path',
187                  'type' => 'string',
188                  'required' => true,
189                ],
190              ],
191            ],'list' => [
192              'path' => 'v1/{+parent}/nodes',
193              'httpMethod' => 'GET',
194              'parameters' => [
195                'parent' => [
196                  'location' => 'path',
197                  'type' => 'string',
198                  'required' => true,
199                ],
200                'pageSize' => [
201                  'location' => 'query',
202                  'type' => 'integer',
203                ],
204                'pageToken' => [
205                  'location' => 'query',
206                  'type' => 'string',
207                ],
208              ],
209            ],'reimage' => [
210              'path' => 'v1/{+name}:reimage',
211              'httpMethod' => 'POST',
212              'parameters' => [
213                'name' => [
214                  'location' => 'path',
215                  'type' => 'string',
216                  'required' => true,
217                ],
218              ],
219            ],'start' => [
220              'path' => 'v1/{+name}:start',
221              'httpMethod' => 'POST',
222              'parameters' => [
223                'name' => [
224                  'location' => 'path',
225                  'type' => 'string',
226                  'required' => true,
227                ],
228              ],
229            ],'stop' => [
230              'path' => 'v1/{+name}:stop',
231              'httpMethod' => 'POST',
232              'parameters' => [
233                'name' => [
234                  'location' => 'path',
235                  'type' => 'string',
236                  'required' => true,
237                ],
238              ],
239            ],
240          ]
241        ]
242    );
243    $this->projects_locations_operations = new TPU\Resource\ProjectsLocationsOperations(
244        $this,
245        $this->serviceName,
246        'operations',
247        [
248          'methods' => [
249            'cancel' => [
250              'path' => 'v1/{+name}:cancel',
251              'httpMethod' => 'POST',
252              'parameters' => [
253                'name' => [
254                  'location' => 'path',
255                  'type' => 'string',
256                  'required' => true,
257                ],
258              ],
259            ],'delete' => [
260              'path' => 'v1/{+name}',
261              'httpMethod' => 'DELETE',
262              'parameters' => [
263                'name' => [
264                  'location' => 'path',
265                  'type' => 'string',
266                  'required' => true,
267                ],
268              ],
269            ],'get' => [
270              'path' => 'v1/{+name}',
271              'httpMethod' => 'GET',
272              'parameters' => [
273                'name' => [
274                  'location' => 'path',
275                  'type' => 'string',
276                  'required' => true,
277                ],
278              ],
279            ],'list' => [
280              'path' => 'v1/{+name}/operations',
281              'httpMethod' => 'GET',
282              'parameters' => [
283                'name' => [
284                  'location' => 'path',
285                  'type' => 'string',
286                  'required' => true,
287                ],
288                'filter' => [
289                  'location' => 'query',
290                  'type' => 'string',
291                ],
292                'pageSize' => [
293                  'location' => 'query',
294                  'type' => 'integer',
295                ],
296                'pageToken' => [
297                  'location' => 'query',
298                  'type' => 'string',
299                ],
300              ],
301            ],
302          ]
303        ]
304    );
305    $this->projects_locations_tensorflowVersions = new TPU\Resource\ProjectsLocationsTensorflowVersions(
306        $this,
307        $this->serviceName,
308        'tensorflowVersions',
309        [
310          'methods' => [
311            'get' => [
312              'path' => 'v1/{+name}',
313              'httpMethod' => 'GET',
314              'parameters' => [
315                'name' => [
316                  'location' => 'path',
317                  'type' => 'string',
318                  'required' => true,
319                ],
320              ],
321            ],'list' => [
322              'path' => 'v1/{+parent}/tensorflowVersions',
323              'httpMethod' => 'GET',
324              'parameters' => [
325                'parent' => [
326                  'location' => 'path',
327                  'type' => 'string',
328                  'required' => true,
329                ],
330                'filter' => [
331                  'location' => 'query',
332                  'type' => 'string',
333                ],
334                'orderBy' => [
335                  'location' => 'query',
336                  'type' => 'string',
337                ],
338                'pageSize' => [
339                  'location' => 'query',
340                  'type' => 'integer',
341                ],
342                'pageToken' => [
343                  'location' => 'query',
344                  'type' => 'string',
345                ],
346              ],
347            ],
348          ]
349        ]
350    );
351  }
352}
353
354// Adding a class alias for backwards compatibility with the previous class name.
355class_alias(TPU::class, 'Google_Service_TPU');
356