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