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 DatabaseMigrationService (v1).
24 *
25 * <p>
26 * Manage Cloud Database Migration Service resources on Google Cloud Platform.</p>
27 *
28 * <p>
29 * For more information about this service, see the API
30 * <a href="https://cloud.google.com/database-migration/" target="_blank">Documentation</a>
31 * </p>
32 *
33 * @author Google, Inc.
34 */
35class DatabaseMigrationService 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_connectionProfiles;
43  public $projects_locations_migrationJobs;
44  public $projects_locations_operations;
45
46  /**
47   * Constructs the internal representation of the DatabaseMigrationService
48   * 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://datamigration.googleapis.com/';
58    $this->servicePath = '';
59    $this->batchPath = 'batch';
60    $this->version = 'v1';
61    $this->serviceName = 'datamigration';
62
63    $this->projects_locations = new DatabaseMigrationService\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_connectionProfiles = new DatabaseMigrationService\Resource\ProjectsLocationsConnectionProfiles(
106        $this,
107        $this->serviceName,
108        'connectionProfiles',
109        [
110          'methods' => [
111            'create' => [
112              'path' => 'v1/{+parent}/connectionProfiles',
113              'httpMethod' => 'POST',
114              'parameters' => [
115                'parent' => [
116                  'location' => 'path',
117                  'type' => 'string',
118                  'required' => true,
119                ],
120                'connectionProfileId' => [
121                  'location' => 'query',
122                  'type' => 'string',
123                ],
124                'requestId' => [
125                  'location' => 'query',
126                  'type' => 'string',
127                ],
128              ],
129            ],'delete' => [
130              'path' => 'v1/{+name}',
131              'httpMethod' => 'DELETE',
132              'parameters' => [
133                'name' => [
134                  'location' => 'path',
135                  'type' => 'string',
136                  'required' => true,
137                ],
138                'force' => [
139                  'location' => 'query',
140                  'type' => 'boolean',
141                ],
142                'requestId' => [
143                  'location' => 'query',
144                  'type' => 'string',
145                ],
146              ],
147            ],'get' => [
148              'path' => 'v1/{+name}',
149              'httpMethod' => 'GET',
150              'parameters' => [
151                'name' => [
152                  'location' => 'path',
153                  'type' => 'string',
154                  'required' => true,
155                ],
156              ],
157            ],'getIamPolicy' => [
158              'path' => 'v1/{+resource}:getIamPolicy',
159              'httpMethod' => 'GET',
160              'parameters' => [
161                'resource' => [
162                  'location' => 'path',
163                  'type' => 'string',
164                  'required' => true,
165                ],
166                'options.requestedPolicyVersion' => [
167                  'location' => 'query',
168                  'type' => 'integer',
169                ],
170              ],
171            ],'list' => [
172              'path' => 'v1/{+parent}/connectionProfiles',
173              'httpMethod' => 'GET',
174              'parameters' => [
175                'parent' => [
176                  'location' => 'path',
177                  'type' => 'string',
178                  'required' => true,
179                ],
180                'filter' => [
181                  'location' => 'query',
182                  'type' => 'string',
183                ],
184                'orderBy' => [
185                  'location' => 'query',
186                  'type' => 'string',
187                ],
188                'pageSize' => [
189                  'location' => 'query',
190                  'type' => 'integer',
191                ],
192                'pageToken' => [
193                  'location' => 'query',
194                  'type' => 'string',
195                ],
196              ],
197            ],'patch' => [
198              'path' => 'v1/{+name}',
199              'httpMethod' => 'PATCH',
200              'parameters' => [
201                'name' => [
202                  'location' => 'path',
203                  'type' => 'string',
204                  'required' => true,
205                ],
206                'requestId' => [
207                  'location' => 'query',
208                  'type' => 'string',
209                ],
210                'updateMask' => [
211                  'location' => 'query',
212                  'type' => 'string',
213                ],
214              ],
215            ],'setIamPolicy' => [
216              'path' => 'v1/{+resource}:setIamPolicy',
217              'httpMethod' => 'POST',
218              'parameters' => [
219                'resource' => [
220                  'location' => 'path',
221                  'type' => 'string',
222                  'required' => true,
223                ],
224              ],
225            ],'testIamPermissions' => [
226              'path' => 'v1/{+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_migrationJobs = new DatabaseMigrationService\Resource\ProjectsLocationsMigrationJobs(
240        $this,
241        $this->serviceName,
242        'migrationJobs',
243        [
244          'methods' => [
245            'create' => [
246              'path' => 'v1/{+parent}/migrationJobs',
247              'httpMethod' => 'POST',
248              'parameters' => [
249                'parent' => [
250                  'location' => 'path',
251                  'type' => 'string',
252                  'required' => true,
253                ],
254                'migrationJobId' => [
255                  'location' => 'query',
256                  'type' => 'string',
257                ],
258                'requestId' => [
259                  'location' => 'query',
260                  'type' => 'string',
261                ],
262              ],
263            ],'delete' => [
264              'path' => 'v1/{+name}',
265              'httpMethod' => 'DELETE',
266              'parameters' => [
267                'name' => [
268                  'location' => 'path',
269                  'type' => 'string',
270                  'required' => true,
271                ],
272                'force' => [
273                  'location' => 'query',
274                  'type' => 'boolean',
275                ],
276                'requestId' => [
277                  'location' => 'query',
278                  'type' => 'string',
279                ],
280              ],
281            ],'generateSshScript' => [
282              'path' => 'v1/{+migrationJob}:generateSshScript',
283              'httpMethod' => 'POST',
284              'parameters' => [
285                'migrationJob' => [
286                  'location' => 'path',
287                  'type' => 'string',
288                  'required' => true,
289                ],
290              ],
291            ],'get' => [
292              'path' => 'v1/{+name}',
293              'httpMethod' => 'GET',
294              'parameters' => [
295                'name' => [
296                  'location' => 'path',
297                  'type' => 'string',
298                  'required' => true,
299                ],
300              ],
301            ],'getIamPolicy' => [
302              'path' => 'v1/{+resource}:getIamPolicy',
303              'httpMethod' => 'GET',
304              'parameters' => [
305                'resource' => [
306                  'location' => 'path',
307                  'type' => 'string',
308                  'required' => true,
309                ],
310                'options.requestedPolicyVersion' => [
311                  'location' => 'query',
312                  'type' => 'integer',
313                ],
314              ],
315            ],'list' => [
316              'path' => 'v1/{+parent}/migrationJobs',
317              'httpMethod' => 'GET',
318              'parameters' => [
319                'parent' => [
320                  'location' => 'path',
321                  'type' => 'string',
322                  'required' => true,
323                ],
324                'filter' => [
325                  'location' => 'query',
326                  'type' => 'string',
327                ],
328                'orderBy' => [
329                  'location' => 'query',
330                  'type' => 'string',
331                ],
332                'pageSize' => [
333                  'location' => 'query',
334                  'type' => 'integer',
335                ],
336                'pageToken' => [
337                  'location' => 'query',
338                  'type' => 'string',
339                ],
340              ],
341            ],'patch' => [
342              'path' => 'v1/{+name}',
343              'httpMethod' => 'PATCH',
344              'parameters' => [
345                'name' => [
346                  'location' => 'path',
347                  'type' => 'string',
348                  'required' => true,
349                ],
350                'requestId' => [
351                  'location' => 'query',
352                  'type' => 'string',
353                ],
354                'updateMask' => [
355                  'location' => 'query',
356                  'type' => 'string',
357                ],
358              ],
359            ],'promote' => [
360              'path' => 'v1/{+name}:promote',
361              'httpMethod' => 'POST',
362              'parameters' => [
363                'name' => [
364                  'location' => 'path',
365                  'type' => 'string',
366                  'required' => true,
367                ],
368              ],
369            ],'restart' => [
370              'path' => 'v1/{+name}:restart',
371              'httpMethod' => 'POST',
372              'parameters' => [
373                'name' => [
374                  'location' => 'path',
375                  'type' => 'string',
376                  'required' => true,
377                ],
378              ],
379            ],'resume' => [
380              'path' => 'v1/{+name}:resume',
381              'httpMethod' => 'POST',
382              'parameters' => [
383                'name' => [
384                  'location' => 'path',
385                  'type' => 'string',
386                  'required' => true,
387                ],
388              ],
389            ],'setIamPolicy' => [
390              'path' => 'v1/{+resource}:setIamPolicy',
391              'httpMethod' => 'POST',
392              'parameters' => [
393                'resource' => [
394                  'location' => 'path',
395                  'type' => 'string',
396                  'required' => true,
397                ],
398              ],
399            ],'start' => [
400              'path' => 'v1/{+name}:start',
401              'httpMethod' => 'POST',
402              'parameters' => [
403                'name' => [
404                  'location' => 'path',
405                  'type' => 'string',
406                  'required' => true,
407                ],
408              ],
409            ],'stop' => [
410              'path' => 'v1/{+name}:stop',
411              'httpMethod' => 'POST',
412              'parameters' => [
413                'name' => [
414                  'location' => 'path',
415                  'type' => 'string',
416                  'required' => true,
417                ],
418              ],
419            ],'testIamPermissions' => [
420              'path' => 'v1/{+resource}:testIamPermissions',
421              'httpMethod' => 'POST',
422              'parameters' => [
423                'resource' => [
424                  'location' => 'path',
425                  'type' => 'string',
426                  'required' => true,
427                ],
428              ],
429            ],'verify' => [
430              'path' => 'v1/{+name}:verify',
431              'httpMethod' => 'POST',
432              'parameters' => [
433                'name' => [
434                  'location' => 'path',
435                  'type' => 'string',
436                  'required' => true,
437                ],
438              ],
439            ],
440          ]
441        ]
442    );
443    $this->projects_locations_operations = new DatabaseMigrationService\Resource\ProjectsLocationsOperations(
444        $this,
445        $this->serviceName,
446        'operations',
447        [
448          'methods' => [
449            'cancel' => [
450              'path' => 'v1/{+name}:cancel',
451              'httpMethod' => 'POST',
452              'parameters' => [
453                'name' => [
454                  'location' => 'path',
455                  'type' => 'string',
456                  'required' => true,
457                ],
458              ],
459            ],'delete' => [
460              'path' => 'v1/{+name}',
461              'httpMethod' => 'DELETE',
462              'parameters' => [
463                'name' => [
464                  'location' => 'path',
465                  'type' => 'string',
466                  'required' => true,
467                ],
468              ],
469            ],'get' => [
470              'path' => 'v1/{+name}',
471              'httpMethod' => 'GET',
472              'parameters' => [
473                'name' => [
474                  'location' => 'path',
475                  'type' => 'string',
476                  'required' => true,
477                ],
478              ],
479            ],'list' => [
480              'path' => 'v1/{+name}/operations',
481              'httpMethod' => 'GET',
482              'parameters' => [
483                'name' => [
484                  'location' => 'path',
485                  'type' => 'string',
486                  'required' => true,
487                ],
488                'filter' => [
489                  'location' => 'query',
490                  'type' => 'string',
491                ],
492                'pageSize' => [
493                  'location' => 'query',
494                  'type' => 'integer',
495                ],
496                'pageToken' => [
497                  'location' => 'query',
498                  'type' => 'string',
499                ],
500              ],
501            ],
502          ]
503        ]
504    );
505  }
506}
507
508// Adding a class alias for backwards compatibility with the previous class name.
509class_alias(DatabaseMigrationService::class, 'Google_Service_DatabaseMigrationService');
510