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 SQLAdmin (v1beta4).
20 *
21 * <p>
22 * Creates and manages Cloud SQL instances, which provide fully managed MySQL or
23 * PostgreSQL databases.</p>
24 *
25 * <p>
26 * For more information about this service, see the API
27 * <a href="https://cloud.google.com/sql/docs/reference/latest" target="_blank">Documentation</a>
28 * </p>
29 *
30 * @author Google, Inc.
31 */
32class Google_Service_SQLAdmin 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  /** Manage your Google SQL Service instances. */
38  const SQLSERVICE_ADMIN =
39      "https://www.googleapis.com/auth/sqlservice.admin";
40
41  public $backupRuns;
42  public $databases;
43  public $flags;
44  public $instances;
45  public $operations;
46  public $sslCerts;
47  public $tiers;
48  public $users;
49
50  /**
51   * Constructs the internal representation of the SQLAdmin service.
52   *
53   * @param Google_Client $client
54   */
55  public function __construct(Google_Client $client)
56  {
57    parent::__construct($client);
58    $this->rootUrl = 'https://www.googleapis.com/';
59    $this->servicePath = 'sql/v1beta4/';
60    $this->batchPath = 'batch/sqladmin/v1beta4';
61    $this->version = 'v1beta4';
62    $this->serviceName = 'sqladmin';
63
64    $this->backupRuns = new Google_Service_SQLAdmin_Resource_BackupRuns(
65        $this,
66        $this->serviceName,
67        'backupRuns',
68        array(
69          'methods' => array(
70            'delete' => array(
71              'path' => 'projects/{project}/instances/{instance}/backupRuns/{id}',
72              'httpMethod' => 'DELETE',
73              'parameters' => array(
74                'project' => array(
75                  'location' => 'path',
76                  'type' => 'string',
77                  'required' => true,
78                ),
79                'instance' => array(
80                  'location' => 'path',
81                  'type' => 'string',
82                  'required' => true,
83                ),
84                'id' => array(
85                  'location' => 'path',
86                  'type' => 'string',
87                  'required' => true,
88                ),
89              ),
90            ),'get' => array(
91              'path' => 'projects/{project}/instances/{instance}/backupRuns/{id}',
92              'httpMethod' => 'GET',
93              'parameters' => array(
94                'project' => array(
95                  'location' => 'path',
96                  'type' => 'string',
97                  'required' => true,
98                ),
99                'instance' => array(
100                  'location' => 'path',
101                  'type' => 'string',
102                  'required' => true,
103                ),
104                'id' => array(
105                  'location' => 'path',
106                  'type' => 'string',
107                  'required' => true,
108                ),
109              ),
110            ),'insert' => array(
111              'path' => 'projects/{project}/instances/{instance}/backupRuns',
112              'httpMethod' => 'POST',
113              'parameters' => array(
114                'project' => array(
115                  'location' => 'path',
116                  'type' => 'string',
117                  'required' => true,
118                ),
119                'instance' => array(
120                  'location' => 'path',
121                  'type' => 'string',
122                  'required' => true,
123                ),
124              ),
125            ),'list' => array(
126              'path' => 'projects/{project}/instances/{instance}/backupRuns',
127              'httpMethod' => 'GET',
128              'parameters' => array(
129                'project' => array(
130                  'location' => 'path',
131                  'type' => 'string',
132                  'required' => true,
133                ),
134                'instance' => array(
135                  'location' => 'path',
136                  'type' => 'string',
137                  'required' => true,
138                ),
139                'maxResults' => array(
140                  'location' => 'query',
141                  'type' => 'integer',
142                ),
143                'pageToken' => array(
144                  'location' => 'query',
145                  'type' => 'string',
146                ),
147              ),
148            ),
149          )
150        )
151    );
152    $this->databases = new Google_Service_SQLAdmin_Resource_Databases(
153        $this,
154        $this->serviceName,
155        'databases',
156        array(
157          'methods' => array(
158            'delete' => array(
159              'path' => 'projects/{project}/instances/{instance}/databases/{database}',
160              'httpMethod' => 'DELETE',
161              'parameters' => array(
162                'project' => array(
163                  'location' => 'path',
164                  'type' => 'string',
165                  'required' => true,
166                ),
167                'instance' => array(
168                  'location' => 'path',
169                  'type' => 'string',
170                  'required' => true,
171                ),
172                'database' => array(
173                  'location' => 'path',
174                  'type' => 'string',
175                  'required' => true,
176                ),
177              ),
178            ),'get' => array(
179              'path' => 'projects/{project}/instances/{instance}/databases/{database}',
180              'httpMethod' => 'GET',
181              'parameters' => array(
182                'project' => array(
183                  'location' => 'path',
184                  'type' => 'string',
185                  'required' => true,
186                ),
187                'instance' => array(
188                  'location' => 'path',
189                  'type' => 'string',
190                  'required' => true,
191                ),
192                'database' => array(
193                  'location' => 'path',
194                  'type' => 'string',
195                  'required' => true,
196                ),
197              ),
198            ),'insert' => array(
199              'path' => 'projects/{project}/instances/{instance}/databases',
200              'httpMethod' => 'POST',
201              'parameters' => array(
202                'project' => array(
203                  'location' => 'path',
204                  'type' => 'string',
205                  'required' => true,
206                ),
207                'instance' => array(
208                  'location' => 'path',
209                  'type' => 'string',
210                  'required' => true,
211                ),
212              ),
213            ),'list' => array(
214              'path' => 'projects/{project}/instances/{instance}/databases',
215              'httpMethod' => 'GET',
216              'parameters' => array(
217                'project' => array(
218                  'location' => 'path',
219                  'type' => 'string',
220                  'required' => true,
221                ),
222                'instance' => array(
223                  'location' => 'path',
224                  'type' => 'string',
225                  'required' => true,
226                ),
227              ),
228            ),'patch' => array(
229              'path' => 'projects/{project}/instances/{instance}/databases/{database}',
230              'httpMethod' => 'PATCH',
231              'parameters' => array(
232                'project' => array(
233                  'location' => 'path',
234                  'type' => 'string',
235                  'required' => true,
236                ),
237                'instance' => array(
238                  'location' => 'path',
239                  'type' => 'string',
240                  'required' => true,
241                ),
242                'database' => array(
243                  'location' => 'path',
244                  'type' => 'string',
245                  'required' => true,
246                ),
247              ),
248            ),'update' => array(
249              'path' => 'projects/{project}/instances/{instance}/databases/{database}',
250              'httpMethod' => 'PUT',
251              'parameters' => array(
252                'project' => array(
253                  'location' => 'path',
254                  'type' => 'string',
255                  'required' => true,
256                ),
257                'instance' => array(
258                  'location' => 'path',
259                  'type' => 'string',
260                  'required' => true,
261                ),
262                'database' => array(
263                  'location' => 'path',
264                  'type' => 'string',
265                  'required' => true,
266                ),
267              ),
268            ),
269          )
270        )
271    );
272    $this->flags = new Google_Service_SQLAdmin_Resource_Flags(
273        $this,
274        $this->serviceName,
275        'flags',
276        array(
277          'methods' => array(
278            'list' => array(
279              'path' => 'flags',
280              'httpMethod' => 'GET',
281              'parameters' => array(
282                'databaseVersion' => array(
283                  'location' => 'query',
284                  'type' => 'string',
285                ),
286              ),
287            ),
288          )
289        )
290    );
291    $this->instances = new Google_Service_SQLAdmin_Resource_Instances(
292        $this,
293        $this->serviceName,
294        'instances',
295        array(
296          'methods' => array(
297            'addServerCa' => array(
298              'path' => 'projects/{project}/instances/{instance}/addServerCa',
299              'httpMethod' => 'POST',
300              'parameters' => array(
301                'project' => array(
302                  'location' => 'path',
303                  'type' => 'string',
304                  'required' => true,
305                ),
306                'instance' => array(
307                  'location' => 'path',
308                  'type' => 'string',
309                  'required' => true,
310                ),
311              ),
312            ),'clone' => array(
313              'path' => 'projects/{project}/instances/{instance}/clone',
314              'httpMethod' => 'POST',
315              'parameters' => array(
316                'project' => array(
317                  'location' => 'path',
318                  'type' => 'string',
319                  'required' => true,
320                ),
321                'instance' => array(
322                  'location' => 'path',
323                  'type' => 'string',
324                  'required' => true,
325                ),
326              ),
327            ),'delete' => array(
328              'path' => 'projects/{project}/instances/{instance}',
329              'httpMethod' => 'DELETE',
330              'parameters' => array(
331                'project' => array(
332                  'location' => 'path',
333                  'type' => 'string',
334                  'required' => true,
335                ),
336                'instance' => array(
337                  'location' => 'path',
338                  'type' => 'string',
339                  'required' => true,
340                ),
341              ),
342            ),'demoteMaster' => array(
343              'path' => 'projects/{project}/instances/{instance}/demoteMaster',
344              'httpMethod' => 'POST',
345              'parameters' => array(
346                'project' => array(
347                  'location' => 'path',
348                  'type' => 'string',
349                  'required' => true,
350                ),
351                'instance' => array(
352                  'location' => 'path',
353                  'type' => 'string',
354                  'required' => true,
355                ),
356              ),
357            ),'export' => array(
358              'path' => 'projects/{project}/instances/{instance}/export',
359              'httpMethod' => 'POST',
360              'parameters' => array(
361                'project' => array(
362                  'location' => 'path',
363                  'type' => 'string',
364                  'required' => true,
365                ),
366                'instance' => array(
367                  'location' => 'path',
368                  'type' => 'string',
369                  'required' => true,
370                ),
371              ),
372            ),'failover' => array(
373              'path' => 'projects/{project}/instances/{instance}/failover',
374              'httpMethod' => 'POST',
375              'parameters' => array(
376                'project' => array(
377                  'location' => 'path',
378                  'type' => 'string',
379                  'required' => true,
380                ),
381                'instance' => array(
382                  'location' => 'path',
383                  'type' => 'string',
384                  'required' => true,
385                ),
386              ),
387            ),'get' => array(
388              'path' => 'projects/{project}/instances/{instance}',
389              'httpMethod' => 'GET',
390              'parameters' => array(
391                'project' => array(
392                  'location' => 'path',
393                  'type' => 'string',
394                  'required' => true,
395                ),
396                'instance' => array(
397                  'location' => 'path',
398                  'type' => 'string',
399                  'required' => true,
400                ),
401              ),
402            ),'import' => array(
403              'path' => 'projects/{project}/instances/{instance}/import',
404              'httpMethod' => 'POST',
405              'parameters' => array(
406                'project' => array(
407                  'location' => 'path',
408                  'type' => 'string',
409                  'required' => true,
410                ),
411                'instance' => array(
412                  'location' => 'path',
413                  'type' => 'string',
414                  'required' => true,
415                ),
416              ),
417            ),'insert' => array(
418              'path' => 'projects/{project}/instances',
419              'httpMethod' => 'POST',
420              'parameters' => array(
421                'project' => array(
422                  'location' => 'path',
423                  'type' => 'string',
424                  'required' => true,
425                ),
426              ),
427            ),'list' => array(
428              'path' => 'projects/{project}/instances',
429              'httpMethod' => 'GET',
430              'parameters' => array(
431                'project' => array(
432                  'location' => 'path',
433                  'type' => 'string',
434                  'required' => true,
435                ),
436                'filter' => array(
437                  'location' => 'query',
438                  'type' => 'string',
439                ),
440                'maxResults' => array(
441                  'location' => 'query',
442                  'type' => 'integer',
443                ),
444                'pageToken' => array(
445                  'location' => 'query',
446                  'type' => 'string',
447                ),
448              ),
449            ),'listServerCas' => array(
450              'path' => 'projects/{project}/instances/{instance}/listServerCas',
451              'httpMethod' => 'GET',
452              'parameters' => array(
453                'project' => array(
454                  'location' => 'path',
455                  'type' => 'string',
456                  'required' => true,
457                ),
458                'instance' => array(
459                  'location' => 'path',
460                  'type' => 'string',
461                  'required' => true,
462                ),
463              ),
464            ),'patch' => array(
465              'path' => 'projects/{project}/instances/{instance}',
466              'httpMethod' => 'PATCH',
467              'parameters' => array(
468                'project' => array(
469                  'location' => 'path',
470                  'type' => 'string',
471                  'required' => true,
472                ),
473                'instance' => array(
474                  'location' => 'path',
475                  'type' => 'string',
476                  'required' => true,
477                ),
478              ),
479            ),'promoteReplica' => array(
480              'path' => 'projects/{project}/instances/{instance}/promoteReplica',
481              'httpMethod' => 'POST',
482              'parameters' => array(
483                'project' => array(
484                  'location' => 'path',
485                  'type' => 'string',
486                  'required' => true,
487                ),
488                'instance' => array(
489                  'location' => 'path',
490                  'type' => 'string',
491                  'required' => true,
492                ),
493              ),
494            ),'resetSslConfig' => array(
495              'path' => 'projects/{project}/instances/{instance}/resetSslConfig',
496              'httpMethod' => 'POST',
497              'parameters' => array(
498                'project' => array(
499                  'location' => 'path',
500                  'type' => 'string',
501                  'required' => true,
502                ),
503                'instance' => array(
504                  'location' => 'path',
505                  'type' => 'string',
506                  'required' => true,
507                ),
508              ),
509            ),'restart' => array(
510              'path' => 'projects/{project}/instances/{instance}/restart',
511              'httpMethod' => 'POST',
512              'parameters' => array(
513                'project' => array(
514                  'location' => 'path',
515                  'type' => 'string',
516                  'required' => true,
517                ),
518                'instance' => array(
519                  'location' => 'path',
520                  'type' => 'string',
521                  'required' => true,
522                ),
523              ),
524            ),'restoreBackup' => array(
525              'path' => 'projects/{project}/instances/{instance}/restoreBackup',
526              'httpMethod' => 'POST',
527              'parameters' => array(
528                'project' => array(
529                  'location' => 'path',
530                  'type' => 'string',
531                  'required' => true,
532                ),
533                'instance' => array(
534                  'location' => 'path',
535                  'type' => 'string',
536                  'required' => true,
537                ),
538              ),
539            ),'rotateServerCa' => array(
540              'path' => 'projects/{project}/instances/{instance}/rotateServerCa',
541              'httpMethod' => 'POST',
542              'parameters' => array(
543                'project' => array(
544                  'location' => 'path',
545                  'type' => 'string',
546                  'required' => true,
547                ),
548                'instance' => array(
549                  'location' => 'path',
550                  'type' => 'string',
551                  'required' => true,
552                ),
553              ),
554            ),'startReplica' => array(
555              'path' => 'projects/{project}/instances/{instance}/startReplica',
556              'httpMethod' => 'POST',
557              'parameters' => array(
558                'project' => array(
559                  'location' => 'path',
560                  'type' => 'string',
561                  'required' => true,
562                ),
563                'instance' => array(
564                  'location' => 'path',
565                  'type' => 'string',
566                  'required' => true,
567                ),
568              ),
569            ),'stopReplica' => array(
570              'path' => 'projects/{project}/instances/{instance}/stopReplica',
571              'httpMethod' => 'POST',
572              'parameters' => array(
573                'project' => array(
574                  'location' => 'path',
575                  'type' => 'string',
576                  'required' => true,
577                ),
578                'instance' => array(
579                  'location' => 'path',
580                  'type' => 'string',
581                  'required' => true,
582                ),
583              ),
584            ),'truncateLog' => array(
585              'path' => 'projects/{project}/instances/{instance}/truncateLog',
586              'httpMethod' => 'POST',
587              'parameters' => array(
588                'project' => array(
589                  'location' => 'path',
590                  'type' => 'string',
591                  'required' => true,
592                ),
593                'instance' => array(
594                  'location' => 'path',
595                  'type' => 'string',
596                  'required' => true,
597                ),
598              ),
599            ),'update' => array(
600              'path' => 'projects/{project}/instances/{instance}',
601              'httpMethod' => 'PUT',
602              'parameters' => array(
603                'project' => array(
604                  'location' => 'path',
605                  'type' => 'string',
606                  'required' => true,
607                ),
608                'instance' => array(
609                  'location' => 'path',
610                  'type' => 'string',
611                  'required' => true,
612                ),
613              ),
614            ),
615          )
616        )
617    );
618    $this->operations = new Google_Service_SQLAdmin_Resource_Operations(
619        $this,
620        $this->serviceName,
621        'operations',
622        array(
623          'methods' => array(
624            'get' => array(
625              'path' => 'projects/{project}/operations/{operation}',
626              'httpMethod' => 'GET',
627              'parameters' => array(
628                'project' => array(
629                  'location' => 'path',
630                  'type' => 'string',
631                  'required' => true,
632                ),
633                'operation' => array(
634                  'location' => 'path',
635                  'type' => 'string',
636                  'required' => true,
637                ),
638              ),
639            ),'list' => array(
640              'path' => 'projects/{project}/operations',
641              'httpMethod' => 'GET',
642              'parameters' => array(
643                'project' => array(
644                  'location' => 'path',
645                  'type' => 'string',
646                  'required' => true,
647                ),
648                'instance' => array(
649                  'location' => 'query',
650                  'type' => 'string',
651                  'required' => true,
652                ),
653                'maxResults' => array(
654                  'location' => 'query',
655                  'type' => 'integer',
656                ),
657                'pageToken' => array(
658                  'location' => 'query',
659                  'type' => 'string',
660                ),
661              ),
662            ),
663          )
664        )
665    );
666    $this->sslCerts = new Google_Service_SQLAdmin_Resource_SslCerts(
667        $this,
668        $this->serviceName,
669        'sslCerts',
670        array(
671          'methods' => array(
672            'createEphemeral' => array(
673              'path' => 'projects/{project}/instances/{instance}/createEphemeral',
674              'httpMethod' => 'POST',
675              'parameters' => array(
676                'project' => array(
677                  'location' => 'path',
678                  'type' => 'string',
679                  'required' => true,
680                ),
681                'instance' => array(
682                  'location' => 'path',
683                  'type' => 'string',
684                  'required' => true,
685                ),
686              ),
687            ),'delete' => array(
688              'path' => 'projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}',
689              'httpMethod' => 'DELETE',
690              'parameters' => array(
691                'project' => array(
692                  'location' => 'path',
693                  'type' => 'string',
694                  'required' => true,
695                ),
696                'instance' => array(
697                  'location' => 'path',
698                  'type' => 'string',
699                  'required' => true,
700                ),
701                'sha1Fingerprint' => array(
702                  'location' => 'path',
703                  'type' => 'string',
704                  'required' => true,
705                ),
706              ),
707            ),'get' => array(
708              'path' => 'projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}',
709              'httpMethod' => 'GET',
710              'parameters' => array(
711                'project' => array(
712                  'location' => 'path',
713                  'type' => 'string',
714                  'required' => true,
715                ),
716                'instance' => array(
717                  'location' => 'path',
718                  'type' => 'string',
719                  'required' => true,
720                ),
721                'sha1Fingerprint' => array(
722                  'location' => 'path',
723                  'type' => 'string',
724                  'required' => true,
725                ),
726              ),
727            ),'insert' => array(
728              'path' => 'projects/{project}/instances/{instance}/sslCerts',
729              'httpMethod' => 'POST',
730              'parameters' => array(
731                'project' => array(
732                  'location' => 'path',
733                  'type' => 'string',
734                  'required' => true,
735                ),
736                'instance' => array(
737                  'location' => 'path',
738                  'type' => 'string',
739                  'required' => true,
740                ),
741              ),
742            ),'list' => array(
743              'path' => 'projects/{project}/instances/{instance}/sslCerts',
744              'httpMethod' => 'GET',
745              'parameters' => array(
746                'project' => array(
747                  'location' => 'path',
748                  'type' => 'string',
749                  'required' => true,
750                ),
751                'instance' => array(
752                  'location' => 'path',
753                  'type' => 'string',
754                  'required' => true,
755                ),
756              ),
757            ),
758          )
759        )
760    );
761    $this->tiers = new Google_Service_SQLAdmin_Resource_Tiers(
762        $this,
763        $this->serviceName,
764        'tiers',
765        array(
766          'methods' => array(
767            'list' => array(
768              'path' => 'projects/{project}/tiers',
769              'httpMethod' => 'GET',
770              'parameters' => array(
771                'project' => array(
772                  'location' => 'path',
773                  'type' => 'string',
774                  'required' => true,
775                ),
776              ),
777            ),
778          )
779        )
780    );
781    $this->users = new Google_Service_SQLAdmin_Resource_Users(
782        $this,
783        $this->serviceName,
784        'users',
785        array(
786          'methods' => array(
787            'delete' => array(
788              'path' => 'projects/{project}/instances/{instance}/users',
789              'httpMethod' => 'DELETE',
790              'parameters' => array(
791                'project' => array(
792                  'location' => 'path',
793                  'type' => 'string',
794                  'required' => true,
795                ),
796                'instance' => array(
797                  'location' => 'path',
798                  'type' => 'string',
799                  'required' => true,
800                ),
801                'host' => array(
802                  'location' => 'query',
803                  'type' => 'string',
804                  'required' => true,
805                ),
806                'name' => array(
807                  'location' => 'query',
808                  'type' => 'string',
809                  'required' => true,
810                ),
811              ),
812            ),'insert' => array(
813              'path' => 'projects/{project}/instances/{instance}/users',
814              'httpMethod' => 'POST',
815              'parameters' => array(
816                'project' => array(
817                  'location' => 'path',
818                  'type' => 'string',
819                  'required' => true,
820                ),
821                'instance' => array(
822                  'location' => 'path',
823                  'type' => 'string',
824                  'required' => true,
825                ),
826              ),
827            ),'list' => array(
828              'path' => 'projects/{project}/instances/{instance}/users',
829              'httpMethod' => 'GET',
830              'parameters' => array(
831                'project' => array(
832                  'location' => 'path',
833                  'type' => 'string',
834                  'required' => true,
835                ),
836                'instance' => array(
837                  'location' => 'path',
838                  'type' => 'string',
839                  'required' => true,
840                ),
841              ),
842            ),'update' => array(
843              'path' => 'projects/{project}/instances/{instance}/users',
844              'httpMethod' => 'PUT',
845              'parameters' => array(
846                'project' => array(
847                  'location' => 'path',
848                  'type' => 'string',
849                  'required' => true,
850                ),
851                'instance' => array(
852                  'location' => 'path',
853                  'type' => 'string',
854                  'required' => true,
855                ),
856                'name' => array(
857                  'location' => 'query',
858                  'type' => 'string',
859                  'required' => true,
860                ),
861                'host' => array(
862                  'location' => 'query',
863                  'type' => 'string',
864                ),
865              ),
866            ),
867          )
868        )
869    );
870  }
871}
872