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