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