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 file
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 = "file:v1"
90 const apiName = "file"
91 const apiVersion = "v1"
92 const basePath = "https://file.googleapis.com/"
93 const basePathTemplate = "https://file.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://file.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.Backups = NewProjectsLocationsBackupsService(s)
172 rs.Instances = NewProjectsLocationsInstancesService(s)
173 rs.Operations = NewProjectsLocationsOperationsService(s)
174 return rs
175 }
176
177 type ProjectsLocationsService struct {
178 s *Service
179
180 Backups *ProjectsLocationsBackupsService
181
182 Instances *ProjectsLocationsInstancesService
183
184 Operations *ProjectsLocationsOperationsService
185 }
186
187 func NewProjectsLocationsBackupsService(s *Service) *ProjectsLocationsBackupsService {
188 rs := &ProjectsLocationsBackupsService{s: s}
189 return rs
190 }
191
192 type ProjectsLocationsBackupsService struct {
193 s *Service
194 }
195
196 func NewProjectsLocationsInstancesService(s *Service) *ProjectsLocationsInstancesService {
197 rs := &ProjectsLocationsInstancesService{s: s}
198 rs.Snapshots = NewProjectsLocationsInstancesSnapshotsService(s)
199 return rs
200 }
201
202 type ProjectsLocationsInstancesService struct {
203 s *Service
204
205 Snapshots *ProjectsLocationsInstancesSnapshotsService
206 }
207
208 func NewProjectsLocationsInstancesSnapshotsService(s *Service) *ProjectsLocationsInstancesSnapshotsService {
209 rs := &ProjectsLocationsInstancesSnapshotsService{s: s}
210 return rs
211 }
212
213 type ProjectsLocationsInstancesSnapshotsService struct {
214 s *Service
215 }
216
217 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
218 rs := &ProjectsLocationsOperationsService{s: s}
219 return rs
220 }
221
222 type ProjectsLocationsOperationsService struct {
223 s *Service
224 }
225
226
227 type Backup struct {
228
229
230 CapacityGb int64 `json:"capacityGb,omitempty,string"`
231
232 CreateTime string `json:"createTime,omitempty"`
233
234
235 Description string `json:"description,omitempty"`
236
237
238
239 DownloadBytes int64 `json:"downloadBytes,omitempty,string"`
240
241 KmsKey string `json:"kmsKey,omitempty"`
242
243 Labels map[string]string `json:"labels,omitempty"`
244
245
246 Name string `json:"name,omitempty"`
247
248 SatisfiesPzi bool `json:"satisfiesPzi,omitempty"`
249
250 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
251
252
253 SourceFileShare string `json:"sourceFileShare,omitempty"`
254
255
256
257
258 SourceInstance string `json:"sourceInstance,omitempty"`
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280 SourceInstanceTier string `json:"sourceInstanceTier,omitempty"`
281
282
283
284
285
286
287
288
289
290
291
292
293 State string `json:"state,omitempty"`
294
295
296
297 StorageBytes int64 `json:"storageBytes,omitempty,string"`
298
299
300 googleapi.ServerResponse `json:"-"`
301
302
303
304
305
306 ForceSendFields []string `json:"-"`
307
308
309
310
311 NullFields []string `json:"-"`
312 }
313
314 func (s *Backup) MarshalJSON() ([]byte, error) {
315 type NoMethod Backup
316 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
317 }
318
319
320 type CancelOperationRequest struct {
321 }
322
323
324 type DailyCycle struct {
325
326 Duration string `json:"duration,omitempty"`
327
328 StartTime *TimeOfDay `json:"startTime,omitempty"`
329
330
331
332
333
334 ForceSendFields []string `json:"-"`
335
336
337
338
339 NullFields []string `json:"-"`
340 }
341
342 func (s *DailyCycle) MarshalJSON() ([]byte, error) {
343 type NoMethod DailyCycle
344 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
345 }
346
347
348
349
350
351
352
353
354
355
356 type Date struct {
357
358
359
360 Day int64 `json:"day,omitempty"`
361
362
363 Month int64 `json:"month,omitempty"`
364
365
366 Year int64 `json:"year,omitempty"`
367
368
369
370
371
372 ForceSendFields []string `json:"-"`
373
374
375
376
377 NullFields []string `json:"-"`
378 }
379
380 func (s *Date) MarshalJSON() ([]byte, error) {
381 type NoMethod Date
382 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
383 }
384
385
386
387
388 type DenyMaintenancePeriod struct {
389
390
391
392
393 EndDate *Date `json:"endDate,omitempty"`
394
395
396
397
398 StartDate *Date `json:"startDate,omitempty"`
399
400
401 Time *TimeOfDay `json:"time,omitempty"`
402
403
404
405
406
407 ForceSendFields []string `json:"-"`
408
409
410
411
412 NullFields []string `json:"-"`
413 }
414
415 func (s *DenyMaintenancePeriod) MarshalJSON() ([]byte, error) {
416 type NoMethod DenyMaintenancePeriod
417 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
418 }
419
420
421
422
423
424 type Empty struct {
425
426 googleapi.ServerResponse `json:"-"`
427 }
428
429
430 type FileShareConfig struct {
431
432
433 CapacityGb int64 `json:"capacityGb,omitempty,string"`
434
435
436
437
438 Name string `json:"name,omitempty"`
439
440
441 NfsExportOptions []*NfsExportOptions `json:"nfsExportOptions,omitempty"`
442
443
444
445 SourceBackup string `json:"sourceBackup,omitempty"`
446
447
448
449
450
451 ForceSendFields []string `json:"-"`
452
453
454
455
456 NullFields []string `json:"-"`
457 }
458
459 func (s *FileShareConfig) MarshalJSON() ([]byte, error) {
460 type NoMethod FileShareConfig
461 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
462 }
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483 type GoogleCloudSaasacceleratorManagementProvidersV1Instance struct {
484
485
486
487
488
489
490 ConsumerDefinedName string `json:"consumerDefinedName,omitempty"`
491
492 CreateTime string `json:"createTime,omitempty"`
493
494
495
496
497
498
499 InstanceType string `json:"instanceType,omitempty"`
500
501
502
503 Labels map[string]string `json:"labels,omitempty"`
504
505
506
507
508
509 MaintenancePolicyNames map[string]string `json:"maintenancePolicyNames,omitempty"`
510
511
512
513 MaintenanceSchedules map[string]GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule `json:"maintenanceSchedules,omitempty"`
514
515
516 MaintenanceSettings *GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings `json:"maintenanceSettings,omitempty"`
517
518
519
520
521
522
523 Name string `json:"name,omitempty"`
524
525
526
527
528 NotificationParameters map[string]GoogleCloudSaasacceleratorManagementProvidersV1NotificationParameter `json:"notificationParameters,omitempty"`
529
530
531
532 ProducerMetadata map[string]string `json:"producerMetadata,omitempty"`
533
534
535
536 ProvisionedResources []*GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource `json:"provisionedResources,omitempty"`
537
538
539
540
541 SlmInstanceTemplate string `json:"slmInstanceTemplate,omitempty"`
542
543
544
545 SloMetadata *GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata `json:"sloMetadata,omitempty"`
546
547
548 SoftwareVersions map[string]string `json:"softwareVersions,omitempty"`
549
550
551
552
553
554
555
556
557
558
559
560 State string `json:"state,omitempty"`
561
562
563 TenantProjectId string `json:"tenantProjectId,omitempty"`
564
565 UpdateTime string `json:"updateTime,omitempty"`
566
567
568
569
570
571 ForceSendFields []string `json:"-"`
572
573
574
575
576 NullFields []string `json:"-"`
577 }
578
579 func (s *GoogleCloudSaasacceleratorManagementProvidersV1Instance) MarshalJSON() ([]byte, error) {
580 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1Instance
581 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
582 }
583
584
585
586
587 type GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule struct {
588
589
590
591 CanReschedule bool `json:"canReschedule,omitempty"`
592
593 EndTime string `json:"endTime,omitempty"`
594
595
596
597 RolloutManagementPolicy string `json:"rolloutManagementPolicy,omitempty"`
598
599
600
601
602 ScheduleDeadlineTime string `json:"scheduleDeadlineTime,omitempty"`
603
604 StartTime string `json:"startTime,omitempty"`
605
606
607
608
609
610 ForceSendFields []string `json:"-"`
611
612
613
614
615 NullFields []string `json:"-"`
616 }
617
618 func (s *GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule) MarshalJSON() ([]byte, error) {
619 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule
620 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
621 }
622
623
624
625
626 type GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings struct {
627
628
629
630 Exclude bool `json:"exclude,omitempty"`
631
632
633 IsRollback bool `json:"isRollback,omitempty"`
634
635
636
637
638
639
640 MaintenancePolicies map[string]MaintenancePolicy `json:"maintenancePolicies,omitempty"`
641
642
643
644
645
646 ForceSendFields []string `json:"-"`
647
648
649
650
651 NullFields []string `json:"-"`
652 }
653
654 func (s *GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings) MarshalJSON() ([]byte, error) {
655 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings
656 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
657 }
658
659
660
661
662
663
664 type GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata struct {
665
666 Location string `json:"location,omitempty"`
667
668
669 NodeId string `json:"nodeId,omitempty"`
670
671
672 PerSliEligibility *GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility `json:"perSliEligibility,omitempty"`
673
674
675
676
677
678 ForceSendFields []string `json:"-"`
679
680
681
682
683 NullFields []string `json:"-"`
684 }
685
686 func (s *GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata) MarshalJSON() ([]byte, error) {
687 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata
688 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
689 }
690
691
692
693 type GoogleCloudSaasacceleratorManagementProvidersV1NotificationParameter struct {
694
695
696 Values []string `json:"values,omitempty"`
697
698
699
700
701
702 ForceSendFields []string `json:"-"`
703
704
705
706
707 NullFields []string `json:"-"`
708 }
709
710 func (s *GoogleCloudSaasacceleratorManagementProvidersV1NotificationParameter) MarshalJSON() ([]byte, error) {
711 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1NotificationParameter
712 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
713 }
714
715
716
717 type GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility struct {
718
719
720
721
722
723
724
725
726
727
728
729
730 Eligibilities map[string]GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility `json:"eligibilities,omitempty"`
731
732
733
734
735
736 ForceSendFields []string `json:"-"`
737
738
739
740
741 NullFields []string `json:"-"`
742 }
743
744 func (s *GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility) MarshalJSON() ([]byte, error) {
745 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility
746 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
747 }
748
749
750
751 type GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource struct {
752
753
754
755
756
757
758 ResourceType string `json:"resourceType,omitempty"`
759
760
761 ResourceUrl string `json:"resourceUrl,omitempty"`
762
763
764
765
766
767 ForceSendFields []string `json:"-"`
768
769
770
771
772 NullFields []string `json:"-"`
773 }
774
775 func (s *GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource) MarshalJSON() ([]byte, error) {
776 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource
777 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
778 }
779
780
781
782
783
784 type GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility struct {
785
786 Eligible bool `json:"eligible,omitempty"`
787
788
789
790 Reason string `json:"reason,omitempty"`
791
792
793
794
795
796 ForceSendFields []string `json:"-"`
797
798
799
800
801 NullFields []string `json:"-"`
802 }
803
804 func (s *GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility) MarshalJSON() ([]byte, error) {
805 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility
806 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
807 }
808
809
810
811 type GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata struct {
812
813
814
815
816 Nodes []*GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata `json:"nodes,omitempty"`
817
818
819 PerSliEligibility *GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility `json:"perSliEligibility,omitempty"`
820
821
822
823 Tier string `json:"tier,omitempty"`
824
825
826
827
828
829 ForceSendFields []string `json:"-"`
830
831
832
833
834 NullFields []string `json:"-"`
835 }
836
837 func (s *GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata) MarshalJSON() ([]byte, error) {
838 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata
839 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
840 }
841
842
843 type Instance struct {
844
845 CreateTime string `json:"createTime,omitempty"`
846
847 Description string `json:"description,omitempty"`
848
849
850 Etag string `json:"etag,omitempty"`
851
852
853 FileShares []*FileShareConfig `json:"fileShares,omitempty"`
854
855 KmsKeyName string `json:"kmsKeyName,omitempty"`
856
857 Labels map[string]string `json:"labels,omitempty"`
858
859
860 Name string `json:"name,omitempty"`
861
862
863 Networks []*NetworkConfig `json:"networks,omitempty"`
864
865 SatisfiesPzi bool `json:"satisfiesPzi,omitempty"`
866
867 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887 State string `json:"state,omitempty"`
888
889
890 StatusMessage string `json:"statusMessage,omitempty"`
891
892
893
894
895
896
897
898 SuspensionReasons []string `json:"suspensionReasons,omitempty"`
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919 Tier string `json:"tier,omitempty"`
920
921
922 googleapi.ServerResponse `json:"-"`
923
924
925
926
927
928 ForceSendFields []string `json:"-"`
929
930
931
932
933 NullFields []string `json:"-"`
934 }
935
936 func (s *Instance) MarshalJSON() ([]byte, error) {
937 type NoMethod Instance
938 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
939 }
940
941
942
943 type ListBackupsResponse struct {
944
945
946
947
948
949 Backups []*Backup `json:"backups,omitempty"`
950
951
952 NextPageToken string `json:"nextPageToken,omitempty"`
953
954 Unreachable []string `json:"unreachable,omitempty"`
955
956
957 googleapi.ServerResponse `json:"-"`
958
959
960
961
962
963 ForceSendFields []string `json:"-"`
964
965
966
967
968 NullFields []string `json:"-"`
969 }
970
971 func (s *ListBackupsResponse) MarshalJSON() ([]byte, error) {
972 type NoMethod ListBackupsResponse
973 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
974 }
975
976
977
978 type ListInstancesResponse struct {
979
980
981
982
983
984 Instances []*Instance `json:"instances,omitempty"`
985
986
987 NextPageToken string `json:"nextPageToken,omitempty"`
988
989 Unreachable []string `json:"unreachable,omitempty"`
990
991
992 googleapi.ServerResponse `json:"-"`
993
994
995
996
997
998 ForceSendFields []string `json:"-"`
999
1000
1001
1002
1003 NullFields []string `json:"-"`
1004 }
1005
1006 func (s *ListInstancesResponse) MarshalJSON() ([]byte, error) {
1007 type NoMethod ListInstancesResponse
1008 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1009 }
1010
1011
1012 type ListLocationsResponse struct {
1013
1014
1015 Locations []*Location `json:"locations,omitempty"`
1016
1017 NextPageToken string `json:"nextPageToken,omitempty"`
1018
1019
1020 googleapi.ServerResponse `json:"-"`
1021
1022
1023
1024
1025
1026 ForceSendFields []string `json:"-"`
1027
1028
1029
1030
1031 NullFields []string `json:"-"`
1032 }
1033
1034 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
1035 type NoMethod ListLocationsResponse
1036 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1037 }
1038
1039
1040 type ListOperationsResponse struct {
1041
1042 NextPageToken string `json:"nextPageToken,omitempty"`
1043
1044
1045 Operations []*Operation `json:"operations,omitempty"`
1046
1047
1048 googleapi.ServerResponse `json:"-"`
1049
1050
1051
1052
1053
1054 ForceSendFields []string `json:"-"`
1055
1056
1057
1058
1059 NullFields []string `json:"-"`
1060 }
1061
1062 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
1063 type NoMethod ListOperationsResponse
1064 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1065 }
1066
1067
1068
1069 type ListSnapshotsResponse struct {
1070
1071
1072 NextPageToken string `json:"nextPageToken,omitempty"`
1073
1074 Snapshots []*Snapshot `json:"snapshots,omitempty"`
1075
1076
1077 googleapi.ServerResponse `json:"-"`
1078
1079
1080
1081
1082
1083 ForceSendFields []string `json:"-"`
1084
1085
1086
1087
1088 NullFields []string `json:"-"`
1089 }
1090
1091 func (s *ListSnapshotsResponse) MarshalJSON() ([]byte, error) {
1092 type NoMethod ListSnapshotsResponse
1093 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1094 }
1095
1096
1097 type Location struct {
1098
1099
1100 DisplayName string `json:"displayName,omitempty"`
1101
1102
1103 Labels map[string]string `json:"labels,omitempty"`
1104
1105 LocationId string `json:"locationId,omitempty"`
1106
1107
1108 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1109
1110
1111
1112 Name string `json:"name,omitempty"`
1113
1114
1115 googleapi.ServerResponse `json:"-"`
1116
1117
1118
1119
1120
1121 ForceSendFields []string `json:"-"`
1122
1123
1124
1125
1126 NullFields []string `json:"-"`
1127 }
1128
1129 func (s *Location) MarshalJSON() ([]byte, error) {
1130 type NoMethod Location
1131 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1132 }
1133
1134
1135 type MaintenancePolicy struct {
1136
1137 CreateTime string `json:"createTime,omitempty"`
1138
1139
1140 Description string `json:"description,omitempty"`
1141
1142
1143
1144 Labels map[string]string `json:"labels,omitempty"`
1145
1146
1147
1148
1149
1150
1151 Name string `json:"name,omitempty"`
1152
1153
1154
1155
1156
1157
1158
1159 State string `json:"state,omitempty"`
1160
1161 UpdatePolicy *UpdatePolicy `json:"updatePolicy,omitempty"`
1162
1163 UpdateTime string `json:"updateTime,omitempty"`
1164
1165
1166
1167
1168
1169 ForceSendFields []string `json:"-"`
1170
1171
1172
1173
1174 NullFields []string `json:"-"`
1175 }
1176
1177 func (s *MaintenancePolicy) MarshalJSON() ([]byte, error) {
1178 type NoMethod MaintenancePolicy
1179 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1180 }
1181
1182
1183 type MaintenanceWindow struct {
1184
1185 DailyCycle *DailyCycle `json:"dailyCycle,omitempty"`
1186
1187 WeeklyCycle *WeeklyCycle `json:"weeklyCycle,omitempty"`
1188
1189
1190
1191
1192
1193 ForceSendFields []string `json:"-"`
1194
1195
1196
1197
1198 NullFields []string `json:"-"`
1199 }
1200
1201 func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
1202 type NoMethod MaintenanceWindow
1203 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1204 }
1205
1206
1207 type NetworkConfig struct {
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217 ConnectMode string `json:"connectMode,omitempty"`
1218
1219
1220
1221 IpAddresses []string `json:"ipAddresses,omitempty"`
1222
1223
1224
1225
1226
1227
1228 Modes []string `json:"modes,omitempty"`
1229
1230
1231 Network string `json:"network,omitempty"`
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247 ReservedIpRange string `json:"reservedIpRange,omitempty"`
1248
1249
1250
1251
1252
1253 ForceSendFields []string `json:"-"`
1254
1255
1256
1257
1258 NullFields []string `json:"-"`
1259 }
1260
1261 func (s *NetworkConfig) MarshalJSON() ([]byte, error) {
1262 type NoMethod NetworkConfig
1263 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1264 }
1265
1266
1267 type NfsExportOptions struct {
1268
1269
1270
1271
1272
1273
1274
1275
1276 AccessMode string `json:"accessMode,omitempty"`
1277
1278
1279
1280 AnonGid int64 `json:"anonGid,omitempty,string"`
1281
1282
1283
1284 AnonUid int64 `json:"anonUid,omitempty,string"`
1285
1286
1287
1288
1289
1290
1291 IpRanges []string `json:"ipRanges,omitempty"`
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302 SquashMode string `json:"squashMode,omitempty"`
1303
1304
1305
1306
1307
1308 ForceSendFields []string `json:"-"`
1309
1310
1311
1312
1313 NullFields []string `json:"-"`
1314 }
1315
1316 func (s *NfsExportOptions) MarshalJSON() ([]byte, error) {
1317 type NoMethod NfsExportOptions
1318 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1319 }
1320
1321
1322
1323 type Operation struct {
1324
1325
1326
1327 Done bool `json:"done,omitempty"`
1328
1329 Error *Status `json:"error,omitempty"`
1330
1331
1332
1333
1334 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1335
1336
1337
1338 Name string `json:"name,omitempty"`
1339
1340
1341
1342
1343
1344
1345
1346 Response googleapi.RawMessage `json:"response,omitempty"`
1347
1348
1349 googleapi.ServerResponse `json:"-"`
1350
1351
1352
1353
1354
1355 ForceSendFields []string `json:"-"`
1356
1357
1358
1359
1360 NullFields []string `json:"-"`
1361 }
1362
1363 func (s *Operation) MarshalJSON() ([]byte, error) {
1364 type NoMethod Operation
1365 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1366 }
1367
1368
1369 type OperationMetadata struct {
1370
1371 ApiVersion string `json:"apiVersion,omitempty"`
1372
1373
1374
1375
1376 CancelRequested bool `json:"cancelRequested,omitempty"`
1377
1378 CreateTime string `json:"createTime,omitempty"`
1379
1380 EndTime string `json:"endTime,omitempty"`
1381
1382 StatusDetail string `json:"statusDetail,omitempty"`
1383
1384
1385 Target string `json:"target,omitempty"`
1386
1387 Verb string `json:"verb,omitempty"`
1388
1389
1390
1391
1392
1393 ForceSendFields []string `json:"-"`
1394
1395
1396
1397
1398 NullFields []string `json:"-"`
1399 }
1400
1401 func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
1402 type NoMethod OperationMetadata
1403 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1404 }
1405
1406
1407
1408 type RestoreInstanceRequest struct {
1409
1410
1411 FileShare string `json:"fileShare,omitempty"`
1412
1413
1414 SourceBackup string `json:"sourceBackup,omitempty"`
1415
1416
1417
1418
1419
1420 ForceSendFields []string `json:"-"`
1421
1422
1423
1424
1425 NullFields []string `json:"-"`
1426 }
1427
1428 func (s *RestoreInstanceRequest) MarshalJSON() ([]byte, error) {
1429 type NoMethod RestoreInstanceRequest
1430 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1431 }
1432
1433
1434
1435 type RevertInstanceRequest struct {
1436
1437
1438
1439
1440
1441 TargetSnapshotId string `json:"targetSnapshotId,omitempty"`
1442
1443
1444
1445
1446
1447 ForceSendFields []string `json:"-"`
1448
1449
1450
1451
1452 NullFields []string `json:"-"`
1453 }
1454
1455 func (s *RevertInstanceRequest) MarshalJSON() ([]byte, error) {
1456 type NoMethod RevertInstanceRequest
1457 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1458 }
1459
1460
1461 type Schedule struct {
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473 Day string `json:"day,omitempty"`
1474
1475 Duration string `json:"duration,omitempty"`
1476
1477 StartTime *TimeOfDay `json:"startTime,omitempty"`
1478
1479
1480
1481
1482
1483 ForceSendFields []string `json:"-"`
1484
1485
1486
1487
1488 NullFields []string `json:"-"`
1489 }
1490
1491 func (s *Schedule) MarshalJSON() ([]byte, error) {
1492 type NoMethod Schedule
1493 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1494 }
1495
1496
1497 type Snapshot struct {
1498
1499 CreateTime string `json:"createTime,omitempty"`
1500
1501
1502 Description string `json:"description,omitempty"`
1503
1504
1505 FilesystemUsedBytes int64 `json:"filesystemUsedBytes,omitempty,string"`
1506
1507 Labels map[string]string `json:"labels,omitempty"`
1508
1509
1510
1511 Name string `json:"name,omitempty"`
1512
1513
1514
1515
1516
1517
1518
1519 State string `json:"state,omitempty"`
1520
1521
1522 googleapi.ServerResponse `json:"-"`
1523
1524
1525
1526
1527
1528 ForceSendFields []string `json:"-"`
1529
1530
1531
1532
1533 NullFields []string `json:"-"`
1534 }
1535
1536 func (s *Snapshot) MarshalJSON() ([]byte, error) {
1537 type NoMethod Snapshot
1538 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1539 }
1540
1541
1542
1543
1544
1545
1546
1547 type Status struct {
1548
1549 Code int64 `json:"code,omitempty"`
1550
1551
1552 Details []googleapi.RawMessage `json:"details,omitempty"`
1553
1554
1555
1556 Message string `json:"message,omitempty"`
1557
1558
1559
1560
1561
1562 ForceSendFields []string `json:"-"`
1563
1564
1565
1566
1567 NullFields []string `json:"-"`
1568 }
1569
1570 func (s *Status) MarshalJSON() ([]byte, error) {
1571 type NoMethod Status
1572 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1573 }
1574
1575
1576
1577
1578 type TimeOfDay struct {
1579
1580
1581
1582 Hours int64 `json:"hours,omitempty"`
1583
1584 Minutes int64 `json:"minutes,omitempty"`
1585
1586 Nanos int64 `json:"nanos,omitempty"`
1587
1588
1589 Seconds int64 `json:"seconds,omitempty"`
1590
1591
1592
1593
1594
1595 ForceSendFields []string `json:"-"`
1596
1597
1598
1599
1600 NullFields []string `json:"-"`
1601 }
1602
1603 func (s *TimeOfDay) MarshalJSON() ([]byte, error) {
1604 type NoMethod TimeOfDay
1605 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1606 }
1607
1608
1609 type UpdatePolicy struct {
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629 Channel string `json:"channel,omitempty"`
1630
1631
1632
1633
1634 DenyMaintenancePeriods []*DenyMaintenancePeriod `json:"denyMaintenancePeriods,omitempty"`
1635
1636
1637 Window *MaintenanceWindow `json:"window,omitempty"`
1638
1639
1640
1641
1642
1643 ForceSendFields []string `json:"-"`
1644
1645
1646
1647
1648 NullFields []string `json:"-"`
1649 }
1650
1651 func (s *UpdatePolicy) MarshalJSON() ([]byte, error) {
1652 type NoMethod UpdatePolicy
1653 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1654 }
1655
1656
1657 type WeeklyCycle struct {
1658
1659 Schedule []*Schedule `json:"schedule,omitempty"`
1660
1661
1662
1663
1664
1665 ForceSendFields []string `json:"-"`
1666
1667
1668
1669
1670 NullFields []string `json:"-"`
1671 }
1672
1673 func (s *WeeklyCycle) MarshalJSON() ([]byte, error) {
1674 type NoMethod WeeklyCycle
1675 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1676 }
1677
1678 type ProjectsLocationsGetCall struct {
1679 s *Service
1680 name string
1681 urlParams_ gensupport.URLParams
1682 ifNoneMatch_ string
1683 ctx_ context.Context
1684 header_ http.Header
1685 }
1686
1687
1688
1689
1690 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
1691 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1692 c.name = name
1693 return c
1694 }
1695
1696
1697
1698
1699 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
1700 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1701 return c
1702 }
1703
1704
1705
1706
1707 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
1708 c.ifNoneMatch_ = entityTag
1709 return c
1710 }
1711
1712
1713 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
1714 c.ctx_ = ctx
1715 return c
1716 }
1717
1718
1719
1720 func (c *ProjectsLocationsGetCall) Header() http.Header {
1721 if c.header_ == nil {
1722 c.header_ = make(http.Header)
1723 }
1724 return c.header_
1725 }
1726
1727 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
1728 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1729 if c.ifNoneMatch_ != "" {
1730 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1731 }
1732 var body io.Reader = nil
1733 c.urlParams_.Set("alt", alt)
1734 c.urlParams_.Set("prettyPrint", "false")
1735 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1736 urls += "?" + c.urlParams_.Encode()
1737 req, err := http.NewRequest("GET", urls, body)
1738 if err != nil {
1739 return nil, err
1740 }
1741 req.Header = reqHeaders
1742 googleapi.Expand(req.URL, map[string]string{
1743 "name": c.name,
1744 })
1745 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1746 }
1747
1748
1749
1750
1751
1752
1753 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
1754 gensupport.SetOptions(c.urlParams_, opts...)
1755 res, err := c.doRequest("json")
1756 if res != nil && res.StatusCode == http.StatusNotModified {
1757 if res.Body != nil {
1758 res.Body.Close()
1759 }
1760 return nil, gensupport.WrapError(&googleapi.Error{
1761 Code: res.StatusCode,
1762 Header: res.Header,
1763 })
1764 }
1765 if err != nil {
1766 return nil, err
1767 }
1768 defer googleapi.CloseBody(res)
1769 if err := googleapi.CheckResponse(res); err != nil {
1770 return nil, gensupport.WrapError(err)
1771 }
1772 ret := &Location{
1773 ServerResponse: googleapi.ServerResponse{
1774 Header: res.Header,
1775 HTTPStatusCode: res.StatusCode,
1776 },
1777 }
1778 target := &ret
1779 if err := gensupport.DecodeResponse(target, res); err != nil {
1780 return nil, err
1781 }
1782 return ret, nil
1783 }
1784
1785 type ProjectsLocationsListCall struct {
1786 s *Service
1787 name string
1788 urlParams_ gensupport.URLParams
1789 ifNoneMatch_ string
1790 ctx_ context.Context
1791 header_ http.Header
1792 }
1793
1794
1795
1796
1797 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
1798 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1799 c.name = name
1800 return c
1801 }
1802
1803
1804
1805
1806
1807 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
1808 c.urlParams_.Set("filter", filter)
1809 return c
1810 }
1811
1812
1813
1814
1815 func (c *ProjectsLocationsListCall) IncludeUnrevealedLocations(includeUnrevealedLocations bool) *ProjectsLocationsListCall {
1816 c.urlParams_.Set("includeUnrevealedLocations", fmt.Sprint(includeUnrevealedLocations))
1817 return c
1818 }
1819
1820
1821
1822 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
1823 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1824 return c
1825 }
1826
1827
1828
1829
1830 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
1831 c.urlParams_.Set("pageToken", pageToken)
1832 return c
1833 }
1834
1835
1836
1837
1838 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
1839 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1840 return c
1841 }
1842
1843
1844
1845
1846 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
1847 c.ifNoneMatch_ = entityTag
1848 return c
1849 }
1850
1851
1852 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
1853 c.ctx_ = ctx
1854 return c
1855 }
1856
1857
1858
1859 func (c *ProjectsLocationsListCall) Header() http.Header {
1860 if c.header_ == nil {
1861 c.header_ = make(http.Header)
1862 }
1863 return c.header_
1864 }
1865
1866 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
1867 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1868 if c.ifNoneMatch_ != "" {
1869 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1870 }
1871 var body io.Reader = nil
1872 c.urlParams_.Set("alt", alt)
1873 c.urlParams_.Set("prettyPrint", "false")
1874 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
1875 urls += "?" + c.urlParams_.Encode()
1876 req, err := http.NewRequest("GET", urls, body)
1877 if err != nil {
1878 return nil, err
1879 }
1880 req.Header = reqHeaders
1881 googleapi.Expand(req.URL, map[string]string{
1882 "name": c.name,
1883 })
1884 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1885 }
1886
1887
1888
1889
1890
1891
1892
1893 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
1894 gensupport.SetOptions(c.urlParams_, opts...)
1895 res, err := c.doRequest("json")
1896 if res != nil && res.StatusCode == http.StatusNotModified {
1897 if res.Body != nil {
1898 res.Body.Close()
1899 }
1900 return nil, gensupport.WrapError(&googleapi.Error{
1901 Code: res.StatusCode,
1902 Header: res.Header,
1903 })
1904 }
1905 if err != nil {
1906 return nil, err
1907 }
1908 defer googleapi.CloseBody(res)
1909 if err := googleapi.CheckResponse(res); err != nil {
1910 return nil, gensupport.WrapError(err)
1911 }
1912 ret := &ListLocationsResponse{
1913 ServerResponse: googleapi.ServerResponse{
1914 Header: res.Header,
1915 HTTPStatusCode: res.StatusCode,
1916 },
1917 }
1918 target := &ret
1919 if err := gensupport.DecodeResponse(target, res); err != nil {
1920 return nil, err
1921 }
1922 return ret, nil
1923 }
1924
1925
1926
1927
1928 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
1929 c.ctx_ = ctx
1930 defer c.PageToken(c.urlParams_.Get("pageToken"))
1931 for {
1932 x, err := c.Do()
1933 if err != nil {
1934 return err
1935 }
1936 if err := f(x); err != nil {
1937 return err
1938 }
1939 if x.NextPageToken == "" {
1940 return nil
1941 }
1942 c.PageToken(x.NextPageToken)
1943 }
1944 }
1945
1946 type ProjectsLocationsBackupsCreateCall struct {
1947 s *Service
1948 parent string
1949 backup *Backup
1950 urlParams_ gensupport.URLParams
1951 ctx_ context.Context
1952 header_ http.Header
1953 }
1954
1955
1956
1957
1958
1959
1960 func (r *ProjectsLocationsBackupsService) Create(parent string, backup *Backup) *ProjectsLocationsBackupsCreateCall {
1961 c := &ProjectsLocationsBackupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1962 c.parent = parent
1963 c.backup = backup
1964 return c
1965 }
1966
1967
1968
1969
1970
1971
1972 func (c *ProjectsLocationsBackupsCreateCall) BackupId(backupId string) *ProjectsLocationsBackupsCreateCall {
1973 c.urlParams_.Set("backupId", backupId)
1974 return c
1975 }
1976
1977
1978
1979
1980 func (c *ProjectsLocationsBackupsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupsCreateCall {
1981 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1982 return c
1983 }
1984
1985
1986 func (c *ProjectsLocationsBackupsCreateCall) Context(ctx context.Context) *ProjectsLocationsBackupsCreateCall {
1987 c.ctx_ = ctx
1988 return c
1989 }
1990
1991
1992
1993 func (c *ProjectsLocationsBackupsCreateCall) Header() http.Header {
1994 if c.header_ == nil {
1995 c.header_ = make(http.Header)
1996 }
1997 return c.header_
1998 }
1999
2000 func (c *ProjectsLocationsBackupsCreateCall) doRequest(alt string) (*http.Response, error) {
2001 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2002 var body io.Reader = nil
2003 body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup)
2004 if err != nil {
2005 return nil, err
2006 }
2007 c.urlParams_.Set("alt", alt)
2008 c.urlParams_.Set("prettyPrint", "false")
2009 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups")
2010 urls += "?" + c.urlParams_.Encode()
2011 req, err := http.NewRequest("POST", urls, body)
2012 if err != nil {
2013 return nil, err
2014 }
2015 req.Header = reqHeaders
2016 googleapi.Expand(req.URL, map[string]string{
2017 "parent": c.parent,
2018 })
2019 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2020 }
2021
2022
2023
2024
2025
2026
2027 func (c *ProjectsLocationsBackupsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2028 gensupport.SetOptions(c.urlParams_, opts...)
2029 res, err := c.doRequest("json")
2030 if res != nil && res.StatusCode == http.StatusNotModified {
2031 if res.Body != nil {
2032 res.Body.Close()
2033 }
2034 return nil, gensupport.WrapError(&googleapi.Error{
2035 Code: res.StatusCode,
2036 Header: res.Header,
2037 })
2038 }
2039 if err != nil {
2040 return nil, err
2041 }
2042 defer googleapi.CloseBody(res)
2043 if err := googleapi.CheckResponse(res); err != nil {
2044 return nil, gensupport.WrapError(err)
2045 }
2046 ret := &Operation{
2047 ServerResponse: googleapi.ServerResponse{
2048 Header: res.Header,
2049 HTTPStatusCode: res.StatusCode,
2050 },
2051 }
2052 target := &ret
2053 if err := gensupport.DecodeResponse(target, res); err != nil {
2054 return nil, err
2055 }
2056 return ret, nil
2057 }
2058
2059 type ProjectsLocationsBackupsDeleteCall struct {
2060 s *Service
2061 name string
2062 urlParams_ gensupport.URLParams
2063 ctx_ context.Context
2064 header_ http.Header
2065 }
2066
2067
2068
2069
2070
2071 func (r *ProjectsLocationsBackupsService) Delete(name string) *ProjectsLocationsBackupsDeleteCall {
2072 c := &ProjectsLocationsBackupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2073 c.name = name
2074 return c
2075 }
2076
2077
2078
2079
2080 func (c *ProjectsLocationsBackupsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupsDeleteCall {
2081 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2082 return c
2083 }
2084
2085
2086 func (c *ProjectsLocationsBackupsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBackupsDeleteCall {
2087 c.ctx_ = ctx
2088 return c
2089 }
2090
2091
2092
2093 func (c *ProjectsLocationsBackupsDeleteCall) Header() http.Header {
2094 if c.header_ == nil {
2095 c.header_ = make(http.Header)
2096 }
2097 return c.header_
2098 }
2099
2100 func (c *ProjectsLocationsBackupsDeleteCall) doRequest(alt string) (*http.Response, error) {
2101 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2102 var body io.Reader = nil
2103 c.urlParams_.Set("alt", alt)
2104 c.urlParams_.Set("prettyPrint", "false")
2105 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2106 urls += "?" + c.urlParams_.Encode()
2107 req, err := http.NewRequest("DELETE", urls, body)
2108 if err != nil {
2109 return nil, err
2110 }
2111 req.Header = reqHeaders
2112 googleapi.Expand(req.URL, map[string]string{
2113 "name": c.name,
2114 })
2115 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2116 }
2117
2118
2119
2120
2121
2122
2123 func (c *ProjectsLocationsBackupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2124 gensupport.SetOptions(c.urlParams_, opts...)
2125 res, err := c.doRequest("json")
2126 if res != nil && res.StatusCode == http.StatusNotModified {
2127 if res.Body != nil {
2128 res.Body.Close()
2129 }
2130 return nil, gensupport.WrapError(&googleapi.Error{
2131 Code: res.StatusCode,
2132 Header: res.Header,
2133 })
2134 }
2135 if err != nil {
2136 return nil, err
2137 }
2138 defer googleapi.CloseBody(res)
2139 if err := googleapi.CheckResponse(res); err != nil {
2140 return nil, gensupport.WrapError(err)
2141 }
2142 ret := &Operation{
2143 ServerResponse: googleapi.ServerResponse{
2144 Header: res.Header,
2145 HTTPStatusCode: res.StatusCode,
2146 },
2147 }
2148 target := &ret
2149 if err := gensupport.DecodeResponse(target, res); err != nil {
2150 return nil, err
2151 }
2152 return ret, nil
2153 }
2154
2155 type ProjectsLocationsBackupsGetCall struct {
2156 s *Service
2157 name string
2158 urlParams_ gensupport.URLParams
2159 ifNoneMatch_ string
2160 ctx_ context.Context
2161 header_ http.Header
2162 }
2163
2164
2165
2166
2167
2168 func (r *ProjectsLocationsBackupsService) Get(name string) *ProjectsLocationsBackupsGetCall {
2169 c := &ProjectsLocationsBackupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2170 c.name = name
2171 return c
2172 }
2173
2174
2175
2176
2177 func (c *ProjectsLocationsBackupsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupsGetCall {
2178 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2179 return c
2180 }
2181
2182
2183
2184
2185 func (c *ProjectsLocationsBackupsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBackupsGetCall {
2186 c.ifNoneMatch_ = entityTag
2187 return c
2188 }
2189
2190
2191 func (c *ProjectsLocationsBackupsGetCall) Context(ctx context.Context) *ProjectsLocationsBackupsGetCall {
2192 c.ctx_ = ctx
2193 return c
2194 }
2195
2196
2197
2198 func (c *ProjectsLocationsBackupsGetCall) Header() http.Header {
2199 if c.header_ == nil {
2200 c.header_ = make(http.Header)
2201 }
2202 return c.header_
2203 }
2204
2205 func (c *ProjectsLocationsBackupsGetCall) doRequest(alt string) (*http.Response, error) {
2206 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2207 if c.ifNoneMatch_ != "" {
2208 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2209 }
2210 var body io.Reader = nil
2211 c.urlParams_.Set("alt", alt)
2212 c.urlParams_.Set("prettyPrint", "false")
2213 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2214 urls += "?" + c.urlParams_.Encode()
2215 req, err := http.NewRequest("GET", urls, body)
2216 if err != nil {
2217 return nil, err
2218 }
2219 req.Header = reqHeaders
2220 googleapi.Expand(req.URL, map[string]string{
2221 "name": c.name,
2222 })
2223 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2224 }
2225
2226
2227
2228
2229
2230
2231 func (c *ProjectsLocationsBackupsGetCall) Do(opts ...googleapi.CallOption) (*Backup, error) {
2232 gensupport.SetOptions(c.urlParams_, opts...)
2233 res, err := c.doRequest("json")
2234 if res != nil && res.StatusCode == http.StatusNotModified {
2235 if res.Body != nil {
2236 res.Body.Close()
2237 }
2238 return nil, gensupport.WrapError(&googleapi.Error{
2239 Code: res.StatusCode,
2240 Header: res.Header,
2241 })
2242 }
2243 if err != nil {
2244 return nil, err
2245 }
2246 defer googleapi.CloseBody(res)
2247 if err := googleapi.CheckResponse(res); err != nil {
2248 return nil, gensupport.WrapError(err)
2249 }
2250 ret := &Backup{
2251 ServerResponse: googleapi.ServerResponse{
2252 Header: res.Header,
2253 HTTPStatusCode: res.StatusCode,
2254 },
2255 }
2256 target := &ret
2257 if err := gensupport.DecodeResponse(target, res); err != nil {
2258 return nil, err
2259 }
2260 return ret, nil
2261 }
2262
2263 type ProjectsLocationsBackupsListCall struct {
2264 s *Service
2265 parent string
2266 urlParams_ gensupport.URLParams
2267 ifNoneMatch_ string
2268 ctx_ context.Context
2269 header_ http.Header
2270 }
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280 func (r *ProjectsLocationsBackupsService) List(parent string) *ProjectsLocationsBackupsListCall {
2281 c := &ProjectsLocationsBackupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2282 c.parent = parent
2283 return c
2284 }
2285
2286
2287 func (c *ProjectsLocationsBackupsListCall) Filter(filter string) *ProjectsLocationsBackupsListCall {
2288 c.urlParams_.Set("filter", filter)
2289 return c
2290 }
2291
2292
2293
2294 func (c *ProjectsLocationsBackupsListCall) OrderBy(orderBy string) *ProjectsLocationsBackupsListCall {
2295 c.urlParams_.Set("orderBy", orderBy)
2296 return c
2297 }
2298
2299
2300
2301 func (c *ProjectsLocationsBackupsListCall) PageSize(pageSize int64) *ProjectsLocationsBackupsListCall {
2302 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2303 return c
2304 }
2305
2306
2307
2308 func (c *ProjectsLocationsBackupsListCall) PageToken(pageToken string) *ProjectsLocationsBackupsListCall {
2309 c.urlParams_.Set("pageToken", pageToken)
2310 return c
2311 }
2312
2313
2314
2315
2316 func (c *ProjectsLocationsBackupsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupsListCall {
2317 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2318 return c
2319 }
2320
2321
2322
2323
2324 func (c *ProjectsLocationsBackupsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBackupsListCall {
2325 c.ifNoneMatch_ = entityTag
2326 return c
2327 }
2328
2329
2330 func (c *ProjectsLocationsBackupsListCall) Context(ctx context.Context) *ProjectsLocationsBackupsListCall {
2331 c.ctx_ = ctx
2332 return c
2333 }
2334
2335
2336
2337 func (c *ProjectsLocationsBackupsListCall) Header() http.Header {
2338 if c.header_ == nil {
2339 c.header_ = make(http.Header)
2340 }
2341 return c.header_
2342 }
2343
2344 func (c *ProjectsLocationsBackupsListCall) doRequest(alt string) (*http.Response, error) {
2345 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2346 if c.ifNoneMatch_ != "" {
2347 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2348 }
2349 var body io.Reader = nil
2350 c.urlParams_.Set("alt", alt)
2351 c.urlParams_.Set("prettyPrint", "false")
2352 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups")
2353 urls += "?" + c.urlParams_.Encode()
2354 req, err := http.NewRequest("GET", urls, body)
2355 if err != nil {
2356 return nil, err
2357 }
2358 req.Header = reqHeaders
2359 googleapi.Expand(req.URL, map[string]string{
2360 "parent": c.parent,
2361 })
2362 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2363 }
2364
2365
2366
2367
2368
2369
2370
2371 func (c *ProjectsLocationsBackupsListCall) Do(opts ...googleapi.CallOption) (*ListBackupsResponse, error) {
2372 gensupport.SetOptions(c.urlParams_, opts...)
2373 res, err := c.doRequest("json")
2374 if res != nil && res.StatusCode == http.StatusNotModified {
2375 if res.Body != nil {
2376 res.Body.Close()
2377 }
2378 return nil, gensupport.WrapError(&googleapi.Error{
2379 Code: res.StatusCode,
2380 Header: res.Header,
2381 })
2382 }
2383 if err != nil {
2384 return nil, err
2385 }
2386 defer googleapi.CloseBody(res)
2387 if err := googleapi.CheckResponse(res); err != nil {
2388 return nil, gensupport.WrapError(err)
2389 }
2390 ret := &ListBackupsResponse{
2391 ServerResponse: googleapi.ServerResponse{
2392 Header: res.Header,
2393 HTTPStatusCode: res.StatusCode,
2394 },
2395 }
2396 target := &ret
2397 if err := gensupport.DecodeResponse(target, res); err != nil {
2398 return nil, err
2399 }
2400 return ret, nil
2401 }
2402
2403
2404
2405
2406 func (c *ProjectsLocationsBackupsListCall) Pages(ctx context.Context, f func(*ListBackupsResponse) error) error {
2407 c.ctx_ = ctx
2408 defer c.PageToken(c.urlParams_.Get("pageToken"))
2409 for {
2410 x, err := c.Do()
2411 if err != nil {
2412 return err
2413 }
2414 if err := f(x); err != nil {
2415 return err
2416 }
2417 if x.NextPageToken == "" {
2418 return nil
2419 }
2420 c.PageToken(x.NextPageToken)
2421 }
2422 }
2423
2424 type ProjectsLocationsBackupsPatchCall struct {
2425 s *Service
2426 name string
2427 backup *Backup
2428 urlParams_ gensupport.URLParams
2429 ctx_ context.Context
2430 header_ http.Header
2431 }
2432
2433
2434
2435
2436
2437 func (r *ProjectsLocationsBackupsService) Patch(name string, backup *Backup) *ProjectsLocationsBackupsPatchCall {
2438 c := &ProjectsLocationsBackupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2439 c.name = name
2440 c.backup = backup
2441 return c
2442 }
2443
2444
2445
2446 func (c *ProjectsLocationsBackupsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBackupsPatchCall {
2447 c.urlParams_.Set("updateMask", updateMask)
2448 return c
2449 }
2450
2451
2452
2453
2454 func (c *ProjectsLocationsBackupsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupsPatchCall {
2455 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2456 return c
2457 }
2458
2459
2460 func (c *ProjectsLocationsBackupsPatchCall) Context(ctx context.Context) *ProjectsLocationsBackupsPatchCall {
2461 c.ctx_ = ctx
2462 return c
2463 }
2464
2465
2466
2467 func (c *ProjectsLocationsBackupsPatchCall) Header() http.Header {
2468 if c.header_ == nil {
2469 c.header_ = make(http.Header)
2470 }
2471 return c.header_
2472 }
2473
2474 func (c *ProjectsLocationsBackupsPatchCall) doRequest(alt string) (*http.Response, error) {
2475 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2476 var body io.Reader = nil
2477 body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup)
2478 if err != nil {
2479 return nil, err
2480 }
2481 c.urlParams_.Set("alt", alt)
2482 c.urlParams_.Set("prettyPrint", "false")
2483 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2484 urls += "?" + c.urlParams_.Encode()
2485 req, err := http.NewRequest("PATCH", urls, body)
2486 if err != nil {
2487 return nil, err
2488 }
2489 req.Header = reqHeaders
2490 googleapi.Expand(req.URL, map[string]string{
2491 "name": c.name,
2492 })
2493 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2494 }
2495
2496
2497
2498
2499
2500
2501 func (c *ProjectsLocationsBackupsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2502 gensupport.SetOptions(c.urlParams_, opts...)
2503 res, err := c.doRequest("json")
2504 if res != nil && res.StatusCode == http.StatusNotModified {
2505 if res.Body != nil {
2506 res.Body.Close()
2507 }
2508 return nil, gensupport.WrapError(&googleapi.Error{
2509 Code: res.StatusCode,
2510 Header: res.Header,
2511 })
2512 }
2513 if err != nil {
2514 return nil, err
2515 }
2516 defer googleapi.CloseBody(res)
2517 if err := googleapi.CheckResponse(res); err != nil {
2518 return nil, gensupport.WrapError(err)
2519 }
2520 ret := &Operation{
2521 ServerResponse: googleapi.ServerResponse{
2522 Header: res.Header,
2523 HTTPStatusCode: res.StatusCode,
2524 },
2525 }
2526 target := &ret
2527 if err := gensupport.DecodeResponse(target, res); err != nil {
2528 return nil, err
2529 }
2530 return ret, nil
2531 }
2532
2533 type ProjectsLocationsInstancesCreateCall struct {
2534 s *Service
2535 parent string
2536 instance *Instance
2537 urlParams_ gensupport.URLParams
2538 ctx_ context.Context
2539 header_ http.Header
2540 }
2541
2542
2543
2544
2545
2546
2547
2548
2549 func (r *ProjectsLocationsInstancesService) Create(parent string, instance *Instance) *ProjectsLocationsInstancesCreateCall {
2550 c := &ProjectsLocationsInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2551 c.parent = parent
2552 c.instance = instance
2553 return c
2554 }
2555
2556
2557
2558
2559 func (c *ProjectsLocationsInstancesCreateCall) InstanceId(instanceId string) *ProjectsLocationsInstancesCreateCall {
2560 c.urlParams_.Set("instanceId", instanceId)
2561 return c
2562 }
2563
2564
2565
2566
2567 func (c *ProjectsLocationsInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesCreateCall {
2568 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2569 return c
2570 }
2571
2572
2573 func (c *ProjectsLocationsInstancesCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesCreateCall {
2574 c.ctx_ = ctx
2575 return c
2576 }
2577
2578
2579
2580 func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header {
2581 if c.header_ == nil {
2582 c.header_ = make(http.Header)
2583 }
2584 return c.header_
2585 }
2586
2587 func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) {
2588 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2589 var body io.Reader = nil
2590 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
2591 if err != nil {
2592 return nil, err
2593 }
2594 c.urlParams_.Set("alt", alt)
2595 c.urlParams_.Set("prettyPrint", "false")
2596 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances")
2597 urls += "?" + c.urlParams_.Encode()
2598 req, err := http.NewRequest("POST", urls, body)
2599 if err != nil {
2600 return nil, err
2601 }
2602 req.Header = reqHeaders
2603 googleapi.Expand(req.URL, map[string]string{
2604 "parent": c.parent,
2605 })
2606 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2607 }
2608
2609
2610
2611
2612
2613
2614 func (c *ProjectsLocationsInstancesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2615 gensupport.SetOptions(c.urlParams_, opts...)
2616 res, err := c.doRequest("json")
2617 if res != nil && res.StatusCode == http.StatusNotModified {
2618 if res.Body != nil {
2619 res.Body.Close()
2620 }
2621 return nil, gensupport.WrapError(&googleapi.Error{
2622 Code: res.StatusCode,
2623 Header: res.Header,
2624 })
2625 }
2626 if err != nil {
2627 return nil, err
2628 }
2629 defer googleapi.CloseBody(res)
2630 if err := googleapi.CheckResponse(res); err != nil {
2631 return nil, gensupport.WrapError(err)
2632 }
2633 ret := &Operation{
2634 ServerResponse: googleapi.ServerResponse{
2635 Header: res.Header,
2636 HTTPStatusCode: res.StatusCode,
2637 },
2638 }
2639 target := &ret
2640 if err := gensupport.DecodeResponse(target, res); err != nil {
2641 return nil, err
2642 }
2643 return ret, nil
2644 }
2645
2646 type ProjectsLocationsInstancesDeleteCall struct {
2647 s *Service
2648 name string
2649 urlParams_ gensupport.URLParams
2650 ctx_ context.Context
2651 header_ http.Header
2652 }
2653
2654
2655
2656
2657
2658 func (r *ProjectsLocationsInstancesService) Delete(name string) *ProjectsLocationsInstancesDeleteCall {
2659 c := &ProjectsLocationsInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2660 c.name = name
2661 return c
2662 }
2663
2664
2665
2666
2667 func (c *ProjectsLocationsInstancesDeleteCall) Force(force bool) *ProjectsLocationsInstancesDeleteCall {
2668 c.urlParams_.Set("force", fmt.Sprint(force))
2669 return c
2670 }
2671
2672
2673
2674
2675 func (c *ProjectsLocationsInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDeleteCall {
2676 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2677 return c
2678 }
2679
2680
2681 func (c *ProjectsLocationsInstancesDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesDeleteCall {
2682 c.ctx_ = ctx
2683 return c
2684 }
2685
2686
2687
2688 func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header {
2689 if c.header_ == nil {
2690 c.header_ = make(http.Header)
2691 }
2692 return c.header_
2693 }
2694
2695 func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
2696 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2697 var body io.Reader = nil
2698 c.urlParams_.Set("alt", alt)
2699 c.urlParams_.Set("prettyPrint", "false")
2700 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2701 urls += "?" + c.urlParams_.Encode()
2702 req, err := http.NewRequest("DELETE", urls, body)
2703 if err != nil {
2704 return nil, err
2705 }
2706 req.Header = reqHeaders
2707 googleapi.Expand(req.URL, map[string]string{
2708 "name": c.name,
2709 })
2710 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2711 }
2712
2713
2714
2715
2716
2717
2718 func (c *ProjectsLocationsInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2719 gensupport.SetOptions(c.urlParams_, opts...)
2720 res, err := c.doRequest("json")
2721 if res != nil && res.StatusCode == http.StatusNotModified {
2722 if res.Body != nil {
2723 res.Body.Close()
2724 }
2725 return nil, gensupport.WrapError(&googleapi.Error{
2726 Code: res.StatusCode,
2727 Header: res.Header,
2728 })
2729 }
2730 if err != nil {
2731 return nil, err
2732 }
2733 defer googleapi.CloseBody(res)
2734 if err := googleapi.CheckResponse(res); err != nil {
2735 return nil, gensupport.WrapError(err)
2736 }
2737 ret := &Operation{
2738 ServerResponse: googleapi.ServerResponse{
2739 Header: res.Header,
2740 HTTPStatusCode: res.StatusCode,
2741 },
2742 }
2743 target := &ret
2744 if err := gensupport.DecodeResponse(target, res); err != nil {
2745 return nil, err
2746 }
2747 return ret, nil
2748 }
2749
2750 type ProjectsLocationsInstancesGetCall struct {
2751 s *Service
2752 name string
2753 urlParams_ gensupport.URLParams
2754 ifNoneMatch_ string
2755 ctx_ context.Context
2756 header_ http.Header
2757 }
2758
2759
2760
2761
2762
2763 func (r *ProjectsLocationsInstancesService) Get(name string) *ProjectsLocationsInstancesGetCall {
2764 c := &ProjectsLocationsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2765 c.name = name
2766 return c
2767 }
2768
2769
2770
2771
2772 func (c *ProjectsLocationsInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetCall {
2773 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2774 return c
2775 }
2776
2777
2778
2779
2780 func (c *ProjectsLocationsInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetCall {
2781 c.ifNoneMatch_ = entityTag
2782 return c
2783 }
2784
2785
2786 func (c *ProjectsLocationsInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetCall {
2787 c.ctx_ = ctx
2788 return c
2789 }
2790
2791
2792
2793 func (c *ProjectsLocationsInstancesGetCall) Header() http.Header {
2794 if c.header_ == nil {
2795 c.header_ = make(http.Header)
2796 }
2797 return c.header_
2798 }
2799
2800 func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Response, error) {
2801 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2802 if c.ifNoneMatch_ != "" {
2803 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2804 }
2805 var body io.Reader = nil
2806 c.urlParams_.Set("alt", alt)
2807 c.urlParams_.Set("prettyPrint", "false")
2808 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2809 urls += "?" + c.urlParams_.Encode()
2810 req, err := http.NewRequest("GET", urls, body)
2811 if err != nil {
2812 return nil, err
2813 }
2814 req.Header = reqHeaders
2815 googleapi.Expand(req.URL, map[string]string{
2816 "name": c.name,
2817 })
2818 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2819 }
2820
2821
2822
2823
2824
2825
2826 func (c *ProjectsLocationsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
2827 gensupport.SetOptions(c.urlParams_, opts...)
2828 res, err := c.doRequest("json")
2829 if res != nil && res.StatusCode == http.StatusNotModified {
2830 if res.Body != nil {
2831 res.Body.Close()
2832 }
2833 return nil, gensupport.WrapError(&googleapi.Error{
2834 Code: res.StatusCode,
2835 Header: res.Header,
2836 })
2837 }
2838 if err != nil {
2839 return nil, err
2840 }
2841 defer googleapi.CloseBody(res)
2842 if err := googleapi.CheckResponse(res); err != nil {
2843 return nil, gensupport.WrapError(err)
2844 }
2845 ret := &Instance{
2846 ServerResponse: googleapi.ServerResponse{
2847 Header: res.Header,
2848 HTTPStatusCode: res.StatusCode,
2849 },
2850 }
2851 target := &ret
2852 if err := gensupport.DecodeResponse(target, res); err != nil {
2853 return nil, err
2854 }
2855 return ret, nil
2856 }
2857
2858 type ProjectsLocationsInstancesListCall struct {
2859 s *Service
2860 parent string
2861 urlParams_ gensupport.URLParams
2862 ifNoneMatch_ string
2863 ctx_ context.Context
2864 header_ http.Header
2865 }
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875 func (r *ProjectsLocationsInstancesService) List(parent string) *ProjectsLocationsInstancesListCall {
2876 c := &ProjectsLocationsInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2877 c.parent = parent
2878 return c
2879 }
2880
2881
2882 func (c *ProjectsLocationsInstancesListCall) Filter(filter string) *ProjectsLocationsInstancesListCall {
2883 c.urlParams_.Set("filter", filter)
2884 return c
2885 }
2886
2887
2888
2889 func (c *ProjectsLocationsInstancesListCall) OrderBy(orderBy string) *ProjectsLocationsInstancesListCall {
2890 c.urlParams_.Set("orderBy", orderBy)
2891 return c
2892 }
2893
2894
2895
2896 func (c *ProjectsLocationsInstancesListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesListCall {
2897 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2898 return c
2899 }
2900
2901
2902
2903 func (c *ProjectsLocationsInstancesListCall) PageToken(pageToken string) *ProjectsLocationsInstancesListCall {
2904 c.urlParams_.Set("pageToken", pageToken)
2905 return c
2906 }
2907
2908
2909
2910
2911 func (c *ProjectsLocationsInstancesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesListCall {
2912 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2913 return c
2914 }
2915
2916
2917
2918
2919 func (c *ProjectsLocationsInstancesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesListCall {
2920 c.ifNoneMatch_ = entityTag
2921 return c
2922 }
2923
2924
2925 func (c *ProjectsLocationsInstancesListCall) Context(ctx context.Context) *ProjectsLocationsInstancesListCall {
2926 c.ctx_ = ctx
2927 return c
2928 }
2929
2930
2931
2932 func (c *ProjectsLocationsInstancesListCall) Header() http.Header {
2933 if c.header_ == nil {
2934 c.header_ = make(http.Header)
2935 }
2936 return c.header_
2937 }
2938
2939 func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Response, error) {
2940 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2941 if c.ifNoneMatch_ != "" {
2942 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2943 }
2944 var body io.Reader = nil
2945 c.urlParams_.Set("alt", alt)
2946 c.urlParams_.Set("prettyPrint", "false")
2947 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances")
2948 urls += "?" + c.urlParams_.Encode()
2949 req, err := http.NewRequest("GET", urls, body)
2950 if err != nil {
2951 return nil, err
2952 }
2953 req.Header = reqHeaders
2954 googleapi.Expand(req.URL, map[string]string{
2955 "parent": c.parent,
2956 })
2957 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2958 }
2959
2960
2961
2962
2963
2964
2965
2966 func (c *ProjectsLocationsInstancesListCall) Do(opts ...googleapi.CallOption) (*ListInstancesResponse, error) {
2967 gensupport.SetOptions(c.urlParams_, opts...)
2968 res, err := c.doRequest("json")
2969 if res != nil && res.StatusCode == http.StatusNotModified {
2970 if res.Body != nil {
2971 res.Body.Close()
2972 }
2973 return nil, gensupport.WrapError(&googleapi.Error{
2974 Code: res.StatusCode,
2975 Header: res.Header,
2976 })
2977 }
2978 if err != nil {
2979 return nil, err
2980 }
2981 defer googleapi.CloseBody(res)
2982 if err := googleapi.CheckResponse(res); err != nil {
2983 return nil, gensupport.WrapError(err)
2984 }
2985 ret := &ListInstancesResponse{
2986 ServerResponse: googleapi.ServerResponse{
2987 Header: res.Header,
2988 HTTPStatusCode: res.StatusCode,
2989 },
2990 }
2991 target := &ret
2992 if err := gensupport.DecodeResponse(target, res); err != nil {
2993 return nil, err
2994 }
2995 return ret, nil
2996 }
2997
2998
2999
3000
3001 func (c *ProjectsLocationsInstancesListCall) Pages(ctx context.Context, f func(*ListInstancesResponse) error) error {
3002 c.ctx_ = ctx
3003 defer c.PageToken(c.urlParams_.Get("pageToken"))
3004 for {
3005 x, err := c.Do()
3006 if err != nil {
3007 return err
3008 }
3009 if err := f(x); err != nil {
3010 return err
3011 }
3012 if x.NextPageToken == "" {
3013 return nil
3014 }
3015 c.PageToken(x.NextPageToken)
3016 }
3017 }
3018
3019 type ProjectsLocationsInstancesPatchCall struct {
3020 s *Service
3021 name string
3022 instance *Instance
3023 urlParams_ gensupport.URLParams
3024 ctx_ context.Context
3025 header_ http.Header
3026 }
3027
3028
3029
3030
3031
3032 func (r *ProjectsLocationsInstancesService) Patch(name string, instance *Instance) *ProjectsLocationsInstancesPatchCall {
3033 c := &ProjectsLocationsInstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3034 c.name = name
3035 c.instance = instance
3036 return c
3037 }
3038
3039
3040
3041
3042
3043 func (c *ProjectsLocationsInstancesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsInstancesPatchCall {
3044 c.urlParams_.Set("updateMask", updateMask)
3045 return c
3046 }
3047
3048
3049
3050
3051 func (c *ProjectsLocationsInstancesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesPatchCall {
3052 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3053 return c
3054 }
3055
3056
3057 func (c *ProjectsLocationsInstancesPatchCall) Context(ctx context.Context) *ProjectsLocationsInstancesPatchCall {
3058 c.ctx_ = ctx
3059 return c
3060 }
3061
3062
3063
3064 func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header {
3065 if c.header_ == nil {
3066 c.header_ = make(http.Header)
3067 }
3068 return c.header_
3069 }
3070
3071 func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) {
3072 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3073 var body io.Reader = nil
3074 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
3075 if err != nil {
3076 return nil, err
3077 }
3078 c.urlParams_.Set("alt", alt)
3079 c.urlParams_.Set("prettyPrint", "false")
3080 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3081 urls += "?" + c.urlParams_.Encode()
3082 req, err := http.NewRequest("PATCH", urls, body)
3083 if err != nil {
3084 return nil, err
3085 }
3086 req.Header = reqHeaders
3087 googleapi.Expand(req.URL, map[string]string{
3088 "name": c.name,
3089 })
3090 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3091 }
3092
3093
3094
3095
3096
3097
3098 func (c *ProjectsLocationsInstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3099 gensupport.SetOptions(c.urlParams_, opts...)
3100 res, err := c.doRequest("json")
3101 if res != nil && res.StatusCode == http.StatusNotModified {
3102 if res.Body != nil {
3103 res.Body.Close()
3104 }
3105 return nil, gensupport.WrapError(&googleapi.Error{
3106 Code: res.StatusCode,
3107 Header: res.Header,
3108 })
3109 }
3110 if err != nil {
3111 return nil, err
3112 }
3113 defer googleapi.CloseBody(res)
3114 if err := googleapi.CheckResponse(res); err != nil {
3115 return nil, gensupport.WrapError(err)
3116 }
3117 ret := &Operation{
3118 ServerResponse: googleapi.ServerResponse{
3119 Header: res.Header,
3120 HTTPStatusCode: res.StatusCode,
3121 },
3122 }
3123 target := &ret
3124 if err := gensupport.DecodeResponse(target, res); err != nil {
3125 return nil, err
3126 }
3127 return ret, nil
3128 }
3129
3130 type ProjectsLocationsInstancesRestoreCall struct {
3131 s *Service
3132 name string
3133 restoreinstancerequest *RestoreInstanceRequest
3134 urlParams_ gensupport.URLParams
3135 ctx_ context.Context
3136 header_ http.Header
3137 }
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147 func (r *ProjectsLocationsInstancesService) Restore(name string, restoreinstancerequest *RestoreInstanceRequest) *ProjectsLocationsInstancesRestoreCall {
3148 c := &ProjectsLocationsInstancesRestoreCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3149 c.name = name
3150 c.restoreinstancerequest = restoreinstancerequest
3151 return c
3152 }
3153
3154
3155
3156
3157 func (c *ProjectsLocationsInstancesRestoreCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesRestoreCall {
3158 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3159 return c
3160 }
3161
3162
3163 func (c *ProjectsLocationsInstancesRestoreCall) Context(ctx context.Context) *ProjectsLocationsInstancesRestoreCall {
3164 c.ctx_ = ctx
3165 return c
3166 }
3167
3168
3169
3170 func (c *ProjectsLocationsInstancesRestoreCall) Header() http.Header {
3171 if c.header_ == nil {
3172 c.header_ = make(http.Header)
3173 }
3174 return c.header_
3175 }
3176
3177 func (c *ProjectsLocationsInstancesRestoreCall) doRequest(alt string) (*http.Response, error) {
3178 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3179 var body io.Reader = nil
3180 body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreinstancerequest)
3181 if err != nil {
3182 return nil, err
3183 }
3184 c.urlParams_.Set("alt", alt)
3185 c.urlParams_.Set("prettyPrint", "false")
3186 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:restore")
3187 urls += "?" + c.urlParams_.Encode()
3188 req, err := http.NewRequest("POST", urls, body)
3189 if err != nil {
3190 return nil, err
3191 }
3192 req.Header = reqHeaders
3193 googleapi.Expand(req.URL, map[string]string{
3194 "name": c.name,
3195 })
3196 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3197 }
3198
3199
3200
3201
3202
3203
3204 func (c *ProjectsLocationsInstancesRestoreCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3205 gensupport.SetOptions(c.urlParams_, opts...)
3206 res, err := c.doRequest("json")
3207 if res != nil && res.StatusCode == http.StatusNotModified {
3208 if res.Body != nil {
3209 res.Body.Close()
3210 }
3211 return nil, gensupport.WrapError(&googleapi.Error{
3212 Code: res.StatusCode,
3213 Header: res.Header,
3214 })
3215 }
3216 if err != nil {
3217 return nil, err
3218 }
3219 defer googleapi.CloseBody(res)
3220 if err := googleapi.CheckResponse(res); err != nil {
3221 return nil, gensupport.WrapError(err)
3222 }
3223 ret := &Operation{
3224 ServerResponse: googleapi.ServerResponse{
3225 Header: res.Header,
3226 HTTPStatusCode: res.StatusCode,
3227 },
3228 }
3229 target := &ret
3230 if err := gensupport.DecodeResponse(target, res); err != nil {
3231 return nil, err
3232 }
3233 return ret, nil
3234 }
3235
3236 type ProjectsLocationsInstancesRevertCall struct {
3237 s *Service
3238 name string
3239 revertinstancerequest *RevertInstanceRequest
3240 urlParams_ gensupport.URLParams
3241 ctx_ context.Context
3242 header_ http.Header
3243 }
3244
3245
3246
3247
3248
3249 func (r *ProjectsLocationsInstancesService) Revert(name string, revertinstancerequest *RevertInstanceRequest) *ProjectsLocationsInstancesRevertCall {
3250 c := &ProjectsLocationsInstancesRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3251 c.name = name
3252 c.revertinstancerequest = revertinstancerequest
3253 return c
3254 }
3255
3256
3257
3258
3259 func (c *ProjectsLocationsInstancesRevertCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesRevertCall {
3260 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3261 return c
3262 }
3263
3264
3265 func (c *ProjectsLocationsInstancesRevertCall) Context(ctx context.Context) *ProjectsLocationsInstancesRevertCall {
3266 c.ctx_ = ctx
3267 return c
3268 }
3269
3270
3271
3272 func (c *ProjectsLocationsInstancesRevertCall) Header() http.Header {
3273 if c.header_ == nil {
3274 c.header_ = make(http.Header)
3275 }
3276 return c.header_
3277 }
3278
3279 func (c *ProjectsLocationsInstancesRevertCall) doRequest(alt string) (*http.Response, error) {
3280 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3281 var body io.Reader = nil
3282 body, err := googleapi.WithoutDataWrapper.JSONReader(c.revertinstancerequest)
3283 if err != nil {
3284 return nil, err
3285 }
3286 c.urlParams_.Set("alt", alt)
3287 c.urlParams_.Set("prettyPrint", "false")
3288 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:revert")
3289 urls += "?" + c.urlParams_.Encode()
3290 req, err := http.NewRequest("POST", urls, body)
3291 if err != nil {
3292 return nil, err
3293 }
3294 req.Header = reqHeaders
3295 googleapi.Expand(req.URL, map[string]string{
3296 "name": c.name,
3297 })
3298 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3299 }
3300
3301
3302
3303
3304
3305
3306 func (c *ProjectsLocationsInstancesRevertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3307 gensupport.SetOptions(c.urlParams_, opts...)
3308 res, err := c.doRequest("json")
3309 if res != nil && res.StatusCode == http.StatusNotModified {
3310 if res.Body != nil {
3311 res.Body.Close()
3312 }
3313 return nil, gensupport.WrapError(&googleapi.Error{
3314 Code: res.StatusCode,
3315 Header: res.Header,
3316 })
3317 }
3318 if err != nil {
3319 return nil, err
3320 }
3321 defer googleapi.CloseBody(res)
3322 if err := googleapi.CheckResponse(res); err != nil {
3323 return nil, gensupport.WrapError(err)
3324 }
3325 ret := &Operation{
3326 ServerResponse: googleapi.ServerResponse{
3327 Header: res.Header,
3328 HTTPStatusCode: res.StatusCode,
3329 },
3330 }
3331 target := &ret
3332 if err := gensupport.DecodeResponse(target, res); err != nil {
3333 return nil, err
3334 }
3335 return ret, nil
3336 }
3337
3338 type ProjectsLocationsInstancesSnapshotsCreateCall struct {
3339 s *Service
3340 parent string
3341 snapshot *Snapshot
3342 urlParams_ gensupport.URLParams
3343 ctx_ context.Context
3344 header_ http.Header
3345 }
3346
3347
3348
3349
3350
3351 func (r *ProjectsLocationsInstancesSnapshotsService) Create(parent string, snapshot *Snapshot) *ProjectsLocationsInstancesSnapshotsCreateCall {
3352 c := &ProjectsLocationsInstancesSnapshotsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3353 c.parent = parent
3354 c.snapshot = snapshot
3355 return c
3356 }
3357
3358
3359
3360
3361
3362 func (c *ProjectsLocationsInstancesSnapshotsCreateCall) SnapshotId(snapshotId string) *ProjectsLocationsInstancesSnapshotsCreateCall {
3363 c.urlParams_.Set("snapshotId", snapshotId)
3364 return c
3365 }
3366
3367
3368
3369
3370 func (c *ProjectsLocationsInstancesSnapshotsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesSnapshotsCreateCall {
3371 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3372 return c
3373 }
3374
3375
3376 func (c *ProjectsLocationsInstancesSnapshotsCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesSnapshotsCreateCall {
3377 c.ctx_ = ctx
3378 return c
3379 }
3380
3381
3382
3383 func (c *ProjectsLocationsInstancesSnapshotsCreateCall) Header() http.Header {
3384 if c.header_ == nil {
3385 c.header_ = make(http.Header)
3386 }
3387 return c.header_
3388 }
3389
3390 func (c *ProjectsLocationsInstancesSnapshotsCreateCall) doRequest(alt string) (*http.Response, error) {
3391 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3392 var body io.Reader = nil
3393 body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
3394 if err != nil {
3395 return nil, err
3396 }
3397 c.urlParams_.Set("alt", alt)
3398 c.urlParams_.Set("prettyPrint", "false")
3399 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/snapshots")
3400 urls += "?" + c.urlParams_.Encode()
3401 req, err := http.NewRequest("POST", urls, body)
3402 if err != nil {
3403 return nil, err
3404 }
3405 req.Header = reqHeaders
3406 googleapi.Expand(req.URL, map[string]string{
3407 "parent": c.parent,
3408 })
3409 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3410 }
3411
3412
3413
3414
3415
3416
3417 func (c *ProjectsLocationsInstancesSnapshotsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3418 gensupport.SetOptions(c.urlParams_, opts...)
3419 res, err := c.doRequest("json")
3420 if res != nil && res.StatusCode == http.StatusNotModified {
3421 if res.Body != nil {
3422 res.Body.Close()
3423 }
3424 return nil, gensupport.WrapError(&googleapi.Error{
3425 Code: res.StatusCode,
3426 Header: res.Header,
3427 })
3428 }
3429 if err != nil {
3430 return nil, err
3431 }
3432 defer googleapi.CloseBody(res)
3433 if err := googleapi.CheckResponse(res); err != nil {
3434 return nil, gensupport.WrapError(err)
3435 }
3436 ret := &Operation{
3437 ServerResponse: googleapi.ServerResponse{
3438 Header: res.Header,
3439 HTTPStatusCode: res.StatusCode,
3440 },
3441 }
3442 target := &ret
3443 if err := gensupport.DecodeResponse(target, res); err != nil {
3444 return nil, err
3445 }
3446 return ret, nil
3447 }
3448
3449 type ProjectsLocationsInstancesSnapshotsDeleteCall struct {
3450 s *Service
3451 name string
3452 urlParams_ gensupport.URLParams
3453 ctx_ context.Context
3454 header_ http.Header
3455 }
3456
3457
3458
3459
3460
3461
3462 func (r *ProjectsLocationsInstancesSnapshotsService) Delete(name string) *ProjectsLocationsInstancesSnapshotsDeleteCall {
3463 c := &ProjectsLocationsInstancesSnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3464 c.name = name
3465 return c
3466 }
3467
3468
3469
3470
3471 func (c *ProjectsLocationsInstancesSnapshotsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesSnapshotsDeleteCall {
3472 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3473 return c
3474 }
3475
3476
3477 func (c *ProjectsLocationsInstancesSnapshotsDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesSnapshotsDeleteCall {
3478 c.ctx_ = ctx
3479 return c
3480 }
3481
3482
3483
3484 func (c *ProjectsLocationsInstancesSnapshotsDeleteCall) Header() http.Header {
3485 if c.header_ == nil {
3486 c.header_ = make(http.Header)
3487 }
3488 return c.header_
3489 }
3490
3491 func (c *ProjectsLocationsInstancesSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
3492 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3493 var body io.Reader = nil
3494 c.urlParams_.Set("alt", alt)
3495 c.urlParams_.Set("prettyPrint", "false")
3496 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3497 urls += "?" + c.urlParams_.Encode()
3498 req, err := http.NewRequest("DELETE", urls, body)
3499 if err != nil {
3500 return nil, err
3501 }
3502 req.Header = reqHeaders
3503 googleapi.Expand(req.URL, map[string]string{
3504 "name": c.name,
3505 })
3506 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3507 }
3508
3509
3510
3511
3512
3513
3514 func (c *ProjectsLocationsInstancesSnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3515 gensupport.SetOptions(c.urlParams_, opts...)
3516 res, err := c.doRequest("json")
3517 if res != nil && res.StatusCode == http.StatusNotModified {
3518 if res.Body != nil {
3519 res.Body.Close()
3520 }
3521 return nil, gensupport.WrapError(&googleapi.Error{
3522 Code: res.StatusCode,
3523 Header: res.Header,
3524 })
3525 }
3526 if err != nil {
3527 return nil, err
3528 }
3529 defer googleapi.CloseBody(res)
3530 if err := googleapi.CheckResponse(res); err != nil {
3531 return nil, gensupport.WrapError(err)
3532 }
3533 ret := &Operation{
3534 ServerResponse: googleapi.ServerResponse{
3535 Header: res.Header,
3536 HTTPStatusCode: res.StatusCode,
3537 },
3538 }
3539 target := &ret
3540 if err := gensupport.DecodeResponse(target, res); err != nil {
3541 return nil, err
3542 }
3543 return ret, nil
3544 }
3545
3546 type ProjectsLocationsInstancesSnapshotsGetCall struct {
3547 s *Service
3548 name string
3549 urlParams_ gensupport.URLParams
3550 ifNoneMatch_ string
3551 ctx_ context.Context
3552 header_ http.Header
3553 }
3554
3555
3556
3557
3558
3559
3560 func (r *ProjectsLocationsInstancesSnapshotsService) Get(name string) *ProjectsLocationsInstancesSnapshotsGetCall {
3561 c := &ProjectsLocationsInstancesSnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3562 c.name = name
3563 return c
3564 }
3565
3566
3567
3568
3569 func (c *ProjectsLocationsInstancesSnapshotsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesSnapshotsGetCall {
3570 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3571 return c
3572 }
3573
3574
3575
3576
3577 func (c *ProjectsLocationsInstancesSnapshotsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesSnapshotsGetCall {
3578 c.ifNoneMatch_ = entityTag
3579 return c
3580 }
3581
3582
3583 func (c *ProjectsLocationsInstancesSnapshotsGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesSnapshotsGetCall {
3584 c.ctx_ = ctx
3585 return c
3586 }
3587
3588
3589
3590 func (c *ProjectsLocationsInstancesSnapshotsGetCall) Header() http.Header {
3591 if c.header_ == nil {
3592 c.header_ = make(http.Header)
3593 }
3594 return c.header_
3595 }
3596
3597 func (c *ProjectsLocationsInstancesSnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
3598 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3599 if c.ifNoneMatch_ != "" {
3600 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3601 }
3602 var body io.Reader = nil
3603 c.urlParams_.Set("alt", alt)
3604 c.urlParams_.Set("prettyPrint", "false")
3605 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3606 urls += "?" + c.urlParams_.Encode()
3607 req, err := http.NewRequest("GET", urls, body)
3608 if err != nil {
3609 return nil, err
3610 }
3611 req.Header = reqHeaders
3612 googleapi.Expand(req.URL, map[string]string{
3613 "name": c.name,
3614 })
3615 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3616 }
3617
3618
3619
3620
3621
3622
3623 func (c *ProjectsLocationsInstancesSnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
3624 gensupport.SetOptions(c.urlParams_, opts...)
3625 res, err := c.doRequest("json")
3626 if res != nil && res.StatusCode == http.StatusNotModified {
3627 if res.Body != nil {
3628 res.Body.Close()
3629 }
3630 return nil, gensupport.WrapError(&googleapi.Error{
3631 Code: res.StatusCode,
3632 Header: res.Header,
3633 })
3634 }
3635 if err != nil {
3636 return nil, err
3637 }
3638 defer googleapi.CloseBody(res)
3639 if err := googleapi.CheckResponse(res); err != nil {
3640 return nil, gensupport.WrapError(err)
3641 }
3642 ret := &Snapshot{
3643 ServerResponse: googleapi.ServerResponse{
3644 Header: res.Header,
3645 HTTPStatusCode: res.StatusCode,
3646 },
3647 }
3648 target := &ret
3649 if err := gensupport.DecodeResponse(target, res); err != nil {
3650 return nil, err
3651 }
3652 return ret, nil
3653 }
3654
3655 type ProjectsLocationsInstancesSnapshotsListCall struct {
3656 s *Service
3657 parent string
3658 urlParams_ gensupport.URLParams
3659 ifNoneMatch_ string
3660 ctx_ context.Context
3661 header_ http.Header
3662 }
3663
3664
3665
3666
3667
3668
3669
3670 func (r *ProjectsLocationsInstancesSnapshotsService) List(parent string) *ProjectsLocationsInstancesSnapshotsListCall {
3671 c := &ProjectsLocationsInstancesSnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3672 c.parent = parent
3673 return c
3674 }
3675
3676
3677 func (c *ProjectsLocationsInstancesSnapshotsListCall) Filter(filter string) *ProjectsLocationsInstancesSnapshotsListCall {
3678 c.urlParams_.Set("filter", filter)
3679 return c
3680 }
3681
3682
3683
3684 func (c *ProjectsLocationsInstancesSnapshotsListCall) OrderBy(orderBy string) *ProjectsLocationsInstancesSnapshotsListCall {
3685 c.urlParams_.Set("orderBy", orderBy)
3686 return c
3687 }
3688
3689
3690
3691 func (c *ProjectsLocationsInstancesSnapshotsListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesSnapshotsListCall {
3692 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3693 return c
3694 }
3695
3696
3697
3698 func (c *ProjectsLocationsInstancesSnapshotsListCall) PageToken(pageToken string) *ProjectsLocationsInstancesSnapshotsListCall {
3699 c.urlParams_.Set("pageToken", pageToken)
3700 return c
3701 }
3702
3703
3704
3705
3706 func (c *ProjectsLocationsInstancesSnapshotsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesSnapshotsListCall {
3707 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3708 return c
3709 }
3710
3711
3712
3713
3714 func (c *ProjectsLocationsInstancesSnapshotsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesSnapshotsListCall {
3715 c.ifNoneMatch_ = entityTag
3716 return c
3717 }
3718
3719
3720 func (c *ProjectsLocationsInstancesSnapshotsListCall) Context(ctx context.Context) *ProjectsLocationsInstancesSnapshotsListCall {
3721 c.ctx_ = ctx
3722 return c
3723 }
3724
3725
3726
3727 func (c *ProjectsLocationsInstancesSnapshotsListCall) Header() http.Header {
3728 if c.header_ == nil {
3729 c.header_ = make(http.Header)
3730 }
3731 return c.header_
3732 }
3733
3734 func (c *ProjectsLocationsInstancesSnapshotsListCall) doRequest(alt string) (*http.Response, error) {
3735 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3736 if c.ifNoneMatch_ != "" {
3737 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3738 }
3739 var body io.Reader = nil
3740 c.urlParams_.Set("alt", alt)
3741 c.urlParams_.Set("prettyPrint", "false")
3742 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/snapshots")
3743 urls += "?" + c.urlParams_.Encode()
3744 req, err := http.NewRequest("GET", urls, body)
3745 if err != nil {
3746 return nil, err
3747 }
3748 req.Header = reqHeaders
3749 googleapi.Expand(req.URL, map[string]string{
3750 "parent": c.parent,
3751 })
3752 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3753 }
3754
3755
3756
3757
3758
3759
3760
3761 func (c *ProjectsLocationsInstancesSnapshotsListCall) Do(opts ...googleapi.CallOption) (*ListSnapshotsResponse, error) {
3762 gensupport.SetOptions(c.urlParams_, opts...)
3763 res, err := c.doRequest("json")
3764 if res != nil && res.StatusCode == http.StatusNotModified {
3765 if res.Body != nil {
3766 res.Body.Close()
3767 }
3768 return nil, gensupport.WrapError(&googleapi.Error{
3769 Code: res.StatusCode,
3770 Header: res.Header,
3771 })
3772 }
3773 if err != nil {
3774 return nil, err
3775 }
3776 defer googleapi.CloseBody(res)
3777 if err := googleapi.CheckResponse(res); err != nil {
3778 return nil, gensupport.WrapError(err)
3779 }
3780 ret := &ListSnapshotsResponse{
3781 ServerResponse: googleapi.ServerResponse{
3782 Header: res.Header,
3783 HTTPStatusCode: res.StatusCode,
3784 },
3785 }
3786 target := &ret
3787 if err := gensupport.DecodeResponse(target, res); err != nil {
3788 return nil, err
3789 }
3790 return ret, nil
3791 }
3792
3793
3794
3795
3796 func (c *ProjectsLocationsInstancesSnapshotsListCall) Pages(ctx context.Context, f func(*ListSnapshotsResponse) error) error {
3797 c.ctx_ = ctx
3798 defer c.PageToken(c.urlParams_.Get("pageToken"))
3799 for {
3800 x, err := c.Do()
3801 if err != nil {
3802 return err
3803 }
3804 if err := f(x); err != nil {
3805 return err
3806 }
3807 if x.NextPageToken == "" {
3808 return nil
3809 }
3810 c.PageToken(x.NextPageToken)
3811 }
3812 }
3813
3814 type ProjectsLocationsInstancesSnapshotsPatchCall struct {
3815 s *Service
3816 name string
3817 snapshot *Snapshot
3818 urlParams_ gensupport.URLParams
3819 ctx_ context.Context
3820 header_ http.Header
3821 }
3822
3823
3824
3825
3826
3827
3828 func (r *ProjectsLocationsInstancesSnapshotsService) Patch(name string, snapshot *Snapshot) *ProjectsLocationsInstancesSnapshotsPatchCall {
3829 c := &ProjectsLocationsInstancesSnapshotsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3830 c.name = name
3831 c.snapshot = snapshot
3832 return c
3833 }
3834
3835
3836
3837 func (c *ProjectsLocationsInstancesSnapshotsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsInstancesSnapshotsPatchCall {
3838 c.urlParams_.Set("updateMask", updateMask)
3839 return c
3840 }
3841
3842
3843
3844
3845 func (c *ProjectsLocationsInstancesSnapshotsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesSnapshotsPatchCall {
3846 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3847 return c
3848 }
3849
3850
3851 func (c *ProjectsLocationsInstancesSnapshotsPatchCall) Context(ctx context.Context) *ProjectsLocationsInstancesSnapshotsPatchCall {
3852 c.ctx_ = ctx
3853 return c
3854 }
3855
3856
3857
3858 func (c *ProjectsLocationsInstancesSnapshotsPatchCall) Header() http.Header {
3859 if c.header_ == nil {
3860 c.header_ = make(http.Header)
3861 }
3862 return c.header_
3863 }
3864
3865 func (c *ProjectsLocationsInstancesSnapshotsPatchCall) doRequest(alt string) (*http.Response, error) {
3866 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3867 var body io.Reader = nil
3868 body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
3869 if err != nil {
3870 return nil, err
3871 }
3872 c.urlParams_.Set("alt", alt)
3873 c.urlParams_.Set("prettyPrint", "false")
3874 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3875 urls += "?" + c.urlParams_.Encode()
3876 req, err := http.NewRequest("PATCH", urls, body)
3877 if err != nil {
3878 return nil, err
3879 }
3880 req.Header = reqHeaders
3881 googleapi.Expand(req.URL, map[string]string{
3882 "name": c.name,
3883 })
3884 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3885 }
3886
3887
3888
3889
3890
3891
3892 func (c *ProjectsLocationsInstancesSnapshotsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3893 gensupport.SetOptions(c.urlParams_, opts...)
3894 res, err := c.doRequest("json")
3895 if res != nil && res.StatusCode == http.StatusNotModified {
3896 if res.Body != nil {
3897 res.Body.Close()
3898 }
3899 return nil, gensupport.WrapError(&googleapi.Error{
3900 Code: res.StatusCode,
3901 Header: res.Header,
3902 })
3903 }
3904 if err != nil {
3905 return nil, err
3906 }
3907 defer googleapi.CloseBody(res)
3908 if err := googleapi.CheckResponse(res); err != nil {
3909 return nil, gensupport.WrapError(err)
3910 }
3911 ret := &Operation{
3912 ServerResponse: googleapi.ServerResponse{
3913 Header: res.Header,
3914 HTTPStatusCode: res.StatusCode,
3915 },
3916 }
3917 target := &ret
3918 if err := gensupport.DecodeResponse(target, res); err != nil {
3919 return nil, err
3920 }
3921 return ret, nil
3922 }
3923
3924 type ProjectsLocationsOperationsCancelCall struct {
3925 s *Service
3926 name string
3927 canceloperationrequest *CancelOperationRequest
3928 urlParams_ gensupport.URLParams
3929 ctx_ context.Context
3930 header_ http.Header
3931 }
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
3945 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3946 c.name = name
3947 c.canceloperationrequest = canceloperationrequest
3948 return c
3949 }
3950
3951
3952
3953
3954 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
3955 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3956 return c
3957 }
3958
3959
3960 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
3961 c.ctx_ = ctx
3962 return c
3963 }
3964
3965
3966
3967 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
3968 if c.header_ == nil {
3969 c.header_ = make(http.Header)
3970 }
3971 return c.header_
3972 }
3973
3974 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
3975 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3976 var body io.Reader = nil
3977 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
3978 if err != nil {
3979 return nil, err
3980 }
3981 c.urlParams_.Set("alt", alt)
3982 c.urlParams_.Set("prettyPrint", "false")
3983 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
3984 urls += "?" + c.urlParams_.Encode()
3985 req, err := http.NewRequest("POST", urls, body)
3986 if err != nil {
3987 return nil, err
3988 }
3989 req.Header = reqHeaders
3990 googleapi.Expand(req.URL, map[string]string{
3991 "name": c.name,
3992 })
3993 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3994 }
3995
3996
3997
3998
3999
4000
4001 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4002 gensupport.SetOptions(c.urlParams_, opts...)
4003 res, err := c.doRequest("json")
4004 if res != nil && res.StatusCode == http.StatusNotModified {
4005 if res.Body != nil {
4006 res.Body.Close()
4007 }
4008 return nil, gensupport.WrapError(&googleapi.Error{
4009 Code: res.StatusCode,
4010 Header: res.Header,
4011 })
4012 }
4013 if err != nil {
4014 return nil, err
4015 }
4016 defer googleapi.CloseBody(res)
4017 if err := googleapi.CheckResponse(res); err != nil {
4018 return nil, gensupport.WrapError(err)
4019 }
4020 ret := &Empty{
4021 ServerResponse: googleapi.ServerResponse{
4022 Header: res.Header,
4023 HTTPStatusCode: res.StatusCode,
4024 },
4025 }
4026 target := &ret
4027 if err := gensupport.DecodeResponse(target, res); err != nil {
4028 return nil, err
4029 }
4030 return ret, nil
4031 }
4032
4033 type ProjectsLocationsOperationsDeleteCall struct {
4034 s *Service
4035 name string
4036 urlParams_ gensupport.URLParams
4037 ctx_ context.Context
4038 header_ http.Header
4039 }
4040
4041
4042
4043
4044
4045
4046
4047 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
4048 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4049 c.name = name
4050 return c
4051 }
4052
4053
4054
4055
4056 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
4057 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4058 return c
4059 }
4060
4061
4062 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
4063 c.ctx_ = ctx
4064 return c
4065 }
4066
4067
4068
4069 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
4070 if c.header_ == nil {
4071 c.header_ = make(http.Header)
4072 }
4073 return c.header_
4074 }
4075
4076 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
4077 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4078 var body io.Reader = nil
4079 c.urlParams_.Set("alt", alt)
4080 c.urlParams_.Set("prettyPrint", "false")
4081 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4082 urls += "?" + c.urlParams_.Encode()
4083 req, err := http.NewRequest("DELETE", urls, body)
4084 if err != nil {
4085 return nil, err
4086 }
4087 req.Header = reqHeaders
4088 googleapi.Expand(req.URL, map[string]string{
4089 "name": c.name,
4090 })
4091 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4092 }
4093
4094
4095
4096
4097
4098
4099 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4100 gensupport.SetOptions(c.urlParams_, opts...)
4101 res, err := c.doRequest("json")
4102 if res != nil && res.StatusCode == http.StatusNotModified {
4103 if res.Body != nil {
4104 res.Body.Close()
4105 }
4106 return nil, gensupport.WrapError(&googleapi.Error{
4107 Code: res.StatusCode,
4108 Header: res.Header,
4109 })
4110 }
4111 if err != nil {
4112 return nil, err
4113 }
4114 defer googleapi.CloseBody(res)
4115 if err := googleapi.CheckResponse(res); err != nil {
4116 return nil, gensupport.WrapError(err)
4117 }
4118 ret := &Empty{
4119 ServerResponse: googleapi.ServerResponse{
4120 Header: res.Header,
4121 HTTPStatusCode: res.StatusCode,
4122 },
4123 }
4124 target := &ret
4125 if err := gensupport.DecodeResponse(target, res); err != nil {
4126 return nil, err
4127 }
4128 return ret, nil
4129 }
4130
4131 type ProjectsLocationsOperationsGetCall struct {
4132 s *Service
4133 name string
4134 urlParams_ gensupport.URLParams
4135 ifNoneMatch_ string
4136 ctx_ context.Context
4137 header_ http.Header
4138 }
4139
4140
4141
4142
4143
4144
4145 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
4146 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4147 c.name = name
4148 return c
4149 }
4150
4151
4152
4153
4154 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
4155 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4156 return c
4157 }
4158
4159
4160
4161
4162 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
4163 c.ifNoneMatch_ = entityTag
4164 return c
4165 }
4166
4167
4168 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
4169 c.ctx_ = ctx
4170 return c
4171 }
4172
4173
4174
4175 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
4176 if c.header_ == nil {
4177 c.header_ = make(http.Header)
4178 }
4179 return c.header_
4180 }
4181
4182 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
4183 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4184 if c.ifNoneMatch_ != "" {
4185 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4186 }
4187 var body io.Reader = nil
4188 c.urlParams_.Set("alt", alt)
4189 c.urlParams_.Set("prettyPrint", "false")
4190 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4191 urls += "?" + c.urlParams_.Encode()
4192 req, err := http.NewRequest("GET", urls, body)
4193 if err != nil {
4194 return nil, err
4195 }
4196 req.Header = reqHeaders
4197 googleapi.Expand(req.URL, map[string]string{
4198 "name": c.name,
4199 })
4200 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4201 }
4202
4203
4204
4205
4206
4207
4208 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4209 gensupport.SetOptions(c.urlParams_, opts...)
4210 res, err := c.doRequest("json")
4211 if res != nil && res.StatusCode == http.StatusNotModified {
4212 if res.Body != nil {
4213 res.Body.Close()
4214 }
4215 return nil, gensupport.WrapError(&googleapi.Error{
4216 Code: res.StatusCode,
4217 Header: res.Header,
4218 })
4219 }
4220 if err != nil {
4221 return nil, err
4222 }
4223 defer googleapi.CloseBody(res)
4224 if err := googleapi.CheckResponse(res); err != nil {
4225 return nil, gensupport.WrapError(err)
4226 }
4227 ret := &Operation{
4228 ServerResponse: googleapi.ServerResponse{
4229 Header: res.Header,
4230 HTTPStatusCode: res.StatusCode,
4231 },
4232 }
4233 target := &ret
4234 if err := gensupport.DecodeResponse(target, res); err != nil {
4235 return nil, err
4236 }
4237 return ret, nil
4238 }
4239
4240 type ProjectsLocationsOperationsListCall struct {
4241 s *Service
4242 name string
4243 urlParams_ gensupport.URLParams
4244 ifNoneMatch_ string
4245 ctx_ context.Context
4246 header_ http.Header
4247 }
4248
4249
4250
4251
4252
4253 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
4254 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4255 c.name = name
4256 return c
4257 }
4258
4259
4260 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
4261 c.urlParams_.Set("filter", filter)
4262 return c
4263 }
4264
4265
4266
4267 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
4268 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4269 return c
4270 }
4271
4272
4273
4274 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
4275 c.urlParams_.Set("pageToken", pageToken)
4276 return c
4277 }
4278
4279
4280
4281
4282 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
4283 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4284 return c
4285 }
4286
4287
4288
4289
4290 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
4291 c.ifNoneMatch_ = entityTag
4292 return c
4293 }
4294
4295
4296 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
4297 c.ctx_ = ctx
4298 return c
4299 }
4300
4301
4302
4303 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
4304 if c.header_ == nil {
4305 c.header_ = make(http.Header)
4306 }
4307 return c.header_
4308 }
4309
4310 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
4311 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4312 if c.ifNoneMatch_ != "" {
4313 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4314 }
4315 var body io.Reader = nil
4316 c.urlParams_.Set("alt", alt)
4317 c.urlParams_.Set("prettyPrint", "false")
4318 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
4319 urls += "?" + c.urlParams_.Encode()
4320 req, err := http.NewRequest("GET", urls, body)
4321 if err != nil {
4322 return nil, err
4323 }
4324 req.Header = reqHeaders
4325 googleapi.Expand(req.URL, map[string]string{
4326 "name": c.name,
4327 })
4328 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4329 }
4330
4331
4332
4333
4334
4335
4336
4337 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
4338 gensupport.SetOptions(c.urlParams_, opts...)
4339 res, err := c.doRequest("json")
4340 if res != nil && res.StatusCode == http.StatusNotModified {
4341 if res.Body != nil {
4342 res.Body.Close()
4343 }
4344 return nil, gensupport.WrapError(&googleapi.Error{
4345 Code: res.StatusCode,
4346 Header: res.Header,
4347 })
4348 }
4349 if err != nil {
4350 return nil, err
4351 }
4352 defer googleapi.CloseBody(res)
4353 if err := googleapi.CheckResponse(res); err != nil {
4354 return nil, gensupport.WrapError(err)
4355 }
4356 ret := &ListOperationsResponse{
4357 ServerResponse: googleapi.ServerResponse{
4358 Header: res.Header,
4359 HTTPStatusCode: res.StatusCode,
4360 },
4361 }
4362 target := &ret
4363 if err := gensupport.DecodeResponse(target, res); err != nil {
4364 return nil, err
4365 }
4366 return ret, nil
4367 }
4368
4369
4370
4371
4372 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
4373 c.ctx_ = ctx
4374 defer c.PageToken(c.urlParams_.Get("pageToken"))
4375 for {
4376 x, err := c.Do()
4377 if err != nil {
4378 return err
4379 }
4380 if err := f(x); err != nil {
4381 return err
4382 }
4383 if x.NextPageToken == "" {
4384 return nil
4385 }
4386 c.PageToken(x.NextPageToken)
4387 }
4388 }
4389
View as plain text