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