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