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 datafusion
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 = "datafusion:v1"
90 const apiName = "datafusion"
91 const apiVersion = "v1"
92 const basePath = "https://datafusion.googleapis.com/"
93 const basePathTemplate = "https://datafusion.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://datafusion.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 rs.Versions = NewProjectsLocationsVersionsService(s)
174 return rs
175 }
176
177 type ProjectsLocationsService struct {
178 s *Service
179
180 Instances *ProjectsLocationsInstancesService
181
182 Operations *ProjectsLocationsOperationsService
183
184 Versions *ProjectsLocationsVersionsService
185 }
186
187 func NewProjectsLocationsInstancesService(s *Service) *ProjectsLocationsInstancesService {
188 rs := &ProjectsLocationsInstancesService{s: s}
189 rs.DnsPeerings = NewProjectsLocationsInstancesDnsPeeringsService(s)
190 return rs
191 }
192
193 type ProjectsLocationsInstancesService struct {
194 s *Service
195
196 DnsPeerings *ProjectsLocationsInstancesDnsPeeringsService
197 }
198
199 func NewProjectsLocationsInstancesDnsPeeringsService(s *Service) *ProjectsLocationsInstancesDnsPeeringsService {
200 rs := &ProjectsLocationsInstancesDnsPeeringsService{s: s}
201 return rs
202 }
203
204 type ProjectsLocationsInstancesDnsPeeringsService struct {
205 s *Service
206 }
207
208 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
209 rs := &ProjectsLocationsOperationsService{s: s}
210 return rs
211 }
212
213 type ProjectsLocationsOperationsService struct {
214 s *Service
215 }
216
217 func NewProjectsLocationsVersionsService(s *Service) *ProjectsLocationsVersionsService {
218 rs := &ProjectsLocationsVersionsService{s: s}
219 return rs
220 }
221
222 type ProjectsLocationsVersionsService struct {
223 s *Service
224 }
225
226
227 type Accelerator struct {
228
229
230
231
232
233
234
235
236
237
238
239
240
241 AcceleratorType string `json:"acceleratorType,omitempty"`
242
243
244
245
246
247
248
249
250
251
252 State string `json:"state,omitempty"`
253
254
255
256
257
258 ForceSendFields []string `json:"-"`
259
260
261
262
263 NullFields []string `json:"-"`
264 }
265
266 func (s *Accelerator) MarshalJSON() ([]byte, error) {
267 type NoMethod Accelerator
268 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
269 }
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287 type AuditConfig struct {
288
289 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
290
291
292
293 Service string `json:"service,omitempty"`
294
295
296
297
298
299 ForceSendFields []string `json:"-"`
300
301
302
303
304 NullFields []string `json:"-"`
305 }
306
307 func (s *AuditConfig) MarshalJSON() ([]byte, error) {
308 type NoMethod AuditConfig
309 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
310 }
311
312
313
314
315
316
317 type AuditLogConfig struct {
318
319
320 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
321
322
323
324
325
326
327
328 LogType string `json:"logType,omitempty"`
329
330
331
332
333
334 ForceSendFields []string `json:"-"`
335
336
337
338
339 NullFields []string `json:"-"`
340 }
341
342 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
343 type NoMethod AuditLogConfig
344 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
345 }
346
347
348 type Binding struct {
349
350
351
352
353
354
355
356
357 Condition *Expr `json:"condition,omitempty"`
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420 Members []string `json:"members,omitempty"`
421
422
423 Role string `json:"role,omitempty"`
424
425
426
427
428
429 ForceSendFields []string `json:"-"`
430
431
432
433
434 NullFields []string `json:"-"`
435 }
436
437 func (s *Binding) MarshalJSON() ([]byte, error) {
438 type NoMethod Binding
439 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
440 }
441
442
443 type CancelOperationRequest struct {
444 }
445
446
447
448 type CryptoKeyConfig struct {
449
450
451
452 KeyReference string `json:"keyReference,omitempty"`
453
454
455
456
457
458 ForceSendFields []string `json:"-"`
459
460
461
462
463 NullFields []string `json:"-"`
464 }
465
466 func (s *CryptoKeyConfig) MarshalJSON() ([]byte, error) {
467 type NoMethod CryptoKeyConfig
468 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
469 }
470
471
472 type DataResidencyAugmentedView struct {
473
474
475
476
477 CrGopoGuris []string `json:"crGopoGuris,omitempty"`
478
479
480
481
482
483
484 CrGopoPrefixes []string `json:"crGopoPrefixes,omitempty"`
485
486
487
488
489 ServiceData *ServiceData `json:"serviceData,omitempty"`
490
491
492 TpIds []string `json:"tpIds,omitempty"`
493
494
495
496
497
498 ForceSendFields []string `json:"-"`
499
500
501
502
503 NullFields []string `json:"-"`
504 }
505
506 func (s *DataResidencyAugmentedView) MarshalJSON() ([]byte, error) {
507 type NoMethod DataResidencyAugmentedView
508 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
509 }
510
511
512
513 type DnsPeering struct {
514
515 Description string `json:"description,omitempty"`
516
517 Domain string `json:"domain,omitempty"`
518
519
520
521 Name string `json:"name,omitempty"`
522
523
524 TargetNetwork string `json:"targetNetwork,omitempty"`
525
526
527 TargetProject string `json:"targetProject,omitempty"`
528
529
530 googleapi.ServerResponse `json:"-"`
531
532
533
534
535
536 ForceSendFields []string `json:"-"`
537
538
539
540
541 NullFields []string `json:"-"`
542 }
543
544 func (s *DnsPeering) MarshalJSON() ([]byte, error) {
545 type NoMethod DnsPeering
546 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
547 }
548
549
550
551
552
553 type Empty struct {
554
555 googleapi.ServerResponse `json:"-"`
556 }
557
558
559 type EventPublishConfig struct {
560
561 Enabled bool `json:"enabled,omitempty"`
562
563
564 Topic string `json:"topic,omitempty"`
565
566
567
568
569
570 ForceSendFields []string `json:"-"`
571
572
573
574
575 NullFields []string `json:"-"`
576 }
577
578 func (s *EventPublishConfig) MarshalJSON() ([]byte, error) {
579 type NoMethod EventPublishConfig
580 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
581 }
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599 type Expr struct {
600
601
602 Description string `json:"description,omitempty"`
603
604
605 Expression string `json:"expression,omitempty"`
606
607
608 Location string `json:"location,omitempty"`
609
610
611
612 Title string `json:"title,omitempty"`
613
614
615
616
617
618 ForceSendFields []string `json:"-"`
619
620
621
622
623 NullFields []string `json:"-"`
624 }
625
626 func (s *Expr) MarshalJSON() ([]byte, error) {
627 type NoMethod Expr
628 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
629 }
630
631
632 type Instance struct {
633
634
635 Accelerators []*Accelerator `json:"accelerators,omitempty"`
636
637 ApiEndpoint string `json:"apiEndpoint,omitempty"`
638
639
640 AvailableVersion []*Version `json:"availableVersion,omitempty"`
641
642 CreateTime string `json:"createTime,omitempty"`
643
644
645 CryptoKeyConfig *CryptoKeyConfig `json:"cryptoKeyConfig,omitempty"`
646
647
648 DataplexDataLineageIntegrationEnabled bool `json:"dataplexDataLineageIntegrationEnabled,omitempty"`
649
650
651
652
653 DataprocServiceAccount string `json:"dataprocServiceAccount,omitempty"`
654
655 Description string `json:"description,omitempty"`
656
657
658
659
660
661
662
663 DisabledReason []string `json:"disabledReason,omitempty"`
664
665 DisplayName string `json:"displayName,omitempty"`
666
667 EnableRbac bool `json:"enableRbac,omitempty"`
668
669 EnableStackdriverLogging bool `json:"enableStackdriverLogging,omitempty"`
670
671 EnableStackdriverMonitoring bool `json:"enableStackdriverMonitoring,omitempty"`
672
673 EnableZoneSeparation bool `json:"enableZoneSeparation,omitempty"`
674
675 EventPublishConfig *EventPublishConfig `json:"eventPublishConfig,omitempty"`
676
677
678 GcsBucket string `json:"gcsBucket,omitempty"`
679
680
681
682 Labels map[string]string `json:"labels,omitempty"`
683
684
685 Name string `json:"name,omitempty"`
686
687
688 NetworkConfig *NetworkConfig `json:"networkConfig,omitempty"`
689
690
691 Options map[string]string `json:"options,omitempty"`
692
693 P4ServiceAccount string `json:"p4ServiceAccount,omitempty"`
694
695 PatchRevision string `json:"patchRevision,omitempty"`
696
697
698
699 PrivateInstance bool `json:"privateInstance,omitempty"`
700
701 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
702
703
704 ServiceAccount string `json:"serviceAccount,omitempty"`
705
706
707 ServiceEndpoint string `json:"serviceEndpoint,omitempty"`
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723 State string `json:"state,omitempty"`
724
725
726 StateMessage string `json:"stateMessage,omitempty"`
727
728 TenantProjectId string `json:"tenantProjectId,omitempty"`
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744 Type string `json:"type,omitempty"`
745
746 UpdateTime string `json:"updateTime,omitempty"`
747
748 Version string `json:"version,omitempty"`
749
750
751 WorkforceIdentityServiceEndpoint string `json:"workforceIdentityServiceEndpoint,omitempty"`
752
753
754 Zone string `json:"zone,omitempty"`
755
756
757 googleapi.ServerResponse `json:"-"`
758
759
760
761
762
763 ForceSendFields []string `json:"-"`
764
765
766
767
768 NullFields []string `json:"-"`
769 }
770
771 func (s *Instance) MarshalJSON() ([]byte, error) {
772 type NoMethod Instance
773 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
774 }
775
776
777
778 type ListAvailableVersionsResponse struct {
779
780 AvailableVersions []*Version `json:"availableVersions,omitempty"`
781
782
783 NextPageToken string `json:"nextPageToken,omitempty"`
784
785
786 googleapi.ServerResponse `json:"-"`
787
788
789
790
791
792 ForceSendFields []string `json:"-"`
793
794
795
796
797 NullFields []string `json:"-"`
798 }
799
800 func (s *ListAvailableVersionsResponse) MarshalJSON() ([]byte, error) {
801 type NoMethod ListAvailableVersionsResponse
802 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
803 }
804
805
806 type ListDnsPeeringsResponse struct {
807
808 DnsPeerings []*DnsPeering `json:"dnsPeerings,omitempty"`
809
810
811 NextPageToken string `json:"nextPageToken,omitempty"`
812
813
814 googleapi.ServerResponse `json:"-"`
815
816
817
818
819
820 ForceSendFields []string `json:"-"`
821
822
823
824
825 NullFields []string `json:"-"`
826 }
827
828 func (s *ListDnsPeeringsResponse) MarshalJSON() ([]byte, error) {
829 type NoMethod ListDnsPeeringsResponse
830 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
831 }
832
833
834 type ListInstancesResponse struct {
835
836 Instances []*Instance `json:"instances,omitempty"`
837
838
839 NextPageToken string `json:"nextPageToken,omitempty"`
840
841 Unreachable []string `json:"unreachable,omitempty"`
842
843
844 googleapi.ServerResponse `json:"-"`
845
846
847
848
849
850 ForceSendFields []string `json:"-"`
851
852
853
854
855 NullFields []string `json:"-"`
856 }
857
858 func (s *ListInstancesResponse) MarshalJSON() ([]byte, error) {
859 type NoMethod ListInstancesResponse
860 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
861 }
862
863
864 type ListLocationsResponse struct {
865
866
867 Locations []*Location `json:"locations,omitempty"`
868
869 NextPageToken string `json:"nextPageToken,omitempty"`
870
871
872 googleapi.ServerResponse `json:"-"`
873
874
875
876
877
878 ForceSendFields []string `json:"-"`
879
880
881
882
883 NullFields []string `json:"-"`
884 }
885
886 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
887 type NoMethod ListLocationsResponse
888 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
889 }
890
891
892 type ListOperationsResponse struct {
893
894 NextPageToken string `json:"nextPageToken,omitempty"`
895
896
897 Operations []*Operation `json:"operations,omitempty"`
898
899
900 googleapi.ServerResponse `json:"-"`
901
902
903
904
905
906 ForceSendFields []string `json:"-"`
907
908
909
910
911 NullFields []string `json:"-"`
912 }
913
914 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
915 type NoMethod ListOperationsResponse
916 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
917 }
918
919
920 type Location struct {
921
922
923 DisplayName string `json:"displayName,omitempty"`
924
925
926 Labels map[string]string `json:"labels,omitempty"`
927
928 LocationId string `json:"locationId,omitempty"`
929
930
931 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
932
933
934
935 Name string `json:"name,omitempty"`
936
937
938 googleapi.ServerResponse `json:"-"`
939
940
941
942
943
944 ForceSendFields []string `json:"-"`
945
946
947
948
949 NullFields []string `json:"-"`
950 }
951
952 func (s *Location) MarshalJSON() ([]byte, error) {
953 type NoMethod Location
954 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
955 }
956
957
958
959
960
961
962
963
964 type NetworkConfig struct {
965
966
967
968
969
970
971
972
973
974
975
976
977
978 ConnectionType string `json:"connectionType,omitempty"`
979
980
981
982
983
984 IpAllocation string `json:"ipAllocation,omitempty"`
985
986
987
988
989
990
991 Network string `json:"network,omitempty"`
992
993
994
995 PrivateServiceConnectConfig *PrivateServiceConnectConfig `json:"privateServiceConnectConfig,omitempty"`
996
997
998
999
1000
1001 ForceSendFields []string `json:"-"`
1002
1003
1004
1005
1006 NullFields []string `json:"-"`
1007 }
1008
1009 func (s *NetworkConfig) MarshalJSON() ([]byte, error) {
1010 type NoMethod NetworkConfig
1011 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1012 }
1013
1014
1015
1016 type Operation struct {
1017
1018
1019
1020 Done bool `json:"done,omitempty"`
1021
1022 Error *Status `json:"error,omitempty"`
1023
1024
1025
1026
1027 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1028
1029
1030
1031 Name string `json:"name,omitempty"`
1032
1033
1034
1035
1036
1037
1038
1039 Response googleapi.RawMessage `json:"response,omitempty"`
1040
1041
1042 googleapi.ServerResponse `json:"-"`
1043
1044
1045
1046
1047
1048 ForceSendFields []string `json:"-"`
1049
1050
1051
1052
1053 NullFields []string `json:"-"`
1054 }
1055
1056 func (s *Operation) MarshalJSON() ([]byte, error) {
1057 type NoMethod Operation
1058 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1059 }
1060
1061
1062 type OperationMetadata struct {
1063
1064
1065
1066
1067 AdditionalStatus map[string]string `json:"additionalStatus,omitempty"`
1068
1069 ApiVersion string `json:"apiVersion,omitempty"`
1070
1071 CreateTime string `json:"createTime,omitempty"`
1072
1073 EndTime string `json:"endTime,omitempty"`
1074
1075
1076
1077
1078 RequestedCancellation bool `json:"requestedCancellation,omitempty"`
1079
1080 StatusDetail string `json:"statusDetail,omitempty"`
1081
1082 Target string `json:"target,omitempty"`
1083
1084 Verb string `json:"verb,omitempty"`
1085
1086
1087
1088
1089
1090 ForceSendFields []string `json:"-"`
1091
1092
1093
1094
1095 NullFields []string `json:"-"`
1096 }
1097
1098 func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
1099 type NoMethod OperationMetadata
1100 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1101 }
1102
1103
1104
1105
1106 type PersistentDiskData struct {
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120 CfsRoots []string `json:"cfsRoots,omitempty"`
1121
1122
1123
1124 GcsBucketNames []string `json:"gcsBucketNames,omitempty"`
1125
1126
1127
1128
1129
1130 ForceSendFields []string `json:"-"`
1131
1132
1133
1134
1135 NullFields []string `json:"-"`
1136 }
1137
1138 func (s *PersistentDiskData) MarshalJSON() ([]byte, error) {
1139 type NoMethod PersistentDiskData
1140 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1141 }
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173 type Policy struct {
1174
1175 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185 Bindings []*Binding `json:"bindings,omitempty"`
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197 Etag string `json:"etag,omitempty"`
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213 Version int64 `json:"version,omitempty"`
1214
1215
1216 googleapi.ServerResponse `json:"-"`
1217
1218
1219
1220
1221
1222 ForceSendFields []string `json:"-"`
1223
1224
1225
1226
1227 NullFields []string `json:"-"`
1228 }
1229
1230 func (s *Policy) MarshalJSON() ([]byte, error) {
1231 type NoMethod Policy
1232 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1233 }
1234
1235
1236
1237
1238 type PrivateServiceConnectConfig struct {
1239
1240
1241
1242
1243 EffectiveUnreachableCidrBlock string `json:"effectiveUnreachableCidrBlock,omitempty"`
1244
1245
1246
1247
1248 NetworkAttachment string `json:"networkAttachment,omitempty"`
1249
1250
1251
1252
1253
1254
1255
1256
1257 UnreachableCidrBlock string `json:"unreachableCidrBlock,omitempty"`
1258
1259
1260
1261
1262
1263 ForceSendFields []string `json:"-"`
1264
1265
1266
1267
1268 NullFields []string `json:"-"`
1269 }
1270
1271 func (s *PrivateServiceConnectConfig) MarshalJSON() ([]byte, error) {
1272 type NoMethod PrivateServiceConnectConfig
1273 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1274 }
1275
1276
1277
1278 type RestartInstanceRequest struct {
1279 }
1280
1281
1282
1283
1284 type ServiceData struct {
1285
1286
1287 Pd *PersistentDiskData `json:"pd,omitempty"`
1288
1289
1290
1291
1292
1293 ForceSendFields []string `json:"-"`
1294
1295
1296
1297
1298 NullFields []string `json:"-"`
1299 }
1300
1301 func (s *ServiceData) MarshalJSON() ([]byte, error) {
1302 type NoMethod ServiceData
1303 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1304 }
1305
1306
1307 type SetIamPolicyRequest struct {
1308
1309
1310
1311
1312 Policy *Policy `json:"policy,omitempty"`
1313
1314
1315
1316 UpdateMask string `json:"updateMask,omitempty"`
1317
1318
1319
1320
1321
1322 ForceSendFields []string `json:"-"`
1323
1324
1325
1326
1327 NullFields []string `json:"-"`
1328 }
1329
1330 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
1331 type NoMethod SetIamPolicyRequest
1332 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1333 }
1334
1335
1336
1337
1338
1339
1340
1341 type Status struct {
1342
1343 Code int64 `json:"code,omitempty"`
1344
1345
1346 Details []googleapi.RawMessage `json:"details,omitempty"`
1347
1348
1349
1350 Message string `json:"message,omitempty"`
1351
1352
1353
1354
1355
1356 ForceSendFields []string `json:"-"`
1357
1358
1359
1360
1361 NullFields []string `json:"-"`
1362 }
1363
1364 func (s *Status) MarshalJSON() ([]byte, error) {
1365 type NoMethod Status
1366 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1367 }
1368
1369
1370 type TestIamPermissionsRequest struct {
1371
1372
1373
1374
1375 Permissions []string `json:"permissions,omitempty"`
1376
1377
1378
1379
1380
1381 ForceSendFields []string `json:"-"`
1382
1383
1384
1385
1386 NullFields []string `json:"-"`
1387 }
1388
1389 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
1390 type NoMethod TestIamPermissionsRequest
1391 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1392 }
1393
1394
1395
1396 type TestIamPermissionsResponse struct {
1397
1398
1399 Permissions []string `json:"permissions,omitempty"`
1400
1401
1402 googleapi.ServerResponse `json:"-"`
1403
1404
1405
1406
1407
1408 ForceSendFields []string `json:"-"`
1409
1410
1411
1412
1413 NullFields []string `json:"-"`
1414 }
1415
1416 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
1417 type NoMethod TestIamPermissionsResponse
1418 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1419 }
1420
1421
1422
1423
1424 type Version struct {
1425
1426
1427 AvailableFeatures []string `json:"availableFeatures,omitempty"`
1428
1429
1430 DefaultVersion bool `json:"defaultVersion,omitempty"`
1431
1432
1433
1434
1435
1436
1437 Type string `json:"type,omitempty"`
1438
1439
1440 VersionNumber string `json:"versionNumber,omitempty"`
1441
1442
1443
1444
1445
1446 ForceSendFields []string `json:"-"`
1447
1448
1449
1450
1451 NullFields []string `json:"-"`
1452 }
1453
1454 func (s *Version) MarshalJSON() ([]byte, error) {
1455 type NoMethod Version
1456 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1457 }
1458
1459 type ProjectsLocationsGetCall struct {
1460 s *Service
1461 name string
1462 urlParams_ gensupport.URLParams
1463 ifNoneMatch_ string
1464 ctx_ context.Context
1465 header_ http.Header
1466 }
1467
1468
1469
1470
1471 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
1472 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1473 c.name = name
1474 return c
1475 }
1476
1477
1478
1479
1480 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
1481 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1482 return c
1483 }
1484
1485
1486
1487
1488 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
1489 c.ifNoneMatch_ = entityTag
1490 return c
1491 }
1492
1493
1494 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
1495 c.ctx_ = ctx
1496 return c
1497 }
1498
1499
1500
1501 func (c *ProjectsLocationsGetCall) Header() http.Header {
1502 if c.header_ == nil {
1503 c.header_ = make(http.Header)
1504 }
1505 return c.header_
1506 }
1507
1508 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
1509 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1510 if c.ifNoneMatch_ != "" {
1511 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1512 }
1513 var body io.Reader = nil
1514 c.urlParams_.Set("alt", alt)
1515 c.urlParams_.Set("prettyPrint", "false")
1516 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1517 urls += "?" + c.urlParams_.Encode()
1518 req, err := http.NewRequest("GET", urls, body)
1519 if err != nil {
1520 return nil, err
1521 }
1522 req.Header = reqHeaders
1523 googleapi.Expand(req.URL, map[string]string{
1524 "name": c.name,
1525 })
1526 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1527 }
1528
1529
1530
1531
1532
1533
1534 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
1535 gensupport.SetOptions(c.urlParams_, opts...)
1536 res, err := c.doRequest("json")
1537 if res != nil && res.StatusCode == http.StatusNotModified {
1538 if res.Body != nil {
1539 res.Body.Close()
1540 }
1541 return nil, gensupport.WrapError(&googleapi.Error{
1542 Code: res.StatusCode,
1543 Header: res.Header,
1544 })
1545 }
1546 if err != nil {
1547 return nil, err
1548 }
1549 defer googleapi.CloseBody(res)
1550 if err := googleapi.CheckResponse(res); err != nil {
1551 return nil, gensupport.WrapError(err)
1552 }
1553 ret := &Location{
1554 ServerResponse: googleapi.ServerResponse{
1555 Header: res.Header,
1556 HTTPStatusCode: res.StatusCode,
1557 },
1558 }
1559 target := &ret
1560 if err := gensupport.DecodeResponse(target, res); err != nil {
1561 return nil, err
1562 }
1563 return ret, nil
1564 }
1565
1566 type ProjectsLocationsListCall struct {
1567 s *Service
1568 name string
1569 urlParams_ gensupport.URLParams
1570 ifNoneMatch_ string
1571 ctx_ context.Context
1572 header_ http.Header
1573 }
1574
1575
1576
1577
1578 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
1579 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1580 c.name = name
1581 return c
1582 }
1583
1584
1585
1586
1587
1588 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
1589 c.urlParams_.Set("filter", filter)
1590 return c
1591 }
1592
1593
1594
1595
1596 func (c *ProjectsLocationsListCall) IncludeUnrevealedLocations(includeUnrevealedLocations bool) *ProjectsLocationsListCall {
1597 c.urlParams_.Set("includeUnrevealedLocations", fmt.Sprint(includeUnrevealedLocations))
1598 return c
1599 }
1600
1601
1602
1603 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
1604 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1605 return c
1606 }
1607
1608
1609
1610
1611 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
1612 c.urlParams_.Set("pageToken", pageToken)
1613 return c
1614 }
1615
1616
1617
1618
1619 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
1620 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1621 return c
1622 }
1623
1624
1625
1626
1627 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
1628 c.ifNoneMatch_ = entityTag
1629 return c
1630 }
1631
1632
1633 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
1634 c.ctx_ = ctx
1635 return c
1636 }
1637
1638
1639
1640 func (c *ProjectsLocationsListCall) Header() http.Header {
1641 if c.header_ == nil {
1642 c.header_ = make(http.Header)
1643 }
1644 return c.header_
1645 }
1646
1647 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
1648 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1649 if c.ifNoneMatch_ != "" {
1650 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1651 }
1652 var body io.Reader = nil
1653 c.urlParams_.Set("alt", alt)
1654 c.urlParams_.Set("prettyPrint", "false")
1655 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
1656 urls += "?" + c.urlParams_.Encode()
1657 req, err := http.NewRequest("GET", urls, body)
1658 if err != nil {
1659 return nil, err
1660 }
1661 req.Header = reqHeaders
1662 googleapi.Expand(req.URL, map[string]string{
1663 "name": c.name,
1664 })
1665 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1666 }
1667
1668
1669
1670
1671
1672
1673
1674 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
1675 gensupport.SetOptions(c.urlParams_, opts...)
1676 res, err := c.doRequest("json")
1677 if res != nil && res.StatusCode == http.StatusNotModified {
1678 if res.Body != nil {
1679 res.Body.Close()
1680 }
1681 return nil, gensupport.WrapError(&googleapi.Error{
1682 Code: res.StatusCode,
1683 Header: res.Header,
1684 })
1685 }
1686 if err != nil {
1687 return nil, err
1688 }
1689 defer googleapi.CloseBody(res)
1690 if err := googleapi.CheckResponse(res); err != nil {
1691 return nil, gensupport.WrapError(err)
1692 }
1693 ret := &ListLocationsResponse{
1694 ServerResponse: googleapi.ServerResponse{
1695 Header: res.Header,
1696 HTTPStatusCode: res.StatusCode,
1697 },
1698 }
1699 target := &ret
1700 if err := gensupport.DecodeResponse(target, res); err != nil {
1701 return nil, err
1702 }
1703 return ret, nil
1704 }
1705
1706
1707
1708
1709 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
1710 c.ctx_ = ctx
1711 defer c.PageToken(c.urlParams_.Get("pageToken"))
1712 for {
1713 x, err := c.Do()
1714 if err != nil {
1715 return err
1716 }
1717 if err := f(x); err != nil {
1718 return err
1719 }
1720 if x.NextPageToken == "" {
1721 return nil
1722 }
1723 c.PageToken(x.NextPageToken)
1724 }
1725 }
1726
1727 type ProjectsLocationsInstancesCreateCall struct {
1728 s *Service
1729 parent string
1730 instance *Instance
1731 urlParams_ gensupport.URLParams
1732 ctx_ context.Context
1733 header_ http.Header
1734 }
1735
1736
1737
1738
1739
1740
1741 func (r *ProjectsLocationsInstancesService) Create(parent string, instance *Instance) *ProjectsLocationsInstancesCreateCall {
1742 c := &ProjectsLocationsInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1743 c.parent = parent
1744 c.instance = instance
1745 return c
1746 }
1747
1748
1749
1750
1751
1752 func (c *ProjectsLocationsInstancesCreateCall) InstanceId(instanceId string) *ProjectsLocationsInstancesCreateCall {
1753 c.urlParams_.Set("instanceId", instanceId)
1754 return c
1755 }
1756
1757
1758
1759
1760 func (c *ProjectsLocationsInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesCreateCall {
1761 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1762 return c
1763 }
1764
1765
1766 func (c *ProjectsLocationsInstancesCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesCreateCall {
1767 c.ctx_ = ctx
1768 return c
1769 }
1770
1771
1772
1773 func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header {
1774 if c.header_ == nil {
1775 c.header_ = make(http.Header)
1776 }
1777 return c.header_
1778 }
1779
1780 func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) {
1781 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1782 var body io.Reader = nil
1783 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
1784 if err != nil {
1785 return nil, err
1786 }
1787 c.urlParams_.Set("alt", alt)
1788 c.urlParams_.Set("prettyPrint", "false")
1789 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances")
1790 urls += "?" + c.urlParams_.Encode()
1791 req, err := http.NewRequest("POST", urls, body)
1792 if err != nil {
1793 return nil, err
1794 }
1795 req.Header = reqHeaders
1796 googleapi.Expand(req.URL, map[string]string{
1797 "parent": c.parent,
1798 })
1799 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1800 }
1801
1802
1803
1804
1805
1806
1807 func (c *ProjectsLocationsInstancesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1808 gensupport.SetOptions(c.urlParams_, opts...)
1809 res, err := c.doRequest("json")
1810 if res != nil && res.StatusCode == http.StatusNotModified {
1811 if res.Body != nil {
1812 res.Body.Close()
1813 }
1814 return nil, gensupport.WrapError(&googleapi.Error{
1815 Code: res.StatusCode,
1816 Header: res.Header,
1817 })
1818 }
1819 if err != nil {
1820 return nil, err
1821 }
1822 defer googleapi.CloseBody(res)
1823 if err := googleapi.CheckResponse(res); err != nil {
1824 return nil, gensupport.WrapError(err)
1825 }
1826 ret := &Operation{
1827 ServerResponse: googleapi.ServerResponse{
1828 Header: res.Header,
1829 HTTPStatusCode: res.StatusCode,
1830 },
1831 }
1832 target := &ret
1833 if err := gensupport.DecodeResponse(target, res); err != nil {
1834 return nil, err
1835 }
1836 return ret, nil
1837 }
1838
1839 type ProjectsLocationsInstancesDeleteCall struct {
1840 s *Service
1841 name string
1842 urlParams_ gensupport.URLParams
1843 ctx_ context.Context
1844 header_ http.Header
1845 }
1846
1847
1848
1849
1850
1851 func (r *ProjectsLocationsInstancesService) Delete(name string) *ProjectsLocationsInstancesDeleteCall {
1852 c := &ProjectsLocationsInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1853 c.name = name
1854 return c
1855 }
1856
1857
1858
1859
1860 func (c *ProjectsLocationsInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDeleteCall {
1861 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1862 return c
1863 }
1864
1865
1866 func (c *ProjectsLocationsInstancesDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesDeleteCall {
1867 c.ctx_ = ctx
1868 return c
1869 }
1870
1871
1872
1873 func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header {
1874 if c.header_ == nil {
1875 c.header_ = make(http.Header)
1876 }
1877 return c.header_
1878 }
1879
1880 func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
1881 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1882 var body io.Reader = nil
1883 c.urlParams_.Set("alt", alt)
1884 c.urlParams_.Set("prettyPrint", "false")
1885 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1886 urls += "?" + c.urlParams_.Encode()
1887 req, err := http.NewRequest("DELETE", urls, body)
1888 if err != nil {
1889 return nil, err
1890 }
1891 req.Header = reqHeaders
1892 googleapi.Expand(req.URL, map[string]string{
1893 "name": c.name,
1894 })
1895 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1896 }
1897
1898
1899
1900
1901
1902
1903 func (c *ProjectsLocationsInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1904 gensupport.SetOptions(c.urlParams_, opts...)
1905 res, err := c.doRequest("json")
1906 if res != nil && res.StatusCode == http.StatusNotModified {
1907 if res.Body != nil {
1908 res.Body.Close()
1909 }
1910 return nil, gensupport.WrapError(&googleapi.Error{
1911 Code: res.StatusCode,
1912 Header: res.Header,
1913 })
1914 }
1915 if err != nil {
1916 return nil, err
1917 }
1918 defer googleapi.CloseBody(res)
1919 if err := googleapi.CheckResponse(res); err != nil {
1920 return nil, gensupport.WrapError(err)
1921 }
1922 ret := &Operation{
1923 ServerResponse: googleapi.ServerResponse{
1924 Header: res.Header,
1925 HTTPStatusCode: res.StatusCode,
1926 },
1927 }
1928 target := &ret
1929 if err := gensupport.DecodeResponse(target, res); err != nil {
1930 return nil, err
1931 }
1932 return ret, nil
1933 }
1934
1935 type ProjectsLocationsInstancesGetCall struct {
1936 s *Service
1937 name string
1938 urlParams_ gensupport.URLParams
1939 ifNoneMatch_ string
1940 ctx_ context.Context
1941 header_ http.Header
1942 }
1943
1944
1945
1946
1947
1948 func (r *ProjectsLocationsInstancesService) Get(name string) *ProjectsLocationsInstancesGetCall {
1949 c := &ProjectsLocationsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1950 c.name = name
1951 return c
1952 }
1953
1954
1955
1956
1957 func (c *ProjectsLocationsInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetCall {
1958 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1959 return c
1960 }
1961
1962
1963
1964
1965 func (c *ProjectsLocationsInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetCall {
1966 c.ifNoneMatch_ = entityTag
1967 return c
1968 }
1969
1970
1971 func (c *ProjectsLocationsInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetCall {
1972 c.ctx_ = ctx
1973 return c
1974 }
1975
1976
1977
1978 func (c *ProjectsLocationsInstancesGetCall) Header() http.Header {
1979 if c.header_ == nil {
1980 c.header_ = make(http.Header)
1981 }
1982 return c.header_
1983 }
1984
1985 func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Response, error) {
1986 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1987 if c.ifNoneMatch_ != "" {
1988 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1989 }
1990 var body io.Reader = nil
1991 c.urlParams_.Set("alt", alt)
1992 c.urlParams_.Set("prettyPrint", "false")
1993 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1994 urls += "?" + c.urlParams_.Encode()
1995 req, err := http.NewRequest("GET", urls, body)
1996 if err != nil {
1997 return nil, err
1998 }
1999 req.Header = reqHeaders
2000 googleapi.Expand(req.URL, map[string]string{
2001 "name": c.name,
2002 })
2003 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2004 }
2005
2006
2007
2008
2009
2010
2011 func (c *ProjectsLocationsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
2012 gensupport.SetOptions(c.urlParams_, opts...)
2013 res, err := c.doRequest("json")
2014 if res != nil && res.StatusCode == http.StatusNotModified {
2015 if res.Body != nil {
2016 res.Body.Close()
2017 }
2018 return nil, gensupport.WrapError(&googleapi.Error{
2019 Code: res.StatusCode,
2020 Header: res.Header,
2021 })
2022 }
2023 if err != nil {
2024 return nil, err
2025 }
2026 defer googleapi.CloseBody(res)
2027 if err := googleapi.CheckResponse(res); err != nil {
2028 return nil, gensupport.WrapError(err)
2029 }
2030 ret := &Instance{
2031 ServerResponse: googleapi.ServerResponse{
2032 Header: res.Header,
2033 HTTPStatusCode: res.StatusCode,
2034 },
2035 }
2036 target := &ret
2037 if err := gensupport.DecodeResponse(target, res); err != nil {
2038 return nil, err
2039 }
2040 return ret, nil
2041 }
2042
2043 type ProjectsLocationsInstancesGetIamPolicyCall struct {
2044 s *Service
2045 resource string
2046 urlParams_ gensupport.URLParams
2047 ifNoneMatch_ string
2048 ctx_ context.Context
2049 header_ http.Header
2050 }
2051
2052
2053
2054
2055
2056
2057
2058 func (r *ProjectsLocationsInstancesService) GetIamPolicy(resource string) *ProjectsLocationsInstancesGetIamPolicyCall {
2059 c := &ProjectsLocationsInstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2060 c.resource = resource
2061 return c
2062 }
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076 func (c *ProjectsLocationsInstancesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsInstancesGetIamPolicyCall {
2077 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
2078 return c
2079 }
2080
2081
2082
2083
2084 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetIamPolicyCall {
2085 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2086 return c
2087 }
2088
2089
2090
2091
2092 func (c *ProjectsLocationsInstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetIamPolicyCall {
2093 c.ifNoneMatch_ = entityTag
2094 return c
2095 }
2096
2097
2098 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetIamPolicyCall {
2099 c.ctx_ = ctx
2100 return c
2101 }
2102
2103
2104
2105 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Header() http.Header {
2106 if c.header_ == nil {
2107 c.header_ = make(http.Header)
2108 }
2109 return c.header_
2110 }
2111
2112 func (c *ProjectsLocationsInstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2113 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2114 if c.ifNoneMatch_ != "" {
2115 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2116 }
2117 var body io.Reader = nil
2118 c.urlParams_.Set("alt", alt)
2119 c.urlParams_.Set("prettyPrint", "false")
2120 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
2121 urls += "?" + c.urlParams_.Encode()
2122 req, err := http.NewRequest("GET", urls, body)
2123 if err != nil {
2124 return nil, err
2125 }
2126 req.Header = reqHeaders
2127 googleapi.Expand(req.URL, map[string]string{
2128 "resource": c.resource,
2129 })
2130 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2131 }
2132
2133
2134
2135
2136
2137
2138 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2139 gensupport.SetOptions(c.urlParams_, opts...)
2140 res, err := c.doRequest("json")
2141 if res != nil && res.StatusCode == http.StatusNotModified {
2142 if res.Body != nil {
2143 res.Body.Close()
2144 }
2145 return nil, gensupport.WrapError(&googleapi.Error{
2146 Code: res.StatusCode,
2147 Header: res.Header,
2148 })
2149 }
2150 if err != nil {
2151 return nil, err
2152 }
2153 defer googleapi.CloseBody(res)
2154 if err := googleapi.CheckResponse(res); err != nil {
2155 return nil, gensupport.WrapError(err)
2156 }
2157 ret := &Policy{
2158 ServerResponse: googleapi.ServerResponse{
2159 Header: res.Header,
2160 HTTPStatusCode: res.StatusCode,
2161 },
2162 }
2163 target := &ret
2164 if err := gensupport.DecodeResponse(target, res); err != nil {
2165 return nil, err
2166 }
2167 return ret, nil
2168 }
2169
2170 type ProjectsLocationsInstancesListCall struct {
2171 s *Service
2172 parent string
2173 urlParams_ gensupport.URLParams
2174 ifNoneMatch_ string
2175 ctx_ context.Context
2176 header_ http.Header
2177 }
2178
2179
2180
2181
2182
2183
2184
2185 func (r *ProjectsLocationsInstancesService) List(parent string) *ProjectsLocationsInstancesListCall {
2186 c := &ProjectsLocationsInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2187 c.parent = parent
2188 return c
2189 }
2190
2191
2192 func (c *ProjectsLocationsInstancesListCall) Filter(filter string) *ProjectsLocationsInstancesListCall {
2193 c.urlParams_.Set("filter", filter)
2194 return c
2195 }
2196
2197
2198
2199 func (c *ProjectsLocationsInstancesListCall) OrderBy(orderBy string) *ProjectsLocationsInstancesListCall {
2200 c.urlParams_.Set("orderBy", orderBy)
2201 return c
2202 }
2203
2204
2205
2206 func (c *ProjectsLocationsInstancesListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesListCall {
2207 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2208 return c
2209 }
2210
2211
2212
2213 func (c *ProjectsLocationsInstancesListCall) PageToken(pageToken string) *ProjectsLocationsInstancesListCall {
2214 c.urlParams_.Set("pageToken", pageToken)
2215 return c
2216 }
2217
2218
2219
2220
2221 func (c *ProjectsLocationsInstancesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesListCall {
2222 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2223 return c
2224 }
2225
2226
2227
2228
2229 func (c *ProjectsLocationsInstancesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesListCall {
2230 c.ifNoneMatch_ = entityTag
2231 return c
2232 }
2233
2234
2235 func (c *ProjectsLocationsInstancesListCall) Context(ctx context.Context) *ProjectsLocationsInstancesListCall {
2236 c.ctx_ = ctx
2237 return c
2238 }
2239
2240
2241
2242 func (c *ProjectsLocationsInstancesListCall) Header() http.Header {
2243 if c.header_ == nil {
2244 c.header_ = make(http.Header)
2245 }
2246 return c.header_
2247 }
2248
2249 func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Response, error) {
2250 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2251 if c.ifNoneMatch_ != "" {
2252 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2253 }
2254 var body io.Reader = nil
2255 c.urlParams_.Set("alt", alt)
2256 c.urlParams_.Set("prettyPrint", "false")
2257 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances")
2258 urls += "?" + c.urlParams_.Encode()
2259 req, err := http.NewRequest("GET", urls, body)
2260 if err != nil {
2261 return nil, err
2262 }
2263 req.Header = reqHeaders
2264 googleapi.Expand(req.URL, map[string]string{
2265 "parent": c.parent,
2266 })
2267 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2268 }
2269
2270
2271
2272
2273
2274
2275
2276 func (c *ProjectsLocationsInstancesListCall) Do(opts ...googleapi.CallOption) (*ListInstancesResponse, error) {
2277 gensupport.SetOptions(c.urlParams_, opts...)
2278 res, err := c.doRequest("json")
2279 if res != nil && res.StatusCode == http.StatusNotModified {
2280 if res.Body != nil {
2281 res.Body.Close()
2282 }
2283 return nil, gensupport.WrapError(&googleapi.Error{
2284 Code: res.StatusCode,
2285 Header: res.Header,
2286 })
2287 }
2288 if err != nil {
2289 return nil, err
2290 }
2291 defer googleapi.CloseBody(res)
2292 if err := googleapi.CheckResponse(res); err != nil {
2293 return nil, gensupport.WrapError(err)
2294 }
2295 ret := &ListInstancesResponse{
2296 ServerResponse: googleapi.ServerResponse{
2297 Header: res.Header,
2298 HTTPStatusCode: res.StatusCode,
2299 },
2300 }
2301 target := &ret
2302 if err := gensupport.DecodeResponse(target, res); err != nil {
2303 return nil, err
2304 }
2305 return ret, nil
2306 }
2307
2308
2309
2310
2311 func (c *ProjectsLocationsInstancesListCall) Pages(ctx context.Context, f func(*ListInstancesResponse) error) error {
2312 c.ctx_ = ctx
2313 defer c.PageToken(c.urlParams_.Get("pageToken"))
2314 for {
2315 x, err := c.Do()
2316 if err != nil {
2317 return err
2318 }
2319 if err := f(x); err != nil {
2320 return err
2321 }
2322 if x.NextPageToken == "" {
2323 return nil
2324 }
2325 c.PageToken(x.NextPageToken)
2326 }
2327 }
2328
2329 type ProjectsLocationsInstancesPatchCall struct {
2330 s *Service
2331 name string
2332 instance *Instance
2333 urlParams_ gensupport.URLParams
2334 ctx_ context.Context
2335 header_ http.Header
2336 }
2337
2338
2339
2340
2341
2342 func (r *ProjectsLocationsInstancesService) Patch(name string, instance *Instance) *ProjectsLocationsInstancesPatchCall {
2343 c := &ProjectsLocationsInstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2344 c.name = name
2345 c.instance = instance
2346 return c
2347 }
2348
2349
2350
2351
2352
2353
2354 func (c *ProjectsLocationsInstancesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsInstancesPatchCall {
2355 c.urlParams_.Set("updateMask", updateMask)
2356 return c
2357 }
2358
2359
2360
2361
2362 func (c *ProjectsLocationsInstancesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesPatchCall {
2363 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2364 return c
2365 }
2366
2367
2368 func (c *ProjectsLocationsInstancesPatchCall) Context(ctx context.Context) *ProjectsLocationsInstancesPatchCall {
2369 c.ctx_ = ctx
2370 return c
2371 }
2372
2373
2374
2375 func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header {
2376 if c.header_ == nil {
2377 c.header_ = make(http.Header)
2378 }
2379 return c.header_
2380 }
2381
2382 func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) {
2383 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2384 var body io.Reader = nil
2385 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
2386 if err != nil {
2387 return nil, err
2388 }
2389 c.urlParams_.Set("alt", alt)
2390 c.urlParams_.Set("prettyPrint", "false")
2391 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2392 urls += "?" + c.urlParams_.Encode()
2393 req, err := http.NewRequest("PATCH", urls, body)
2394 if err != nil {
2395 return nil, err
2396 }
2397 req.Header = reqHeaders
2398 googleapi.Expand(req.URL, map[string]string{
2399 "name": c.name,
2400 })
2401 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2402 }
2403
2404
2405
2406
2407
2408
2409 func (c *ProjectsLocationsInstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2410 gensupport.SetOptions(c.urlParams_, opts...)
2411 res, err := c.doRequest("json")
2412 if res != nil && res.StatusCode == http.StatusNotModified {
2413 if res.Body != nil {
2414 res.Body.Close()
2415 }
2416 return nil, gensupport.WrapError(&googleapi.Error{
2417 Code: res.StatusCode,
2418 Header: res.Header,
2419 })
2420 }
2421 if err != nil {
2422 return nil, err
2423 }
2424 defer googleapi.CloseBody(res)
2425 if err := googleapi.CheckResponse(res); err != nil {
2426 return nil, gensupport.WrapError(err)
2427 }
2428 ret := &Operation{
2429 ServerResponse: googleapi.ServerResponse{
2430 Header: res.Header,
2431 HTTPStatusCode: res.StatusCode,
2432 },
2433 }
2434 target := &ret
2435 if err := gensupport.DecodeResponse(target, res); err != nil {
2436 return nil, err
2437 }
2438 return ret, nil
2439 }
2440
2441 type ProjectsLocationsInstancesRestartCall struct {
2442 s *Service
2443 name string
2444 restartinstancerequest *RestartInstanceRequest
2445 urlParams_ gensupport.URLParams
2446 ctx_ context.Context
2447 header_ http.Header
2448 }
2449
2450
2451
2452
2453
2454
2455 func (r *ProjectsLocationsInstancesService) Restart(name string, restartinstancerequest *RestartInstanceRequest) *ProjectsLocationsInstancesRestartCall {
2456 c := &ProjectsLocationsInstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2457 c.name = name
2458 c.restartinstancerequest = restartinstancerequest
2459 return c
2460 }
2461
2462
2463
2464
2465 func (c *ProjectsLocationsInstancesRestartCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesRestartCall {
2466 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2467 return c
2468 }
2469
2470
2471 func (c *ProjectsLocationsInstancesRestartCall) Context(ctx context.Context) *ProjectsLocationsInstancesRestartCall {
2472 c.ctx_ = ctx
2473 return c
2474 }
2475
2476
2477
2478 func (c *ProjectsLocationsInstancesRestartCall) Header() http.Header {
2479 if c.header_ == nil {
2480 c.header_ = make(http.Header)
2481 }
2482 return c.header_
2483 }
2484
2485 func (c *ProjectsLocationsInstancesRestartCall) doRequest(alt string) (*http.Response, error) {
2486 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2487 var body io.Reader = nil
2488 body, err := googleapi.WithoutDataWrapper.JSONReader(c.restartinstancerequest)
2489 if err != nil {
2490 return nil, err
2491 }
2492 c.urlParams_.Set("alt", alt)
2493 c.urlParams_.Set("prettyPrint", "false")
2494 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:restart")
2495 urls += "?" + c.urlParams_.Encode()
2496 req, err := http.NewRequest("POST", urls, body)
2497 if err != nil {
2498 return nil, err
2499 }
2500 req.Header = reqHeaders
2501 googleapi.Expand(req.URL, map[string]string{
2502 "name": c.name,
2503 })
2504 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2505 }
2506
2507
2508
2509
2510
2511
2512 func (c *ProjectsLocationsInstancesRestartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2513 gensupport.SetOptions(c.urlParams_, opts...)
2514 res, err := c.doRequest("json")
2515 if res != nil && res.StatusCode == http.StatusNotModified {
2516 if res.Body != nil {
2517 res.Body.Close()
2518 }
2519 return nil, gensupport.WrapError(&googleapi.Error{
2520 Code: res.StatusCode,
2521 Header: res.Header,
2522 })
2523 }
2524 if err != nil {
2525 return nil, err
2526 }
2527 defer googleapi.CloseBody(res)
2528 if err := googleapi.CheckResponse(res); err != nil {
2529 return nil, gensupport.WrapError(err)
2530 }
2531 ret := &Operation{
2532 ServerResponse: googleapi.ServerResponse{
2533 Header: res.Header,
2534 HTTPStatusCode: res.StatusCode,
2535 },
2536 }
2537 target := &ret
2538 if err := gensupport.DecodeResponse(target, res); err != nil {
2539 return nil, err
2540 }
2541 return ret, nil
2542 }
2543
2544 type ProjectsLocationsInstancesSetIamPolicyCall struct {
2545 s *Service
2546 resource string
2547 setiampolicyrequest *SetIamPolicyRequest
2548 urlParams_ gensupport.URLParams
2549 ctx_ context.Context
2550 header_ http.Header
2551 }
2552
2553
2554
2555
2556
2557
2558
2559
2560 func (r *ProjectsLocationsInstancesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsInstancesSetIamPolicyCall {
2561 c := &ProjectsLocationsInstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2562 c.resource = resource
2563 c.setiampolicyrequest = setiampolicyrequest
2564 return c
2565 }
2566
2567
2568
2569
2570 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesSetIamPolicyCall {
2571 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2572 return c
2573 }
2574
2575
2576 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInstancesSetIamPolicyCall {
2577 c.ctx_ = ctx
2578 return c
2579 }
2580
2581
2582
2583 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Header() http.Header {
2584 if c.header_ == nil {
2585 c.header_ = make(http.Header)
2586 }
2587 return c.header_
2588 }
2589
2590 func (c *ProjectsLocationsInstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2591 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2592 var body io.Reader = nil
2593 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
2594 if err != nil {
2595 return nil, err
2596 }
2597 c.urlParams_.Set("alt", alt)
2598 c.urlParams_.Set("prettyPrint", "false")
2599 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
2600 urls += "?" + c.urlParams_.Encode()
2601 req, err := http.NewRequest("POST", urls, body)
2602 if err != nil {
2603 return nil, err
2604 }
2605 req.Header = reqHeaders
2606 googleapi.Expand(req.URL, map[string]string{
2607 "resource": c.resource,
2608 })
2609 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2610 }
2611
2612
2613
2614
2615
2616
2617 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2618 gensupport.SetOptions(c.urlParams_, opts...)
2619 res, err := c.doRequest("json")
2620 if res != nil && res.StatusCode == http.StatusNotModified {
2621 if res.Body != nil {
2622 res.Body.Close()
2623 }
2624 return nil, gensupport.WrapError(&googleapi.Error{
2625 Code: res.StatusCode,
2626 Header: res.Header,
2627 })
2628 }
2629 if err != nil {
2630 return nil, err
2631 }
2632 defer googleapi.CloseBody(res)
2633 if err := googleapi.CheckResponse(res); err != nil {
2634 return nil, gensupport.WrapError(err)
2635 }
2636 ret := &Policy{
2637 ServerResponse: googleapi.ServerResponse{
2638 Header: res.Header,
2639 HTTPStatusCode: res.StatusCode,
2640 },
2641 }
2642 target := &ret
2643 if err := gensupport.DecodeResponse(target, res); err != nil {
2644 return nil, err
2645 }
2646 return ret, nil
2647 }
2648
2649 type ProjectsLocationsInstancesTestIamPermissionsCall struct {
2650 s *Service
2651 resource string
2652 testiampermissionsrequest *TestIamPermissionsRequest
2653 urlParams_ gensupport.URLParams
2654 ctx_ context.Context
2655 header_ http.Header
2656 }
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668 func (r *ProjectsLocationsInstancesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsInstancesTestIamPermissionsCall {
2669 c := &ProjectsLocationsInstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2670 c.resource = resource
2671 c.testiampermissionsrequest = testiampermissionsrequest
2672 return c
2673 }
2674
2675
2676
2677
2678 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesTestIamPermissionsCall {
2679 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2680 return c
2681 }
2682
2683
2684 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsInstancesTestIamPermissionsCall {
2685 c.ctx_ = ctx
2686 return c
2687 }
2688
2689
2690
2691 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Header() http.Header {
2692 if c.header_ == nil {
2693 c.header_ = make(http.Header)
2694 }
2695 return c.header_
2696 }
2697
2698 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
2699 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2700 var body io.Reader = nil
2701 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
2702 if err != nil {
2703 return nil, err
2704 }
2705 c.urlParams_.Set("alt", alt)
2706 c.urlParams_.Set("prettyPrint", "false")
2707 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
2708 urls += "?" + c.urlParams_.Encode()
2709 req, err := http.NewRequest("POST", urls, body)
2710 if err != nil {
2711 return nil, err
2712 }
2713 req.Header = reqHeaders
2714 googleapi.Expand(req.URL, map[string]string{
2715 "resource": c.resource,
2716 })
2717 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2718 }
2719
2720
2721
2722
2723
2724
2725
2726 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
2727 gensupport.SetOptions(c.urlParams_, opts...)
2728 res, err := c.doRequest("json")
2729 if res != nil && res.StatusCode == http.StatusNotModified {
2730 if res.Body != nil {
2731 res.Body.Close()
2732 }
2733 return nil, gensupport.WrapError(&googleapi.Error{
2734 Code: res.StatusCode,
2735 Header: res.Header,
2736 })
2737 }
2738 if err != nil {
2739 return nil, err
2740 }
2741 defer googleapi.CloseBody(res)
2742 if err := googleapi.CheckResponse(res); err != nil {
2743 return nil, gensupport.WrapError(err)
2744 }
2745 ret := &TestIamPermissionsResponse{
2746 ServerResponse: googleapi.ServerResponse{
2747 Header: res.Header,
2748 HTTPStatusCode: res.StatusCode,
2749 },
2750 }
2751 target := &ret
2752 if err := gensupport.DecodeResponse(target, res); err != nil {
2753 return nil, err
2754 }
2755 return ret, nil
2756 }
2757
2758 type ProjectsLocationsInstancesDnsPeeringsCreateCall struct {
2759 s *Service
2760 parent string
2761 dnspeering *DnsPeering
2762 urlParams_ gensupport.URLParams
2763 ctx_ context.Context
2764 header_ http.Header
2765 }
2766
2767
2768
2769
2770 func (r *ProjectsLocationsInstancesDnsPeeringsService) Create(parent string, dnspeering *DnsPeering) *ProjectsLocationsInstancesDnsPeeringsCreateCall {
2771 c := &ProjectsLocationsInstancesDnsPeeringsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2772 c.parent = parent
2773 c.dnspeering = dnspeering
2774 return c
2775 }
2776
2777
2778
2779 func (c *ProjectsLocationsInstancesDnsPeeringsCreateCall) DnsPeeringId(dnsPeeringId string) *ProjectsLocationsInstancesDnsPeeringsCreateCall {
2780 c.urlParams_.Set("dnsPeeringId", dnsPeeringId)
2781 return c
2782 }
2783
2784
2785
2786
2787 func (c *ProjectsLocationsInstancesDnsPeeringsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDnsPeeringsCreateCall {
2788 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2789 return c
2790 }
2791
2792
2793 func (c *ProjectsLocationsInstancesDnsPeeringsCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesDnsPeeringsCreateCall {
2794 c.ctx_ = ctx
2795 return c
2796 }
2797
2798
2799
2800 func (c *ProjectsLocationsInstancesDnsPeeringsCreateCall) Header() http.Header {
2801 if c.header_ == nil {
2802 c.header_ = make(http.Header)
2803 }
2804 return c.header_
2805 }
2806
2807 func (c *ProjectsLocationsInstancesDnsPeeringsCreateCall) doRequest(alt string) (*http.Response, error) {
2808 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2809 var body io.Reader = nil
2810 body, err := googleapi.WithoutDataWrapper.JSONReader(c.dnspeering)
2811 if err != nil {
2812 return nil, err
2813 }
2814 c.urlParams_.Set("alt", alt)
2815 c.urlParams_.Set("prettyPrint", "false")
2816 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dnsPeerings")
2817 urls += "?" + c.urlParams_.Encode()
2818 req, err := http.NewRequest("POST", urls, body)
2819 if err != nil {
2820 return nil, err
2821 }
2822 req.Header = reqHeaders
2823 googleapi.Expand(req.URL, map[string]string{
2824 "parent": c.parent,
2825 })
2826 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2827 }
2828
2829
2830
2831
2832
2833
2834 func (c *ProjectsLocationsInstancesDnsPeeringsCreateCall) Do(opts ...googleapi.CallOption) (*DnsPeering, error) {
2835 gensupport.SetOptions(c.urlParams_, opts...)
2836 res, err := c.doRequest("json")
2837 if res != nil && res.StatusCode == http.StatusNotModified {
2838 if res.Body != nil {
2839 res.Body.Close()
2840 }
2841 return nil, gensupport.WrapError(&googleapi.Error{
2842 Code: res.StatusCode,
2843 Header: res.Header,
2844 })
2845 }
2846 if err != nil {
2847 return nil, err
2848 }
2849 defer googleapi.CloseBody(res)
2850 if err := googleapi.CheckResponse(res); err != nil {
2851 return nil, gensupport.WrapError(err)
2852 }
2853 ret := &DnsPeering{
2854 ServerResponse: googleapi.ServerResponse{
2855 Header: res.Header,
2856 HTTPStatusCode: res.StatusCode,
2857 },
2858 }
2859 target := &ret
2860 if err := gensupport.DecodeResponse(target, res); err != nil {
2861 return nil, err
2862 }
2863 return ret, nil
2864 }
2865
2866 type ProjectsLocationsInstancesDnsPeeringsDeleteCall struct {
2867 s *Service
2868 name string
2869 urlParams_ gensupport.URLParams
2870 ctx_ context.Context
2871 header_ http.Header
2872 }
2873
2874
2875
2876
2877
2878
2879 func (r *ProjectsLocationsInstancesDnsPeeringsService) Delete(name string) *ProjectsLocationsInstancesDnsPeeringsDeleteCall {
2880 c := &ProjectsLocationsInstancesDnsPeeringsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2881 c.name = name
2882 return c
2883 }
2884
2885
2886
2887
2888 func (c *ProjectsLocationsInstancesDnsPeeringsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDnsPeeringsDeleteCall {
2889 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2890 return c
2891 }
2892
2893
2894 func (c *ProjectsLocationsInstancesDnsPeeringsDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesDnsPeeringsDeleteCall {
2895 c.ctx_ = ctx
2896 return c
2897 }
2898
2899
2900
2901 func (c *ProjectsLocationsInstancesDnsPeeringsDeleteCall) Header() http.Header {
2902 if c.header_ == nil {
2903 c.header_ = make(http.Header)
2904 }
2905 return c.header_
2906 }
2907
2908 func (c *ProjectsLocationsInstancesDnsPeeringsDeleteCall) doRequest(alt string) (*http.Response, error) {
2909 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2910 var body io.Reader = nil
2911 c.urlParams_.Set("alt", alt)
2912 c.urlParams_.Set("prettyPrint", "false")
2913 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2914 urls += "?" + c.urlParams_.Encode()
2915 req, err := http.NewRequest("DELETE", urls, body)
2916 if err != nil {
2917 return nil, err
2918 }
2919 req.Header = reqHeaders
2920 googleapi.Expand(req.URL, map[string]string{
2921 "name": c.name,
2922 })
2923 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2924 }
2925
2926
2927
2928
2929
2930
2931 func (c *ProjectsLocationsInstancesDnsPeeringsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2932 gensupport.SetOptions(c.urlParams_, opts...)
2933 res, err := c.doRequest("json")
2934 if res != nil && res.StatusCode == http.StatusNotModified {
2935 if res.Body != nil {
2936 res.Body.Close()
2937 }
2938 return nil, gensupport.WrapError(&googleapi.Error{
2939 Code: res.StatusCode,
2940 Header: res.Header,
2941 })
2942 }
2943 if err != nil {
2944 return nil, err
2945 }
2946 defer googleapi.CloseBody(res)
2947 if err := googleapi.CheckResponse(res); err != nil {
2948 return nil, gensupport.WrapError(err)
2949 }
2950 ret := &Empty{
2951 ServerResponse: googleapi.ServerResponse{
2952 Header: res.Header,
2953 HTTPStatusCode: res.StatusCode,
2954 },
2955 }
2956 target := &ret
2957 if err := gensupport.DecodeResponse(target, res); err != nil {
2958 return nil, err
2959 }
2960 return ret, nil
2961 }
2962
2963 type ProjectsLocationsInstancesDnsPeeringsListCall struct {
2964 s *Service
2965 parent string
2966 urlParams_ gensupport.URLParams
2967 ifNoneMatch_ string
2968 ctx_ context.Context
2969 header_ http.Header
2970 }
2971
2972
2973
2974
2975
2976 func (r *ProjectsLocationsInstancesDnsPeeringsService) List(parent string) *ProjectsLocationsInstancesDnsPeeringsListCall {
2977 c := &ProjectsLocationsInstancesDnsPeeringsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2978 c.parent = parent
2979 return c
2980 }
2981
2982
2983
2984
2985
2986 func (c *ProjectsLocationsInstancesDnsPeeringsListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesDnsPeeringsListCall {
2987 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2988 return c
2989 }
2990
2991
2992
2993
2994
2995 func (c *ProjectsLocationsInstancesDnsPeeringsListCall) PageToken(pageToken string) *ProjectsLocationsInstancesDnsPeeringsListCall {
2996 c.urlParams_.Set("pageToken", pageToken)
2997 return c
2998 }
2999
3000
3001
3002
3003 func (c *ProjectsLocationsInstancesDnsPeeringsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDnsPeeringsListCall {
3004 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3005 return c
3006 }
3007
3008
3009
3010
3011 func (c *ProjectsLocationsInstancesDnsPeeringsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesDnsPeeringsListCall {
3012 c.ifNoneMatch_ = entityTag
3013 return c
3014 }
3015
3016
3017 func (c *ProjectsLocationsInstancesDnsPeeringsListCall) Context(ctx context.Context) *ProjectsLocationsInstancesDnsPeeringsListCall {
3018 c.ctx_ = ctx
3019 return c
3020 }
3021
3022
3023
3024 func (c *ProjectsLocationsInstancesDnsPeeringsListCall) Header() http.Header {
3025 if c.header_ == nil {
3026 c.header_ = make(http.Header)
3027 }
3028 return c.header_
3029 }
3030
3031 func (c *ProjectsLocationsInstancesDnsPeeringsListCall) doRequest(alt string) (*http.Response, error) {
3032 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3033 if c.ifNoneMatch_ != "" {
3034 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3035 }
3036 var body io.Reader = nil
3037 c.urlParams_.Set("alt", alt)
3038 c.urlParams_.Set("prettyPrint", "false")
3039 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dnsPeerings")
3040 urls += "?" + c.urlParams_.Encode()
3041 req, err := http.NewRequest("GET", urls, body)
3042 if err != nil {
3043 return nil, err
3044 }
3045 req.Header = reqHeaders
3046 googleapi.Expand(req.URL, map[string]string{
3047 "parent": c.parent,
3048 })
3049 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3050 }
3051
3052
3053
3054
3055
3056
3057
3058 func (c *ProjectsLocationsInstancesDnsPeeringsListCall) Do(opts ...googleapi.CallOption) (*ListDnsPeeringsResponse, error) {
3059 gensupport.SetOptions(c.urlParams_, opts...)
3060 res, err := c.doRequest("json")
3061 if res != nil && res.StatusCode == http.StatusNotModified {
3062 if res.Body != nil {
3063 res.Body.Close()
3064 }
3065 return nil, gensupport.WrapError(&googleapi.Error{
3066 Code: res.StatusCode,
3067 Header: res.Header,
3068 })
3069 }
3070 if err != nil {
3071 return nil, err
3072 }
3073 defer googleapi.CloseBody(res)
3074 if err := googleapi.CheckResponse(res); err != nil {
3075 return nil, gensupport.WrapError(err)
3076 }
3077 ret := &ListDnsPeeringsResponse{
3078 ServerResponse: googleapi.ServerResponse{
3079 Header: res.Header,
3080 HTTPStatusCode: res.StatusCode,
3081 },
3082 }
3083 target := &ret
3084 if err := gensupport.DecodeResponse(target, res); err != nil {
3085 return nil, err
3086 }
3087 return ret, nil
3088 }
3089
3090
3091
3092
3093 func (c *ProjectsLocationsInstancesDnsPeeringsListCall) Pages(ctx context.Context, f func(*ListDnsPeeringsResponse) error) error {
3094 c.ctx_ = ctx
3095 defer c.PageToken(c.urlParams_.Get("pageToken"))
3096 for {
3097 x, err := c.Do()
3098 if err != nil {
3099 return err
3100 }
3101 if err := f(x); err != nil {
3102 return err
3103 }
3104 if x.NextPageToken == "" {
3105 return nil
3106 }
3107 c.PageToken(x.NextPageToken)
3108 }
3109 }
3110
3111 type ProjectsLocationsOperationsCancelCall struct {
3112 s *Service
3113 name string
3114 canceloperationrequest *CancelOperationRequest
3115 urlParams_ gensupport.URLParams
3116 ctx_ context.Context
3117 header_ http.Header
3118 }
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
3132 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3133 c.name = name
3134 c.canceloperationrequest = canceloperationrequest
3135 return c
3136 }
3137
3138
3139
3140
3141 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
3142 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3143 return c
3144 }
3145
3146
3147 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
3148 c.ctx_ = ctx
3149 return c
3150 }
3151
3152
3153
3154 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
3155 if c.header_ == nil {
3156 c.header_ = make(http.Header)
3157 }
3158 return c.header_
3159 }
3160
3161 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
3162 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3163 var body io.Reader = nil
3164 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
3165 if err != nil {
3166 return nil, err
3167 }
3168 c.urlParams_.Set("alt", alt)
3169 c.urlParams_.Set("prettyPrint", "false")
3170 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
3171 urls += "?" + c.urlParams_.Encode()
3172 req, err := http.NewRequest("POST", urls, body)
3173 if err != nil {
3174 return nil, err
3175 }
3176 req.Header = reqHeaders
3177 googleapi.Expand(req.URL, map[string]string{
3178 "name": c.name,
3179 })
3180 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3181 }
3182
3183
3184
3185
3186
3187
3188 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3189 gensupport.SetOptions(c.urlParams_, opts...)
3190 res, err := c.doRequest("json")
3191 if res != nil && res.StatusCode == http.StatusNotModified {
3192 if res.Body != nil {
3193 res.Body.Close()
3194 }
3195 return nil, gensupport.WrapError(&googleapi.Error{
3196 Code: res.StatusCode,
3197 Header: res.Header,
3198 })
3199 }
3200 if err != nil {
3201 return nil, err
3202 }
3203 defer googleapi.CloseBody(res)
3204 if err := googleapi.CheckResponse(res); err != nil {
3205 return nil, gensupport.WrapError(err)
3206 }
3207 ret := &Empty{
3208 ServerResponse: googleapi.ServerResponse{
3209 Header: res.Header,
3210 HTTPStatusCode: res.StatusCode,
3211 },
3212 }
3213 target := &ret
3214 if err := gensupport.DecodeResponse(target, res); err != nil {
3215 return nil, err
3216 }
3217 return ret, nil
3218 }
3219
3220 type ProjectsLocationsOperationsDeleteCall struct {
3221 s *Service
3222 name string
3223 urlParams_ gensupport.URLParams
3224 ctx_ context.Context
3225 header_ http.Header
3226 }
3227
3228
3229
3230
3231
3232
3233
3234 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
3235 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3236 c.name = name
3237 return c
3238 }
3239
3240
3241
3242
3243 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
3244 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3245 return c
3246 }
3247
3248
3249 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
3250 c.ctx_ = ctx
3251 return c
3252 }
3253
3254
3255
3256 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
3257 if c.header_ == nil {
3258 c.header_ = make(http.Header)
3259 }
3260 return c.header_
3261 }
3262
3263 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
3264 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3265 var body io.Reader = nil
3266 c.urlParams_.Set("alt", alt)
3267 c.urlParams_.Set("prettyPrint", "false")
3268 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3269 urls += "?" + c.urlParams_.Encode()
3270 req, err := http.NewRequest("DELETE", urls, body)
3271 if err != nil {
3272 return nil, err
3273 }
3274 req.Header = reqHeaders
3275 googleapi.Expand(req.URL, map[string]string{
3276 "name": c.name,
3277 })
3278 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3279 }
3280
3281
3282
3283
3284
3285
3286 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3287 gensupport.SetOptions(c.urlParams_, opts...)
3288 res, err := c.doRequest("json")
3289 if res != nil && res.StatusCode == http.StatusNotModified {
3290 if res.Body != nil {
3291 res.Body.Close()
3292 }
3293 return nil, gensupport.WrapError(&googleapi.Error{
3294 Code: res.StatusCode,
3295 Header: res.Header,
3296 })
3297 }
3298 if err != nil {
3299 return nil, err
3300 }
3301 defer googleapi.CloseBody(res)
3302 if err := googleapi.CheckResponse(res); err != nil {
3303 return nil, gensupport.WrapError(err)
3304 }
3305 ret := &Empty{
3306 ServerResponse: googleapi.ServerResponse{
3307 Header: res.Header,
3308 HTTPStatusCode: res.StatusCode,
3309 },
3310 }
3311 target := &ret
3312 if err := gensupport.DecodeResponse(target, res); err != nil {
3313 return nil, err
3314 }
3315 return ret, nil
3316 }
3317
3318 type ProjectsLocationsOperationsGetCall struct {
3319 s *Service
3320 name string
3321 urlParams_ gensupport.URLParams
3322 ifNoneMatch_ string
3323 ctx_ context.Context
3324 header_ http.Header
3325 }
3326
3327
3328
3329
3330
3331
3332 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
3333 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3334 c.name = name
3335 return c
3336 }
3337
3338
3339
3340
3341 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
3342 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3343 return c
3344 }
3345
3346
3347
3348
3349 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
3350 c.ifNoneMatch_ = entityTag
3351 return c
3352 }
3353
3354
3355 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
3356 c.ctx_ = ctx
3357 return c
3358 }
3359
3360
3361
3362 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
3363 if c.header_ == nil {
3364 c.header_ = make(http.Header)
3365 }
3366 return c.header_
3367 }
3368
3369 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
3370 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3371 if c.ifNoneMatch_ != "" {
3372 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3373 }
3374 var body io.Reader = nil
3375 c.urlParams_.Set("alt", alt)
3376 c.urlParams_.Set("prettyPrint", "false")
3377 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3378 urls += "?" + c.urlParams_.Encode()
3379 req, err := http.NewRequest("GET", urls, body)
3380 if err != nil {
3381 return nil, err
3382 }
3383 req.Header = reqHeaders
3384 googleapi.Expand(req.URL, map[string]string{
3385 "name": c.name,
3386 })
3387 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3388 }
3389
3390
3391
3392
3393
3394
3395 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3396 gensupport.SetOptions(c.urlParams_, opts...)
3397 res, err := c.doRequest("json")
3398 if res != nil && res.StatusCode == http.StatusNotModified {
3399 if res.Body != nil {
3400 res.Body.Close()
3401 }
3402 return nil, gensupport.WrapError(&googleapi.Error{
3403 Code: res.StatusCode,
3404 Header: res.Header,
3405 })
3406 }
3407 if err != nil {
3408 return nil, err
3409 }
3410 defer googleapi.CloseBody(res)
3411 if err := googleapi.CheckResponse(res); err != nil {
3412 return nil, gensupport.WrapError(err)
3413 }
3414 ret := &Operation{
3415 ServerResponse: googleapi.ServerResponse{
3416 Header: res.Header,
3417 HTTPStatusCode: res.StatusCode,
3418 },
3419 }
3420 target := &ret
3421 if err := gensupport.DecodeResponse(target, res); err != nil {
3422 return nil, err
3423 }
3424 return ret, nil
3425 }
3426
3427 type ProjectsLocationsOperationsListCall struct {
3428 s *Service
3429 name string
3430 urlParams_ gensupport.URLParams
3431 ifNoneMatch_ string
3432 ctx_ context.Context
3433 header_ http.Header
3434 }
3435
3436
3437
3438
3439
3440 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
3441 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3442 c.name = name
3443 return c
3444 }
3445
3446
3447 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
3448 c.urlParams_.Set("filter", filter)
3449 return c
3450 }
3451
3452
3453
3454 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
3455 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3456 return c
3457 }
3458
3459
3460
3461 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
3462 c.urlParams_.Set("pageToken", pageToken)
3463 return c
3464 }
3465
3466
3467
3468
3469 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
3470 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3471 return c
3472 }
3473
3474
3475
3476
3477 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
3478 c.ifNoneMatch_ = entityTag
3479 return c
3480 }
3481
3482
3483 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
3484 c.ctx_ = ctx
3485 return c
3486 }
3487
3488
3489
3490 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
3491 if c.header_ == nil {
3492 c.header_ = make(http.Header)
3493 }
3494 return c.header_
3495 }
3496
3497 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
3498 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3499 if c.ifNoneMatch_ != "" {
3500 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3501 }
3502 var body io.Reader = nil
3503 c.urlParams_.Set("alt", alt)
3504 c.urlParams_.Set("prettyPrint", "false")
3505 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
3506 urls += "?" + c.urlParams_.Encode()
3507 req, err := http.NewRequest("GET", urls, body)
3508 if err != nil {
3509 return nil, err
3510 }
3511 req.Header = reqHeaders
3512 googleapi.Expand(req.URL, map[string]string{
3513 "name": c.name,
3514 })
3515 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3516 }
3517
3518
3519
3520
3521
3522
3523
3524 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
3525 gensupport.SetOptions(c.urlParams_, opts...)
3526 res, err := c.doRequest("json")
3527 if res != nil && res.StatusCode == http.StatusNotModified {
3528 if res.Body != nil {
3529 res.Body.Close()
3530 }
3531 return nil, gensupport.WrapError(&googleapi.Error{
3532 Code: res.StatusCode,
3533 Header: res.Header,
3534 })
3535 }
3536 if err != nil {
3537 return nil, err
3538 }
3539 defer googleapi.CloseBody(res)
3540 if err := googleapi.CheckResponse(res); err != nil {
3541 return nil, gensupport.WrapError(err)
3542 }
3543 ret := &ListOperationsResponse{
3544 ServerResponse: googleapi.ServerResponse{
3545 Header: res.Header,
3546 HTTPStatusCode: res.StatusCode,
3547 },
3548 }
3549 target := &ret
3550 if err := gensupport.DecodeResponse(target, res); err != nil {
3551 return nil, err
3552 }
3553 return ret, nil
3554 }
3555
3556
3557
3558
3559 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
3560 c.ctx_ = ctx
3561 defer c.PageToken(c.urlParams_.Get("pageToken"))
3562 for {
3563 x, err := c.Do()
3564 if err != nil {
3565 return err
3566 }
3567 if err := f(x); err != nil {
3568 return err
3569 }
3570 if x.NextPageToken == "" {
3571 return nil
3572 }
3573 c.PageToken(x.NextPageToken)
3574 }
3575 }
3576
3577 type ProjectsLocationsVersionsListCall struct {
3578 s *Service
3579 parent string
3580 urlParams_ gensupport.URLParams
3581 ifNoneMatch_ string
3582 ctx_ context.Context
3583 header_ http.Header
3584 }
3585
3586
3587
3588
3589
3590
3591 func (r *ProjectsLocationsVersionsService) List(parent string) *ProjectsLocationsVersionsListCall {
3592 c := &ProjectsLocationsVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3593 c.parent = parent
3594 return c
3595 }
3596
3597
3598
3599
3600
3601 func (c *ProjectsLocationsVersionsListCall) LatestPatchOnly(latestPatchOnly bool) *ProjectsLocationsVersionsListCall {
3602 c.urlParams_.Set("latestPatchOnly", fmt.Sprint(latestPatchOnly))
3603 return c
3604 }
3605
3606
3607
3608 func (c *ProjectsLocationsVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsVersionsListCall {
3609 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3610 return c
3611 }
3612
3613
3614
3615 func (c *ProjectsLocationsVersionsListCall) PageToken(pageToken string) *ProjectsLocationsVersionsListCall {
3616 c.urlParams_.Set("pageToken", pageToken)
3617 return c
3618 }
3619
3620
3621
3622
3623 func (c *ProjectsLocationsVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsVersionsListCall {
3624 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3625 return c
3626 }
3627
3628
3629
3630
3631 func (c *ProjectsLocationsVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsVersionsListCall {
3632 c.ifNoneMatch_ = entityTag
3633 return c
3634 }
3635
3636
3637 func (c *ProjectsLocationsVersionsListCall) Context(ctx context.Context) *ProjectsLocationsVersionsListCall {
3638 c.ctx_ = ctx
3639 return c
3640 }
3641
3642
3643
3644 func (c *ProjectsLocationsVersionsListCall) Header() http.Header {
3645 if c.header_ == nil {
3646 c.header_ = make(http.Header)
3647 }
3648 return c.header_
3649 }
3650
3651 func (c *ProjectsLocationsVersionsListCall) doRequest(alt string) (*http.Response, error) {
3652 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3653 if c.ifNoneMatch_ != "" {
3654 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3655 }
3656 var body io.Reader = nil
3657 c.urlParams_.Set("alt", alt)
3658 c.urlParams_.Set("prettyPrint", "false")
3659 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions")
3660 urls += "?" + c.urlParams_.Encode()
3661 req, err := http.NewRequest("GET", urls, body)
3662 if err != nil {
3663 return nil, err
3664 }
3665 req.Header = reqHeaders
3666 googleapi.Expand(req.URL, map[string]string{
3667 "parent": c.parent,
3668 })
3669 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3670 }
3671
3672
3673
3674
3675
3676
3677
3678 func (c *ProjectsLocationsVersionsListCall) Do(opts ...googleapi.CallOption) (*ListAvailableVersionsResponse, error) {
3679 gensupport.SetOptions(c.urlParams_, opts...)
3680 res, err := c.doRequest("json")
3681 if res != nil && res.StatusCode == http.StatusNotModified {
3682 if res.Body != nil {
3683 res.Body.Close()
3684 }
3685 return nil, gensupport.WrapError(&googleapi.Error{
3686 Code: res.StatusCode,
3687 Header: res.Header,
3688 })
3689 }
3690 if err != nil {
3691 return nil, err
3692 }
3693 defer googleapi.CloseBody(res)
3694 if err := googleapi.CheckResponse(res); err != nil {
3695 return nil, gensupport.WrapError(err)
3696 }
3697 ret := &ListAvailableVersionsResponse{
3698 ServerResponse: googleapi.ServerResponse{
3699 Header: res.Header,
3700 HTTPStatusCode: res.StatusCode,
3701 },
3702 }
3703 target := &ret
3704 if err := gensupport.DecodeResponse(target, res); err != nil {
3705 return nil, err
3706 }
3707 return ret, nil
3708 }
3709
3710
3711
3712
3713 func (c *ProjectsLocationsVersionsListCall) Pages(ctx context.Context, f func(*ListAvailableVersionsResponse) error) error {
3714 c.ctx_ = ctx
3715 defer c.PageToken(c.urlParams_.Get("pageToken"))
3716 for {
3717 x, err := c.Do()
3718 if err != nil {
3719 return err
3720 }
3721 if err := f(x); err != nil {
3722 return err
3723 }
3724 if x.NextPageToken == "" {
3725 return nil
3726 }
3727 c.PageToken(x.NextPageToken)
3728 }
3729 }
3730
View as plain text