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