1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 package gkebackup
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "net/http"
61 "net/url"
62 "strconv"
63 "strings"
64
65 googleapi "google.golang.org/api/googleapi"
66 internal "google.golang.org/api/internal"
67 gensupport "google.golang.org/api/internal/gensupport"
68 option "google.golang.org/api/option"
69 internaloption "google.golang.org/api/option/internaloption"
70 htransport "google.golang.org/api/transport/http"
71 )
72
73
74
75 var _ = bytes.NewBuffer
76 var _ = strconv.Itoa
77 var _ = fmt.Sprintf
78 var _ = json.NewDecoder
79 var _ = io.Copy
80 var _ = url.Parse
81 var _ = gensupport.MarshalJSON
82 var _ = googleapi.Version
83 var _ = errors.New
84 var _ = strings.Replace
85 var _ = context.Canceled
86 var _ = internaloption.WithDefaultEndpoint
87 var _ = internal.Version
88
89 const apiId = "gkebackup:v1"
90 const apiName = "gkebackup"
91 const apiVersion = "v1"
92 const basePath = "https://gkebackup.googleapis.com/"
93 const basePathTemplate = "https://gkebackup.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://gkebackup.mtls.googleapis.com/"
95
96
97 const (
98
99
100 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
101 )
102
103
104 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
105 scopesOption := internaloption.WithDefaultScopes(
106 "https://www.googleapis.com/auth/cloud-platform",
107 )
108
109 opts = append([]option.ClientOption{scopesOption}, opts...)
110 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
111 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
112 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
113 opts = append(opts, internaloption.EnableNewAuthLibrary())
114 client, endpoint, err := htransport.NewClient(ctx, opts...)
115 if err != nil {
116 return nil, err
117 }
118 s, err := New(client)
119 if err != nil {
120 return nil, err
121 }
122 if endpoint != "" {
123 s.BasePath = endpoint
124 }
125 return s, nil
126 }
127
128
129
130
131
132
133 func New(client *http.Client) (*Service, error) {
134 if client == nil {
135 return nil, errors.New("client is nil")
136 }
137 s := &Service{client: client, BasePath: basePath}
138 s.Projects = NewProjectsService(s)
139 return s, nil
140 }
141
142 type Service struct {
143 client *http.Client
144 BasePath string
145 UserAgent string
146
147 Projects *ProjectsService
148 }
149
150 func (s *Service) userAgent() string {
151 if s.UserAgent == "" {
152 return googleapi.UserAgent
153 }
154 return googleapi.UserAgent + " " + s.UserAgent
155 }
156
157 func NewProjectsService(s *Service) *ProjectsService {
158 rs := &ProjectsService{s: s}
159 rs.Locations = NewProjectsLocationsService(s)
160 return rs
161 }
162
163 type ProjectsService struct {
164 s *Service
165
166 Locations *ProjectsLocationsService
167 }
168
169 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
170 rs := &ProjectsLocationsService{s: s}
171 rs.BackupPlans = NewProjectsLocationsBackupPlansService(s)
172 rs.Operations = NewProjectsLocationsOperationsService(s)
173 rs.RestorePlans = NewProjectsLocationsRestorePlansService(s)
174 return rs
175 }
176
177 type ProjectsLocationsService struct {
178 s *Service
179
180 BackupPlans *ProjectsLocationsBackupPlansService
181
182 Operations *ProjectsLocationsOperationsService
183
184 RestorePlans *ProjectsLocationsRestorePlansService
185 }
186
187 func NewProjectsLocationsBackupPlansService(s *Service) *ProjectsLocationsBackupPlansService {
188 rs := &ProjectsLocationsBackupPlansService{s: s}
189 rs.Backups = NewProjectsLocationsBackupPlansBackupsService(s)
190 return rs
191 }
192
193 type ProjectsLocationsBackupPlansService struct {
194 s *Service
195
196 Backups *ProjectsLocationsBackupPlansBackupsService
197 }
198
199 func NewProjectsLocationsBackupPlansBackupsService(s *Service) *ProjectsLocationsBackupPlansBackupsService {
200 rs := &ProjectsLocationsBackupPlansBackupsService{s: s}
201 rs.VolumeBackups = NewProjectsLocationsBackupPlansBackupsVolumeBackupsService(s)
202 return rs
203 }
204
205 type ProjectsLocationsBackupPlansBackupsService struct {
206 s *Service
207
208 VolumeBackups *ProjectsLocationsBackupPlansBackupsVolumeBackupsService
209 }
210
211 func NewProjectsLocationsBackupPlansBackupsVolumeBackupsService(s *Service) *ProjectsLocationsBackupPlansBackupsVolumeBackupsService {
212 rs := &ProjectsLocationsBackupPlansBackupsVolumeBackupsService{s: s}
213 return rs
214 }
215
216 type ProjectsLocationsBackupPlansBackupsVolumeBackupsService struct {
217 s *Service
218 }
219
220 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
221 rs := &ProjectsLocationsOperationsService{s: s}
222 return rs
223 }
224
225 type ProjectsLocationsOperationsService struct {
226 s *Service
227 }
228
229 func NewProjectsLocationsRestorePlansService(s *Service) *ProjectsLocationsRestorePlansService {
230 rs := &ProjectsLocationsRestorePlansService{s: s}
231 rs.Restores = NewProjectsLocationsRestorePlansRestoresService(s)
232 return rs
233 }
234
235 type ProjectsLocationsRestorePlansService struct {
236 s *Service
237
238 Restores *ProjectsLocationsRestorePlansRestoresService
239 }
240
241 func NewProjectsLocationsRestorePlansRestoresService(s *Service) *ProjectsLocationsRestorePlansRestoresService {
242 rs := &ProjectsLocationsRestorePlansRestoresService{s: s}
243 rs.VolumeRestores = NewProjectsLocationsRestorePlansRestoresVolumeRestoresService(s)
244 return rs
245 }
246
247 type ProjectsLocationsRestorePlansRestoresService struct {
248 s *Service
249
250 VolumeRestores *ProjectsLocationsRestorePlansRestoresVolumeRestoresService
251 }
252
253 func NewProjectsLocationsRestorePlansRestoresVolumeRestoresService(s *Service) *ProjectsLocationsRestorePlansRestoresVolumeRestoresService {
254 rs := &ProjectsLocationsRestorePlansRestoresVolumeRestoresService{s: s}
255 return rs
256 }
257
258 type ProjectsLocationsRestorePlansRestoresVolumeRestoresService struct {
259 s *Service
260 }
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278 type AuditConfig struct {
279
280 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
281
282
283
284 Service string `json:"service,omitempty"`
285
286
287
288
289
290 ForceSendFields []string `json:"-"`
291
292
293
294
295 NullFields []string `json:"-"`
296 }
297
298 func (s *AuditConfig) MarshalJSON() ([]byte, error) {
299 type NoMethod AuditConfig
300 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
301 }
302
303
304
305
306
307
308 type AuditLogConfig struct {
309
310
311 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
312
313
314
315
316
317
318
319 LogType string `json:"logType,omitempty"`
320
321
322
323
324
325 ForceSendFields []string `json:"-"`
326
327
328
329
330 NullFields []string `json:"-"`
331 }
332
333 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
334 type NoMethod AuditLogConfig
335 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
336 }
337
338
339
340
341
342 type Backup struct {
343
344
345 AllNamespaces bool `json:"allNamespaces,omitempty"`
346
347
348 ClusterMetadata *ClusterMetadata `json:"clusterMetadata,omitempty"`
349
350 CompleteTime string `json:"completeTime,omitempty"`
351
352 ConfigBackupSizeBytes int64 `json:"configBackupSizeBytes,omitempty,string"`
353
354
355 ContainsSecrets bool `json:"containsSecrets,omitempty"`
356
357
358 ContainsVolumeData bool `json:"containsVolumeData,omitempty"`
359
360
361 CreateTime string `json:"createTime,omitempty"`
362
363
364
365
366
367
368
369 DeleteLockDays int64 `json:"deleteLockDays,omitempty"`
370
371
372
373 DeleteLockExpireTime string `json:"deleteLockExpireTime,omitempty"`
374
375 Description string `json:"description,omitempty"`
376
377
378
379 EncryptionKey *EncryptionKey `json:"encryptionKey,omitempty"`
380
381
382
383
384
385
386
387
388 Etag string `json:"etag,omitempty"`
389
390 Labels map[string]string `json:"labels,omitempty"`
391
392
393
394 Manual bool `json:"manual,omitempty"`
395
396
397 Name string `json:"name,omitempty"`
398
399
400 PodCount int64 `json:"podCount,omitempty"`
401
402
403 ResourceCount int64 `json:"resourceCount,omitempty"`
404
405
406
407
408
409 RetainDays int64 `json:"retainDays,omitempty"`
410
411
412 RetainExpireTime string `json:"retainExpireTime,omitempty"`
413
414
415 SelectedApplications *NamespacedNames `json:"selectedApplications,omitempty"`
416
417
418 SelectedNamespaces *Namespaces `json:"selectedNamespaces,omitempty"`
419
420
421 SizeBytes int64 `json:"sizeBytes,omitempty,string"`
422
423
424
425
426
427
428
429
430
431
432
433
434
435 State string `json:"state,omitempty"`
436
437
438 StateReason string `json:"stateReason,omitempty"`
439
440
441 Uid string `json:"uid,omitempty"`
442
443
444 UpdateTime string `json:"updateTime,omitempty"`
445
446
447 VolumeCount int64 `json:"volumeCount,omitempty"`
448
449
450 googleapi.ServerResponse `json:"-"`
451
452
453
454
455
456 ForceSendFields []string `json:"-"`
457
458
459
460
461 NullFields []string `json:"-"`
462 }
463
464 func (s *Backup) MarshalJSON() ([]byte, error) {
465 type NoMethod Backup
466 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
467 }
468
469
470
471 type BackupConfig struct {
472
473 AllNamespaces bool `json:"allNamespaces,omitempty"`
474
475
476
477
478 EncryptionKey *EncryptionKey `json:"encryptionKey,omitempty"`
479
480
481
482 IncludeSecrets bool `json:"includeSecrets,omitempty"`
483
484
485 IncludeVolumeData bool `json:"includeVolumeData,omitempty"`
486
487
488 SelectedApplications *NamespacedNames `json:"selectedApplications,omitempty"`
489
490
491 SelectedNamespaces *Namespaces `json:"selectedNamespaces,omitempty"`
492
493
494
495
496
497 ForceSendFields []string `json:"-"`
498
499
500
501
502 NullFields []string `json:"-"`
503 }
504
505 func (s *BackupConfig) MarshalJSON() ([]byte, error) {
506 type NoMethod BackupConfig
507 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
508 }
509
510
511
512 type BackupPlan struct {
513
514
515 BackupConfig *BackupConfig `json:"backupConfig,omitempty"`
516
517
518 BackupSchedule *Schedule `json:"backupSchedule,omitempty"`
519
520
521
522 Cluster string `json:"cluster,omitempty"`
523
524
525 CreateTime string `json:"createTime,omitempty"`
526
527
528
529
530
531 Deactivated bool `json:"deactivated,omitempty"`
532
533
534 Description string `json:"description,omitempty"`
535
536
537
538
539
540
541
542
543 Etag string `json:"etag,omitempty"`
544
545 Labels map[string]string `json:"labels,omitempty"`
546
547
548 Name string `json:"name,omitempty"`
549
550
551 ProtectedPodCount int64 `json:"protectedPodCount,omitempty"`
552
553
554 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`
555
556
557
558 RpoRiskLevel int64 `json:"rpoRiskLevel,omitempty"`
559
560
561 RpoRiskReason string `json:"rpoRiskReason,omitempty"`
562
563
564
565
566
567
568
569
570
571
572
573
574
575 State string `json:"state,omitempty"`
576
577
578 StateReason string `json:"stateReason,omitempty"`
579
580
581 Uid string `json:"uid,omitempty"`
582
583
584 UpdateTime string `json:"updateTime,omitempty"`
585
586
587 googleapi.ServerResponse `json:"-"`
588
589
590
591
592
593 ForceSendFields []string `json:"-"`
594
595
596
597
598 NullFields []string `json:"-"`
599 }
600
601 func (s *BackupPlan) MarshalJSON() ([]byte, error) {
602 type NoMethod BackupPlan
603 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
604 }
605
606
607 type Binding struct {
608
609
610
611
612
613
614
615
616 Condition *Expr `json:"condition,omitempty"`
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679 Members []string `json:"members,omitempty"`
680
681
682
683
684
685
686 Role string `json:"role,omitempty"`
687
688
689
690
691
692 ForceSendFields []string `json:"-"`
693
694
695
696
697 NullFields []string `json:"-"`
698 }
699
700 func (s *Binding) MarshalJSON() ([]byte, error) {
701 type NoMethod Binding
702 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
703 }
704
705
706
707 type ClusterMetadata struct {
708
709 AnthosVersion string `json:"anthosVersion,omitempty"`
710
711
712 BackupCrdVersions map[string]string `json:"backupCrdVersions,omitempty"`
713
714
715
716
717 Cluster string `json:"cluster,omitempty"`
718
719 GkeVersion string `json:"gkeVersion,omitempty"`
720
721
722 K8sVersion string `json:"k8sVersion,omitempty"`
723
724
725
726
727
728 ForceSendFields []string `json:"-"`
729
730
731
732
733 NullFields []string `json:"-"`
734 }
735
736 func (s *ClusterMetadata) MarshalJSON() ([]byte, error) {
737 type NoMethod ClusterMetadata
738 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
739 }
740
741
742
743
744
745
746
747
748
749
750
751 type ClusterResourceRestoreScope struct {
752
753
754 AllGroupKinds bool `json:"allGroupKinds,omitempty"`
755
756
757
758
759 ExcludedGroupKinds []*GroupKind `json:"excludedGroupKinds,omitempty"`
760
761
762
763 NoGroupKinds bool `json:"noGroupKinds,omitempty"`
764
765
766
767 SelectedGroupKinds []*GroupKind `json:"selectedGroupKinds,omitempty"`
768
769
770
771
772
773 ForceSendFields []string `json:"-"`
774
775
776
777
778 NullFields []string `json:"-"`
779 }
780
781 func (s *ClusterResourceRestoreScope) MarshalJSON() ([]byte, error) {
782 type NoMethod ClusterResourceRestoreScope
783 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
784 }
785
786
787
788
789
790
791
792
793
794
795 type Date struct {
796
797
798
799 Day int64 `json:"day,omitempty"`
800
801
802 Month int64 `json:"month,omitempty"`
803
804
805 Year int64 `json:"year,omitempty"`
806
807
808
809
810
811 ForceSendFields []string `json:"-"`
812
813
814
815
816 NullFields []string `json:"-"`
817 }
818
819 func (s *Date) MarshalJSON() ([]byte, error) {
820 type NoMethod Date
821 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
822 }
823
824
825 type DayOfWeekList struct {
826
827
828
829
830
831
832
833
834
835
836
837 DaysOfWeek []string `json:"daysOfWeek,omitempty"`
838
839
840
841
842
843 ForceSendFields []string `json:"-"`
844
845
846
847
848 NullFields []string `json:"-"`
849 }
850
851 func (s *DayOfWeekList) MarshalJSON() ([]byte, error) {
852 type NoMethod DayOfWeekList
853 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
854 }
855
856
857
858
859
860 type Empty struct {
861
862 googleapi.ServerResponse `json:"-"`
863 }
864
865
866
867 type EncryptionKey struct {
868
869
870 GcpKmsEncryptionKey string `json:"gcpKmsEncryptionKey,omitempty"`
871
872
873
874
875
876 ForceSendFields []string `json:"-"`
877
878
879
880
881 NullFields []string `json:"-"`
882 }
883
884 func (s *EncryptionKey) MarshalJSON() ([]byte, error) {
885 type NoMethod EncryptionKey
886 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
887 }
888
889
890
891 type ExclusionWindow struct {
892
893
894 Daily bool `json:"daily,omitempty"`
895
896 DaysOfWeek *DayOfWeekList `json:"daysOfWeek,omitempty"`
897
898
899
900
901
902
903
904 Duration string `json:"duration,omitempty"`
905
906
907 SingleOccurrenceDate *Date `json:"singleOccurrenceDate,omitempty"`
908
909
910 StartTime *TimeOfDay `json:"startTime,omitempty"`
911
912
913
914
915
916 ForceSendFields []string `json:"-"`
917
918
919
920
921 NullFields []string `json:"-"`
922 }
923
924 func (s *ExclusionWindow) MarshalJSON() ([]byte, error) {
925 type NoMethod ExclusionWindow
926 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
927 }
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945 type Expr struct {
946
947
948 Description string `json:"description,omitempty"`
949
950
951 Expression string `json:"expression,omitempty"`
952
953
954 Location string `json:"location,omitempty"`
955
956
957
958 Title string `json:"title,omitempty"`
959
960
961
962
963
964 ForceSendFields []string `json:"-"`
965
966
967
968
969 NullFields []string `json:"-"`
970 }
971
972 func (s *Expr) MarshalJSON() ([]byte, error) {
973 type NoMethod Expr
974 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
975 }
976
977
978
979 type GetBackupIndexDownloadUrlResponse struct {
980 SignedUrl string `json:"signedUrl,omitempty"`
981
982
983 googleapi.ServerResponse `json:"-"`
984
985
986
987
988
989 ForceSendFields []string `json:"-"`
990
991
992
993
994 NullFields []string `json:"-"`
995 }
996
997 func (s *GetBackupIndexDownloadUrlResponse) MarshalJSON() ([]byte, error) {
998 type NoMethod GetBackupIndexDownloadUrlResponse
999 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1000 }
1001
1002
1003
1004 type GoogleLongrunningCancelOperationRequest struct {
1005 }
1006
1007
1008
1009 type GoogleLongrunningListOperationsResponse struct {
1010
1011 NextPageToken string `json:"nextPageToken,omitempty"`
1012
1013
1014 Operations []*GoogleLongrunningOperation `json:"operations,omitempty"`
1015
1016
1017 googleapi.ServerResponse `json:"-"`
1018
1019
1020
1021
1022
1023 ForceSendFields []string `json:"-"`
1024
1025
1026
1027
1028 NullFields []string `json:"-"`
1029 }
1030
1031 func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) {
1032 type NoMethod GoogleLongrunningListOperationsResponse
1033 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1034 }
1035
1036
1037
1038 type GoogleLongrunningOperation struct {
1039
1040
1041
1042 Done bool `json:"done,omitempty"`
1043
1044 Error *GoogleRpcStatus `json:"error,omitempty"`
1045
1046
1047
1048
1049 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1050
1051
1052
1053 Name string `json:"name,omitempty"`
1054
1055
1056
1057
1058
1059
1060
1061 Response googleapi.RawMessage `json:"response,omitempty"`
1062
1063
1064 googleapi.ServerResponse `json:"-"`
1065
1066
1067
1068
1069
1070 ForceSendFields []string `json:"-"`
1071
1072
1073
1074
1075 NullFields []string `json:"-"`
1076 }
1077
1078 func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
1079 type NoMethod GoogleLongrunningOperation
1080 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1081 }
1082
1083
1084
1085
1086
1087
1088
1089 type GoogleRpcStatus struct {
1090
1091 Code int64 `json:"code,omitempty"`
1092
1093
1094 Details []googleapi.RawMessage `json:"details,omitempty"`
1095
1096
1097
1098 Message string `json:"message,omitempty"`
1099
1100
1101
1102
1103
1104 ForceSendFields []string `json:"-"`
1105
1106
1107
1108
1109 NullFields []string `json:"-"`
1110 }
1111
1112 func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
1113 type NoMethod GoogleRpcStatus
1114 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1115 }
1116
1117
1118
1119
1120 type GroupKind struct {
1121
1122
1123
1124 ResourceGroup string `json:"resourceGroup,omitempty"`
1125
1126
1127
1128 ResourceKind string `json:"resourceKind,omitempty"`
1129
1130
1131
1132
1133
1134 ForceSendFields []string `json:"-"`
1135
1136
1137
1138
1139 NullFields []string `json:"-"`
1140 }
1141
1142 func (s *GroupKind) MarshalJSON() ([]byte, error) {
1143 type NoMethod GroupKind
1144 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1145 }
1146
1147
1148 type ListBackupPlansResponse struct {
1149
1150 BackupPlans []*BackupPlan `json:"backupPlans,omitempty"`
1151
1152
1153
1154 NextPageToken string `json:"nextPageToken,omitempty"`
1155
1156 Unreachable []string `json:"unreachable,omitempty"`
1157
1158
1159 googleapi.ServerResponse `json:"-"`
1160
1161
1162
1163
1164
1165 ForceSendFields []string `json:"-"`
1166
1167
1168
1169
1170 NullFields []string `json:"-"`
1171 }
1172
1173 func (s *ListBackupPlansResponse) MarshalJSON() ([]byte, error) {
1174 type NoMethod ListBackupPlansResponse
1175 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1176 }
1177
1178
1179 type ListBackupsResponse struct {
1180
1181 Backups []*Backup `json:"backups,omitempty"`
1182
1183
1184
1185 NextPageToken string `json:"nextPageToken,omitempty"`
1186
1187
1188 googleapi.ServerResponse `json:"-"`
1189
1190
1191
1192
1193
1194 ForceSendFields []string `json:"-"`
1195
1196
1197
1198
1199 NullFields []string `json:"-"`
1200 }
1201
1202 func (s *ListBackupsResponse) MarshalJSON() ([]byte, error) {
1203 type NoMethod ListBackupsResponse
1204 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1205 }
1206
1207
1208 type ListLocationsResponse struct {
1209
1210
1211 Locations []*Location `json:"locations,omitempty"`
1212
1213 NextPageToken string `json:"nextPageToken,omitempty"`
1214
1215
1216 googleapi.ServerResponse `json:"-"`
1217
1218
1219
1220
1221
1222 ForceSendFields []string `json:"-"`
1223
1224
1225
1226
1227 NullFields []string `json:"-"`
1228 }
1229
1230 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
1231 type NoMethod ListLocationsResponse
1232 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1233 }
1234
1235
1236 type ListRestorePlansResponse struct {
1237
1238
1239
1240 NextPageToken string `json:"nextPageToken,omitempty"`
1241
1242 RestorePlans []*RestorePlan `json:"restorePlans,omitempty"`
1243
1244 Unreachable []string `json:"unreachable,omitempty"`
1245
1246
1247 googleapi.ServerResponse `json:"-"`
1248
1249
1250
1251
1252
1253 ForceSendFields []string `json:"-"`
1254
1255
1256
1257
1258 NullFields []string `json:"-"`
1259 }
1260
1261 func (s *ListRestorePlansResponse) MarshalJSON() ([]byte, error) {
1262 type NoMethod ListRestorePlansResponse
1263 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1264 }
1265
1266
1267 type ListRestoresResponse struct {
1268
1269
1270
1271 NextPageToken string `json:"nextPageToken,omitempty"`
1272
1273 Restores []*Restore `json:"restores,omitempty"`
1274
1275 Unreachable []string `json:"unreachable,omitempty"`
1276
1277
1278 googleapi.ServerResponse `json:"-"`
1279
1280
1281
1282
1283
1284 ForceSendFields []string `json:"-"`
1285
1286
1287
1288
1289 NullFields []string `json:"-"`
1290 }
1291
1292 func (s *ListRestoresResponse) MarshalJSON() ([]byte, error) {
1293 type NoMethod ListRestoresResponse
1294 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1295 }
1296
1297
1298 type ListVolumeBackupsResponse struct {
1299
1300
1301
1302 NextPageToken string `json:"nextPageToken,omitempty"`
1303
1304 VolumeBackups []*VolumeBackup `json:"volumeBackups,omitempty"`
1305
1306
1307 googleapi.ServerResponse `json:"-"`
1308
1309
1310
1311
1312
1313 ForceSendFields []string `json:"-"`
1314
1315
1316
1317
1318 NullFields []string `json:"-"`
1319 }
1320
1321 func (s *ListVolumeBackupsResponse) MarshalJSON() ([]byte, error) {
1322 type NoMethod ListVolumeBackupsResponse
1323 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1324 }
1325
1326
1327 type ListVolumeRestoresResponse struct {
1328
1329
1330
1331 NextPageToken string `json:"nextPageToken,omitempty"`
1332
1333 VolumeRestores []*VolumeRestore `json:"volumeRestores,omitempty"`
1334
1335
1336 googleapi.ServerResponse `json:"-"`
1337
1338
1339
1340
1341
1342 ForceSendFields []string `json:"-"`
1343
1344
1345
1346
1347 NullFields []string `json:"-"`
1348 }
1349
1350 func (s *ListVolumeRestoresResponse) MarshalJSON() ([]byte, error) {
1351 type NoMethod ListVolumeRestoresResponse
1352 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1353 }
1354
1355
1356 type Location struct {
1357
1358
1359 DisplayName string `json:"displayName,omitempty"`
1360
1361
1362 Labels map[string]string `json:"labels,omitempty"`
1363
1364 LocationId string `json:"locationId,omitempty"`
1365
1366
1367 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1368
1369
1370
1371 Name string `json:"name,omitempty"`
1372
1373
1374 googleapi.ServerResponse `json:"-"`
1375
1376
1377
1378
1379
1380 ForceSendFields []string `json:"-"`
1381
1382
1383
1384
1385 NullFields []string `json:"-"`
1386 }
1387
1388 func (s *Location) MarshalJSON() ([]byte, error) {
1389 type NoMethod Location
1390 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1391 }
1392
1393
1394 type NamespacedName struct {
1395
1396 Name string `json:"name,omitempty"`
1397
1398 Namespace string `json:"namespace,omitempty"`
1399
1400
1401
1402
1403
1404 ForceSendFields []string `json:"-"`
1405
1406
1407
1408
1409 NullFields []string `json:"-"`
1410 }
1411
1412 func (s *NamespacedName) MarshalJSON() ([]byte, error) {
1413 type NoMethod NamespacedName
1414 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1415 }
1416
1417
1418 type NamespacedNames struct {
1419
1420 NamespacedNames []*NamespacedName `json:"namespacedNames,omitempty"`
1421
1422
1423
1424
1425
1426 ForceSendFields []string `json:"-"`
1427
1428
1429
1430
1431 NullFields []string `json:"-"`
1432 }
1433
1434 func (s *NamespacedNames) MarshalJSON() ([]byte, error) {
1435 type NoMethod NamespacedNames
1436 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1437 }
1438
1439
1440 type Namespaces struct {
1441
1442 Namespaces []string `json:"namespaces,omitempty"`
1443
1444
1445
1446
1447
1448 ForceSendFields []string `json:"-"`
1449
1450
1451
1452
1453 NullFields []string `json:"-"`
1454 }
1455
1456 func (s *Namespaces) MarshalJSON() ([]byte, error) {
1457 type NoMethod Namespaces
1458 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1459 }
1460
1461
1462 type OperationMetadata struct {
1463
1464 ApiVersion string `json:"apiVersion,omitempty"`
1465
1466 CreateTime string `json:"createTime,omitempty"`
1467
1468 EndTime string `json:"endTime,omitempty"`
1469
1470
1471
1472
1473 RequestedCancellation bool `json:"requestedCancellation,omitempty"`
1474
1475 StatusMessage string `json:"statusMessage,omitempty"`
1476
1477
1478 Target string `json:"target,omitempty"`
1479
1480 Verb string `json:"verb,omitempty"`
1481
1482
1483
1484
1485
1486 ForceSendFields []string `json:"-"`
1487
1488
1489
1490
1491 NullFields []string `json:"-"`
1492 }
1493
1494 func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
1495 type NoMethod OperationMetadata
1496 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1497 }
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529 type Policy struct {
1530
1531 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541 Bindings []*Binding `json:"bindings,omitempty"`
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553 Etag string `json:"etag,omitempty"`
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569 Version int64 `json:"version,omitempty"`
1570
1571
1572 googleapi.ServerResponse `json:"-"`
1573
1574
1575
1576
1577
1578 ForceSendFields []string `json:"-"`
1579
1580
1581
1582
1583 NullFields []string `json:"-"`
1584 }
1585
1586 func (s *Policy) MarshalJSON() ([]byte, error) {
1587 type NoMethod Policy
1588 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1589 }
1590
1591
1592
1593
1594 type ResourceFilter struct {
1595
1596
1597
1598
1599
1600 GroupKinds []*GroupKind `json:"groupKinds,omitempty"`
1601
1602
1603
1604
1605
1606 JsonPath string `json:"jsonPath,omitempty"`
1607
1608
1609
1610
1611
1612 Namespaces []string `json:"namespaces,omitempty"`
1613
1614
1615
1616
1617
1618 ForceSendFields []string `json:"-"`
1619
1620
1621
1622
1623 NullFields []string `json:"-"`
1624 }
1625
1626 func (s *ResourceFilter) MarshalJSON() ([]byte, error) {
1627 type NoMethod ResourceFilter
1628 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1629 }
1630
1631
1632
1633 type Restore struct {
1634
1635
1636
1637
1638 Backup string `json:"backup,omitempty"`
1639
1640
1641
1642
1643 Cluster string `json:"cluster,omitempty"`
1644
1645
1646 CompleteTime string `json:"completeTime,omitempty"`
1647
1648
1649 CreateTime string `json:"createTime,omitempty"`
1650
1651 Description string `json:"description,omitempty"`
1652
1653
1654
1655
1656
1657
1658
1659
1660 Etag string `json:"etag,omitempty"`
1661
1662 Labels map[string]string `json:"labels,omitempty"`
1663
1664
1665 Name string `json:"name,omitempty"`
1666
1667
1668 ResourcesExcludedCount int64 `json:"resourcesExcludedCount,omitempty"`
1669
1670
1671 ResourcesFailedCount int64 `json:"resourcesFailedCount,omitempty"`
1672
1673
1674 ResourcesRestoredCount int64 `json:"resourcesRestoredCount,omitempty"`
1675
1676
1677 RestoreConfig *RestoreConfig `json:"restoreConfig,omitempty"`
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691 State string `json:"state,omitempty"`
1692
1693
1694 StateReason string `json:"stateReason,omitempty"`
1695
1696
1697 Uid string `json:"uid,omitempty"`
1698
1699
1700 UpdateTime string `json:"updateTime,omitempty"`
1701
1702
1703 VolumesRestoredCount int64 `json:"volumesRestoredCount,omitempty"`
1704
1705
1706 googleapi.ServerResponse `json:"-"`
1707
1708
1709
1710
1711
1712 ForceSendFields []string `json:"-"`
1713
1714
1715
1716
1717 NullFields []string `json:"-"`
1718 }
1719
1720 func (s *Restore) MarshalJSON() ([]byte, error) {
1721 type NoMethod Restore
1722 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1723 }
1724
1725
1726 type RestoreConfig struct {
1727
1728
1729 AllNamespaces bool `json:"allNamespaces,omitempty"`
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745 ClusterResourceConflictPolicy string `json:"clusterResourceConflictPolicy,omitempty"`
1746
1747
1748
1749 ClusterResourceRestoreScope *ClusterResourceRestoreScope `json:"clusterResourceRestoreScope,omitempty"`
1750
1751
1752 ExcludedNamespaces *Namespaces `json:"excludedNamespaces,omitempty"`
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772 NamespacedResourceRestoreMode string `json:"namespacedResourceRestoreMode,omitempty"`
1773
1774
1775 NoNamespaces bool `json:"noNamespaces,omitempty"`
1776
1777
1778
1779 SelectedApplications *NamespacedNames `json:"selectedApplications,omitempty"`
1780
1781
1782
1783 SelectedNamespaces *Namespaces `json:"selectedNamespaces,omitempty"`
1784
1785
1786
1787
1788
1789 SubstitutionRules []*SubstitutionRule `json:"substitutionRules,omitempty"`
1790
1791
1792
1793
1794
1795 TransformationRules []*TransformationRule `json:"transformationRules,omitempty"`
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814 VolumeDataRestorePolicy string `json:"volumeDataRestorePolicy,omitempty"`
1815
1816
1817
1818
1819
1820 ForceSendFields []string `json:"-"`
1821
1822
1823
1824
1825 NullFields []string `json:"-"`
1826 }
1827
1828 func (s *RestoreConfig) MarshalJSON() ([]byte, error) {
1829 type NoMethod RestoreConfig
1830 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1831 }
1832
1833
1834
1835 type RestorePlan struct {
1836
1837
1838
1839 BackupPlan string `json:"backupPlan,omitempty"`
1840
1841
1842
1843
1844 Cluster string `json:"cluster,omitempty"`
1845
1846
1847 CreateTime string `json:"createTime,omitempty"`
1848
1849
1850 Description string `json:"description,omitempty"`
1851
1852
1853
1854
1855
1856
1857
1858
1859 Etag string `json:"etag,omitempty"`
1860
1861 Labels map[string]string `json:"labels,omitempty"`
1862
1863
1864 Name string `json:"name,omitempty"`
1865
1866
1867 RestoreConfig *RestoreConfig `json:"restoreConfig,omitempty"`
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878 State string `json:"state,omitempty"`
1879
1880
1881 StateReason string `json:"stateReason,omitempty"`
1882
1883
1884 Uid string `json:"uid,omitempty"`
1885
1886
1887 UpdateTime string `json:"updateTime,omitempty"`
1888
1889
1890 googleapi.ServerResponse `json:"-"`
1891
1892
1893
1894
1895
1896 ForceSendFields []string `json:"-"`
1897
1898
1899
1900
1901 NullFields []string `json:"-"`
1902 }
1903
1904 func (s *RestorePlan) MarshalJSON() ([]byte, error) {
1905 type NoMethod RestorePlan
1906 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1907 }
1908
1909
1910
1911 type RetentionPolicy struct {
1912
1913
1914
1915
1916
1917
1918
1919 BackupDeleteLockDays int64 `json:"backupDeleteLockDays,omitempty"`
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932 BackupRetainDays int64 `json:"backupRetainDays,omitempty"`
1933
1934
1935
1936 Locked bool `json:"locked,omitempty"`
1937
1938
1939
1940
1941
1942 ForceSendFields []string `json:"-"`
1943
1944
1945
1946
1947 NullFields []string `json:"-"`
1948 }
1949
1950 func (s *RetentionPolicy) MarshalJSON() ([]byte, error) {
1951 type NoMethod RetentionPolicy
1952 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1953 }
1954
1955
1956
1957 type RpoConfig struct {
1958
1959
1960
1961
1962
1963
1964
1965
1966 ExclusionWindows []*ExclusionWindow `json:"exclusionWindows,omitempty"`
1967
1968
1969
1970
1971 TargetRpoMinutes int64 `json:"targetRpoMinutes,omitempty"`
1972
1973
1974
1975
1976
1977 ForceSendFields []string `json:"-"`
1978
1979
1980
1981
1982 NullFields []string `json:"-"`
1983 }
1984
1985 func (s *RpoConfig) MarshalJSON() ([]byte, error) {
1986 type NoMethod RpoConfig
1987 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1988 }
1989
1990
1991
1992 type Schedule struct {
1993
1994
1995
1996
1997
1998
1999 CronSchedule string `json:"cronSchedule,omitempty"`
2000
2001
2002 NextScheduledBackupTime string `json:"nextScheduledBackupTime,omitempty"`
2003
2004
2005 Paused bool `json:"paused,omitempty"`
2006
2007
2008
2009
2010
2011 RpoConfig *RpoConfig `json:"rpoConfig,omitempty"`
2012
2013
2014
2015
2016
2017 ForceSendFields []string `json:"-"`
2018
2019
2020
2021
2022 NullFields []string `json:"-"`
2023 }
2024
2025 func (s *Schedule) MarshalJSON() ([]byte, error) {
2026 type NoMethod Schedule
2027 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2028 }
2029
2030
2031 type SetIamPolicyRequest struct {
2032
2033
2034
2035
2036 Policy *Policy `json:"policy,omitempty"`
2037
2038
2039
2040 UpdateMask string `json:"updateMask,omitempty"`
2041
2042
2043
2044
2045
2046 ForceSendFields []string `json:"-"`
2047
2048
2049
2050
2051 NullFields []string `json:"-"`
2052 }
2053
2054 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
2055 type NoMethod SetIamPolicyRequest
2056 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2057 }
2058
2059
2060
2061
2062
2063 type SubstitutionRule struct {
2064
2065
2066
2067
2068 NewValue string `json:"newValue,omitempty"`
2069
2070
2071
2072
2073
2074
2075
2076
2077 OriginalValuePattern string `json:"originalValuePattern,omitempty"`
2078
2079
2080
2081
2082 TargetGroupKinds []*GroupKind `json:"targetGroupKinds,omitempty"`
2083
2084
2085
2086
2087
2088
2089
2090 TargetJsonPath string `json:"targetJsonPath,omitempty"`
2091
2092
2093
2094
2095
2096
2097
2098 TargetNamespaces []string `json:"targetNamespaces,omitempty"`
2099
2100
2101
2102
2103
2104 ForceSendFields []string `json:"-"`
2105
2106
2107
2108
2109 NullFields []string `json:"-"`
2110 }
2111
2112 func (s *SubstitutionRule) MarshalJSON() ([]byte, error) {
2113 type NoMethod SubstitutionRule
2114 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2115 }
2116
2117
2118 type TestIamPermissionsRequest struct {
2119
2120
2121
2122
2123 Permissions []string `json:"permissions,omitempty"`
2124
2125
2126
2127
2128
2129 ForceSendFields []string `json:"-"`
2130
2131
2132
2133
2134 NullFields []string `json:"-"`
2135 }
2136
2137 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
2138 type NoMethod TestIamPermissionsRequest
2139 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2140 }
2141
2142
2143
2144 type TestIamPermissionsResponse struct {
2145
2146
2147 Permissions []string `json:"permissions,omitempty"`
2148
2149
2150 googleapi.ServerResponse `json:"-"`
2151
2152
2153
2154
2155
2156 ForceSendFields []string `json:"-"`
2157
2158
2159
2160
2161 NullFields []string `json:"-"`
2162 }
2163
2164 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
2165 type NoMethod TestIamPermissionsResponse
2166 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2167 }
2168
2169
2170
2171
2172 type TimeOfDay struct {
2173
2174
2175
2176 Hours int64 `json:"hours,omitempty"`
2177
2178 Minutes int64 `json:"minutes,omitempty"`
2179
2180 Nanos int64 `json:"nanos,omitempty"`
2181
2182
2183 Seconds int64 `json:"seconds,omitempty"`
2184
2185
2186
2187
2188
2189 ForceSendFields []string `json:"-"`
2190
2191
2192
2193
2194 NullFields []string `json:"-"`
2195 }
2196
2197 func (s *TimeOfDay) MarshalJSON() ([]byte, error) {
2198 type NoMethod TimeOfDay
2199 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2200 }
2201
2202
2203
2204
2205
2206 type TransformationRule struct {
2207
2208
2209 Description string `json:"description,omitempty"`
2210
2211
2212
2213
2214 FieldActions []*TransformationRuleAction `json:"fieldActions,omitempty"`
2215
2216
2217
2218
2219 ResourceFilter *ResourceFilter `json:"resourceFilter,omitempty"`
2220
2221
2222
2223
2224
2225 ForceSendFields []string `json:"-"`
2226
2227
2228
2229
2230 NullFields []string `json:"-"`
2231 }
2232
2233 func (s *TransformationRule) MarshalJSON() ([]byte, error) {
2234 type NoMethod TransformationRule
2235 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2236 }
2237
2238
2239
2240
2241 type TransformationRuleAction struct {
2242
2243
2244 FromPath string `json:"fromPath,omitempty"`
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267 Op string `json:"op,omitempty"`
2268
2269
2270 Path string `json:"path,omitempty"`
2271
2272
2273 Value string `json:"value,omitempty"`
2274
2275
2276
2277
2278
2279 ForceSendFields []string `json:"-"`
2280
2281
2282
2283
2284 NullFields []string `json:"-"`
2285 }
2286
2287 func (s *TransformationRuleAction) MarshalJSON() ([]byte, error) {
2288 type NoMethod TransformationRuleAction
2289 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2290 }
2291
2292
2293
2294
2295 type VolumeBackup struct {
2296
2297
2298 CompleteTime string `json:"completeTime,omitempty"`
2299
2300
2301 CreateTime string `json:"createTime,omitempty"`
2302
2303
2304 DiskSizeBytes int64 `json:"diskSizeBytes,omitempty,string"`
2305
2306
2307
2308
2309
2310 Etag string `json:"etag,omitempty"`
2311
2312
2313
2314
2315
2316
2317 Format string `json:"format,omitempty"`
2318
2319
2320 Name string `json:"name,omitempty"`
2321
2322
2323 SourcePvc *NamespacedName `json:"sourcePvc,omitempty"`
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341 State string `json:"state,omitempty"`
2342
2343
2344 StateMessage string `json:"stateMessage,omitempty"`
2345
2346
2347
2348
2349
2350 StorageBytes int64 `json:"storageBytes,omitempty,string"`
2351
2352
2353 Uid string `json:"uid,omitempty"`
2354
2355
2356 UpdateTime string `json:"updateTime,omitempty"`
2357
2358
2359 VolumeBackupHandle string `json:"volumeBackupHandle,omitempty"`
2360
2361
2362 googleapi.ServerResponse `json:"-"`
2363
2364
2365
2366
2367
2368 ForceSendFields []string `json:"-"`
2369
2370
2371
2372
2373 NullFields []string `json:"-"`
2374 }
2375
2376 func (s *VolumeBackup) MarshalJSON() ([]byte, error) {
2377 type NoMethod VolumeBackup
2378 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2379 }
2380
2381
2382
2383 type VolumeRestore struct {
2384
2385
2386 CompleteTime string `json:"completeTime,omitempty"`
2387
2388
2389 CreateTime string `json:"createTime,omitempty"`
2390
2391
2392
2393
2394
2395 Etag string `json:"etag,omitempty"`
2396
2397
2398 Name string `json:"name,omitempty"`
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411 State string `json:"state,omitempty"`
2412
2413
2414 StateMessage string `json:"stateMessage,omitempty"`
2415
2416
2417 TargetPvc *NamespacedName `json:"targetPvc,omitempty"`
2418
2419
2420 Uid string `json:"uid,omitempty"`
2421
2422
2423 UpdateTime string `json:"updateTime,omitempty"`
2424
2425
2426
2427 VolumeBackup string `json:"volumeBackup,omitempty"`
2428
2429
2430 VolumeHandle string `json:"volumeHandle,omitempty"`
2431
2432
2433
2434
2435
2436 VolumeType string `json:"volumeType,omitempty"`
2437
2438
2439 googleapi.ServerResponse `json:"-"`
2440
2441
2442
2443
2444
2445 ForceSendFields []string `json:"-"`
2446
2447
2448
2449
2450 NullFields []string `json:"-"`
2451 }
2452
2453 func (s *VolumeRestore) MarshalJSON() ([]byte, error) {
2454 type NoMethod VolumeRestore
2455 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2456 }
2457
2458 type ProjectsLocationsGetCall struct {
2459 s *Service
2460 name string
2461 urlParams_ gensupport.URLParams
2462 ifNoneMatch_ string
2463 ctx_ context.Context
2464 header_ http.Header
2465 }
2466
2467
2468
2469
2470 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
2471 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2472 c.name = name
2473 return c
2474 }
2475
2476
2477
2478
2479 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
2480 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2481 return c
2482 }
2483
2484
2485
2486
2487 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
2488 c.ifNoneMatch_ = entityTag
2489 return c
2490 }
2491
2492
2493 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
2494 c.ctx_ = ctx
2495 return c
2496 }
2497
2498
2499
2500 func (c *ProjectsLocationsGetCall) Header() http.Header {
2501 if c.header_ == nil {
2502 c.header_ = make(http.Header)
2503 }
2504 return c.header_
2505 }
2506
2507 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
2508 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2509 if c.ifNoneMatch_ != "" {
2510 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2511 }
2512 var body io.Reader = nil
2513 c.urlParams_.Set("alt", alt)
2514 c.urlParams_.Set("prettyPrint", "false")
2515 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2516 urls += "?" + c.urlParams_.Encode()
2517 req, err := http.NewRequest("GET", urls, body)
2518 if err != nil {
2519 return nil, err
2520 }
2521 req.Header = reqHeaders
2522 googleapi.Expand(req.URL, map[string]string{
2523 "name": c.name,
2524 })
2525 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2526 }
2527
2528
2529
2530
2531
2532
2533 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
2534 gensupport.SetOptions(c.urlParams_, opts...)
2535 res, err := c.doRequest("json")
2536 if res != nil && res.StatusCode == http.StatusNotModified {
2537 if res.Body != nil {
2538 res.Body.Close()
2539 }
2540 return nil, gensupport.WrapError(&googleapi.Error{
2541 Code: res.StatusCode,
2542 Header: res.Header,
2543 })
2544 }
2545 if err != nil {
2546 return nil, err
2547 }
2548 defer googleapi.CloseBody(res)
2549 if err := googleapi.CheckResponse(res); err != nil {
2550 return nil, gensupport.WrapError(err)
2551 }
2552 ret := &Location{
2553 ServerResponse: googleapi.ServerResponse{
2554 Header: res.Header,
2555 HTTPStatusCode: res.StatusCode,
2556 },
2557 }
2558 target := &ret
2559 if err := gensupport.DecodeResponse(target, res); err != nil {
2560 return nil, err
2561 }
2562 return ret, nil
2563 }
2564
2565 type ProjectsLocationsListCall struct {
2566 s *Service
2567 name string
2568 urlParams_ gensupport.URLParams
2569 ifNoneMatch_ string
2570 ctx_ context.Context
2571 header_ http.Header
2572 }
2573
2574
2575
2576
2577 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
2578 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2579 c.name = name
2580 return c
2581 }
2582
2583
2584
2585
2586
2587 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
2588 c.urlParams_.Set("filter", filter)
2589 return c
2590 }
2591
2592
2593
2594 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
2595 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2596 return c
2597 }
2598
2599
2600
2601
2602 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
2603 c.urlParams_.Set("pageToken", pageToken)
2604 return c
2605 }
2606
2607
2608
2609
2610 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
2611 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2612 return c
2613 }
2614
2615
2616
2617
2618 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
2619 c.ifNoneMatch_ = entityTag
2620 return c
2621 }
2622
2623
2624 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
2625 c.ctx_ = ctx
2626 return c
2627 }
2628
2629
2630
2631 func (c *ProjectsLocationsListCall) Header() http.Header {
2632 if c.header_ == nil {
2633 c.header_ = make(http.Header)
2634 }
2635 return c.header_
2636 }
2637
2638 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
2639 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2640 if c.ifNoneMatch_ != "" {
2641 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2642 }
2643 var body io.Reader = nil
2644 c.urlParams_.Set("alt", alt)
2645 c.urlParams_.Set("prettyPrint", "false")
2646 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
2647 urls += "?" + c.urlParams_.Encode()
2648 req, err := http.NewRequest("GET", urls, body)
2649 if err != nil {
2650 return nil, err
2651 }
2652 req.Header = reqHeaders
2653 googleapi.Expand(req.URL, map[string]string{
2654 "name": c.name,
2655 })
2656 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2657 }
2658
2659
2660
2661
2662
2663
2664
2665 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
2666 gensupport.SetOptions(c.urlParams_, opts...)
2667 res, err := c.doRequest("json")
2668 if res != nil && res.StatusCode == http.StatusNotModified {
2669 if res.Body != nil {
2670 res.Body.Close()
2671 }
2672 return nil, gensupport.WrapError(&googleapi.Error{
2673 Code: res.StatusCode,
2674 Header: res.Header,
2675 })
2676 }
2677 if err != nil {
2678 return nil, err
2679 }
2680 defer googleapi.CloseBody(res)
2681 if err := googleapi.CheckResponse(res); err != nil {
2682 return nil, gensupport.WrapError(err)
2683 }
2684 ret := &ListLocationsResponse{
2685 ServerResponse: googleapi.ServerResponse{
2686 Header: res.Header,
2687 HTTPStatusCode: res.StatusCode,
2688 },
2689 }
2690 target := &ret
2691 if err := gensupport.DecodeResponse(target, res); err != nil {
2692 return nil, err
2693 }
2694 return ret, nil
2695 }
2696
2697
2698
2699
2700 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
2701 c.ctx_ = ctx
2702 defer c.PageToken(c.urlParams_.Get("pageToken"))
2703 for {
2704 x, err := c.Do()
2705 if err != nil {
2706 return err
2707 }
2708 if err := f(x); err != nil {
2709 return err
2710 }
2711 if x.NextPageToken == "" {
2712 return nil
2713 }
2714 c.PageToken(x.NextPageToken)
2715 }
2716 }
2717
2718 type ProjectsLocationsBackupPlansCreateCall struct {
2719 s *Service
2720 parent string
2721 backupplan *BackupPlan
2722 urlParams_ gensupport.URLParams
2723 ctx_ context.Context
2724 header_ http.Header
2725 }
2726
2727
2728
2729
2730
2731 func (r *ProjectsLocationsBackupPlansService) Create(parent string, backupplan *BackupPlan) *ProjectsLocationsBackupPlansCreateCall {
2732 c := &ProjectsLocationsBackupPlansCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2733 c.parent = parent
2734 c.backupplan = backupplan
2735 return c
2736 }
2737
2738
2739
2740
2741
2742
2743
2744 func (c *ProjectsLocationsBackupPlansCreateCall) BackupPlanId(backupPlanId string) *ProjectsLocationsBackupPlansCreateCall {
2745 c.urlParams_.Set("backupPlanId", backupPlanId)
2746 return c
2747 }
2748
2749
2750
2751
2752 func (c *ProjectsLocationsBackupPlansCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansCreateCall {
2753 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2754 return c
2755 }
2756
2757
2758 func (c *ProjectsLocationsBackupPlansCreateCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansCreateCall {
2759 c.ctx_ = ctx
2760 return c
2761 }
2762
2763
2764
2765 func (c *ProjectsLocationsBackupPlansCreateCall) Header() http.Header {
2766 if c.header_ == nil {
2767 c.header_ = make(http.Header)
2768 }
2769 return c.header_
2770 }
2771
2772 func (c *ProjectsLocationsBackupPlansCreateCall) doRequest(alt string) (*http.Response, error) {
2773 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2774 var body io.Reader = nil
2775 body, err := googleapi.WithoutDataWrapper.JSONReader(c.backupplan)
2776 if err != nil {
2777 return nil, err
2778 }
2779 c.urlParams_.Set("alt", alt)
2780 c.urlParams_.Set("prettyPrint", "false")
2781 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backupPlans")
2782 urls += "?" + c.urlParams_.Encode()
2783 req, err := http.NewRequest("POST", urls, body)
2784 if err != nil {
2785 return nil, err
2786 }
2787 req.Header = reqHeaders
2788 googleapi.Expand(req.URL, map[string]string{
2789 "parent": c.parent,
2790 })
2791 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2792 }
2793
2794
2795
2796
2797
2798
2799
2800 func (c *ProjectsLocationsBackupPlansCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
2801 gensupport.SetOptions(c.urlParams_, opts...)
2802 res, err := c.doRequest("json")
2803 if res != nil && res.StatusCode == http.StatusNotModified {
2804 if res.Body != nil {
2805 res.Body.Close()
2806 }
2807 return nil, gensupport.WrapError(&googleapi.Error{
2808 Code: res.StatusCode,
2809 Header: res.Header,
2810 })
2811 }
2812 if err != nil {
2813 return nil, err
2814 }
2815 defer googleapi.CloseBody(res)
2816 if err := googleapi.CheckResponse(res); err != nil {
2817 return nil, gensupport.WrapError(err)
2818 }
2819 ret := &GoogleLongrunningOperation{
2820 ServerResponse: googleapi.ServerResponse{
2821 Header: res.Header,
2822 HTTPStatusCode: res.StatusCode,
2823 },
2824 }
2825 target := &ret
2826 if err := gensupport.DecodeResponse(target, res); err != nil {
2827 return nil, err
2828 }
2829 return ret, nil
2830 }
2831
2832 type ProjectsLocationsBackupPlansDeleteCall struct {
2833 s *Service
2834 name string
2835 urlParams_ gensupport.URLParams
2836 ctx_ context.Context
2837 header_ http.Header
2838 }
2839
2840
2841
2842
2843
2844 func (r *ProjectsLocationsBackupPlansService) Delete(name string) *ProjectsLocationsBackupPlansDeleteCall {
2845 c := &ProjectsLocationsBackupPlansDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2846 c.name = name
2847 return c
2848 }
2849
2850
2851
2852
2853 func (c *ProjectsLocationsBackupPlansDeleteCall) Etag(etag string) *ProjectsLocationsBackupPlansDeleteCall {
2854 c.urlParams_.Set("etag", etag)
2855 return c
2856 }
2857
2858
2859
2860
2861 func (c *ProjectsLocationsBackupPlansDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansDeleteCall {
2862 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2863 return c
2864 }
2865
2866
2867 func (c *ProjectsLocationsBackupPlansDeleteCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansDeleteCall {
2868 c.ctx_ = ctx
2869 return c
2870 }
2871
2872
2873
2874 func (c *ProjectsLocationsBackupPlansDeleteCall) Header() http.Header {
2875 if c.header_ == nil {
2876 c.header_ = make(http.Header)
2877 }
2878 return c.header_
2879 }
2880
2881 func (c *ProjectsLocationsBackupPlansDeleteCall) doRequest(alt string) (*http.Response, error) {
2882 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2883 var body io.Reader = nil
2884 c.urlParams_.Set("alt", alt)
2885 c.urlParams_.Set("prettyPrint", "false")
2886 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2887 urls += "?" + c.urlParams_.Encode()
2888 req, err := http.NewRequest("DELETE", urls, body)
2889 if err != nil {
2890 return nil, err
2891 }
2892 req.Header = reqHeaders
2893 googleapi.Expand(req.URL, map[string]string{
2894 "name": c.name,
2895 })
2896 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2897 }
2898
2899
2900
2901
2902
2903
2904
2905 func (c *ProjectsLocationsBackupPlansDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
2906 gensupport.SetOptions(c.urlParams_, opts...)
2907 res, err := c.doRequest("json")
2908 if res != nil && res.StatusCode == http.StatusNotModified {
2909 if res.Body != nil {
2910 res.Body.Close()
2911 }
2912 return nil, gensupport.WrapError(&googleapi.Error{
2913 Code: res.StatusCode,
2914 Header: res.Header,
2915 })
2916 }
2917 if err != nil {
2918 return nil, err
2919 }
2920 defer googleapi.CloseBody(res)
2921 if err := googleapi.CheckResponse(res); err != nil {
2922 return nil, gensupport.WrapError(err)
2923 }
2924 ret := &GoogleLongrunningOperation{
2925 ServerResponse: googleapi.ServerResponse{
2926 Header: res.Header,
2927 HTTPStatusCode: res.StatusCode,
2928 },
2929 }
2930 target := &ret
2931 if err := gensupport.DecodeResponse(target, res); err != nil {
2932 return nil, err
2933 }
2934 return ret, nil
2935 }
2936
2937 type ProjectsLocationsBackupPlansGetCall struct {
2938 s *Service
2939 name string
2940 urlParams_ gensupport.URLParams
2941 ifNoneMatch_ string
2942 ctx_ context.Context
2943 header_ http.Header
2944 }
2945
2946
2947
2948
2949
2950 func (r *ProjectsLocationsBackupPlansService) Get(name string) *ProjectsLocationsBackupPlansGetCall {
2951 c := &ProjectsLocationsBackupPlansGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2952 c.name = name
2953 return c
2954 }
2955
2956
2957
2958
2959 func (c *ProjectsLocationsBackupPlansGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansGetCall {
2960 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2961 return c
2962 }
2963
2964
2965
2966
2967 func (c *ProjectsLocationsBackupPlansGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBackupPlansGetCall {
2968 c.ifNoneMatch_ = entityTag
2969 return c
2970 }
2971
2972
2973 func (c *ProjectsLocationsBackupPlansGetCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansGetCall {
2974 c.ctx_ = ctx
2975 return c
2976 }
2977
2978
2979
2980 func (c *ProjectsLocationsBackupPlansGetCall) Header() http.Header {
2981 if c.header_ == nil {
2982 c.header_ = make(http.Header)
2983 }
2984 return c.header_
2985 }
2986
2987 func (c *ProjectsLocationsBackupPlansGetCall) doRequest(alt string) (*http.Response, error) {
2988 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2989 if c.ifNoneMatch_ != "" {
2990 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2991 }
2992 var body io.Reader = nil
2993 c.urlParams_.Set("alt", alt)
2994 c.urlParams_.Set("prettyPrint", "false")
2995 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2996 urls += "?" + c.urlParams_.Encode()
2997 req, err := http.NewRequest("GET", urls, body)
2998 if err != nil {
2999 return nil, err
3000 }
3001 req.Header = reqHeaders
3002 googleapi.Expand(req.URL, map[string]string{
3003 "name": c.name,
3004 })
3005 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3006 }
3007
3008
3009
3010
3011
3012
3013 func (c *ProjectsLocationsBackupPlansGetCall) Do(opts ...googleapi.CallOption) (*BackupPlan, error) {
3014 gensupport.SetOptions(c.urlParams_, opts...)
3015 res, err := c.doRequest("json")
3016 if res != nil && res.StatusCode == http.StatusNotModified {
3017 if res.Body != nil {
3018 res.Body.Close()
3019 }
3020 return nil, gensupport.WrapError(&googleapi.Error{
3021 Code: res.StatusCode,
3022 Header: res.Header,
3023 })
3024 }
3025 if err != nil {
3026 return nil, err
3027 }
3028 defer googleapi.CloseBody(res)
3029 if err := googleapi.CheckResponse(res); err != nil {
3030 return nil, gensupport.WrapError(err)
3031 }
3032 ret := &BackupPlan{
3033 ServerResponse: googleapi.ServerResponse{
3034 Header: res.Header,
3035 HTTPStatusCode: res.StatusCode,
3036 },
3037 }
3038 target := &ret
3039 if err := gensupport.DecodeResponse(target, res); err != nil {
3040 return nil, err
3041 }
3042 return ret, nil
3043 }
3044
3045 type ProjectsLocationsBackupPlansGetIamPolicyCall struct {
3046 s *Service
3047 resource string
3048 urlParams_ gensupport.URLParams
3049 ifNoneMatch_ string
3050 ctx_ context.Context
3051 header_ http.Header
3052 }
3053
3054
3055
3056
3057
3058
3059
3060 func (r *ProjectsLocationsBackupPlansService) GetIamPolicy(resource string) *ProjectsLocationsBackupPlansGetIamPolicyCall {
3061 c := &ProjectsLocationsBackupPlansGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3062 c.resource = resource
3063 return c
3064 }
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078 func (c *ProjectsLocationsBackupPlansGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsBackupPlansGetIamPolicyCall {
3079 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
3080 return c
3081 }
3082
3083
3084
3085
3086 func (c *ProjectsLocationsBackupPlansGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansGetIamPolicyCall {
3087 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3088 return c
3089 }
3090
3091
3092
3093
3094 func (c *ProjectsLocationsBackupPlansGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsBackupPlansGetIamPolicyCall {
3095 c.ifNoneMatch_ = entityTag
3096 return c
3097 }
3098
3099
3100 func (c *ProjectsLocationsBackupPlansGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansGetIamPolicyCall {
3101 c.ctx_ = ctx
3102 return c
3103 }
3104
3105
3106
3107 func (c *ProjectsLocationsBackupPlansGetIamPolicyCall) Header() http.Header {
3108 if c.header_ == nil {
3109 c.header_ = make(http.Header)
3110 }
3111 return c.header_
3112 }
3113
3114 func (c *ProjectsLocationsBackupPlansGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3115 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3116 if c.ifNoneMatch_ != "" {
3117 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3118 }
3119 var body io.Reader = nil
3120 c.urlParams_.Set("alt", alt)
3121 c.urlParams_.Set("prettyPrint", "false")
3122 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
3123 urls += "?" + c.urlParams_.Encode()
3124 req, err := http.NewRequest("GET", urls, body)
3125 if err != nil {
3126 return nil, err
3127 }
3128 req.Header = reqHeaders
3129 googleapi.Expand(req.URL, map[string]string{
3130 "resource": c.resource,
3131 })
3132 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3133 }
3134
3135
3136
3137
3138
3139
3140 func (c *ProjectsLocationsBackupPlansGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3141 gensupport.SetOptions(c.urlParams_, opts...)
3142 res, err := c.doRequest("json")
3143 if res != nil && res.StatusCode == http.StatusNotModified {
3144 if res.Body != nil {
3145 res.Body.Close()
3146 }
3147 return nil, gensupport.WrapError(&googleapi.Error{
3148 Code: res.StatusCode,
3149 Header: res.Header,
3150 })
3151 }
3152 if err != nil {
3153 return nil, err
3154 }
3155 defer googleapi.CloseBody(res)
3156 if err := googleapi.CheckResponse(res); err != nil {
3157 return nil, gensupport.WrapError(err)
3158 }
3159 ret := &Policy{
3160 ServerResponse: googleapi.ServerResponse{
3161 Header: res.Header,
3162 HTTPStatusCode: res.StatusCode,
3163 },
3164 }
3165 target := &ret
3166 if err := gensupport.DecodeResponse(target, res); err != nil {
3167 return nil, err
3168 }
3169 return ret, nil
3170 }
3171
3172 type ProjectsLocationsBackupPlansListCall struct {
3173 s *Service
3174 parent string
3175 urlParams_ gensupport.URLParams
3176 ifNoneMatch_ string
3177 ctx_ context.Context
3178 header_ http.Header
3179 }
3180
3181
3182
3183
3184
3185 func (r *ProjectsLocationsBackupPlansService) List(parent string) *ProjectsLocationsBackupPlansListCall {
3186 c := &ProjectsLocationsBackupPlansListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3187 c.parent = parent
3188 return c
3189 }
3190
3191
3192
3193 func (c *ProjectsLocationsBackupPlansListCall) Filter(filter string) *ProjectsLocationsBackupPlansListCall {
3194 c.urlParams_.Set("filter", filter)
3195 return c
3196 }
3197
3198
3199
3200 func (c *ProjectsLocationsBackupPlansListCall) OrderBy(orderBy string) *ProjectsLocationsBackupPlansListCall {
3201 c.urlParams_.Set("orderBy", orderBy)
3202 return c
3203 }
3204
3205
3206
3207
3208
3209
3210 func (c *ProjectsLocationsBackupPlansListCall) PageSize(pageSize int64) *ProjectsLocationsBackupPlansListCall {
3211 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3212 return c
3213 }
3214
3215
3216
3217
3218
3219
3220 func (c *ProjectsLocationsBackupPlansListCall) PageToken(pageToken string) *ProjectsLocationsBackupPlansListCall {
3221 c.urlParams_.Set("pageToken", pageToken)
3222 return c
3223 }
3224
3225
3226
3227
3228 func (c *ProjectsLocationsBackupPlansListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansListCall {
3229 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3230 return c
3231 }
3232
3233
3234
3235
3236 func (c *ProjectsLocationsBackupPlansListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBackupPlansListCall {
3237 c.ifNoneMatch_ = entityTag
3238 return c
3239 }
3240
3241
3242 func (c *ProjectsLocationsBackupPlansListCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansListCall {
3243 c.ctx_ = ctx
3244 return c
3245 }
3246
3247
3248
3249 func (c *ProjectsLocationsBackupPlansListCall) Header() http.Header {
3250 if c.header_ == nil {
3251 c.header_ = make(http.Header)
3252 }
3253 return c.header_
3254 }
3255
3256 func (c *ProjectsLocationsBackupPlansListCall) doRequest(alt string) (*http.Response, error) {
3257 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3258 if c.ifNoneMatch_ != "" {
3259 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3260 }
3261 var body io.Reader = nil
3262 c.urlParams_.Set("alt", alt)
3263 c.urlParams_.Set("prettyPrint", "false")
3264 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backupPlans")
3265 urls += "?" + c.urlParams_.Encode()
3266 req, err := http.NewRequest("GET", urls, body)
3267 if err != nil {
3268 return nil, err
3269 }
3270 req.Header = reqHeaders
3271 googleapi.Expand(req.URL, map[string]string{
3272 "parent": c.parent,
3273 })
3274 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3275 }
3276
3277
3278
3279
3280
3281
3282
3283 func (c *ProjectsLocationsBackupPlansListCall) Do(opts ...googleapi.CallOption) (*ListBackupPlansResponse, error) {
3284 gensupport.SetOptions(c.urlParams_, opts...)
3285 res, err := c.doRequest("json")
3286 if res != nil && res.StatusCode == http.StatusNotModified {
3287 if res.Body != nil {
3288 res.Body.Close()
3289 }
3290 return nil, gensupport.WrapError(&googleapi.Error{
3291 Code: res.StatusCode,
3292 Header: res.Header,
3293 })
3294 }
3295 if err != nil {
3296 return nil, err
3297 }
3298 defer googleapi.CloseBody(res)
3299 if err := googleapi.CheckResponse(res); err != nil {
3300 return nil, gensupport.WrapError(err)
3301 }
3302 ret := &ListBackupPlansResponse{
3303 ServerResponse: googleapi.ServerResponse{
3304 Header: res.Header,
3305 HTTPStatusCode: res.StatusCode,
3306 },
3307 }
3308 target := &ret
3309 if err := gensupport.DecodeResponse(target, res); err != nil {
3310 return nil, err
3311 }
3312 return ret, nil
3313 }
3314
3315
3316
3317
3318 func (c *ProjectsLocationsBackupPlansListCall) Pages(ctx context.Context, f func(*ListBackupPlansResponse) error) error {
3319 c.ctx_ = ctx
3320 defer c.PageToken(c.urlParams_.Get("pageToken"))
3321 for {
3322 x, err := c.Do()
3323 if err != nil {
3324 return err
3325 }
3326 if err := f(x); err != nil {
3327 return err
3328 }
3329 if x.NextPageToken == "" {
3330 return nil
3331 }
3332 c.PageToken(x.NextPageToken)
3333 }
3334 }
3335
3336 type ProjectsLocationsBackupPlansPatchCall struct {
3337 s *Service
3338 name string
3339 backupplan *BackupPlan
3340 urlParams_ gensupport.URLParams
3341 ctx_ context.Context
3342 header_ http.Header
3343 }
3344
3345
3346
3347
3348
3349 func (r *ProjectsLocationsBackupPlansService) Patch(name string, backupplan *BackupPlan) *ProjectsLocationsBackupPlansPatchCall {
3350 c := &ProjectsLocationsBackupPlansPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3351 c.name = name
3352 c.backupplan = backupplan
3353 return c
3354 }
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365 func (c *ProjectsLocationsBackupPlansPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBackupPlansPatchCall {
3366 c.urlParams_.Set("updateMask", updateMask)
3367 return c
3368 }
3369
3370
3371
3372
3373 func (c *ProjectsLocationsBackupPlansPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansPatchCall {
3374 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3375 return c
3376 }
3377
3378
3379 func (c *ProjectsLocationsBackupPlansPatchCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansPatchCall {
3380 c.ctx_ = ctx
3381 return c
3382 }
3383
3384
3385
3386 func (c *ProjectsLocationsBackupPlansPatchCall) Header() http.Header {
3387 if c.header_ == nil {
3388 c.header_ = make(http.Header)
3389 }
3390 return c.header_
3391 }
3392
3393 func (c *ProjectsLocationsBackupPlansPatchCall) doRequest(alt string) (*http.Response, error) {
3394 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3395 var body io.Reader = nil
3396 body, err := googleapi.WithoutDataWrapper.JSONReader(c.backupplan)
3397 if err != nil {
3398 return nil, err
3399 }
3400 c.urlParams_.Set("alt", alt)
3401 c.urlParams_.Set("prettyPrint", "false")
3402 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3403 urls += "?" + c.urlParams_.Encode()
3404 req, err := http.NewRequest("PATCH", urls, body)
3405 if err != nil {
3406 return nil, err
3407 }
3408 req.Header = reqHeaders
3409 googleapi.Expand(req.URL, map[string]string{
3410 "name": c.name,
3411 })
3412 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3413 }
3414
3415
3416
3417
3418
3419
3420
3421 func (c *ProjectsLocationsBackupPlansPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
3422 gensupport.SetOptions(c.urlParams_, opts...)
3423 res, err := c.doRequest("json")
3424 if res != nil && res.StatusCode == http.StatusNotModified {
3425 if res.Body != nil {
3426 res.Body.Close()
3427 }
3428 return nil, gensupport.WrapError(&googleapi.Error{
3429 Code: res.StatusCode,
3430 Header: res.Header,
3431 })
3432 }
3433 if err != nil {
3434 return nil, err
3435 }
3436 defer googleapi.CloseBody(res)
3437 if err := googleapi.CheckResponse(res); err != nil {
3438 return nil, gensupport.WrapError(err)
3439 }
3440 ret := &GoogleLongrunningOperation{
3441 ServerResponse: googleapi.ServerResponse{
3442 Header: res.Header,
3443 HTTPStatusCode: res.StatusCode,
3444 },
3445 }
3446 target := &ret
3447 if err := gensupport.DecodeResponse(target, res); err != nil {
3448 return nil, err
3449 }
3450 return ret, nil
3451 }
3452
3453 type ProjectsLocationsBackupPlansSetIamPolicyCall struct {
3454 s *Service
3455 resource string
3456 setiampolicyrequest *SetIamPolicyRequest
3457 urlParams_ gensupport.URLParams
3458 ctx_ context.Context
3459 header_ http.Header
3460 }
3461
3462
3463
3464
3465
3466
3467
3468
3469 func (r *ProjectsLocationsBackupPlansService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsBackupPlansSetIamPolicyCall {
3470 c := &ProjectsLocationsBackupPlansSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3471 c.resource = resource
3472 c.setiampolicyrequest = setiampolicyrequest
3473 return c
3474 }
3475
3476
3477
3478
3479 func (c *ProjectsLocationsBackupPlansSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansSetIamPolicyCall {
3480 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3481 return c
3482 }
3483
3484
3485 func (c *ProjectsLocationsBackupPlansSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansSetIamPolicyCall {
3486 c.ctx_ = ctx
3487 return c
3488 }
3489
3490
3491
3492 func (c *ProjectsLocationsBackupPlansSetIamPolicyCall) Header() http.Header {
3493 if c.header_ == nil {
3494 c.header_ = make(http.Header)
3495 }
3496 return c.header_
3497 }
3498
3499 func (c *ProjectsLocationsBackupPlansSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3500 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3501 var body io.Reader = nil
3502 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
3503 if err != nil {
3504 return nil, err
3505 }
3506 c.urlParams_.Set("alt", alt)
3507 c.urlParams_.Set("prettyPrint", "false")
3508 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
3509 urls += "?" + c.urlParams_.Encode()
3510 req, err := http.NewRequest("POST", urls, body)
3511 if err != nil {
3512 return nil, err
3513 }
3514 req.Header = reqHeaders
3515 googleapi.Expand(req.URL, map[string]string{
3516 "resource": c.resource,
3517 })
3518 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3519 }
3520
3521
3522
3523
3524
3525
3526 func (c *ProjectsLocationsBackupPlansSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3527 gensupport.SetOptions(c.urlParams_, opts...)
3528 res, err := c.doRequest("json")
3529 if res != nil && res.StatusCode == http.StatusNotModified {
3530 if res.Body != nil {
3531 res.Body.Close()
3532 }
3533 return nil, gensupport.WrapError(&googleapi.Error{
3534 Code: res.StatusCode,
3535 Header: res.Header,
3536 })
3537 }
3538 if err != nil {
3539 return nil, err
3540 }
3541 defer googleapi.CloseBody(res)
3542 if err := googleapi.CheckResponse(res); err != nil {
3543 return nil, gensupport.WrapError(err)
3544 }
3545 ret := &Policy{
3546 ServerResponse: googleapi.ServerResponse{
3547 Header: res.Header,
3548 HTTPStatusCode: res.StatusCode,
3549 },
3550 }
3551 target := &ret
3552 if err := gensupport.DecodeResponse(target, res); err != nil {
3553 return nil, err
3554 }
3555 return ret, nil
3556 }
3557
3558 type ProjectsLocationsBackupPlansTestIamPermissionsCall struct {
3559 s *Service
3560 resource string
3561 testiampermissionsrequest *TestIamPermissionsRequest
3562 urlParams_ gensupport.URLParams
3563 ctx_ context.Context
3564 header_ http.Header
3565 }
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577 func (r *ProjectsLocationsBackupPlansService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsBackupPlansTestIamPermissionsCall {
3578 c := &ProjectsLocationsBackupPlansTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3579 c.resource = resource
3580 c.testiampermissionsrequest = testiampermissionsrequest
3581 return c
3582 }
3583
3584
3585
3586
3587 func (c *ProjectsLocationsBackupPlansTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansTestIamPermissionsCall {
3588 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3589 return c
3590 }
3591
3592
3593 func (c *ProjectsLocationsBackupPlansTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansTestIamPermissionsCall {
3594 c.ctx_ = ctx
3595 return c
3596 }
3597
3598
3599
3600 func (c *ProjectsLocationsBackupPlansTestIamPermissionsCall) Header() http.Header {
3601 if c.header_ == nil {
3602 c.header_ = make(http.Header)
3603 }
3604 return c.header_
3605 }
3606
3607 func (c *ProjectsLocationsBackupPlansTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
3608 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3609 var body io.Reader = nil
3610 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
3611 if err != nil {
3612 return nil, err
3613 }
3614 c.urlParams_.Set("alt", alt)
3615 c.urlParams_.Set("prettyPrint", "false")
3616 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
3617 urls += "?" + c.urlParams_.Encode()
3618 req, err := http.NewRequest("POST", urls, body)
3619 if err != nil {
3620 return nil, err
3621 }
3622 req.Header = reqHeaders
3623 googleapi.Expand(req.URL, map[string]string{
3624 "resource": c.resource,
3625 })
3626 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3627 }
3628
3629
3630
3631
3632
3633
3634
3635 func (c *ProjectsLocationsBackupPlansTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
3636 gensupport.SetOptions(c.urlParams_, opts...)
3637 res, err := c.doRequest("json")
3638 if res != nil && res.StatusCode == http.StatusNotModified {
3639 if res.Body != nil {
3640 res.Body.Close()
3641 }
3642 return nil, gensupport.WrapError(&googleapi.Error{
3643 Code: res.StatusCode,
3644 Header: res.Header,
3645 })
3646 }
3647 if err != nil {
3648 return nil, err
3649 }
3650 defer googleapi.CloseBody(res)
3651 if err := googleapi.CheckResponse(res); err != nil {
3652 return nil, gensupport.WrapError(err)
3653 }
3654 ret := &TestIamPermissionsResponse{
3655 ServerResponse: googleapi.ServerResponse{
3656 Header: res.Header,
3657 HTTPStatusCode: res.StatusCode,
3658 },
3659 }
3660 target := &ret
3661 if err := gensupport.DecodeResponse(target, res); err != nil {
3662 return nil, err
3663 }
3664 return ret, nil
3665 }
3666
3667 type ProjectsLocationsBackupPlansBackupsCreateCall struct {
3668 s *Service
3669 parent string
3670 backup *Backup
3671 urlParams_ gensupport.URLParams
3672 ctx_ context.Context
3673 header_ http.Header
3674 }
3675
3676
3677
3678
3679
3680 func (r *ProjectsLocationsBackupPlansBackupsService) Create(parent string, backup *Backup) *ProjectsLocationsBackupPlansBackupsCreateCall {
3681 c := &ProjectsLocationsBackupPlansBackupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3682 c.parent = parent
3683 c.backup = backup
3684 return c
3685 }
3686
3687
3688
3689
3690
3691
3692 func (c *ProjectsLocationsBackupPlansBackupsCreateCall) BackupId(backupId string) *ProjectsLocationsBackupPlansBackupsCreateCall {
3693 c.urlParams_.Set("backupId", backupId)
3694 return c
3695 }
3696
3697
3698
3699
3700 func (c *ProjectsLocationsBackupPlansBackupsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansBackupsCreateCall {
3701 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3702 return c
3703 }
3704
3705
3706 func (c *ProjectsLocationsBackupPlansBackupsCreateCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansBackupsCreateCall {
3707 c.ctx_ = ctx
3708 return c
3709 }
3710
3711
3712
3713 func (c *ProjectsLocationsBackupPlansBackupsCreateCall) Header() http.Header {
3714 if c.header_ == nil {
3715 c.header_ = make(http.Header)
3716 }
3717 return c.header_
3718 }
3719
3720 func (c *ProjectsLocationsBackupPlansBackupsCreateCall) doRequest(alt string) (*http.Response, error) {
3721 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3722 var body io.Reader = nil
3723 body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup)
3724 if err != nil {
3725 return nil, err
3726 }
3727 c.urlParams_.Set("alt", alt)
3728 c.urlParams_.Set("prettyPrint", "false")
3729 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups")
3730 urls += "?" + c.urlParams_.Encode()
3731 req, err := http.NewRequest("POST", urls, body)
3732 if err != nil {
3733 return nil, err
3734 }
3735 req.Header = reqHeaders
3736 googleapi.Expand(req.URL, map[string]string{
3737 "parent": c.parent,
3738 })
3739 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3740 }
3741
3742
3743
3744
3745
3746
3747
3748 func (c *ProjectsLocationsBackupPlansBackupsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
3749 gensupport.SetOptions(c.urlParams_, opts...)
3750 res, err := c.doRequest("json")
3751 if res != nil && res.StatusCode == http.StatusNotModified {
3752 if res.Body != nil {
3753 res.Body.Close()
3754 }
3755 return nil, gensupport.WrapError(&googleapi.Error{
3756 Code: res.StatusCode,
3757 Header: res.Header,
3758 })
3759 }
3760 if err != nil {
3761 return nil, err
3762 }
3763 defer googleapi.CloseBody(res)
3764 if err := googleapi.CheckResponse(res); err != nil {
3765 return nil, gensupport.WrapError(err)
3766 }
3767 ret := &GoogleLongrunningOperation{
3768 ServerResponse: googleapi.ServerResponse{
3769 Header: res.Header,
3770 HTTPStatusCode: res.StatusCode,
3771 },
3772 }
3773 target := &ret
3774 if err := gensupport.DecodeResponse(target, res); err != nil {
3775 return nil, err
3776 }
3777 return ret, nil
3778 }
3779
3780 type ProjectsLocationsBackupPlansBackupsDeleteCall struct {
3781 s *Service
3782 name string
3783 urlParams_ gensupport.URLParams
3784 ctx_ context.Context
3785 header_ http.Header
3786 }
3787
3788
3789
3790
3791
3792 func (r *ProjectsLocationsBackupPlansBackupsService) Delete(name string) *ProjectsLocationsBackupPlansBackupsDeleteCall {
3793 c := &ProjectsLocationsBackupPlansBackupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3794 c.name = name
3795 return c
3796 }
3797
3798
3799
3800
3801 func (c *ProjectsLocationsBackupPlansBackupsDeleteCall) Etag(etag string) *ProjectsLocationsBackupPlansBackupsDeleteCall {
3802 c.urlParams_.Set("etag", etag)
3803 return c
3804 }
3805
3806
3807
3808
3809 func (c *ProjectsLocationsBackupPlansBackupsDeleteCall) Force(force bool) *ProjectsLocationsBackupPlansBackupsDeleteCall {
3810 c.urlParams_.Set("force", fmt.Sprint(force))
3811 return c
3812 }
3813
3814
3815
3816
3817 func (c *ProjectsLocationsBackupPlansBackupsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansBackupsDeleteCall {
3818 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3819 return c
3820 }
3821
3822
3823 func (c *ProjectsLocationsBackupPlansBackupsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansBackupsDeleteCall {
3824 c.ctx_ = ctx
3825 return c
3826 }
3827
3828
3829
3830 func (c *ProjectsLocationsBackupPlansBackupsDeleteCall) Header() http.Header {
3831 if c.header_ == nil {
3832 c.header_ = make(http.Header)
3833 }
3834 return c.header_
3835 }
3836
3837 func (c *ProjectsLocationsBackupPlansBackupsDeleteCall) doRequest(alt string) (*http.Response, error) {
3838 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3839 var body io.Reader = nil
3840 c.urlParams_.Set("alt", alt)
3841 c.urlParams_.Set("prettyPrint", "false")
3842 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3843 urls += "?" + c.urlParams_.Encode()
3844 req, err := http.NewRequest("DELETE", urls, body)
3845 if err != nil {
3846 return nil, err
3847 }
3848 req.Header = reqHeaders
3849 googleapi.Expand(req.URL, map[string]string{
3850 "name": c.name,
3851 })
3852 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3853 }
3854
3855
3856
3857
3858
3859
3860
3861 func (c *ProjectsLocationsBackupPlansBackupsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
3862 gensupport.SetOptions(c.urlParams_, opts...)
3863 res, err := c.doRequest("json")
3864 if res != nil && res.StatusCode == http.StatusNotModified {
3865 if res.Body != nil {
3866 res.Body.Close()
3867 }
3868 return nil, gensupport.WrapError(&googleapi.Error{
3869 Code: res.StatusCode,
3870 Header: res.Header,
3871 })
3872 }
3873 if err != nil {
3874 return nil, err
3875 }
3876 defer googleapi.CloseBody(res)
3877 if err := googleapi.CheckResponse(res); err != nil {
3878 return nil, gensupport.WrapError(err)
3879 }
3880 ret := &GoogleLongrunningOperation{
3881 ServerResponse: googleapi.ServerResponse{
3882 Header: res.Header,
3883 HTTPStatusCode: res.StatusCode,
3884 },
3885 }
3886 target := &ret
3887 if err := gensupport.DecodeResponse(target, res); err != nil {
3888 return nil, err
3889 }
3890 return ret, nil
3891 }
3892
3893 type ProjectsLocationsBackupPlansBackupsGetCall struct {
3894 s *Service
3895 name string
3896 urlParams_ gensupport.URLParams
3897 ifNoneMatch_ string
3898 ctx_ context.Context
3899 header_ http.Header
3900 }
3901
3902
3903
3904
3905
3906 func (r *ProjectsLocationsBackupPlansBackupsService) Get(name string) *ProjectsLocationsBackupPlansBackupsGetCall {
3907 c := &ProjectsLocationsBackupPlansBackupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3908 c.name = name
3909 return c
3910 }
3911
3912
3913
3914
3915 func (c *ProjectsLocationsBackupPlansBackupsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansBackupsGetCall {
3916 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3917 return c
3918 }
3919
3920
3921
3922
3923 func (c *ProjectsLocationsBackupPlansBackupsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBackupPlansBackupsGetCall {
3924 c.ifNoneMatch_ = entityTag
3925 return c
3926 }
3927
3928
3929 func (c *ProjectsLocationsBackupPlansBackupsGetCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansBackupsGetCall {
3930 c.ctx_ = ctx
3931 return c
3932 }
3933
3934
3935
3936 func (c *ProjectsLocationsBackupPlansBackupsGetCall) Header() http.Header {
3937 if c.header_ == nil {
3938 c.header_ = make(http.Header)
3939 }
3940 return c.header_
3941 }
3942
3943 func (c *ProjectsLocationsBackupPlansBackupsGetCall) doRequest(alt string) (*http.Response, error) {
3944 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3945 if c.ifNoneMatch_ != "" {
3946 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3947 }
3948 var body io.Reader = nil
3949 c.urlParams_.Set("alt", alt)
3950 c.urlParams_.Set("prettyPrint", "false")
3951 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3952 urls += "?" + c.urlParams_.Encode()
3953 req, err := http.NewRequest("GET", urls, body)
3954 if err != nil {
3955 return nil, err
3956 }
3957 req.Header = reqHeaders
3958 googleapi.Expand(req.URL, map[string]string{
3959 "name": c.name,
3960 })
3961 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3962 }
3963
3964
3965
3966
3967
3968
3969 func (c *ProjectsLocationsBackupPlansBackupsGetCall) Do(opts ...googleapi.CallOption) (*Backup, error) {
3970 gensupport.SetOptions(c.urlParams_, opts...)
3971 res, err := c.doRequest("json")
3972 if res != nil && res.StatusCode == http.StatusNotModified {
3973 if res.Body != nil {
3974 res.Body.Close()
3975 }
3976 return nil, gensupport.WrapError(&googleapi.Error{
3977 Code: res.StatusCode,
3978 Header: res.Header,
3979 })
3980 }
3981 if err != nil {
3982 return nil, err
3983 }
3984 defer googleapi.CloseBody(res)
3985 if err := googleapi.CheckResponse(res); err != nil {
3986 return nil, gensupport.WrapError(err)
3987 }
3988 ret := &Backup{
3989 ServerResponse: googleapi.ServerResponse{
3990 Header: res.Header,
3991 HTTPStatusCode: res.StatusCode,
3992 },
3993 }
3994 target := &ret
3995 if err := gensupport.DecodeResponse(target, res); err != nil {
3996 return nil, err
3997 }
3998 return ret, nil
3999 }
4000
4001 type ProjectsLocationsBackupPlansBackupsGetBackupIndexDownloadUrlCall struct {
4002 s *Service
4003 backup string
4004 urlParams_ gensupport.URLParams
4005 ifNoneMatch_ string
4006 ctx_ context.Context
4007 header_ http.Header
4008 }
4009
4010
4011
4012
4013
4014
4015 func (r *ProjectsLocationsBackupPlansBackupsService) GetBackupIndexDownloadUrl(backup string) *ProjectsLocationsBackupPlansBackupsGetBackupIndexDownloadUrlCall {
4016 c := &ProjectsLocationsBackupPlansBackupsGetBackupIndexDownloadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4017 c.backup = backup
4018 return c
4019 }
4020
4021
4022
4023
4024 func (c *ProjectsLocationsBackupPlansBackupsGetBackupIndexDownloadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansBackupsGetBackupIndexDownloadUrlCall {
4025 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4026 return c
4027 }
4028
4029
4030
4031
4032 func (c *ProjectsLocationsBackupPlansBackupsGetBackupIndexDownloadUrlCall) IfNoneMatch(entityTag string) *ProjectsLocationsBackupPlansBackupsGetBackupIndexDownloadUrlCall {
4033 c.ifNoneMatch_ = entityTag
4034 return c
4035 }
4036
4037
4038 func (c *ProjectsLocationsBackupPlansBackupsGetBackupIndexDownloadUrlCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansBackupsGetBackupIndexDownloadUrlCall {
4039 c.ctx_ = ctx
4040 return c
4041 }
4042
4043
4044
4045 func (c *ProjectsLocationsBackupPlansBackupsGetBackupIndexDownloadUrlCall) Header() http.Header {
4046 if c.header_ == nil {
4047 c.header_ = make(http.Header)
4048 }
4049 return c.header_
4050 }
4051
4052 func (c *ProjectsLocationsBackupPlansBackupsGetBackupIndexDownloadUrlCall) doRequest(alt string) (*http.Response, error) {
4053 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4054 if c.ifNoneMatch_ != "" {
4055 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4056 }
4057 var body io.Reader = nil
4058 c.urlParams_.Set("alt", alt)
4059 c.urlParams_.Set("prettyPrint", "false")
4060 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+backup}:getBackupIndexDownloadUrl")
4061 urls += "?" + c.urlParams_.Encode()
4062 req, err := http.NewRequest("GET", urls, body)
4063 if err != nil {
4064 return nil, err
4065 }
4066 req.Header = reqHeaders
4067 googleapi.Expand(req.URL, map[string]string{
4068 "backup": c.backup,
4069 })
4070 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4071 }
4072
4073
4074
4075
4076
4077
4078
4079 func (c *ProjectsLocationsBackupPlansBackupsGetBackupIndexDownloadUrlCall) Do(opts ...googleapi.CallOption) (*GetBackupIndexDownloadUrlResponse, error) {
4080 gensupport.SetOptions(c.urlParams_, opts...)
4081 res, err := c.doRequest("json")
4082 if res != nil && res.StatusCode == http.StatusNotModified {
4083 if res.Body != nil {
4084 res.Body.Close()
4085 }
4086 return nil, gensupport.WrapError(&googleapi.Error{
4087 Code: res.StatusCode,
4088 Header: res.Header,
4089 })
4090 }
4091 if err != nil {
4092 return nil, err
4093 }
4094 defer googleapi.CloseBody(res)
4095 if err := googleapi.CheckResponse(res); err != nil {
4096 return nil, gensupport.WrapError(err)
4097 }
4098 ret := &GetBackupIndexDownloadUrlResponse{
4099 ServerResponse: googleapi.ServerResponse{
4100 Header: res.Header,
4101 HTTPStatusCode: res.StatusCode,
4102 },
4103 }
4104 target := &ret
4105 if err := gensupport.DecodeResponse(target, res); err != nil {
4106 return nil, err
4107 }
4108 return ret, nil
4109 }
4110
4111 type ProjectsLocationsBackupPlansBackupsGetIamPolicyCall struct {
4112 s *Service
4113 resource string
4114 urlParams_ gensupport.URLParams
4115 ifNoneMatch_ string
4116 ctx_ context.Context
4117 header_ http.Header
4118 }
4119
4120
4121
4122
4123
4124
4125
4126 func (r *ProjectsLocationsBackupPlansBackupsService) GetIamPolicy(resource string) *ProjectsLocationsBackupPlansBackupsGetIamPolicyCall {
4127 c := &ProjectsLocationsBackupPlansBackupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4128 c.resource = resource
4129 return c
4130 }
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144 func (c *ProjectsLocationsBackupPlansBackupsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsBackupPlansBackupsGetIamPolicyCall {
4145 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
4146 return c
4147 }
4148
4149
4150
4151
4152 func (c *ProjectsLocationsBackupPlansBackupsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansBackupsGetIamPolicyCall {
4153 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4154 return c
4155 }
4156
4157
4158
4159
4160 func (c *ProjectsLocationsBackupPlansBackupsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsBackupPlansBackupsGetIamPolicyCall {
4161 c.ifNoneMatch_ = entityTag
4162 return c
4163 }
4164
4165
4166 func (c *ProjectsLocationsBackupPlansBackupsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansBackupsGetIamPolicyCall {
4167 c.ctx_ = ctx
4168 return c
4169 }
4170
4171
4172
4173 func (c *ProjectsLocationsBackupPlansBackupsGetIamPolicyCall) Header() http.Header {
4174 if c.header_ == nil {
4175 c.header_ = make(http.Header)
4176 }
4177 return c.header_
4178 }
4179
4180 func (c *ProjectsLocationsBackupPlansBackupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4181 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4182 if c.ifNoneMatch_ != "" {
4183 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4184 }
4185 var body io.Reader = nil
4186 c.urlParams_.Set("alt", alt)
4187 c.urlParams_.Set("prettyPrint", "false")
4188 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
4189 urls += "?" + c.urlParams_.Encode()
4190 req, err := http.NewRequest("GET", urls, body)
4191 if err != nil {
4192 return nil, err
4193 }
4194 req.Header = reqHeaders
4195 googleapi.Expand(req.URL, map[string]string{
4196 "resource": c.resource,
4197 })
4198 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4199 }
4200
4201
4202
4203
4204
4205
4206 func (c *ProjectsLocationsBackupPlansBackupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4207 gensupport.SetOptions(c.urlParams_, opts...)
4208 res, err := c.doRequest("json")
4209 if res != nil && res.StatusCode == http.StatusNotModified {
4210 if res.Body != nil {
4211 res.Body.Close()
4212 }
4213 return nil, gensupport.WrapError(&googleapi.Error{
4214 Code: res.StatusCode,
4215 Header: res.Header,
4216 })
4217 }
4218 if err != nil {
4219 return nil, err
4220 }
4221 defer googleapi.CloseBody(res)
4222 if err := googleapi.CheckResponse(res); err != nil {
4223 return nil, gensupport.WrapError(err)
4224 }
4225 ret := &Policy{
4226 ServerResponse: googleapi.ServerResponse{
4227 Header: res.Header,
4228 HTTPStatusCode: res.StatusCode,
4229 },
4230 }
4231 target := &ret
4232 if err := gensupport.DecodeResponse(target, res); err != nil {
4233 return nil, err
4234 }
4235 return ret, nil
4236 }
4237
4238 type ProjectsLocationsBackupPlansBackupsListCall struct {
4239 s *Service
4240 parent string
4241 urlParams_ gensupport.URLParams
4242 ifNoneMatch_ string
4243 ctx_ context.Context
4244 header_ http.Header
4245 }
4246
4247
4248
4249
4250
4251 func (r *ProjectsLocationsBackupPlansBackupsService) List(parent string) *ProjectsLocationsBackupPlansBackupsListCall {
4252 c := &ProjectsLocationsBackupPlansBackupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4253 c.parent = parent
4254 return c
4255 }
4256
4257
4258
4259 func (c *ProjectsLocationsBackupPlansBackupsListCall) Filter(filter string) *ProjectsLocationsBackupPlansBackupsListCall {
4260 c.urlParams_.Set("filter", filter)
4261 return c
4262 }
4263
4264
4265
4266 func (c *ProjectsLocationsBackupPlansBackupsListCall) OrderBy(orderBy string) *ProjectsLocationsBackupPlansBackupsListCall {
4267 c.urlParams_.Set("orderBy", orderBy)
4268 return c
4269 }
4270
4271
4272
4273
4274
4275
4276 func (c *ProjectsLocationsBackupPlansBackupsListCall) PageSize(pageSize int64) *ProjectsLocationsBackupPlansBackupsListCall {
4277 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4278 return c
4279 }
4280
4281
4282
4283
4284
4285
4286 func (c *ProjectsLocationsBackupPlansBackupsListCall) PageToken(pageToken string) *ProjectsLocationsBackupPlansBackupsListCall {
4287 c.urlParams_.Set("pageToken", pageToken)
4288 return c
4289 }
4290
4291
4292
4293
4294 func (c *ProjectsLocationsBackupPlansBackupsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansBackupsListCall {
4295 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4296 return c
4297 }
4298
4299
4300
4301
4302 func (c *ProjectsLocationsBackupPlansBackupsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBackupPlansBackupsListCall {
4303 c.ifNoneMatch_ = entityTag
4304 return c
4305 }
4306
4307
4308 func (c *ProjectsLocationsBackupPlansBackupsListCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansBackupsListCall {
4309 c.ctx_ = ctx
4310 return c
4311 }
4312
4313
4314
4315 func (c *ProjectsLocationsBackupPlansBackupsListCall) Header() http.Header {
4316 if c.header_ == nil {
4317 c.header_ = make(http.Header)
4318 }
4319 return c.header_
4320 }
4321
4322 func (c *ProjectsLocationsBackupPlansBackupsListCall) doRequest(alt string) (*http.Response, error) {
4323 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4324 if c.ifNoneMatch_ != "" {
4325 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4326 }
4327 var body io.Reader = nil
4328 c.urlParams_.Set("alt", alt)
4329 c.urlParams_.Set("prettyPrint", "false")
4330 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups")
4331 urls += "?" + c.urlParams_.Encode()
4332 req, err := http.NewRequest("GET", urls, body)
4333 if err != nil {
4334 return nil, err
4335 }
4336 req.Header = reqHeaders
4337 googleapi.Expand(req.URL, map[string]string{
4338 "parent": c.parent,
4339 })
4340 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4341 }
4342
4343
4344
4345
4346
4347
4348
4349 func (c *ProjectsLocationsBackupPlansBackupsListCall) Do(opts ...googleapi.CallOption) (*ListBackupsResponse, error) {
4350 gensupport.SetOptions(c.urlParams_, opts...)
4351 res, err := c.doRequest("json")
4352 if res != nil && res.StatusCode == http.StatusNotModified {
4353 if res.Body != nil {
4354 res.Body.Close()
4355 }
4356 return nil, gensupport.WrapError(&googleapi.Error{
4357 Code: res.StatusCode,
4358 Header: res.Header,
4359 })
4360 }
4361 if err != nil {
4362 return nil, err
4363 }
4364 defer googleapi.CloseBody(res)
4365 if err := googleapi.CheckResponse(res); err != nil {
4366 return nil, gensupport.WrapError(err)
4367 }
4368 ret := &ListBackupsResponse{
4369 ServerResponse: googleapi.ServerResponse{
4370 Header: res.Header,
4371 HTTPStatusCode: res.StatusCode,
4372 },
4373 }
4374 target := &ret
4375 if err := gensupport.DecodeResponse(target, res); err != nil {
4376 return nil, err
4377 }
4378 return ret, nil
4379 }
4380
4381
4382
4383
4384 func (c *ProjectsLocationsBackupPlansBackupsListCall) Pages(ctx context.Context, f func(*ListBackupsResponse) error) error {
4385 c.ctx_ = ctx
4386 defer c.PageToken(c.urlParams_.Get("pageToken"))
4387 for {
4388 x, err := c.Do()
4389 if err != nil {
4390 return err
4391 }
4392 if err := f(x); err != nil {
4393 return err
4394 }
4395 if x.NextPageToken == "" {
4396 return nil
4397 }
4398 c.PageToken(x.NextPageToken)
4399 }
4400 }
4401
4402 type ProjectsLocationsBackupPlansBackupsPatchCall struct {
4403 s *Service
4404 name string
4405 backup *Backup
4406 urlParams_ gensupport.URLParams
4407 ctx_ context.Context
4408 header_ http.Header
4409 }
4410
4411
4412
4413
4414
4415 func (r *ProjectsLocationsBackupPlansBackupsService) Patch(name string, backup *Backup) *ProjectsLocationsBackupPlansBackupsPatchCall {
4416 c := &ProjectsLocationsBackupPlansBackupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4417 c.name = name
4418 c.backup = backup
4419 return c
4420 }
4421
4422
4423
4424
4425
4426
4427
4428
4429 func (c *ProjectsLocationsBackupPlansBackupsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBackupPlansBackupsPatchCall {
4430 c.urlParams_.Set("updateMask", updateMask)
4431 return c
4432 }
4433
4434
4435
4436
4437 func (c *ProjectsLocationsBackupPlansBackupsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansBackupsPatchCall {
4438 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4439 return c
4440 }
4441
4442
4443 func (c *ProjectsLocationsBackupPlansBackupsPatchCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansBackupsPatchCall {
4444 c.ctx_ = ctx
4445 return c
4446 }
4447
4448
4449
4450 func (c *ProjectsLocationsBackupPlansBackupsPatchCall) Header() http.Header {
4451 if c.header_ == nil {
4452 c.header_ = make(http.Header)
4453 }
4454 return c.header_
4455 }
4456
4457 func (c *ProjectsLocationsBackupPlansBackupsPatchCall) doRequest(alt string) (*http.Response, error) {
4458 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4459 var body io.Reader = nil
4460 body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup)
4461 if err != nil {
4462 return nil, err
4463 }
4464 c.urlParams_.Set("alt", alt)
4465 c.urlParams_.Set("prettyPrint", "false")
4466 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4467 urls += "?" + c.urlParams_.Encode()
4468 req, err := http.NewRequest("PATCH", urls, body)
4469 if err != nil {
4470 return nil, err
4471 }
4472 req.Header = reqHeaders
4473 googleapi.Expand(req.URL, map[string]string{
4474 "name": c.name,
4475 })
4476 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4477 }
4478
4479
4480
4481
4482
4483
4484
4485 func (c *ProjectsLocationsBackupPlansBackupsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
4486 gensupport.SetOptions(c.urlParams_, opts...)
4487 res, err := c.doRequest("json")
4488 if res != nil && res.StatusCode == http.StatusNotModified {
4489 if res.Body != nil {
4490 res.Body.Close()
4491 }
4492 return nil, gensupport.WrapError(&googleapi.Error{
4493 Code: res.StatusCode,
4494 Header: res.Header,
4495 })
4496 }
4497 if err != nil {
4498 return nil, err
4499 }
4500 defer googleapi.CloseBody(res)
4501 if err := googleapi.CheckResponse(res); err != nil {
4502 return nil, gensupport.WrapError(err)
4503 }
4504 ret := &GoogleLongrunningOperation{
4505 ServerResponse: googleapi.ServerResponse{
4506 Header: res.Header,
4507 HTTPStatusCode: res.StatusCode,
4508 },
4509 }
4510 target := &ret
4511 if err := gensupport.DecodeResponse(target, res); err != nil {
4512 return nil, err
4513 }
4514 return ret, nil
4515 }
4516
4517 type ProjectsLocationsBackupPlansBackupsSetIamPolicyCall struct {
4518 s *Service
4519 resource string
4520 setiampolicyrequest *SetIamPolicyRequest
4521 urlParams_ gensupport.URLParams
4522 ctx_ context.Context
4523 header_ http.Header
4524 }
4525
4526
4527
4528
4529
4530
4531
4532
4533 func (r *ProjectsLocationsBackupPlansBackupsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsBackupPlansBackupsSetIamPolicyCall {
4534 c := &ProjectsLocationsBackupPlansBackupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4535 c.resource = resource
4536 c.setiampolicyrequest = setiampolicyrequest
4537 return c
4538 }
4539
4540
4541
4542
4543 func (c *ProjectsLocationsBackupPlansBackupsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansBackupsSetIamPolicyCall {
4544 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4545 return c
4546 }
4547
4548
4549 func (c *ProjectsLocationsBackupPlansBackupsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansBackupsSetIamPolicyCall {
4550 c.ctx_ = ctx
4551 return c
4552 }
4553
4554
4555
4556 func (c *ProjectsLocationsBackupPlansBackupsSetIamPolicyCall) Header() http.Header {
4557 if c.header_ == nil {
4558 c.header_ = make(http.Header)
4559 }
4560 return c.header_
4561 }
4562
4563 func (c *ProjectsLocationsBackupPlansBackupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4564 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4565 var body io.Reader = nil
4566 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
4567 if err != nil {
4568 return nil, err
4569 }
4570 c.urlParams_.Set("alt", alt)
4571 c.urlParams_.Set("prettyPrint", "false")
4572 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
4573 urls += "?" + c.urlParams_.Encode()
4574 req, err := http.NewRequest("POST", urls, body)
4575 if err != nil {
4576 return nil, err
4577 }
4578 req.Header = reqHeaders
4579 googleapi.Expand(req.URL, map[string]string{
4580 "resource": c.resource,
4581 })
4582 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4583 }
4584
4585
4586
4587
4588
4589
4590 func (c *ProjectsLocationsBackupPlansBackupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4591 gensupport.SetOptions(c.urlParams_, opts...)
4592 res, err := c.doRequest("json")
4593 if res != nil && res.StatusCode == http.StatusNotModified {
4594 if res.Body != nil {
4595 res.Body.Close()
4596 }
4597 return nil, gensupport.WrapError(&googleapi.Error{
4598 Code: res.StatusCode,
4599 Header: res.Header,
4600 })
4601 }
4602 if err != nil {
4603 return nil, err
4604 }
4605 defer googleapi.CloseBody(res)
4606 if err := googleapi.CheckResponse(res); err != nil {
4607 return nil, gensupport.WrapError(err)
4608 }
4609 ret := &Policy{
4610 ServerResponse: googleapi.ServerResponse{
4611 Header: res.Header,
4612 HTTPStatusCode: res.StatusCode,
4613 },
4614 }
4615 target := &ret
4616 if err := gensupport.DecodeResponse(target, res); err != nil {
4617 return nil, err
4618 }
4619 return ret, nil
4620 }
4621
4622 type ProjectsLocationsBackupPlansBackupsTestIamPermissionsCall struct {
4623 s *Service
4624 resource string
4625 testiampermissionsrequest *TestIamPermissionsRequest
4626 urlParams_ gensupport.URLParams
4627 ctx_ context.Context
4628 header_ http.Header
4629 }
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641 func (r *ProjectsLocationsBackupPlansBackupsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsBackupPlansBackupsTestIamPermissionsCall {
4642 c := &ProjectsLocationsBackupPlansBackupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4643 c.resource = resource
4644 c.testiampermissionsrequest = testiampermissionsrequest
4645 return c
4646 }
4647
4648
4649
4650
4651 func (c *ProjectsLocationsBackupPlansBackupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansBackupsTestIamPermissionsCall {
4652 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4653 return c
4654 }
4655
4656
4657 func (c *ProjectsLocationsBackupPlansBackupsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansBackupsTestIamPermissionsCall {
4658 c.ctx_ = ctx
4659 return c
4660 }
4661
4662
4663
4664 func (c *ProjectsLocationsBackupPlansBackupsTestIamPermissionsCall) Header() http.Header {
4665 if c.header_ == nil {
4666 c.header_ = make(http.Header)
4667 }
4668 return c.header_
4669 }
4670
4671 func (c *ProjectsLocationsBackupPlansBackupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
4672 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4673 var body io.Reader = nil
4674 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
4675 if err != nil {
4676 return nil, err
4677 }
4678 c.urlParams_.Set("alt", alt)
4679 c.urlParams_.Set("prettyPrint", "false")
4680 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
4681 urls += "?" + c.urlParams_.Encode()
4682 req, err := http.NewRequest("POST", urls, body)
4683 if err != nil {
4684 return nil, err
4685 }
4686 req.Header = reqHeaders
4687 googleapi.Expand(req.URL, map[string]string{
4688 "resource": c.resource,
4689 })
4690 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4691 }
4692
4693
4694
4695
4696
4697
4698
4699 func (c *ProjectsLocationsBackupPlansBackupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
4700 gensupport.SetOptions(c.urlParams_, opts...)
4701 res, err := c.doRequest("json")
4702 if res != nil && res.StatusCode == http.StatusNotModified {
4703 if res.Body != nil {
4704 res.Body.Close()
4705 }
4706 return nil, gensupport.WrapError(&googleapi.Error{
4707 Code: res.StatusCode,
4708 Header: res.Header,
4709 })
4710 }
4711 if err != nil {
4712 return nil, err
4713 }
4714 defer googleapi.CloseBody(res)
4715 if err := googleapi.CheckResponse(res); err != nil {
4716 return nil, gensupport.WrapError(err)
4717 }
4718 ret := &TestIamPermissionsResponse{
4719 ServerResponse: googleapi.ServerResponse{
4720 Header: res.Header,
4721 HTTPStatusCode: res.StatusCode,
4722 },
4723 }
4724 target := &ret
4725 if err := gensupport.DecodeResponse(target, res); err != nil {
4726 return nil, err
4727 }
4728 return ret, nil
4729 }
4730
4731 type ProjectsLocationsBackupPlansBackupsVolumeBackupsGetCall struct {
4732 s *Service
4733 name string
4734 urlParams_ gensupport.URLParams
4735 ifNoneMatch_ string
4736 ctx_ context.Context
4737 header_ http.Header
4738 }
4739
4740
4741
4742
4743
4744 func (r *ProjectsLocationsBackupPlansBackupsVolumeBackupsService) Get(name string) *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetCall {
4745 c := &ProjectsLocationsBackupPlansBackupsVolumeBackupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4746 c.name = name
4747 return c
4748 }
4749
4750
4751
4752
4753 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetCall {
4754 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4755 return c
4756 }
4757
4758
4759
4760
4761 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetCall {
4762 c.ifNoneMatch_ = entityTag
4763 return c
4764 }
4765
4766
4767 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetCall {
4768 c.ctx_ = ctx
4769 return c
4770 }
4771
4772
4773
4774 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetCall) Header() http.Header {
4775 if c.header_ == nil {
4776 c.header_ = make(http.Header)
4777 }
4778 return c.header_
4779 }
4780
4781 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetCall) doRequest(alt string) (*http.Response, error) {
4782 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4783 if c.ifNoneMatch_ != "" {
4784 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4785 }
4786 var body io.Reader = nil
4787 c.urlParams_.Set("alt", alt)
4788 c.urlParams_.Set("prettyPrint", "false")
4789 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4790 urls += "?" + c.urlParams_.Encode()
4791 req, err := http.NewRequest("GET", urls, body)
4792 if err != nil {
4793 return nil, err
4794 }
4795 req.Header = reqHeaders
4796 googleapi.Expand(req.URL, map[string]string{
4797 "name": c.name,
4798 })
4799 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4800 }
4801
4802
4803
4804
4805
4806
4807 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetCall) Do(opts ...googleapi.CallOption) (*VolumeBackup, error) {
4808 gensupport.SetOptions(c.urlParams_, opts...)
4809 res, err := c.doRequest("json")
4810 if res != nil && res.StatusCode == http.StatusNotModified {
4811 if res.Body != nil {
4812 res.Body.Close()
4813 }
4814 return nil, gensupport.WrapError(&googleapi.Error{
4815 Code: res.StatusCode,
4816 Header: res.Header,
4817 })
4818 }
4819 if err != nil {
4820 return nil, err
4821 }
4822 defer googleapi.CloseBody(res)
4823 if err := googleapi.CheckResponse(res); err != nil {
4824 return nil, gensupport.WrapError(err)
4825 }
4826 ret := &VolumeBackup{
4827 ServerResponse: googleapi.ServerResponse{
4828 Header: res.Header,
4829 HTTPStatusCode: res.StatusCode,
4830 },
4831 }
4832 target := &ret
4833 if err := gensupport.DecodeResponse(target, res); err != nil {
4834 return nil, err
4835 }
4836 return ret, nil
4837 }
4838
4839 type ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall struct {
4840 s *Service
4841 resource string
4842 urlParams_ gensupport.URLParams
4843 ifNoneMatch_ string
4844 ctx_ context.Context
4845 header_ http.Header
4846 }
4847
4848
4849
4850
4851
4852
4853
4854 func (r *ProjectsLocationsBackupPlansBackupsVolumeBackupsService) GetIamPolicy(resource string) *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall {
4855 c := &ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4856 c.resource = resource
4857 return c
4858 }
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall {
4873 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
4874 return c
4875 }
4876
4877
4878
4879
4880 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall {
4881 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4882 return c
4883 }
4884
4885
4886
4887
4888 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall {
4889 c.ifNoneMatch_ = entityTag
4890 return c
4891 }
4892
4893
4894 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall {
4895 c.ctx_ = ctx
4896 return c
4897 }
4898
4899
4900
4901 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall) Header() http.Header {
4902 if c.header_ == nil {
4903 c.header_ = make(http.Header)
4904 }
4905 return c.header_
4906 }
4907
4908 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4909 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4910 if c.ifNoneMatch_ != "" {
4911 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4912 }
4913 var body io.Reader = nil
4914 c.urlParams_.Set("alt", alt)
4915 c.urlParams_.Set("prettyPrint", "false")
4916 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
4917 urls += "?" + c.urlParams_.Encode()
4918 req, err := http.NewRequest("GET", urls, body)
4919 if err != nil {
4920 return nil, err
4921 }
4922 req.Header = reqHeaders
4923 googleapi.Expand(req.URL, map[string]string{
4924 "resource": c.resource,
4925 })
4926 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4927 }
4928
4929
4930
4931
4932
4933
4934 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4935 gensupport.SetOptions(c.urlParams_, opts...)
4936 res, err := c.doRequest("json")
4937 if res != nil && res.StatusCode == http.StatusNotModified {
4938 if res.Body != nil {
4939 res.Body.Close()
4940 }
4941 return nil, gensupport.WrapError(&googleapi.Error{
4942 Code: res.StatusCode,
4943 Header: res.Header,
4944 })
4945 }
4946 if err != nil {
4947 return nil, err
4948 }
4949 defer googleapi.CloseBody(res)
4950 if err := googleapi.CheckResponse(res); err != nil {
4951 return nil, gensupport.WrapError(err)
4952 }
4953 ret := &Policy{
4954 ServerResponse: googleapi.ServerResponse{
4955 Header: res.Header,
4956 HTTPStatusCode: res.StatusCode,
4957 },
4958 }
4959 target := &ret
4960 if err := gensupport.DecodeResponse(target, res); err != nil {
4961 return nil, err
4962 }
4963 return ret, nil
4964 }
4965
4966 type ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall struct {
4967 s *Service
4968 parent string
4969 urlParams_ gensupport.URLParams
4970 ifNoneMatch_ string
4971 ctx_ context.Context
4972 header_ http.Header
4973 }
4974
4975
4976
4977
4978
4979 func (r *ProjectsLocationsBackupPlansBackupsVolumeBackupsService) List(parent string) *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall {
4980 c := &ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4981 c.parent = parent
4982 return c
4983 }
4984
4985
4986
4987 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall) Filter(filter string) *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall {
4988 c.urlParams_.Set("filter", filter)
4989 return c
4990 }
4991
4992
4993
4994 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall) OrderBy(orderBy string) *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall {
4995 c.urlParams_.Set("orderBy", orderBy)
4996 return c
4997 }
4998
4999
5000
5001
5002
5003
5004 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall) PageSize(pageSize int64) *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall {
5005 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5006 return c
5007 }
5008
5009
5010
5011
5012
5013
5014 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall) PageToken(pageToken string) *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall {
5015 c.urlParams_.Set("pageToken", pageToken)
5016 return c
5017 }
5018
5019
5020
5021
5022 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall {
5023 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5024 return c
5025 }
5026
5027
5028
5029
5030 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall {
5031 c.ifNoneMatch_ = entityTag
5032 return c
5033 }
5034
5035
5036 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall {
5037 c.ctx_ = ctx
5038 return c
5039 }
5040
5041
5042
5043 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall) Header() http.Header {
5044 if c.header_ == nil {
5045 c.header_ = make(http.Header)
5046 }
5047 return c.header_
5048 }
5049
5050 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall) doRequest(alt string) (*http.Response, error) {
5051 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5052 if c.ifNoneMatch_ != "" {
5053 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5054 }
5055 var body io.Reader = nil
5056 c.urlParams_.Set("alt", alt)
5057 c.urlParams_.Set("prettyPrint", "false")
5058 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/volumeBackups")
5059 urls += "?" + c.urlParams_.Encode()
5060 req, err := http.NewRequest("GET", urls, body)
5061 if err != nil {
5062 return nil, err
5063 }
5064 req.Header = reqHeaders
5065 googleapi.Expand(req.URL, map[string]string{
5066 "parent": c.parent,
5067 })
5068 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5069 }
5070
5071
5072
5073
5074
5075
5076
5077 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall) Do(opts ...googleapi.CallOption) (*ListVolumeBackupsResponse, error) {
5078 gensupport.SetOptions(c.urlParams_, opts...)
5079 res, err := c.doRequest("json")
5080 if res != nil && res.StatusCode == http.StatusNotModified {
5081 if res.Body != nil {
5082 res.Body.Close()
5083 }
5084 return nil, gensupport.WrapError(&googleapi.Error{
5085 Code: res.StatusCode,
5086 Header: res.Header,
5087 })
5088 }
5089 if err != nil {
5090 return nil, err
5091 }
5092 defer googleapi.CloseBody(res)
5093 if err := googleapi.CheckResponse(res); err != nil {
5094 return nil, gensupport.WrapError(err)
5095 }
5096 ret := &ListVolumeBackupsResponse{
5097 ServerResponse: googleapi.ServerResponse{
5098 Header: res.Header,
5099 HTTPStatusCode: res.StatusCode,
5100 },
5101 }
5102 target := &ret
5103 if err := gensupport.DecodeResponse(target, res); err != nil {
5104 return nil, err
5105 }
5106 return ret, nil
5107 }
5108
5109
5110
5111
5112 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsListCall) Pages(ctx context.Context, f func(*ListVolumeBackupsResponse) error) error {
5113 c.ctx_ = ctx
5114 defer c.PageToken(c.urlParams_.Get("pageToken"))
5115 for {
5116 x, err := c.Do()
5117 if err != nil {
5118 return err
5119 }
5120 if err := f(x); err != nil {
5121 return err
5122 }
5123 if x.NextPageToken == "" {
5124 return nil
5125 }
5126 c.PageToken(x.NextPageToken)
5127 }
5128 }
5129
5130 type ProjectsLocationsBackupPlansBackupsVolumeBackupsSetIamPolicyCall struct {
5131 s *Service
5132 resource string
5133 setiampolicyrequest *SetIamPolicyRequest
5134 urlParams_ gensupport.URLParams
5135 ctx_ context.Context
5136 header_ http.Header
5137 }
5138
5139
5140
5141
5142
5143
5144
5145
5146 func (r *ProjectsLocationsBackupPlansBackupsVolumeBackupsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsBackupPlansBackupsVolumeBackupsSetIamPolicyCall {
5147 c := &ProjectsLocationsBackupPlansBackupsVolumeBackupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5148 c.resource = resource
5149 c.setiampolicyrequest = setiampolicyrequest
5150 return c
5151 }
5152
5153
5154
5155
5156 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansBackupsVolumeBackupsSetIamPolicyCall {
5157 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5158 return c
5159 }
5160
5161
5162 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansBackupsVolumeBackupsSetIamPolicyCall {
5163 c.ctx_ = ctx
5164 return c
5165 }
5166
5167
5168
5169 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsSetIamPolicyCall) Header() http.Header {
5170 if c.header_ == nil {
5171 c.header_ = make(http.Header)
5172 }
5173 return c.header_
5174 }
5175
5176 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
5177 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5178 var body io.Reader = nil
5179 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
5180 if err != nil {
5181 return nil, err
5182 }
5183 c.urlParams_.Set("alt", alt)
5184 c.urlParams_.Set("prettyPrint", "false")
5185 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
5186 urls += "?" + c.urlParams_.Encode()
5187 req, err := http.NewRequest("POST", urls, body)
5188 if err != nil {
5189 return nil, err
5190 }
5191 req.Header = reqHeaders
5192 googleapi.Expand(req.URL, map[string]string{
5193 "resource": c.resource,
5194 })
5195 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5196 }
5197
5198
5199
5200
5201
5202
5203 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
5204 gensupport.SetOptions(c.urlParams_, opts...)
5205 res, err := c.doRequest("json")
5206 if res != nil && res.StatusCode == http.StatusNotModified {
5207 if res.Body != nil {
5208 res.Body.Close()
5209 }
5210 return nil, gensupport.WrapError(&googleapi.Error{
5211 Code: res.StatusCode,
5212 Header: res.Header,
5213 })
5214 }
5215 if err != nil {
5216 return nil, err
5217 }
5218 defer googleapi.CloseBody(res)
5219 if err := googleapi.CheckResponse(res); err != nil {
5220 return nil, gensupport.WrapError(err)
5221 }
5222 ret := &Policy{
5223 ServerResponse: googleapi.ServerResponse{
5224 Header: res.Header,
5225 HTTPStatusCode: res.StatusCode,
5226 },
5227 }
5228 target := &ret
5229 if err := gensupport.DecodeResponse(target, res); err != nil {
5230 return nil, err
5231 }
5232 return ret, nil
5233 }
5234
5235 type ProjectsLocationsBackupPlansBackupsVolumeBackupsTestIamPermissionsCall struct {
5236 s *Service
5237 resource string
5238 testiampermissionsrequest *TestIamPermissionsRequest
5239 urlParams_ gensupport.URLParams
5240 ctx_ context.Context
5241 header_ http.Header
5242 }
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254 func (r *ProjectsLocationsBackupPlansBackupsVolumeBackupsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsBackupPlansBackupsVolumeBackupsTestIamPermissionsCall {
5255 c := &ProjectsLocationsBackupPlansBackupsVolumeBackupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5256 c.resource = resource
5257 c.testiampermissionsrequest = testiampermissionsrequest
5258 return c
5259 }
5260
5261
5262
5263
5264 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupPlansBackupsVolumeBackupsTestIamPermissionsCall {
5265 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5266 return c
5267 }
5268
5269
5270 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsBackupPlansBackupsVolumeBackupsTestIamPermissionsCall {
5271 c.ctx_ = ctx
5272 return c
5273 }
5274
5275
5276
5277 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsTestIamPermissionsCall) Header() http.Header {
5278 if c.header_ == nil {
5279 c.header_ = make(http.Header)
5280 }
5281 return c.header_
5282 }
5283
5284 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
5285 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5286 var body io.Reader = nil
5287 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
5288 if err != nil {
5289 return nil, err
5290 }
5291 c.urlParams_.Set("alt", alt)
5292 c.urlParams_.Set("prettyPrint", "false")
5293 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
5294 urls += "?" + c.urlParams_.Encode()
5295 req, err := http.NewRequest("POST", urls, body)
5296 if err != nil {
5297 return nil, err
5298 }
5299 req.Header = reqHeaders
5300 googleapi.Expand(req.URL, map[string]string{
5301 "resource": c.resource,
5302 })
5303 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5304 }
5305
5306
5307
5308
5309
5310
5311
5312 func (c *ProjectsLocationsBackupPlansBackupsVolumeBackupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
5313 gensupport.SetOptions(c.urlParams_, opts...)
5314 res, err := c.doRequest("json")
5315 if res != nil && res.StatusCode == http.StatusNotModified {
5316 if res.Body != nil {
5317 res.Body.Close()
5318 }
5319 return nil, gensupport.WrapError(&googleapi.Error{
5320 Code: res.StatusCode,
5321 Header: res.Header,
5322 })
5323 }
5324 if err != nil {
5325 return nil, err
5326 }
5327 defer googleapi.CloseBody(res)
5328 if err := googleapi.CheckResponse(res); err != nil {
5329 return nil, gensupport.WrapError(err)
5330 }
5331 ret := &TestIamPermissionsResponse{
5332 ServerResponse: googleapi.ServerResponse{
5333 Header: res.Header,
5334 HTTPStatusCode: res.StatusCode,
5335 },
5336 }
5337 target := &ret
5338 if err := gensupport.DecodeResponse(target, res); err != nil {
5339 return nil, err
5340 }
5341 return ret, nil
5342 }
5343
5344 type ProjectsLocationsOperationsCancelCall struct {
5345 s *Service
5346 name string
5347 googlelongrunningcanceloperationrequest *GoogleLongrunningCancelOperationRequest
5348 urlParams_ gensupport.URLParams
5349 ctx_ context.Context
5350 header_ http.Header
5351 }
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364 func (r *ProjectsLocationsOperationsService) Cancel(name string, googlelongrunningcanceloperationrequest *GoogleLongrunningCancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
5365 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5366 c.name = name
5367 c.googlelongrunningcanceloperationrequest = googlelongrunningcanceloperationrequest
5368 return c
5369 }
5370
5371
5372
5373
5374 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
5375 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5376 return c
5377 }
5378
5379
5380 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
5381 c.ctx_ = ctx
5382 return c
5383 }
5384
5385
5386
5387 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
5388 if c.header_ == nil {
5389 c.header_ = make(http.Header)
5390 }
5391 return c.header_
5392 }
5393
5394 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
5395 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5396 var body io.Reader = nil
5397 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest)
5398 if err != nil {
5399 return nil, err
5400 }
5401 c.urlParams_.Set("alt", alt)
5402 c.urlParams_.Set("prettyPrint", "false")
5403 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
5404 urls += "?" + c.urlParams_.Encode()
5405 req, err := http.NewRequest("POST", urls, body)
5406 if err != nil {
5407 return nil, err
5408 }
5409 req.Header = reqHeaders
5410 googleapi.Expand(req.URL, map[string]string{
5411 "name": c.name,
5412 })
5413 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5414 }
5415
5416
5417
5418
5419
5420
5421 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5422 gensupport.SetOptions(c.urlParams_, opts...)
5423 res, err := c.doRequest("json")
5424 if res != nil && res.StatusCode == http.StatusNotModified {
5425 if res.Body != nil {
5426 res.Body.Close()
5427 }
5428 return nil, gensupport.WrapError(&googleapi.Error{
5429 Code: res.StatusCode,
5430 Header: res.Header,
5431 })
5432 }
5433 if err != nil {
5434 return nil, err
5435 }
5436 defer googleapi.CloseBody(res)
5437 if err := googleapi.CheckResponse(res); err != nil {
5438 return nil, gensupport.WrapError(err)
5439 }
5440 ret := &Empty{
5441 ServerResponse: googleapi.ServerResponse{
5442 Header: res.Header,
5443 HTTPStatusCode: res.StatusCode,
5444 },
5445 }
5446 target := &ret
5447 if err := gensupport.DecodeResponse(target, res); err != nil {
5448 return nil, err
5449 }
5450 return ret, nil
5451 }
5452
5453 type ProjectsLocationsOperationsDeleteCall struct {
5454 s *Service
5455 name string
5456 urlParams_ gensupport.URLParams
5457 ctx_ context.Context
5458 header_ http.Header
5459 }
5460
5461
5462
5463
5464
5465
5466
5467 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
5468 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5469 c.name = name
5470 return c
5471 }
5472
5473
5474
5475
5476 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
5477 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5478 return c
5479 }
5480
5481
5482 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
5483 c.ctx_ = ctx
5484 return c
5485 }
5486
5487
5488
5489 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
5490 if c.header_ == nil {
5491 c.header_ = make(http.Header)
5492 }
5493 return c.header_
5494 }
5495
5496 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
5497 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5498 var body io.Reader = nil
5499 c.urlParams_.Set("alt", alt)
5500 c.urlParams_.Set("prettyPrint", "false")
5501 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5502 urls += "?" + c.urlParams_.Encode()
5503 req, err := http.NewRequest("DELETE", urls, body)
5504 if err != nil {
5505 return nil, err
5506 }
5507 req.Header = reqHeaders
5508 googleapi.Expand(req.URL, map[string]string{
5509 "name": c.name,
5510 })
5511 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5512 }
5513
5514
5515
5516
5517
5518
5519 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5520 gensupport.SetOptions(c.urlParams_, opts...)
5521 res, err := c.doRequest("json")
5522 if res != nil && res.StatusCode == http.StatusNotModified {
5523 if res.Body != nil {
5524 res.Body.Close()
5525 }
5526 return nil, gensupport.WrapError(&googleapi.Error{
5527 Code: res.StatusCode,
5528 Header: res.Header,
5529 })
5530 }
5531 if err != nil {
5532 return nil, err
5533 }
5534 defer googleapi.CloseBody(res)
5535 if err := googleapi.CheckResponse(res); err != nil {
5536 return nil, gensupport.WrapError(err)
5537 }
5538 ret := &Empty{
5539 ServerResponse: googleapi.ServerResponse{
5540 Header: res.Header,
5541 HTTPStatusCode: res.StatusCode,
5542 },
5543 }
5544 target := &ret
5545 if err := gensupport.DecodeResponse(target, res); err != nil {
5546 return nil, err
5547 }
5548 return ret, nil
5549 }
5550
5551 type ProjectsLocationsOperationsGetCall struct {
5552 s *Service
5553 name string
5554 urlParams_ gensupport.URLParams
5555 ifNoneMatch_ string
5556 ctx_ context.Context
5557 header_ http.Header
5558 }
5559
5560
5561
5562
5563
5564
5565 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
5566 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5567 c.name = name
5568 return c
5569 }
5570
5571
5572
5573
5574 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
5575 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5576 return c
5577 }
5578
5579
5580
5581
5582 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
5583 c.ifNoneMatch_ = entityTag
5584 return c
5585 }
5586
5587
5588 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
5589 c.ctx_ = ctx
5590 return c
5591 }
5592
5593
5594
5595 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
5596 if c.header_ == nil {
5597 c.header_ = make(http.Header)
5598 }
5599 return c.header_
5600 }
5601
5602 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
5603 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5604 if c.ifNoneMatch_ != "" {
5605 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5606 }
5607 var body io.Reader = nil
5608 c.urlParams_.Set("alt", alt)
5609 c.urlParams_.Set("prettyPrint", "false")
5610 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5611 urls += "?" + c.urlParams_.Encode()
5612 req, err := http.NewRequest("GET", urls, body)
5613 if err != nil {
5614 return nil, err
5615 }
5616 req.Header = reqHeaders
5617 googleapi.Expand(req.URL, map[string]string{
5618 "name": c.name,
5619 })
5620 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5621 }
5622
5623
5624
5625
5626
5627
5628
5629 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
5630 gensupport.SetOptions(c.urlParams_, opts...)
5631 res, err := c.doRequest("json")
5632 if res != nil && res.StatusCode == http.StatusNotModified {
5633 if res.Body != nil {
5634 res.Body.Close()
5635 }
5636 return nil, gensupport.WrapError(&googleapi.Error{
5637 Code: res.StatusCode,
5638 Header: res.Header,
5639 })
5640 }
5641 if err != nil {
5642 return nil, err
5643 }
5644 defer googleapi.CloseBody(res)
5645 if err := googleapi.CheckResponse(res); err != nil {
5646 return nil, gensupport.WrapError(err)
5647 }
5648 ret := &GoogleLongrunningOperation{
5649 ServerResponse: googleapi.ServerResponse{
5650 Header: res.Header,
5651 HTTPStatusCode: res.StatusCode,
5652 },
5653 }
5654 target := &ret
5655 if err := gensupport.DecodeResponse(target, res); err != nil {
5656 return nil, err
5657 }
5658 return ret, nil
5659 }
5660
5661 type ProjectsLocationsOperationsListCall struct {
5662 s *Service
5663 name string
5664 urlParams_ gensupport.URLParams
5665 ifNoneMatch_ string
5666 ctx_ context.Context
5667 header_ http.Header
5668 }
5669
5670
5671
5672
5673
5674 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
5675 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5676 c.name = name
5677 return c
5678 }
5679
5680
5681 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
5682 c.urlParams_.Set("filter", filter)
5683 return c
5684 }
5685
5686
5687
5688 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
5689 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5690 return c
5691 }
5692
5693
5694
5695 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
5696 c.urlParams_.Set("pageToken", pageToken)
5697 return c
5698 }
5699
5700
5701
5702
5703 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
5704 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5705 return c
5706 }
5707
5708
5709
5710
5711 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
5712 c.ifNoneMatch_ = entityTag
5713 return c
5714 }
5715
5716
5717 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
5718 c.ctx_ = ctx
5719 return c
5720 }
5721
5722
5723
5724 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
5725 if c.header_ == nil {
5726 c.header_ = make(http.Header)
5727 }
5728 return c.header_
5729 }
5730
5731 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
5732 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5733 if c.ifNoneMatch_ != "" {
5734 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5735 }
5736 var body io.Reader = nil
5737 c.urlParams_.Set("alt", alt)
5738 c.urlParams_.Set("prettyPrint", "false")
5739 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
5740 urls += "?" + c.urlParams_.Encode()
5741 req, err := http.NewRequest("GET", urls, body)
5742 if err != nil {
5743 return nil, err
5744 }
5745 req.Header = reqHeaders
5746 googleapi.Expand(req.URL, map[string]string{
5747 "name": c.name,
5748 })
5749 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5750 }
5751
5752
5753
5754
5755
5756
5757
5758 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
5759 gensupport.SetOptions(c.urlParams_, opts...)
5760 res, err := c.doRequest("json")
5761 if res != nil && res.StatusCode == http.StatusNotModified {
5762 if res.Body != nil {
5763 res.Body.Close()
5764 }
5765 return nil, gensupport.WrapError(&googleapi.Error{
5766 Code: res.StatusCode,
5767 Header: res.Header,
5768 })
5769 }
5770 if err != nil {
5771 return nil, err
5772 }
5773 defer googleapi.CloseBody(res)
5774 if err := googleapi.CheckResponse(res); err != nil {
5775 return nil, gensupport.WrapError(err)
5776 }
5777 ret := &GoogleLongrunningListOperationsResponse{
5778 ServerResponse: googleapi.ServerResponse{
5779 Header: res.Header,
5780 HTTPStatusCode: res.StatusCode,
5781 },
5782 }
5783 target := &ret
5784 if err := gensupport.DecodeResponse(target, res); err != nil {
5785 return nil, err
5786 }
5787 return ret, nil
5788 }
5789
5790
5791
5792
5793 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
5794 c.ctx_ = ctx
5795 defer c.PageToken(c.urlParams_.Get("pageToken"))
5796 for {
5797 x, err := c.Do()
5798 if err != nil {
5799 return err
5800 }
5801 if err := f(x); err != nil {
5802 return err
5803 }
5804 if x.NextPageToken == "" {
5805 return nil
5806 }
5807 c.PageToken(x.NextPageToken)
5808 }
5809 }
5810
5811 type ProjectsLocationsRestorePlansCreateCall struct {
5812 s *Service
5813 parent string
5814 restoreplan *RestorePlan
5815 urlParams_ gensupport.URLParams
5816 ctx_ context.Context
5817 header_ http.Header
5818 }
5819
5820
5821
5822
5823
5824 func (r *ProjectsLocationsRestorePlansService) Create(parent string, restoreplan *RestorePlan) *ProjectsLocationsRestorePlansCreateCall {
5825 c := &ProjectsLocationsRestorePlansCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5826 c.parent = parent
5827 c.restoreplan = restoreplan
5828 return c
5829 }
5830
5831
5832
5833
5834
5835
5836
5837 func (c *ProjectsLocationsRestorePlansCreateCall) RestorePlanId(restorePlanId string) *ProjectsLocationsRestorePlansCreateCall {
5838 c.urlParams_.Set("restorePlanId", restorePlanId)
5839 return c
5840 }
5841
5842
5843
5844
5845 func (c *ProjectsLocationsRestorePlansCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansCreateCall {
5846 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5847 return c
5848 }
5849
5850
5851 func (c *ProjectsLocationsRestorePlansCreateCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansCreateCall {
5852 c.ctx_ = ctx
5853 return c
5854 }
5855
5856
5857
5858 func (c *ProjectsLocationsRestorePlansCreateCall) Header() http.Header {
5859 if c.header_ == nil {
5860 c.header_ = make(http.Header)
5861 }
5862 return c.header_
5863 }
5864
5865 func (c *ProjectsLocationsRestorePlansCreateCall) doRequest(alt string) (*http.Response, error) {
5866 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5867 var body io.Reader = nil
5868 body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreplan)
5869 if err != nil {
5870 return nil, err
5871 }
5872 c.urlParams_.Set("alt", alt)
5873 c.urlParams_.Set("prettyPrint", "false")
5874 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/restorePlans")
5875 urls += "?" + c.urlParams_.Encode()
5876 req, err := http.NewRequest("POST", urls, body)
5877 if err != nil {
5878 return nil, err
5879 }
5880 req.Header = reqHeaders
5881 googleapi.Expand(req.URL, map[string]string{
5882 "parent": c.parent,
5883 })
5884 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5885 }
5886
5887
5888
5889
5890
5891
5892
5893 func (c *ProjectsLocationsRestorePlansCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
5894 gensupport.SetOptions(c.urlParams_, opts...)
5895 res, err := c.doRequest("json")
5896 if res != nil && res.StatusCode == http.StatusNotModified {
5897 if res.Body != nil {
5898 res.Body.Close()
5899 }
5900 return nil, gensupport.WrapError(&googleapi.Error{
5901 Code: res.StatusCode,
5902 Header: res.Header,
5903 })
5904 }
5905 if err != nil {
5906 return nil, err
5907 }
5908 defer googleapi.CloseBody(res)
5909 if err := googleapi.CheckResponse(res); err != nil {
5910 return nil, gensupport.WrapError(err)
5911 }
5912 ret := &GoogleLongrunningOperation{
5913 ServerResponse: googleapi.ServerResponse{
5914 Header: res.Header,
5915 HTTPStatusCode: res.StatusCode,
5916 },
5917 }
5918 target := &ret
5919 if err := gensupport.DecodeResponse(target, res); err != nil {
5920 return nil, err
5921 }
5922 return ret, nil
5923 }
5924
5925 type ProjectsLocationsRestorePlansDeleteCall struct {
5926 s *Service
5927 name string
5928 urlParams_ gensupport.URLParams
5929 ctx_ context.Context
5930 header_ http.Header
5931 }
5932
5933
5934
5935
5936
5937 func (r *ProjectsLocationsRestorePlansService) Delete(name string) *ProjectsLocationsRestorePlansDeleteCall {
5938 c := &ProjectsLocationsRestorePlansDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5939 c.name = name
5940 return c
5941 }
5942
5943
5944
5945
5946 func (c *ProjectsLocationsRestorePlansDeleteCall) Etag(etag string) *ProjectsLocationsRestorePlansDeleteCall {
5947 c.urlParams_.Set("etag", etag)
5948 return c
5949 }
5950
5951
5952
5953
5954 func (c *ProjectsLocationsRestorePlansDeleteCall) Force(force bool) *ProjectsLocationsRestorePlansDeleteCall {
5955 c.urlParams_.Set("force", fmt.Sprint(force))
5956 return c
5957 }
5958
5959
5960
5961
5962 func (c *ProjectsLocationsRestorePlansDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansDeleteCall {
5963 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5964 return c
5965 }
5966
5967
5968 func (c *ProjectsLocationsRestorePlansDeleteCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansDeleteCall {
5969 c.ctx_ = ctx
5970 return c
5971 }
5972
5973
5974
5975 func (c *ProjectsLocationsRestorePlansDeleteCall) Header() http.Header {
5976 if c.header_ == nil {
5977 c.header_ = make(http.Header)
5978 }
5979 return c.header_
5980 }
5981
5982 func (c *ProjectsLocationsRestorePlansDeleteCall) doRequest(alt string) (*http.Response, error) {
5983 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5984 var body io.Reader = nil
5985 c.urlParams_.Set("alt", alt)
5986 c.urlParams_.Set("prettyPrint", "false")
5987 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5988 urls += "?" + c.urlParams_.Encode()
5989 req, err := http.NewRequest("DELETE", urls, body)
5990 if err != nil {
5991 return nil, err
5992 }
5993 req.Header = reqHeaders
5994 googleapi.Expand(req.URL, map[string]string{
5995 "name": c.name,
5996 })
5997 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5998 }
5999
6000
6001
6002
6003
6004
6005
6006 func (c *ProjectsLocationsRestorePlansDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
6007 gensupport.SetOptions(c.urlParams_, opts...)
6008 res, err := c.doRequest("json")
6009 if res != nil && res.StatusCode == http.StatusNotModified {
6010 if res.Body != nil {
6011 res.Body.Close()
6012 }
6013 return nil, gensupport.WrapError(&googleapi.Error{
6014 Code: res.StatusCode,
6015 Header: res.Header,
6016 })
6017 }
6018 if err != nil {
6019 return nil, err
6020 }
6021 defer googleapi.CloseBody(res)
6022 if err := googleapi.CheckResponse(res); err != nil {
6023 return nil, gensupport.WrapError(err)
6024 }
6025 ret := &GoogleLongrunningOperation{
6026 ServerResponse: googleapi.ServerResponse{
6027 Header: res.Header,
6028 HTTPStatusCode: res.StatusCode,
6029 },
6030 }
6031 target := &ret
6032 if err := gensupport.DecodeResponse(target, res); err != nil {
6033 return nil, err
6034 }
6035 return ret, nil
6036 }
6037
6038 type ProjectsLocationsRestorePlansGetCall struct {
6039 s *Service
6040 name string
6041 urlParams_ gensupport.URLParams
6042 ifNoneMatch_ string
6043 ctx_ context.Context
6044 header_ http.Header
6045 }
6046
6047
6048
6049
6050
6051 func (r *ProjectsLocationsRestorePlansService) Get(name string) *ProjectsLocationsRestorePlansGetCall {
6052 c := &ProjectsLocationsRestorePlansGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6053 c.name = name
6054 return c
6055 }
6056
6057
6058
6059
6060 func (c *ProjectsLocationsRestorePlansGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansGetCall {
6061 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6062 return c
6063 }
6064
6065
6066
6067
6068 func (c *ProjectsLocationsRestorePlansGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsRestorePlansGetCall {
6069 c.ifNoneMatch_ = entityTag
6070 return c
6071 }
6072
6073
6074 func (c *ProjectsLocationsRestorePlansGetCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansGetCall {
6075 c.ctx_ = ctx
6076 return c
6077 }
6078
6079
6080
6081 func (c *ProjectsLocationsRestorePlansGetCall) Header() http.Header {
6082 if c.header_ == nil {
6083 c.header_ = make(http.Header)
6084 }
6085 return c.header_
6086 }
6087
6088 func (c *ProjectsLocationsRestorePlansGetCall) doRequest(alt string) (*http.Response, error) {
6089 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6090 if c.ifNoneMatch_ != "" {
6091 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6092 }
6093 var body io.Reader = nil
6094 c.urlParams_.Set("alt", alt)
6095 c.urlParams_.Set("prettyPrint", "false")
6096 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6097 urls += "?" + c.urlParams_.Encode()
6098 req, err := http.NewRequest("GET", urls, body)
6099 if err != nil {
6100 return nil, err
6101 }
6102 req.Header = reqHeaders
6103 googleapi.Expand(req.URL, map[string]string{
6104 "name": c.name,
6105 })
6106 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6107 }
6108
6109
6110
6111
6112
6113
6114 func (c *ProjectsLocationsRestorePlansGetCall) Do(opts ...googleapi.CallOption) (*RestorePlan, error) {
6115 gensupport.SetOptions(c.urlParams_, opts...)
6116 res, err := c.doRequest("json")
6117 if res != nil && res.StatusCode == http.StatusNotModified {
6118 if res.Body != nil {
6119 res.Body.Close()
6120 }
6121 return nil, gensupport.WrapError(&googleapi.Error{
6122 Code: res.StatusCode,
6123 Header: res.Header,
6124 })
6125 }
6126 if err != nil {
6127 return nil, err
6128 }
6129 defer googleapi.CloseBody(res)
6130 if err := googleapi.CheckResponse(res); err != nil {
6131 return nil, gensupport.WrapError(err)
6132 }
6133 ret := &RestorePlan{
6134 ServerResponse: googleapi.ServerResponse{
6135 Header: res.Header,
6136 HTTPStatusCode: res.StatusCode,
6137 },
6138 }
6139 target := &ret
6140 if err := gensupport.DecodeResponse(target, res); err != nil {
6141 return nil, err
6142 }
6143 return ret, nil
6144 }
6145
6146 type ProjectsLocationsRestorePlansGetIamPolicyCall struct {
6147 s *Service
6148 resource string
6149 urlParams_ gensupport.URLParams
6150 ifNoneMatch_ string
6151 ctx_ context.Context
6152 header_ http.Header
6153 }
6154
6155
6156
6157
6158
6159
6160
6161 func (r *ProjectsLocationsRestorePlansService) GetIamPolicy(resource string) *ProjectsLocationsRestorePlansGetIamPolicyCall {
6162 c := &ProjectsLocationsRestorePlansGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6163 c.resource = resource
6164 return c
6165 }
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179 func (c *ProjectsLocationsRestorePlansGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsRestorePlansGetIamPolicyCall {
6180 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
6181 return c
6182 }
6183
6184
6185
6186
6187 func (c *ProjectsLocationsRestorePlansGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansGetIamPolicyCall {
6188 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6189 return c
6190 }
6191
6192
6193
6194
6195 func (c *ProjectsLocationsRestorePlansGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsRestorePlansGetIamPolicyCall {
6196 c.ifNoneMatch_ = entityTag
6197 return c
6198 }
6199
6200
6201 func (c *ProjectsLocationsRestorePlansGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansGetIamPolicyCall {
6202 c.ctx_ = ctx
6203 return c
6204 }
6205
6206
6207
6208 func (c *ProjectsLocationsRestorePlansGetIamPolicyCall) Header() http.Header {
6209 if c.header_ == nil {
6210 c.header_ = make(http.Header)
6211 }
6212 return c.header_
6213 }
6214
6215 func (c *ProjectsLocationsRestorePlansGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
6216 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6217 if c.ifNoneMatch_ != "" {
6218 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6219 }
6220 var body io.Reader = nil
6221 c.urlParams_.Set("alt", alt)
6222 c.urlParams_.Set("prettyPrint", "false")
6223 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
6224 urls += "?" + c.urlParams_.Encode()
6225 req, err := http.NewRequest("GET", urls, body)
6226 if err != nil {
6227 return nil, err
6228 }
6229 req.Header = reqHeaders
6230 googleapi.Expand(req.URL, map[string]string{
6231 "resource": c.resource,
6232 })
6233 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6234 }
6235
6236
6237
6238
6239
6240
6241 func (c *ProjectsLocationsRestorePlansGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
6242 gensupport.SetOptions(c.urlParams_, opts...)
6243 res, err := c.doRequest("json")
6244 if res != nil && res.StatusCode == http.StatusNotModified {
6245 if res.Body != nil {
6246 res.Body.Close()
6247 }
6248 return nil, gensupport.WrapError(&googleapi.Error{
6249 Code: res.StatusCode,
6250 Header: res.Header,
6251 })
6252 }
6253 if err != nil {
6254 return nil, err
6255 }
6256 defer googleapi.CloseBody(res)
6257 if err := googleapi.CheckResponse(res); err != nil {
6258 return nil, gensupport.WrapError(err)
6259 }
6260 ret := &Policy{
6261 ServerResponse: googleapi.ServerResponse{
6262 Header: res.Header,
6263 HTTPStatusCode: res.StatusCode,
6264 },
6265 }
6266 target := &ret
6267 if err := gensupport.DecodeResponse(target, res); err != nil {
6268 return nil, err
6269 }
6270 return ret, nil
6271 }
6272
6273 type ProjectsLocationsRestorePlansListCall struct {
6274 s *Service
6275 parent string
6276 urlParams_ gensupport.URLParams
6277 ifNoneMatch_ string
6278 ctx_ context.Context
6279 header_ http.Header
6280 }
6281
6282
6283
6284
6285
6286 func (r *ProjectsLocationsRestorePlansService) List(parent string) *ProjectsLocationsRestorePlansListCall {
6287 c := &ProjectsLocationsRestorePlansListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6288 c.parent = parent
6289 return c
6290 }
6291
6292
6293
6294 func (c *ProjectsLocationsRestorePlansListCall) Filter(filter string) *ProjectsLocationsRestorePlansListCall {
6295 c.urlParams_.Set("filter", filter)
6296 return c
6297 }
6298
6299
6300
6301 func (c *ProjectsLocationsRestorePlansListCall) OrderBy(orderBy string) *ProjectsLocationsRestorePlansListCall {
6302 c.urlParams_.Set("orderBy", orderBy)
6303 return c
6304 }
6305
6306
6307
6308
6309
6310
6311 func (c *ProjectsLocationsRestorePlansListCall) PageSize(pageSize int64) *ProjectsLocationsRestorePlansListCall {
6312 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6313 return c
6314 }
6315
6316
6317
6318
6319
6320
6321 func (c *ProjectsLocationsRestorePlansListCall) PageToken(pageToken string) *ProjectsLocationsRestorePlansListCall {
6322 c.urlParams_.Set("pageToken", pageToken)
6323 return c
6324 }
6325
6326
6327
6328
6329 func (c *ProjectsLocationsRestorePlansListCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansListCall {
6330 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6331 return c
6332 }
6333
6334
6335
6336
6337 func (c *ProjectsLocationsRestorePlansListCall) IfNoneMatch(entityTag string) *ProjectsLocationsRestorePlansListCall {
6338 c.ifNoneMatch_ = entityTag
6339 return c
6340 }
6341
6342
6343 func (c *ProjectsLocationsRestorePlansListCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansListCall {
6344 c.ctx_ = ctx
6345 return c
6346 }
6347
6348
6349
6350 func (c *ProjectsLocationsRestorePlansListCall) Header() http.Header {
6351 if c.header_ == nil {
6352 c.header_ = make(http.Header)
6353 }
6354 return c.header_
6355 }
6356
6357 func (c *ProjectsLocationsRestorePlansListCall) doRequest(alt string) (*http.Response, error) {
6358 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6359 if c.ifNoneMatch_ != "" {
6360 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6361 }
6362 var body io.Reader = nil
6363 c.urlParams_.Set("alt", alt)
6364 c.urlParams_.Set("prettyPrint", "false")
6365 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/restorePlans")
6366 urls += "?" + c.urlParams_.Encode()
6367 req, err := http.NewRequest("GET", urls, body)
6368 if err != nil {
6369 return nil, err
6370 }
6371 req.Header = reqHeaders
6372 googleapi.Expand(req.URL, map[string]string{
6373 "parent": c.parent,
6374 })
6375 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6376 }
6377
6378
6379
6380
6381
6382
6383
6384 func (c *ProjectsLocationsRestorePlansListCall) Do(opts ...googleapi.CallOption) (*ListRestorePlansResponse, error) {
6385 gensupport.SetOptions(c.urlParams_, opts...)
6386 res, err := c.doRequest("json")
6387 if res != nil && res.StatusCode == http.StatusNotModified {
6388 if res.Body != nil {
6389 res.Body.Close()
6390 }
6391 return nil, gensupport.WrapError(&googleapi.Error{
6392 Code: res.StatusCode,
6393 Header: res.Header,
6394 })
6395 }
6396 if err != nil {
6397 return nil, err
6398 }
6399 defer googleapi.CloseBody(res)
6400 if err := googleapi.CheckResponse(res); err != nil {
6401 return nil, gensupport.WrapError(err)
6402 }
6403 ret := &ListRestorePlansResponse{
6404 ServerResponse: googleapi.ServerResponse{
6405 Header: res.Header,
6406 HTTPStatusCode: res.StatusCode,
6407 },
6408 }
6409 target := &ret
6410 if err := gensupport.DecodeResponse(target, res); err != nil {
6411 return nil, err
6412 }
6413 return ret, nil
6414 }
6415
6416
6417
6418
6419 func (c *ProjectsLocationsRestorePlansListCall) Pages(ctx context.Context, f func(*ListRestorePlansResponse) error) error {
6420 c.ctx_ = ctx
6421 defer c.PageToken(c.urlParams_.Get("pageToken"))
6422 for {
6423 x, err := c.Do()
6424 if err != nil {
6425 return err
6426 }
6427 if err := f(x); err != nil {
6428 return err
6429 }
6430 if x.NextPageToken == "" {
6431 return nil
6432 }
6433 c.PageToken(x.NextPageToken)
6434 }
6435 }
6436
6437 type ProjectsLocationsRestorePlansPatchCall struct {
6438 s *Service
6439 name string
6440 restoreplan *RestorePlan
6441 urlParams_ gensupport.URLParams
6442 ctx_ context.Context
6443 header_ http.Header
6444 }
6445
6446
6447
6448
6449
6450 func (r *ProjectsLocationsRestorePlansService) Patch(name string, restoreplan *RestorePlan) *ProjectsLocationsRestorePlansPatchCall {
6451 c := &ProjectsLocationsRestorePlansPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6452 c.name = name
6453 c.restoreplan = restoreplan
6454 return c
6455 }
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465 func (c *ProjectsLocationsRestorePlansPatchCall) UpdateMask(updateMask string) *ProjectsLocationsRestorePlansPatchCall {
6466 c.urlParams_.Set("updateMask", updateMask)
6467 return c
6468 }
6469
6470
6471
6472
6473 func (c *ProjectsLocationsRestorePlansPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansPatchCall {
6474 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6475 return c
6476 }
6477
6478
6479 func (c *ProjectsLocationsRestorePlansPatchCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansPatchCall {
6480 c.ctx_ = ctx
6481 return c
6482 }
6483
6484
6485
6486 func (c *ProjectsLocationsRestorePlansPatchCall) Header() http.Header {
6487 if c.header_ == nil {
6488 c.header_ = make(http.Header)
6489 }
6490 return c.header_
6491 }
6492
6493 func (c *ProjectsLocationsRestorePlansPatchCall) doRequest(alt string) (*http.Response, error) {
6494 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6495 var body io.Reader = nil
6496 body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreplan)
6497 if err != nil {
6498 return nil, err
6499 }
6500 c.urlParams_.Set("alt", alt)
6501 c.urlParams_.Set("prettyPrint", "false")
6502 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6503 urls += "?" + c.urlParams_.Encode()
6504 req, err := http.NewRequest("PATCH", urls, body)
6505 if err != nil {
6506 return nil, err
6507 }
6508 req.Header = reqHeaders
6509 googleapi.Expand(req.URL, map[string]string{
6510 "name": c.name,
6511 })
6512 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6513 }
6514
6515
6516
6517
6518
6519
6520
6521 func (c *ProjectsLocationsRestorePlansPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
6522 gensupport.SetOptions(c.urlParams_, opts...)
6523 res, err := c.doRequest("json")
6524 if res != nil && res.StatusCode == http.StatusNotModified {
6525 if res.Body != nil {
6526 res.Body.Close()
6527 }
6528 return nil, gensupport.WrapError(&googleapi.Error{
6529 Code: res.StatusCode,
6530 Header: res.Header,
6531 })
6532 }
6533 if err != nil {
6534 return nil, err
6535 }
6536 defer googleapi.CloseBody(res)
6537 if err := googleapi.CheckResponse(res); err != nil {
6538 return nil, gensupport.WrapError(err)
6539 }
6540 ret := &GoogleLongrunningOperation{
6541 ServerResponse: googleapi.ServerResponse{
6542 Header: res.Header,
6543 HTTPStatusCode: res.StatusCode,
6544 },
6545 }
6546 target := &ret
6547 if err := gensupport.DecodeResponse(target, res); err != nil {
6548 return nil, err
6549 }
6550 return ret, nil
6551 }
6552
6553 type ProjectsLocationsRestorePlansSetIamPolicyCall struct {
6554 s *Service
6555 resource string
6556 setiampolicyrequest *SetIamPolicyRequest
6557 urlParams_ gensupport.URLParams
6558 ctx_ context.Context
6559 header_ http.Header
6560 }
6561
6562
6563
6564
6565
6566
6567
6568
6569 func (r *ProjectsLocationsRestorePlansService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsRestorePlansSetIamPolicyCall {
6570 c := &ProjectsLocationsRestorePlansSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6571 c.resource = resource
6572 c.setiampolicyrequest = setiampolicyrequest
6573 return c
6574 }
6575
6576
6577
6578
6579 func (c *ProjectsLocationsRestorePlansSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansSetIamPolicyCall {
6580 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6581 return c
6582 }
6583
6584
6585 func (c *ProjectsLocationsRestorePlansSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansSetIamPolicyCall {
6586 c.ctx_ = ctx
6587 return c
6588 }
6589
6590
6591
6592 func (c *ProjectsLocationsRestorePlansSetIamPolicyCall) Header() http.Header {
6593 if c.header_ == nil {
6594 c.header_ = make(http.Header)
6595 }
6596 return c.header_
6597 }
6598
6599 func (c *ProjectsLocationsRestorePlansSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
6600 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6601 var body io.Reader = nil
6602 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
6603 if err != nil {
6604 return nil, err
6605 }
6606 c.urlParams_.Set("alt", alt)
6607 c.urlParams_.Set("prettyPrint", "false")
6608 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
6609 urls += "?" + c.urlParams_.Encode()
6610 req, err := http.NewRequest("POST", urls, body)
6611 if err != nil {
6612 return nil, err
6613 }
6614 req.Header = reqHeaders
6615 googleapi.Expand(req.URL, map[string]string{
6616 "resource": c.resource,
6617 })
6618 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6619 }
6620
6621
6622
6623
6624
6625
6626 func (c *ProjectsLocationsRestorePlansSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
6627 gensupport.SetOptions(c.urlParams_, opts...)
6628 res, err := c.doRequest("json")
6629 if res != nil && res.StatusCode == http.StatusNotModified {
6630 if res.Body != nil {
6631 res.Body.Close()
6632 }
6633 return nil, gensupport.WrapError(&googleapi.Error{
6634 Code: res.StatusCode,
6635 Header: res.Header,
6636 })
6637 }
6638 if err != nil {
6639 return nil, err
6640 }
6641 defer googleapi.CloseBody(res)
6642 if err := googleapi.CheckResponse(res); err != nil {
6643 return nil, gensupport.WrapError(err)
6644 }
6645 ret := &Policy{
6646 ServerResponse: googleapi.ServerResponse{
6647 Header: res.Header,
6648 HTTPStatusCode: res.StatusCode,
6649 },
6650 }
6651 target := &ret
6652 if err := gensupport.DecodeResponse(target, res); err != nil {
6653 return nil, err
6654 }
6655 return ret, nil
6656 }
6657
6658 type ProjectsLocationsRestorePlansTestIamPermissionsCall struct {
6659 s *Service
6660 resource string
6661 testiampermissionsrequest *TestIamPermissionsRequest
6662 urlParams_ gensupport.URLParams
6663 ctx_ context.Context
6664 header_ http.Header
6665 }
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677 func (r *ProjectsLocationsRestorePlansService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsRestorePlansTestIamPermissionsCall {
6678 c := &ProjectsLocationsRestorePlansTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6679 c.resource = resource
6680 c.testiampermissionsrequest = testiampermissionsrequest
6681 return c
6682 }
6683
6684
6685
6686
6687 func (c *ProjectsLocationsRestorePlansTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansTestIamPermissionsCall {
6688 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6689 return c
6690 }
6691
6692
6693 func (c *ProjectsLocationsRestorePlansTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansTestIamPermissionsCall {
6694 c.ctx_ = ctx
6695 return c
6696 }
6697
6698
6699
6700 func (c *ProjectsLocationsRestorePlansTestIamPermissionsCall) Header() http.Header {
6701 if c.header_ == nil {
6702 c.header_ = make(http.Header)
6703 }
6704 return c.header_
6705 }
6706
6707 func (c *ProjectsLocationsRestorePlansTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
6708 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6709 var body io.Reader = nil
6710 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
6711 if err != nil {
6712 return nil, err
6713 }
6714 c.urlParams_.Set("alt", alt)
6715 c.urlParams_.Set("prettyPrint", "false")
6716 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
6717 urls += "?" + c.urlParams_.Encode()
6718 req, err := http.NewRequest("POST", urls, body)
6719 if err != nil {
6720 return nil, err
6721 }
6722 req.Header = reqHeaders
6723 googleapi.Expand(req.URL, map[string]string{
6724 "resource": c.resource,
6725 })
6726 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6727 }
6728
6729
6730
6731
6732
6733
6734
6735 func (c *ProjectsLocationsRestorePlansTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
6736 gensupport.SetOptions(c.urlParams_, opts...)
6737 res, err := c.doRequest("json")
6738 if res != nil && res.StatusCode == http.StatusNotModified {
6739 if res.Body != nil {
6740 res.Body.Close()
6741 }
6742 return nil, gensupport.WrapError(&googleapi.Error{
6743 Code: res.StatusCode,
6744 Header: res.Header,
6745 })
6746 }
6747 if err != nil {
6748 return nil, err
6749 }
6750 defer googleapi.CloseBody(res)
6751 if err := googleapi.CheckResponse(res); err != nil {
6752 return nil, gensupport.WrapError(err)
6753 }
6754 ret := &TestIamPermissionsResponse{
6755 ServerResponse: googleapi.ServerResponse{
6756 Header: res.Header,
6757 HTTPStatusCode: res.StatusCode,
6758 },
6759 }
6760 target := &ret
6761 if err := gensupport.DecodeResponse(target, res); err != nil {
6762 return nil, err
6763 }
6764 return ret, nil
6765 }
6766
6767 type ProjectsLocationsRestorePlansRestoresCreateCall struct {
6768 s *Service
6769 parent string
6770 restore *Restore
6771 urlParams_ gensupport.URLParams
6772 ctx_ context.Context
6773 header_ http.Header
6774 }
6775
6776
6777
6778
6779
6780 func (r *ProjectsLocationsRestorePlansRestoresService) Create(parent string, restore *Restore) *ProjectsLocationsRestorePlansRestoresCreateCall {
6781 c := &ProjectsLocationsRestorePlansRestoresCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6782 c.parent = parent
6783 c.restore = restore
6784 return c
6785 }
6786
6787
6788
6789
6790
6791
6792
6793 func (c *ProjectsLocationsRestorePlansRestoresCreateCall) RestoreId(restoreId string) *ProjectsLocationsRestorePlansRestoresCreateCall {
6794 c.urlParams_.Set("restoreId", restoreId)
6795 return c
6796 }
6797
6798
6799
6800
6801 func (c *ProjectsLocationsRestorePlansRestoresCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansRestoresCreateCall {
6802 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6803 return c
6804 }
6805
6806
6807 func (c *ProjectsLocationsRestorePlansRestoresCreateCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansRestoresCreateCall {
6808 c.ctx_ = ctx
6809 return c
6810 }
6811
6812
6813
6814 func (c *ProjectsLocationsRestorePlansRestoresCreateCall) Header() http.Header {
6815 if c.header_ == nil {
6816 c.header_ = make(http.Header)
6817 }
6818 return c.header_
6819 }
6820
6821 func (c *ProjectsLocationsRestorePlansRestoresCreateCall) doRequest(alt string) (*http.Response, error) {
6822 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6823 var body io.Reader = nil
6824 body, err := googleapi.WithoutDataWrapper.JSONReader(c.restore)
6825 if err != nil {
6826 return nil, err
6827 }
6828 c.urlParams_.Set("alt", alt)
6829 c.urlParams_.Set("prettyPrint", "false")
6830 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/restores")
6831 urls += "?" + c.urlParams_.Encode()
6832 req, err := http.NewRequest("POST", urls, body)
6833 if err != nil {
6834 return nil, err
6835 }
6836 req.Header = reqHeaders
6837 googleapi.Expand(req.URL, map[string]string{
6838 "parent": c.parent,
6839 })
6840 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6841 }
6842
6843
6844
6845
6846
6847
6848
6849 func (c *ProjectsLocationsRestorePlansRestoresCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
6850 gensupport.SetOptions(c.urlParams_, opts...)
6851 res, err := c.doRequest("json")
6852 if res != nil && res.StatusCode == http.StatusNotModified {
6853 if res.Body != nil {
6854 res.Body.Close()
6855 }
6856 return nil, gensupport.WrapError(&googleapi.Error{
6857 Code: res.StatusCode,
6858 Header: res.Header,
6859 })
6860 }
6861 if err != nil {
6862 return nil, err
6863 }
6864 defer googleapi.CloseBody(res)
6865 if err := googleapi.CheckResponse(res); err != nil {
6866 return nil, gensupport.WrapError(err)
6867 }
6868 ret := &GoogleLongrunningOperation{
6869 ServerResponse: googleapi.ServerResponse{
6870 Header: res.Header,
6871 HTTPStatusCode: res.StatusCode,
6872 },
6873 }
6874 target := &ret
6875 if err := gensupport.DecodeResponse(target, res); err != nil {
6876 return nil, err
6877 }
6878 return ret, nil
6879 }
6880
6881 type ProjectsLocationsRestorePlansRestoresDeleteCall struct {
6882 s *Service
6883 name string
6884 urlParams_ gensupport.URLParams
6885 ctx_ context.Context
6886 header_ http.Header
6887 }
6888
6889
6890
6891
6892
6893 func (r *ProjectsLocationsRestorePlansRestoresService) Delete(name string) *ProjectsLocationsRestorePlansRestoresDeleteCall {
6894 c := &ProjectsLocationsRestorePlansRestoresDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6895 c.name = name
6896 return c
6897 }
6898
6899
6900
6901
6902 func (c *ProjectsLocationsRestorePlansRestoresDeleteCall) Etag(etag string) *ProjectsLocationsRestorePlansRestoresDeleteCall {
6903 c.urlParams_.Set("etag", etag)
6904 return c
6905 }
6906
6907
6908
6909
6910 func (c *ProjectsLocationsRestorePlansRestoresDeleteCall) Force(force bool) *ProjectsLocationsRestorePlansRestoresDeleteCall {
6911 c.urlParams_.Set("force", fmt.Sprint(force))
6912 return c
6913 }
6914
6915
6916
6917
6918 func (c *ProjectsLocationsRestorePlansRestoresDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansRestoresDeleteCall {
6919 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6920 return c
6921 }
6922
6923
6924 func (c *ProjectsLocationsRestorePlansRestoresDeleteCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansRestoresDeleteCall {
6925 c.ctx_ = ctx
6926 return c
6927 }
6928
6929
6930
6931 func (c *ProjectsLocationsRestorePlansRestoresDeleteCall) Header() http.Header {
6932 if c.header_ == nil {
6933 c.header_ = make(http.Header)
6934 }
6935 return c.header_
6936 }
6937
6938 func (c *ProjectsLocationsRestorePlansRestoresDeleteCall) doRequest(alt string) (*http.Response, error) {
6939 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6940 var body io.Reader = nil
6941 c.urlParams_.Set("alt", alt)
6942 c.urlParams_.Set("prettyPrint", "false")
6943 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6944 urls += "?" + c.urlParams_.Encode()
6945 req, err := http.NewRequest("DELETE", urls, body)
6946 if err != nil {
6947 return nil, err
6948 }
6949 req.Header = reqHeaders
6950 googleapi.Expand(req.URL, map[string]string{
6951 "name": c.name,
6952 })
6953 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6954 }
6955
6956
6957
6958
6959
6960
6961
6962 func (c *ProjectsLocationsRestorePlansRestoresDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
6963 gensupport.SetOptions(c.urlParams_, opts...)
6964 res, err := c.doRequest("json")
6965 if res != nil && res.StatusCode == http.StatusNotModified {
6966 if res.Body != nil {
6967 res.Body.Close()
6968 }
6969 return nil, gensupport.WrapError(&googleapi.Error{
6970 Code: res.StatusCode,
6971 Header: res.Header,
6972 })
6973 }
6974 if err != nil {
6975 return nil, err
6976 }
6977 defer googleapi.CloseBody(res)
6978 if err := googleapi.CheckResponse(res); err != nil {
6979 return nil, gensupport.WrapError(err)
6980 }
6981 ret := &GoogleLongrunningOperation{
6982 ServerResponse: googleapi.ServerResponse{
6983 Header: res.Header,
6984 HTTPStatusCode: res.StatusCode,
6985 },
6986 }
6987 target := &ret
6988 if err := gensupport.DecodeResponse(target, res); err != nil {
6989 return nil, err
6990 }
6991 return ret, nil
6992 }
6993
6994 type ProjectsLocationsRestorePlansRestoresGetCall struct {
6995 s *Service
6996 name string
6997 urlParams_ gensupport.URLParams
6998 ifNoneMatch_ string
6999 ctx_ context.Context
7000 header_ http.Header
7001 }
7002
7003
7004
7005
7006
7007 func (r *ProjectsLocationsRestorePlansRestoresService) Get(name string) *ProjectsLocationsRestorePlansRestoresGetCall {
7008 c := &ProjectsLocationsRestorePlansRestoresGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7009 c.name = name
7010 return c
7011 }
7012
7013
7014
7015
7016 func (c *ProjectsLocationsRestorePlansRestoresGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansRestoresGetCall {
7017 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7018 return c
7019 }
7020
7021
7022
7023
7024 func (c *ProjectsLocationsRestorePlansRestoresGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsRestorePlansRestoresGetCall {
7025 c.ifNoneMatch_ = entityTag
7026 return c
7027 }
7028
7029
7030 func (c *ProjectsLocationsRestorePlansRestoresGetCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansRestoresGetCall {
7031 c.ctx_ = ctx
7032 return c
7033 }
7034
7035
7036
7037 func (c *ProjectsLocationsRestorePlansRestoresGetCall) Header() http.Header {
7038 if c.header_ == nil {
7039 c.header_ = make(http.Header)
7040 }
7041 return c.header_
7042 }
7043
7044 func (c *ProjectsLocationsRestorePlansRestoresGetCall) doRequest(alt string) (*http.Response, error) {
7045 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7046 if c.ifNoneMatch_ != "" {
7047 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7048 }
7049 var body io.Reader = nil
7050 c.urlParams_.Set("alt", alt)
7051 c.urlParams_.Set("prettyPrint", "false")
7052 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7053 urls += "?" + c.urlParams_.Encode()
7054 req, err := http.NewRequest("GET", urls, body)
7055 if err != nil {
7056 return nil, err
7057 }
7058 req.Header = reqHeaders
7059 googleapi.Expand(req.URL, map[string]string{
7060 "name": c.name,
7061 })
7062 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7063 }
7064
7065
7066
7067
7068
7069
7070 func (c *ProjectsLocationsRestorePlansRestoresGetCall) Do(opts ...googleapi.CallOption) (*Restore, error) {
7071 gensupport.SetOptions(c.urlParams_, opts...)
7072 res, err := c.doRequest("json")
7073 if res != nil && res.StatusCode == http.StatusNotModified {
7074 if res.Body != nil {
7075 res.Body.Close()
7076 }
7077 return nil, gensupport.WrapError(&googleapi.Error{
7078 Code: res.StatusCode,
7079 Header: res.Header,
7080 })
7081 }
7082 if err != nil {
7083 return nil, err
7084 }
7085 defer googleapi.CloseBody(res)
7086 if err := googleapi.CheckResponse(res); err != nil {
7087 return nil, gensupport.WrapError(err)
7088 }
7089 ret := &Restore{
7090 ServerResponse: googleapi.ServerResponse{
7091 Header: res.Header,
7092 HTTPStatusCode: res.StatusCode,
7093 },
7094 }
7095 target := &ret
7096 if err := gensupport.DecodeResponse(target, res); err != nil {
7097 return nil, err
7098 }
7099 return ret, nil
7100 }
7101
7102 type ProjectsLocationsRestorePlansRestoresGetIamPolicyCall struct {
7103 s *Service
7104 resource string
7105 urlParams_ gensupport.URLParams
7106 ifNoneMatch_ string
7107 ctx_ context.Context
7108 header_ http.Header
7109 }
7110
7111
7112
7113
7114
7115
7116
7117 func (r *ProjectsLocationsRestorePlansRestoresService) GetIamPolicy(resource string) *ProjectsLocationsRestorePlansRestoresGetIamPolicyCall {
7118 c := &ProjectsLocationsRestorePlansRestoresGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7119 c.resource = resource
7120 return c
7121 }
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135 func (c *ProjectsLocationsRestorePlansRestoresGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsRestorePlansRestoresGetIamPolicyCall {
7136 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
7137 return c
7138 }
7139
7140
7141
7142
7143 func (c *ProjectsLocationsRestorePlansRestoresGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansRestoresGetIamPolicyCall {
7144 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7145 return c
7146 }
7147
7148
7149
7150
7151 func (c *ProjectsLocationsRestorePlansRestoresGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsRestorePlansRestoresGetIamPolicyCall {
7152 c.ifNoneMatch_ = entityTag
7153 return c
7154 }
7155
7156
7157 func (c *ProjectsLocationsRestorePlansRestoresGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansRestoresGetIamPolicyCall {
7158 c.ctx_ = ctx
7159 return c
7160 }
7161
7162
7163
7164 func (c *ProjectsLocationsRestorePlansRestoresGetIamPolicyCall) Header() http.Header {
7165 if c.header_ == nil {
7166 c.header_ = make(http.Header)
7167 }
7168 return c.header_
7169 }
7170
7171 func (c *ProjectsLocationsRestorePlansRestoresGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
7172 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7173 if c.ifNoneMatch_ != "" {
7174 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7175 }
7176 var body io.Reader = nil
7177 c.urlParams_.Set("alt", alt)
7178 c.urlParams_.Set("prettyPrint", "false")
7179 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
7180 urls += "?" + c.urlParams_.Encode()
7181 req, err := http.NewRequest("GET", urls, body)
7182 if err != nil {
7183 return nil, err
7184 }
7185 req.Header = reqHeaders
7186 googleapi.Expand(req.URL, map[string]string{
7187 "resource": c.resource,
7188 })
7189 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7190 }
7191
7192
7193
7194
7195
7196
7197 func (c *ProjectsLocationsRestorePlansRestoresGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
7198 gensupport.SetOptions(c.urlParams_, opts...)
7199 res, err := c.doRequest("json")
7200 if res != nil && res.StatusCode == http.StatusNotModified {
7201 if res.Body != nil {
7202 res.Body.Close()
7203 }
7204 return nil, gensupport.WrapError(&googleapi.Error{
7205 Code: res.StatusCode,
7206 Header: res.Header,
7207 })
7208 }
7209 if err != nil {
7210 return nil, err
7211 }
7212 defer googleapi.CloseBody(res)
7213 if err := googleapi.CheckResponse(res); err != nil {
7214 return nil, gensupport.WrapError(err)
7215 }
7216 ret := &Policy{
7217 ServerResponse: googleapi.ServerResponse{
7218 Header: res.Header,
7219 HTTPStatusCode: res.StatusCode,
7220 },
7221 }
7222 target := &ret
7223 if err := gensupport.DecodeResponse(target, res); err != nil {
7224 return nil, err
7225 }
7226 return ret, nil
7227 }
7228
7229 type ProjectsLocationsRestorePlansRestoresListCall struct {
7230 s *Service
7231 parent string
7232 urlParams_ gensupport.URLParams
7233 ifNoneMatch_ string
7234 ctx_ context.Context
7235 header_ http.Header
7236 }
7237
7238
7239
7240
7241
7242 func (r *ProjectsLocationsRestorePlansRestoresService) List(parent string) *ProjectsLocationsRestorePlansRestoresListCall {
7243 c := &ProjectsLocationsRestorePlansRestoresListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7244 c.parent = parent
7245 return c
7246 }
7247
7248
7249
7250 func (c *ProjectsLocationsRestorePlansRestoresListCall) Filter(filter string) *ProjectsLocationsRestorePlansRestoresListCall {
7251 c.urlParams_.Set("filter", filter)
7252 return c
7253 }
7254
7255
7256
7257 func (c *ProjectsLocationsRestorePlansRestoresListCall) OrderBy(orderBy string) *ProjectsLocationsRestorePlansRestoresListCall {
7258 c.urlParams_.Set("orderBy", orderBy)
7259 return c
7260 }
7261
7262
7263
7264
7265
7266
7267 func (c *ProjectsLocationsRestorePlansRestoresListCall) PageSize(pageSize int64) *ProjectsLocationsRestorePlansRestoresListCall {
7268 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7269 return c
7270 }
7271
7272
7273
7274
7275
7276
7277 func (c *ProjectsLocationsRestorePlansRestoresListCall) PageToken(pageToken string) *ProjectsLocationsRestorePlansRestoresListCall {
7278 c.urlParams_.Set("pageToken", pageToken)
7279 return c
7280 }
7281
7282
7283
7284
7285 func (c *ProjectsLocationsRestorePlansRestoresListCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansRestoresListCall {
7286 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7287 return c
7288 }
7289
7290
7291
7292
7293 func (c *ProjectsLocationsRestorePlansRestoresListCall) IfNoneMatch(entityTag string) *ProjectsLocationsRestorePlansRestoresListCall {
7294 c.ifNoneMatch_ = entityTag
7295 return c
7296 }
7297
7298
7299 func (c *ProjectsLocationsRestorePlansRestoresListCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansRestoresListCall {
7300 c.ctx_ = ctx
7301 return c
7302 }
7303
7304
7305
7306 func (c *ProjectsLocationsRestorePlansRestoresListCall) Header() http.Header {
7307 if c.header_ == nil {
7308 c.header_ = make(http.Header)
7309 }
7310 return c.header_
7311 }
7312
7313 func (c *ProjectsLocationsRestorePlansRestoresListCall) doRequest(alt string) (*http.Response, error) {
7314 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7315 if c.ifNoneMatch_ != "" {
7316 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7317 }
7318 var body io.Reader = nil
7319 c.urlParams_.Set("alt", alt)
7320 c.urlParams_.Set("prettyPrint", "false")
7321 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/restores")
7322 urls += "?" + c.urlParams_.Encode()
7323 req, err := http.NewRequest("GET", urls, body)
7324 if err != nil {
7325 return nil, err
7326 }
7327 req.Header = reqHeaders
7328 googleapi.Expand(req.URL, map[string]string{
7329 "parent": c.parent,
7330 })
7331 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7332 }
7333
7334
7335
7336
7337
7338
7339
7340 func (c *ProjectsLocationsRestorePlansRestoresListCall) Do(opts ...googleapi.CallOption) (*ListRestoresResponse, error) {
7341 gensupport.SetOptions(c.urlParams_, opts...)
7342 res, err := c.doRequest("json")
7343 if res != nil && res.StatusCode == http.StatusNotModified {
7344 if res.Body != nil {
7345 res.Body.Close()
7346 }
7347 return nil, gensupport.WrapError(&googleapi.Error{
7348 Code: res.StatusCode,
7349 Header: res.Header,
7350 })
7351 }
7352 if err != nil {
7353 return nil, err
7354 }
7355 defer googleapi.CloseBody(res)
7356 if err := googleapi.CheckResponse(res); err != nil {
7357 return nil, gensupport.WrapError(err)
7358 }
7359 ret := &ListRestoresResponse{
7360 ServerResponse: googleapi.ServerResponse{
7361 Header: res.Header,
7362 HTTPStatusCode: res.StatusCode,
7363 },
7364 }
7365 target := &ret
7366 if err := gensupport.DecodeResponse(target, res); err != nil {
7367 return nil, err
7368 }
7369 return ret, nil
7370 }
7371
7372
7373
7374
7375 func (c *ProjectsLocationsRestorePlansRestoresListCall) Pages(ctx context.Context, f func(*ListRestoresResponse) error) error {
7376 c.ctx_ = ctx
7377 defer c.PageToken(c.urlParams_.Get("pageToken"))
7378 for {
7379 x, err := c.Do()
7380 if err != nil {
7381 return err
7382 }
7383 if err := f(x); err != nil {
7384 return err
7385 }
7386 if x.NextPageToken == "" {
7387 return nil
7388 }
7389 c.PageToken(x.NextPageToken)
7390 }
7391 }
7392
7393 type ProjectsLocationsRestorePlansRestoresPatchCall struct {
7394 s *Service
7395 name string
7396 restore *Restore
7397 urlParams_ gensupport.URLParams
7398 ctx_ context.Context
7399 header_ http.Header
7400 }
7401
7402
7403
7404
7405
7406 func (r *ProjectsLocationsRestorePlansRestoresService) Patch(name string, restore *Restore) *ProjectsLocationsRestorePlansRestoresPatchCall {
7407 c := &ProjectsLocationsRestorePlansRestoresPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7408 c.name = name
7409 c.restore = restore
7410 return c
7411 }
7412
7413
7414
7415
7416
7417
7418
7419
7420 func (c *ProjectsLocationsRestorePlansRestoresPatchCall) UpdateMask(updateMask string) *ProjectsLocationsRestorePlansRestoresPatchCall {
7421 c.urlParams_.Set("updateMask", updateMask)
7422 return c
7423 }
7424
7425
7426
7427
7428 func (c *ProjectsLocationsRestorePlansRestoresPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansRestoresPatchCall {
7429 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7430 return c
7431 }
7432
7433
7434 func (c *ProjectsLocationsRestorePlansRestoresPatchCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansRestoresPatchCall {
7435 c.ctx_ = ctx
7436 return c
7437 }
7438
7439
7440
7441 func (c *ProjectsLocationsRestorePlansRestoresPatchCall) Header() http.Header {
7442 if c.header_ == nil {
7443 c.header_ = make(http.Header)
7444 }
7445 return c.header_
7446 }
7447
7448 func (c *ProjectsLocationsRestorePlansRestoresPatchCall) doRequest(alt string) (*http.Response, error) {
7449 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7450 var body io.Reader = nil
7451 body, err := googleapi.WithoutDataWrapper.JSONReader(c.restore)
7452 if err != nil {
7453 return nil, err
7454 }
7455 c.urlParams_.Set("alt", alt)
7456 c.urlParams_.Set("prettyPrint", "false")
7457 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7458 urls += "?" + c.urlParams_.Encode()
7459 req, err := http.NewRequest("PATCH", urls, body)
7460 if err != nil {
7461 return nil, err
7462 }
7463 req.Header = reqHeaders
7464 googleapi.Expand(req.URL, map[string]string{
7465 "name": c.name,
7466 })
7467 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7468 }
7469
7470
7471
7472
7473
7474
7475
7476 func (c *ProjectsLocationsRestorePlansRestoresPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
7477 gensupport.SetOptions(c.urlParams_, opts...)
7478 res, err := c.doRequest("json")
7479 if res != nil && res.StatusCode == http.StatusNotModified {
7480 if res.Body != nil {
7481 res.Body.Close()
7482 }
7483 return nil, gensupport.WrapError(&googleapi.Error{
7484 Code: res.StatusCode,
7485 Header: res.Header,
7486 })
7487 }
7488 if err != nil {
7489 return nil, err
7490 }
7491 defer googleapi.CloseBody(res)
7492 if err := googleapi.CheckResponse(res); err != nil {
7493 return nil, gensupport.WrapError(err)
7494 }
7495 ret := &GoogleLongrunningOperation{
7496 ServerResponse: googleapi.ServerResponse{
7497 Header: res.Header,
7498 HTTPStatusCode: res.StatusCode,
7499 },
7500 }
7501 target := &ret
7502 if err := gensupport.DecodeResponse(target, res); err != nil {
7503 return nil, err
7504 }
7505 return ret, nil
7506 }
7507
7508 type ProjectsLocationsRestorePlansRestoresSetIamPolicyCall struct {
7509 s *Service
7510 resource string
7511 setiampolicyrequest *SetIamPolicyRequest
7512 urlParams_ gensupport.URLParams
7513 ctx_ context.Context
7514 header_ http.Header
7515 }
7516
7517
7518
7519
7520
7521
7522
7523
7524 func (r *ProjectsLocationsRestorePlansRestoresService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsRestorePlansRestoresSetIamPolicyCall {
7525 c := &ProjectsLocationsRestorePlansRestoresSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7526 c.resource = resource
7527 c.setiampolicyrequest = setiampolicyrequest
7528 return c
7529 }
7530
7531
7532
7533
7534 func (c *ProjectsLocationsRestorePlansRestoresSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansRestoresSetIamPolicyCall {
7535 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7536 return c
7537 }
7538
7539
7540 func (c *ProjectsLocationsRestorePlansRestoresSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansRestoresSetIamPolicyCall {
7541 c.ctx_ = ctx
7542 return c
7543 }
7544
7545
7546
7547 func (c *ProjectsLocationsRestorePlansRestoresSetIamPolicyCall) Header() http.Header {
7548 if c.header_ == nil {
7549 c.header_ = make(http.Header)
7550 }
7551 return c.header_
7552 }
7553
7554 func (c *ProjectsLocationsRestorePlansRestoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
7555 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7556 var body io.Reader = nil
7557 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
7558 if err != nil {
7559 return nil, err
7560 }
7561 c.urlParams_.Set("alt", alt)
7562 c.urlParams_.Set("prettyPrint", "false")
7563 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
7564 urls += "?" + c.urlParams_.Encode()
7565 req, err := http.NewRequest("POST", urls, body)
7566 if err != nil {
7567 return nil, err
7568 }
7569 req.Header = reqHeaders
7570 googleapi.Expand(req.URL, map[string]string{
7571 "resource": c.resource,
7572 })
7573 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7574 }
7575
7576
7577
7578
7579
7580
7581 func (c *ProjectsLocationsRestorePlansRestoresSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
7582 gensupport.SetOptions(c.urlParams_, opts...)
7583 res, err := c.doRequest("json")
7584 if res != nil && res.StatusCode == http.StatusNotModified {
7585 if res.Body != nil {
7586 res.Body.Close()
7587 }
7588 return nil, gensupport.WrapError(&googleapi.Error{
7589 Code: res.StatusCode,
7590 Header: res.Header,
7591 })
7592 }
7593 if err != nil {
7594 return nil, err
7595 }
7596 defer googleapi.CloseBody(res)
7597 if err := googleapi.CheckResponse(res); err != nil {
7598 return nil, gensupport.WrapError(err)
7599 }
7600 ret := &Policy{
7601 ServerResponse: googleapi.ServerResponse{
7602 Header: res.Header,
7603 HTTPStatusCode: res.StatusCode,
7604 },
7605 }
7606 target := &ret
7607 if err := gensupport.DecodeResponse(target, res); err != nil {
7608 return nil, err
7609 }
7610 return ret, nil
7611 }
7612
7613 type ProjectsLocationsRestorePlansRestoresTestIamPermissionsCall struct {
7614 s *Service
7615 resource string
7616 testiampermissionsrequest *TestIamPermissionsRequest
7617 urlParams_ gensupport.URLParams
7618 ctx_ context.Context
7619 header_ http.Header
7620 }
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632 func (r *ProjectsLocationsRestorePlansRestoresService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsRestorePlansRestoresTestIamPermissionsCall {
7633 c := &ProjectsLocationsRestorePlansRestoresTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7634 c.resource = resource
7635 c.testiampermissionsrequest = testiampermissionsrequest
7636 return c
7637 }
7638
7639
7640
7641
7642 func (c *ProjectsLocationsRestorePlansRestoresTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansRestoresTestIamPermissionsCall {
7643 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7644 return c
7645 }
7646
7647
7648 func (c *ProjectsLocationsRestorePlansRestoresTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansRestoresTestIamPermissionsCall {
7649 c.ctx_ = ctx
7650 return c
7651 }
7652
7653
7654
7655 func (c *ProjectsLocationsRestorePlansRestoresTestIamPermissionsCall) Header() http.Header {
7656 if c.header_ == nil {
7657 c.header_ = make(http.Header)
7658 }
7659 return c.header_
7660 }
7661
7662 func (c *ProjectsLocationsRestorePlansRestoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
7663 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7664 var body io.Reader = nil
7665 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
7666 if err != nil {
7667 return nil, err
7668 }
7669 c.urlParams_.Set("alt", alt)
7670 c.urlParams_.Set("prettyPrint", "false")
7671 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
7672 urls += "?" + c.urlParams_.Encode()
7673 req, err := http.NewRequest("POST", urls, body)
7674 if err != nil {
7675 return nil, err
7676 }
7677 req.Header = reqHeaders
7678 googleapi.Expand(req.URL, map[string]string{
7679 "resource": c.resource,
7680 })
7681 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7682 }
7683
7684
7685
7686
7687
7688
7689
7690 func (c *ProjectsLocationsRestorePlansRestoresTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
7691 gensupport.SetOptions(c.urlParams_, opts...)
7692 res, err := c.doRequest("json")
7693 if res != nil && res.StatusCode == http.StatusNotModified {
7694 if res.Body != nil {
7695 res.Body.Close()
7696 }
7697 return nil, gensupport.WrapError(&googleapi.Error{
7698 Code: res.StatusCode,
7699 Header: res.Header,
7700 })
7701 }
7702 if err != nil {
7703 return nil, err
7704 }
7705 defer googleapi.CloseBody(res)
7706 if err := googleapi.CheckResponse(res); err != nil {
7707 return nil, gensupport.WrapError(err)
7708 }
7709 ret := &TestIamPermissionsResponse{
7710 ServerResponse: googleapi.ServerResponse{
7711 Header: res.Header,
7712 HTTPStatusCode: res.StatusCode,
7713 },
7714 }
7715 target := &ret
7716 if err := gensupport.DecodeResponse(target, res); err != nil {
7717 return nil, err
7718 }
7719 return ret, nil
7720 }
7721
7722 type ProjectsLocationsRestorePlansRestoresVolumeRestoresGetCall struct {
7723 s *Service
7724 name string
7725 urlParams_ gensupport.URLParams
7726 ifNoneMatch_ string
7727 ctx_ context.Context
7728 header_ http.Header
7729 }
7730
7731
7732
7733
7734
7735 func (r *ProjectsLocationsRestorePlansRestoresVolumeRestoresService) Get(name string) *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetCall {
7736 c := &ProjectsLocationsRestorePlansRestoresVolumeRestoresGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7737 c.name = name
7738 return c
7739 }
7740
7741
7742
7743
7744 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetCall {
7745 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7746 return c
7747 }
7748
7749
7750
7751
7752 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetCall {
7753 c.ifNoneMatch_ = entityTag
7754 return c
7755 }
7756
7757
7758 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetCall {
7759 c.ctx_ = ctx
7760 return c
7761 }
7762
7763
7764
7765 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetCall) Header() http.Header {
7766 if c.header_ == nil {
7767 c.header_ = make(http.Header)
7768 }
7769 return c.header_
7770 }
7771
7772 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetCall) doRequest(alt string) (*http.Response, error) {
7773 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7774 if c.ifNoneMatch_ != "" {
7775 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7776 }
7777 var body io.Reader = nil
7778 c.urlParams_.Set("alt", alt)
7779 c.urlParams_.Set("prettyPrint", "false")
7780 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7781 urls += "?" + c.urlParams_.Encode()
7782 req, err := http.NewRequest("GET", urls, body)
7783 if err != nil {
7784 return nil, err
7785 }
7786 req.Header = reqHeaders
7787 googleapi.Expand(req.URL, map[string]string{
7788 "name": c.name,
7789 })
7790 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7791 }
7792
7793
7794
7795
7796
7797
7798 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetCall) Do(opts ...googleapi.CallOption) (*VolumeRestore, error) {
7799 gensupport.SetOptions(c.urlParams_, opts...)
7800 res, err := c.doRequest("json")
7801 if res != nil && res.StatusCode == http.StatusNotModified {
7802 if res.Body != nil {
7803 res.Body.Close()
7804 }
7805 return nil, gensupport.WrapError(&googleapi.Error{
7806 Code: res.StatusCode,
7807 Header: res.Header,
7808 })
7809 }
7810 if err != nil {
7811 return nil, err
7812 }
7813 defer googleapi.CloseBody(res)
7814 if err := googleapi.CheckResponse(res); err != nil {
7815 return nil, gensupport.WrapError(err)
7816 }
7817 ret := &VolumeRestore{
7818 ServerResponse: googleapi.ServerResponse{
7819 Header: res.Header,
7820 HTTPStatusCode: res.StatusCode,
7821 },
7822 }
7823 target := &ret
7824 if err := gensupport.DecodeResponse(target, res); err != nil {
7825 return nil, err
7826 }
7827 return ret, nil
7828 }
7829
7830 type ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall struct {
7831 s *Service
7832 resource string
7833 urlParams_ gensupport.URLParams
7834 ifNoneMatch_ string
7835 ctx_ context.Context
7836 header_ http.Header
7837 }
7838
7839
7840
7841
7842
7843
7844
7845 func (r *ProjectsLocationsRestorePlansRestoresVolumeRestoresService) GetIamPolicy(resource string) *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall {
7846 c := &ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7847 c.resource = resource
7848 return c
7849 }
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall {
7864 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
7865 return c
7866 }
7867
7868
7869
7870
7871 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall {
7872 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7873 return c
7874 }
7875
7876
7877
7878
7879 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall {
7880 c.ifNoneMatch_ = entityTag
7881 return c
7882 }
7883
7884
7885 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall {
7886 c.ctx_ = ctx
7887 return c
7888 }
7889
7890
7891
7892 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall) Header() http.Header {
7893 if c.header_ == nil {
7894 c.header_ = make(http.Header)
7895 }
7896 return c.header_
7897 }
7898
7899 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
7900 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7901 if c.ifNoneMatch_ != "" {
7902 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7903 }
7904 var body io.Reader = nil
7905 c.urlParams_.Set("alt", alt)
7906 c.urlParams_.Set("prettyPrint", "false")
7907 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
7908 urls += "?" + c.urlParams_.Encode()
7909 req, err := http.NewRequest("GET", urls, body)
7910 if err != nil {
7911 return nil, err
7912 }
7913 req.Header = reqHeaders
7914 googleapi.Expand(req.URL, map[string]string{
7915 "resource": c.resource,
7916 })
7917 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7918 }
7919
7920
7921
7922
7923
7924
7925 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
7926 gensupport.SetOptions(c.urlParams_, opts...)
7927 res, err := c.doRequest("json")
7928 if res != nil && res.StatusCode == http.StatusNotModified {
7929 if res.Body != nil {
7930 res.Body.Close()
7931 }
7932 return nil, gensupport.WrapError(&googleapi.Error{
7933 Code: res.StatusCode,
7934 Header: res.Header,
7935 })
7936 }
7937 if err != nil {
7938 return nil, err
7939 }
7940 defer googleapi.CloseBody(res)
7941 if err := googleapi.CheckResponse(res); err != nil {
7942 return nil, gensupport.WrapError(err)
7943 }
7944 ret := &Policy{
7945 ServerResponse: googleapi.ServerResponse{
7946 Header: res.Header,
7947 HTTPStatusCode: res.StatusCode,
7948 },
7949 }
7950 target := &ret
7951 if err := gensupport.DecodeResponse(target, res); err != nil {
7952 return nil, err
7953 }
7954 return ret, nil
7955 }
7956
7957 type ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall struct {
7958 s *Service
7959 parent string
7960 urlParams_ gensupport.URLParams
7961 ifNoneMatch_ string
7962 ctx_ context.Context
7963 header_ http.Header
7964 }
7965
7966
7967
7968
7969
7970 func (r *ProjectsLocationsRestorePlansRestoresVolumeRestoresService) List(parent string) *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall {
7971 c := &ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7972 c.parent = parent
7973 return c
7974 }
7975
7976
7977
7978 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall) Filter(filter string) *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall {
7979 c.urlParams_.Set("filter", filter)
7980 return c
7981 }
7982
7983
7984
7985 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall) OrderBy(orderBy string) *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall {
7986 c.urlParams_.Set("orderBy", orderBy)
7987 return c
7988 }
7989
7990
7991
7992
7993
7994
7995 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall) PageSize(pageSize int64) *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall {
7996 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7997 return c
7998 }
7999
8000
8001
8002
8003
8004
8005 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall) PageToken(pageToken string) *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall {
8006 c.urlParams_.Set("pageToken", pageToken)
8007 return c
8008 }
8009
8010
8011
8012
8013 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall {
8014 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8015 return c
8016 }
8017
8018
8019
8020
8021 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall) IfNoneMatch(entityTag string) *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall {
8022 c.ifNoneMatch_ = entityTag
8023 return c
8024 }
8025
8026
8027 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall {
8028 c.ctx_ = ctx
8029 return c
8030 }
8031
8032
8033
8034 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall) Header() http.Header {
8035 if c.header_ == nil {
8036 c.header_ = make(http.Header)
8037 }
8038 return c.header_
8039 }
8040
8041 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall) doRequest(alt string) (*http.Response, error) {
8042 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8043 if c.ifNoneMatch_ != "" {
8044 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8045 }
8046 var body io.Reader = nil
8047 c.urlParams_.Set("alt", alt)
8048 c.urlParams_.Set("prettyPrint", "false")
8049 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/volumeRestores")
8050 urls += "?" + c.urlParams_.Encode()
8051 req, err := http.NewRequest("GET", urls, body)
8052 if err != nil {
8053 return nil, err
8054 }
8055 req.Header = reqHeaders
8056 googleapi.Expand(req.URL, map[string]string{
8057 "parent": c.parent,
8058 })
8059 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8060 }
8061
8062
8063
8064
8065
8066
8067
8068 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall) Do(opts ...googleapi.CallOption) (*ListVolumeRestoresResponse, error) {
8069 gensupport.SetOptions(c.urlParams_, opts...)
8070 res, err := c.doRequest("json")
8071 if res != nil && res.StatusCode == http.StatusNotModified {
8072 if res.Body != nil {
8073 res.Body.Close()
8074 }
8075 return nil, gensupport.WrapError(&googleapi.Error{
8076 Code: res.StatusCode,
8077 Header: res.Header,
8078 })
8079 }
8080 if err != nil {
8081 return nil, err
8082 }
8083 defer googleapi.CloseBody(res)
8084 if err := googleapi.CheckResponse(res); err != nil {
8085 return nil, gensupport.WrapError(err)
8086 }
8087 ret := &ListVolumeRestoresResponse{
8088 ServerResponse: googleapi.ServerResponse{
8089 Header: res.Header,
8090 HTTPStatusCode: res.StatusCode,
8091 },
8092 }
8093 target := &ret
8094 if err := gensupport.DecodeResponse(target, res); err != nil {
8095 return nil, err
8096 }
8097 return ret, nil
8098 }
8099
8100
8101
8102
8103 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresListCall) Pages(ctx context.Context, f func(*ListVolumeRestoresResponse) error) error {
8104 c.ctx_ = ctx
8105 defer c.PageToken(c.urlParams_.Get("pageToken"))
8106 for {
8107 x, err := c.Do()
8108 if err != nil {
8109 return err
8110 }
8111 if err := f(x); err != nil {
8112 return err
8113 }
8114 if x.NextPageToken == "" {
8115 return nil
8116 }
8117 c.PageToken(x.NextPageToken)
8118 }
8119 }
8120
8121 type ProjectsLocationsRestorePlansRestoresVolumeRestoresSetIamPolicyCall struct {
8122 s *Service
8123 resource string
8124 setiampolicyrequest *SetIamPolicyRequest
8125 urlParams_ gensupport.URLParams
8126 ctx_ context.Context
8127 header_ http.Header
8128 }
8129
8130
8131
8132
8133
8134
8135
8136
8137 func (r *ProjectsLocationsRestorePlansRestoresVolumeRestoresService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsRestorePlansRestoresVolumeRestoresSetIamPolicyCall {
8138 c := &ProjectsLocationsRestorePlansRestoresVolumeRestoresSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8139 c.resource = resource
8140 c.setiampolicyrequest = setiampolicyrequest
8141 return c
8142 }
8143
8144
8145
8146
8147 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansRestoresVolumeRestoresSetIamPolicyCall {
8148 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8149 return c
8150 }
8151
8152
8153 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansRestoresVolumeRestoresSetIamPolicyCall {
8154 c.ctx_ = ctx
8155 return c
8156 }
8157
8158
8159
8160 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresSetIamPolicyCall) Header() http.Header {
8161 if c.header_ == nil {
8162 c.header_ = make(http.Header)
8163 }
8164 return c.header_
8165 }
8166
8167 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
8168 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8169 var body io.Reader = nil
8170 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
8171 if err != nil {
8172 return nil, err
8173 }
8174 c.urlParams_.Set("alt", alt)
8175 c.urlParams_.Set("prettyPrint", "false")
8176 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
8177 urls += "?" + c.urlParams_.Encode()
8178 req, err := http.NewRequest("POST", urls, body)
8179 if err != nil {
8180 return nil, err
8181 }
8182 req.Header = reqHeaders
8183 googleapi.Expand(req.URL, map[string]string{
8184 "resource": c.resource,
8185 })
8186 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8187 }
8188
8189
8190
8191
8192
8193
8194 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
8195 gensupport.SetOptions(c.urlParams_, opts...)
8196 res, err := c.doRequest("json")
8197 if res != nil && res.StatusCode == http.StatusNotModified {
8198 if res.Body != nil {
8199 res.Body.Close()
8200 }
8201 return nil, gensupport.WrapError(&googleapi.Error{
8202 Code: res.StatusCode,
8203 Header: res.Header,
8204 })
8205 }
8206 if err != nil {
8207 return nil, err
8208 }
8209 defer googleapi.CloseBody(res)
8210 if err := googleapi.CheckResponse(res); err != nil {
8211 return nil, gensupport.WrapError(err)
8212 }
8213 ret := &Policy{
8214 ServerResponse: googleapi.ServerResponse{
8215 Header: res.Header,
8216 HTTPStatusCode: res.StatusCode,
8217 },
8218 }
8219 target := &ret
8220 if err := gensupport.DecodeResponse(target, res); err != nil {
8221 return nil, err
8222 }
8223 return ret, nil
8224 }
8225
8226 type ProjectsLocationsRestorePlansRestoresVolumeRestoresTestIamPermissionsCall struct {
8227 s *Service
8228 resource string
8229 testiampermissionsrequest *TestIamPermissionsRequest
8230 urlParams_ gensupport.URLParams
8231 ctx_ context.Context
8232 header_ http.Header
8233 }
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245 func (r *ProjectsLocationsRestorePlansRestoresVolumeRestoresService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsRestorePlansRestoresVolumeRestoresTestIamPermissionsCall {
8246 c := &ProjectsLocationsRestorePlansRestoresVolumeRestoresTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8247 c.resource = resource
8248 c.testiampermissionsrequest = testiampermissionsrequest
8249 return c
8250 }
8251
8252
8253
8254
8255 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsRestorePlansRestoresVolumeRestoresTestIamPermissionsCall {
8256 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8257 return c
8258 }
8259
8260
8261 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsRestorePlansRestoresVolumeRestoresTestIamPermissionsCall {
8262 c.ctx_ = ctx
8263 return c
8264 }
8265
8266
8267
8268 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresTestIamPermissionsCall) Header() http.Header {
8269 if c.header_ == nil {
8270 c.header_ = make(http.Header)
8271 }
8272 return c.header_
8273 }
8274
8275 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
8276 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8277 var body io.Reader = nil
8278 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
8279 if err != nil {
8280 return nil, err
8281 }
8282 c.urlParams_.Set("alt", alt)
8283 c.urlParams_.Set("prettyPrint", "false")
8284 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
8285 urls += "?" + c.urlParams_.Encode()
8286 req, err := http.NewRequest("POST", urls, body)
8287 if err != nil {
8288 return nil, err
8289 }
8290 req.Header = reqHeaders
8291 googleapi.Expand(req.URL, map[string]string{
8292 "resource": c.resource,
8293 })
8294 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8295 }
8296
8297
8298
8299
8300
8301
8302
8303 func (c *ProjectsLocationsRestorePlansRestoresVolumeRestoresTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
8304 gensupport.SetOptions(c.urlParams_, opts...)
8305 res, err := c.doRequest("json")
8306 if res != nil && res.StatusCode == http.StatusNotModified {
8307 if res.Body != nil {
8308 res.Body.Close()
8309 }
8310 return nil, gensupport.WrapError(&googleapi.Error{
8311 Code: res.StatusCode,
8312 Header: res.Header,
8313 })
8314 }
8315 if err != nil {
8316 return nil, err
8317 }
8318 defer googleapi.CloseBody(res)
8319 if err := googleapi.CheckResponse(res); err != nil {
8320 return nil, gensupport.WrapError(err)
8321 }
8322 ret := &TestIamPermissionsResponse{
8323 ServerResponse: googleapi.ServerResponse{
8324 Header: res.Header,
8325 HTTPStatusCode: res.StatusCode,
8326 },
8327 }
8328 target := &ret
8329 if err := gensupport.DecodeResponse(target, res); err != nil {
8330 return nil, err
8331 }
8332 return ret, nil
8333 }
8334
View as plain text