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