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 privateca
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 = "privateca:v1beta1"
90 const apiName = "privateca"
91 const apiVersion = "v1beta1"
92 const basePath = "https://privateca.googleapis.com/"
93 const basePathTemplate = "https://privateca.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://privateca.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.CertificateAuthorities = NewProjectsLocationsCertificateAuthoritiesService(s)
172 rs.Operations = NewProjectsLocationsOperationsService(s)
173 rs.ReusableConfigs = NewProjectsLocationsReusableConfigsService(s)
174 return rs
175 }
176
177 type ProjectsLocationsService struct {
178 s *Service
179
180 CertificateAuthorities *ProjectsLocationsCertificateAuthoritiesService
181
182 Operations *ProjectsLocationsOperationsService
183
184 ReusableConfigs *ProjectsLocationsReusableConfigsService
185 }
186
187 func NewProjectsLocationsCertificateAuthoritiesService(s *Service) *ProjectsLocationsCertificateAuthoritiesService {
188 rs := &ProjectsLocationsCertificateAuthoritiesService{s: s}
189 rs.CertificateRevocationLists = NewProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService(s)
190 return rs
191 }
192
193 type ProjectsLocationsCertificateAuthoritiesService struct {
194 s *Service
195
196 CertificateRevocationLists *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService
197 }
198
199 func NewProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService(s *Service) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService {
200 rs := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService{s: s}
201 return rs
202 }
203
204 type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService struct {
205 s *Service
206 }
207
208 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
209 rs := &ProjectsLocationsOperationsService{s: s}
210 return rs
211 }
212
213 type ProjectsLocationsOperationsService struct {
214 s *Service
215 }
216
217 func NewProjectsLocationsReusableConfigsService(s *Service) *ProjectsLocationsReusableConfigsService {
218 rs := &ProjectsLocationsReusableConfigsService{s: s}
219 return rs
220 }
221
222 type ProjectsLocationsReusableConfigsService struct {
223 s *Service
224 }
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242 type AuditConfig struct {
243
244 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
245
246
247
248 Service string `json:"service,omitempty"`
249
250
251
252
253
254 ForceSendFields []string `json:"-"`
255
256
257
258
259 NullFields []string `json:"-"`
260 }
261
262 func (s *AuditConfig) MarshalJSON() ([]byte, error) {
263 type NoMethod AuditConfig
264 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
265 }
266
267
268
269
270
271
272 type AuditLogConfig struct {
273
274
275 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
276
277
278
279
280
281
282
283 LogType string `json:"logType,omitempty"`
284
285
286
287
288
289 ForceSendFields []string `json:"-"`
290
291
292
293
294 NullFields []string `json:"-"`
295 }
296
297 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
298 type NoMethod AuditLogConfig
299 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
300 }
301
302
303 type Binding struct {
304
305
306
307
308
309
310
311
312 Condition *Expr `json:"condition,omitempty"`
313
314
315
316
317
318
319
320
321
322
323
324
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 Members []string `json:"members,omitempty"`
376
377
378
379
380
381
382 Role string `json:"role,omitempty"`
383
384
385
386
387
388 ForceSendFields []string `json:"-"`
389
390
391
392
393 NullFields []string `json:"-"`
394 }
395
396 func (s *Binding) MarshalJSON() ([]byte, error) {
397 type NoMethod Binding
398 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
399 }
400
401
402 type CancelOperationRequest struct {
403 }
404
405
406
407
408
409 type Empty struct {
410
411 googleapi.ServerResponse `json:"-"`
412 }
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430 type Expr struct {
431
432
433 Description string `json:"description,omitempty"`
434
435
436 Expression string `json:"expression,omitempty"`
437
438
439 Location string `json:"location,omitempty"`
440
441
442
443 Title string `json:"title,omitempty"`
444
445
446
447
448
449 ForceSendFields []string `json:"-"`
450
451
452
453
454 NullFields []string `json:"-"`
455 }
456
457 func (s *Expr) MarshalJSON() ([]byte, error) {
458 type NoMethod Expr
459 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
460 }
461
462
463 type ListLocationsResponse struct {
464
465
466 Locations []*Location `json:"locations,omitempty"`
467
468 NextPageToken string `json:"nextPageToken,omitempty"`
469
470
471 googleapi.ServerResponse `json:"-"`
472
473
474
475
476
477 ForceSendFields []string `json:"-"`
478
479
480
481
482 NullFields []string `json:"-"`
483 }
484
485 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
486 type NoMethod ListLocationsResponse
487 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
488 }
489
490
491 type ListOperationsResponse struct {
492
493 NextPageToken string `json:"nextPageToken,omitempty"`
494
495
496 Operations []*Operation `json:"operations,omitempty"`
497
498
499 googleapi.ServerResponse `json:"-"`
500
501
502
503
504
505 ForceSendFields []string `json:"-"`
506
507
508
509
510 NullFields []string `json:"-"`
511 }
512
513 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
514 type NoMethod ListOperationsResponse
515 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
516 }
517
518
519 type Location struct {
520
521
522 DisplayName string `json:"displayName,omitempty"`
523
524
525 Labels map[string]string `json:"labels,omitempty"`
526
527 LocationId string `json:"locationId,omitempty"`
528
529
530 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
531
532
533
534 Name string `json:"name,omitempty"`
535
536
537 googleapi.ServerResponse `json:"-"`
538
539
540
541
542
543 ForceSendFields []string `json:"-"`
544
545
546
547
548 NullFields []string `json:"-"`
549 }
550
551 func (s *Location) MarshalJSON() ([]byte, error) {
552 type NoMethod Location
553 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
554 }
555
556
557
558 type Operation struct {
559
560
561
562 Done bool `json:"done,omitempty"`
563
564 Error *Status `json:"error,omitempty"`
565
566
567
568
569 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
570
571
572
573 Name string `json:"name,omitempty"`
574
575
576
577
578
579
580
581 Response googleapi.RawMessage `json:"response,omitempty"`
582
583
584 googleapi.ServerResponse `json:"-"`
585
586
587
588
589
590 ForceSendFields []string `json:"-"`
591
592
593
594
595 NullFields []string `json:"-"`
596 }
597
598 func (s *Operation) MarshalJSON() ([]byte, error) {
599 type NoMethod Operation
600 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
601 }
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633 type Policy struct {
634
635 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
636
637
638
639
640
641
642
643
644
645 Bindings []*Binding `json:"bindings,omitempty"`
646
647
648
649
650
651
652
653
654
655
656
657 Etag string `json:"etag,omitempty"`
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673 Version int64 `json:"version,omitempty"`
674
675
676 googleapi.ServerResponse `json:"-"`
677
678
679
680
681
682 ForceSendFields []string `json:"-"`
683
684
685
686
687 NullFields []string `json:"-"`
688 }
689
690 func (s *Policy) MarshalJSON() ([]byte, error) {
691 type NoMethod Policy
692 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
693 }
694
695
696
697 type ReconciliationOperationMetadata struct {
698
699 DeleteResource bool `json:"deleteResource,omitempty"`
700
701
702
703
704
705
706
707
708
709
710
711 ExclusiveAction string `json:"exclusiveAction,omitempty"`
712
713
714
715
716
717 ForceSendFields []string `json:"-"`
718
719
720
721
722 NullFields []string `json:"-"`
723 }
724
725 func (s *ReconciliationOperationMetadata) MarshalJSON() ([]byte, error) {
726 type NoMethod ReconciliationOperationMetadata
727 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
728 }
729
730
731 type SetIamPolicyRequest struct {
732
733
734
735
736 Policy *Policy `json:"policy,omitempty"`
737
738
739
740 UpdateMask string `json:"updateMask,omitempty"`
741
742
743
744
745
746 ForceSendFields []string `json:"-"`
747
748
749
750
751 NullFields []string `json:"-"`
752 }
753
754 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
755 type NoMethod SetIamPolicyRequest
756 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
757 }
758
759
760
761
762
763
764
765 type Status struct {
766
767 Code int64 `json:"code,omitempty"`
768
769
770 Details []googleapi.RawMessage `json:"details,omitempty"`
771
772
773
774 Message string `json:"message,omitempty"`
775
776
777
778
779
780 ForceSendFields []string `json:"-"`
781
782
783
784
785 NullFields []string `json:"-"`
786 }
787
788 func (s *Status) MarshalJSON() ([]byte, error) {
789 type NoMethod Status
790 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
791 }
792
793
794 type TestIamPermissionsRequest struct {
795
796
797
798
799 Permissions []string `json:"permissions,omitempty"`
800
801
802
803
804
805 ForceSendFields []string `json:"-"`
806
807
808
809
810 NullFields []string `json:"-"`
811 }
812
813 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
814 type NoMethod TestIamPermissionsRequest
815 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
816 }
817
818
819
820 type TestIamPermissionsResponse struct {
821
822
823 Permissions []string `json:"permissions,omitempty"`
824
825
826 googleapi.ServerResponse `json:"-"`
827
828
829
830
831
832 ForceSendFields []string `json:"-"`
833
834
835
836
837 NullFields []string `json:"-"`
838 }
839
840 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
841 type NoMethod TestIamPermissionsResponse
842 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
843 }
844
845 type ProjectsLocationsGetCall struct {
846 s *Service
847 name string
848 urlParams_ gensupport.URLParams
849 ifNoneMatch_ string
850 ctx_ context.Context
851 header_ http.Header
852 }
853
854
855
856
857 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
858 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
859 c.name = name
860 return c
861 }
862
863
864
865
866 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
867 c.urlParams_.Set("fields", googleapi.CombineFields(s))
868 return c
869 }
870
871
872
873
874 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
875 c.ifNoneMatch_ = entityTag
876 return c
877 }
878
879
880 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
881 c.ctx_ = ctx
882 return c
883 }
884
885
886
887 func (c *ProjectsLocationsGetCall) Header() http.Header {
888 if c.header_ == nil {
889 c.header_ = make(http.Header)
890 }
891 return c.header_
892 }
893
894 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
895 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
896 if c.ifNoneMatch_ != "" {
897 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
898 }
899 var body io.Reader = nil
900 c.urlParams_.Set("alt", alt)
901 c.urlParams_.Set("prettyPrint", "false")
902 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
903 urls += "?" + c.urlParams_.Encode()
904 req, err := http.NewRequest("GET", urls, body)
905 if err != nil {
906 return nil, err
907 }
908 req.Header = reqHeaders
909 googleapi.Expand(req.URL, map[string]string{
910 "name": c.name,
911 })
912 return gensupport.SendRequest(c.ctx_, c.s.client, req)
913 }
914
915
916
917
918
919
920 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
921 gensupport.SetOptions(c.urlParams_, opts...)
922 res, err := c.doRequest("json")
923 if res != nil && res.StatusCode == http.StatusNotModified {
924 if res.Body != nil {
925 res.Body.Close()
926 }
927 return nil, gensupport.WrapError(&googleapi.Error{
928 Code: res.StatusCode,
929 Header: res.Header,
930 })
931 }
932 if err != nil {
933 return nil, err
934 }
935 defer googleapi.CloseBody(res)
936 if err := googleapi.CheckResponse(res); err != nil {
937 return nil, gensupport.WrapError(err)
938 }
939 ret := &Location{
940 ServerResponse: googleapi.ServerResponse{
941 Header: res.Header,
942 HTTPStatusCode: res.StatusCode,
943 },
944 }
945 target := &ret
946 if err := gensupport.DecodeResponse(target, res); err != nil {
947 return nil, err
948 }
949 return ret, nil
950 }
951
952 type ProjectsLocationsListCall struct {
953 s *Service
954 name string
955 urlParams_ gensupport.URLParams
956 ifNoneMatch_ string
957 ctx_ context.Context
958 header_ http.Header
959 }
960
961
962
963
964 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
965 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
966 c.name = name
967 return c
968 }
969
970
971
972
973
974 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
975 c.urlParams_.Set("filter", filter)
976 return c
977 }
978
979
980
981 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
982 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
983 return c
984 }
985
986
987
988
989 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
990 c.urlParams_.Set("pageToken", pageToken)
991 return c
992 }
993
994
995
996
997 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
998 c.urlParams_.Set("fields", googleapi.CombineFields(s))
999 return c
1000 }
1001
1002
1003
1004
1005 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
1006 c.ifNoneMatch_ = entityTag
1007 return c
1008 }
1009
1010
1011 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
1012 c.ctx_ = ctx
1013 return c
1014 }
1015
1016
1017
1018 func (c *ProjectsLocationsListCall) Header() http.Header {
1019 if c.header_ == nil {
1020 c.header_ = make(http.Header)
1021 }
1022 return c.header_
1023 }
1024
1025 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
1026 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1027 if c.ifNoneMatch_ != "" {
1028 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1029 }
1030 var body io.Reader = nil
1031 c.urlParams_.Set("alt", alt)
1032 c.urlParams_.Set("prettyPrint", "false")
1033 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations")
1034 urls += "?" + c.urlParams_.Encode()
1035 req, err := http.NewRequest("GET", urls, body)
1036 if err != nil {
1037 return nil, err
1038 }
1039 req.Header = reqHeaders
1040 googleapi.Expand(req.URL, map[string]string{
1041 "name": c.name,
1042 })
1043 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1044 }
1045
1046
1047
1048
1049
1050
1051
1052 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
1053 gensupport.SetOptions(c.urlParams_, opts...)
1054 res, err := c.doRequest("json")
1055 if res != nil && res.StatusCode == http.StatusNotModified {
1056 if res.Body != nil {
1057 res.Body.Close()
1058 }
1059 return nil, gensupport.WrapError(&googleapi.Error{
1060 Code: res.StatusCode,
1061 Header: res.Header,
1062 })
1063 }
1064 if err != nil {
1065 return nil, err
1066 }
1067 defer googleapi.CloseBody(res)
1068 if err := googleapi.CheckResponse(res); err != nil {
1069 return nil, gensupport.WrapError(err)
1070 }
1071 ret := &ListLocationsResponse{
1072 ServerResponse: googleapi.ServerResponse{
1073 Header: res.Header,
1074 HTTPStatusCode: res.StatusCode,
1075 },
1076 }
1077 target := &ret
1078 if err := gensupport.DecodeResponse(target, res); err != nil {
1079 return nil, err
1080 }
1081 return ret, nil
1082 }
1083
1084
1085
1086
1087 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
1088 c.ctx_ = ctx
1089 defer c.PageToken(c.urlParams_.Get("pageToken"))
1090 for {
1091 x, err := c.Do()
1092 if err != nil {
1093 return err
1094 }
1095 if err := f(x); err != nil {
1096 return err
1097 }
1098 if x.NextPageToken == "" {
1099 return nil
1100 }
1101 c.PageToken(x.NextPageToken)
1102 }
1103 }
1104
1105 type ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall struct {
1106 s *Service
1107 resource string
1108 urlParams_ gensupport.URLParams
1109 ifNoneMatch_ string
1110 ctx_ context.Context
1111 header_ http.Header
1112 }
1113
1114
1115
1116
1117
1118
1119
1120 func (r *ProjectsLocationsCertificateAuthoritiesService) GetIamPolicy(resource string) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall {
1121 c := &ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1122 c.resource = resource
1123 return c
1124 }
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138 func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall {
1139 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
1140 return c
1141 }
1142
1143
1144
1145
1146 func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall {
1147 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1148 return c
1149 }
1150
1151
1152
1153
1154 func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall {
1155 c.ifNoneMatch_ = entityTag
1156 return c
1157 }
1158
1159
1160 func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall {
1161 c.ctx_ = ctx
1162 return c
1163 }
1164
1165
1166
1167 func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) Header() http.Header {
1168 if c.header_ == nil {
1169 c.header_ = make(http.Header)
1170 }
1171 return c.header_
1172 }
1173
1174 func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1175 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1176 if c.ifNoneMatch_ != "" {
1177 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1178 }
1179 var body io.Reader = nil
1180 c.urlParams_.Set("alt", alt)
1181 c.urlParams_.Set("prettyPrint", "false")
1182 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
1183 urls += "?" + c.urlParams_.Encode()
1184 req, err := http.NewRequest("GET", urls, body)
1185 if err != nil {
1186 return nil, err
1187 }
1188 req.Header = reqHeaders
1189 googleapi.Expand(req.URL, map[string]string{
1190 "resource": c.resource,
1191 })
1192 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1193 }
1194
1195
1196
1197
1198
1199
1200 func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1201 gensupport.SetOptions(c.urlParams_, opts...)
1202 res, err := c.doRequest("json")
1203 if res != nil && res.StatusCode == http.StatusNotModified {
1204 if res.Body != nil {
1205 res.Body.Close()
1206 }
1207 return nil, gensupport.WrapError(&googleapi.Error{
1208 Code: res.StatusCode,
1209 Header: res.Header,
1210 })
1211 }
1212 if err != nil {
1213 return nil, err
1214 }
1215 defer googleapi.CloseBody(res)
1216 if err := googleapi.CheckResponse(res); err != nil {
1217 return nil, gensupport.WrapError(err)
1218 }
1219 ret := &Policy{
1220 ServerResponse: googleapi.ServerResponse{
1221 Header: res.Header,
1222 HTTPStatusCode: res.StatusCode,
1223 },
1224 }
1225 target := &ret
1226 if err := gensupport.DecodeResponse(target, res); err != nil {
1227 return nil, err
1228 }
1229 return ret, nil
1230 }
1231
1232 type ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall struct {
1233 s *Service
1234 resource string
1235 setiampolicyrequest *SetIamPolicyRequest
1236 urlParams_ gensupport.URLParams
1237 ctx_ context.Context
1238 header_ http.Header
1239 }
1240
1241
1242
1243
1244
1245
1246
1247
1248 func (r *ProjectsLocationsCertificateAuthoritiesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall {
1249 c := &ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1250 c.resource = resource
1251 c.setiampolicyrequest = setiampolicyrequest
1252 return c
1253 }
1254
1255
1256
1257
1258 func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall {
1259 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1260 return c
1261 }
1262
1263
1264 func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall {
1265 c.ctx_ = ctx
1266 return c
1267 }
1268
1269
1270
1271 func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) Header() http.Header {
1272 if c.header_ == nil {
1273 c.header_ = make(http.Header)
1274 }
1275 return c.header_
1276 }
1277
1278 func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1279 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1280 var body io.Reader = nil
1281 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
1282 if err != nil {
1283 return nil, err
1284 }
1285 c.urlParams_.Set("alt", alt)
1286 c.urlParams_.Set("prettyPrint", "false")
1287 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
1288 urls += "?" + c.urlParams_.Encode()
1289 req, err := http.NewRequest("POST", urls, body)
1290 if err != nil {
1291 return nil, err
1292 }
1293 req.Header = reqHeaders
1294 googleapi.Expand(req.URL, map[string]string{
1295 "resource": c.resource,
1296 })
1297 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1298 }
1299
1300
1301
1302
1303
1304
1305 func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1306 gensupport.SetOptions(c.urlParams_, opts...)
1307 res, err := c.doRequest("json")
1308 if res != nil && res.StatusCode == http.StatusNotModified {
1309 if res.Body != nil {
1310 res.Body.Close()
1311 }
1312 return nil, gensupport.WrapError(&googleapi.Error{
1313 Code: res.StatusCode,
1314 Header: res.Header,
1315 })
1316 }
1317 if err != nil {
1318 return nil, err
1319 }
1320 defer googleapi.CloseBody(res)
1321 if err := googleapi.CheckResponse(res); err != nil {
1322 return nil, gensupport.WrapError(err)
1323 }
1324 ret := &Policy{
1325 ServerResponse: googleapi.ServerResponse{
1326 Header: res.Header,
1327 HTTPStatusCode: res.StatusCode,
1328 },
1329 }
1330 target := &ret
1331 if err := gensupport.DecodeResponse(target, res); err != nil {
1332 return nil, err
1333 }
1334 return ret, nil
1335 }
1336
1337 type ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall struct {
1338 s *Service
1339 resource string
1340 testiampermissionsrequest *TestIamPermissionsRequest
1341 urlParams_ gensupport.URLParams
1342 ctx_ context.Context
1343 header_ http.Header
1344 }
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356 func (r *ProjectsLocationsCertificateAuthoritiesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall {
1357 c := &ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1358 c.resource = resource
1359 c.testiampermissionsrequest = testiampermissionsrequest
1360 return c
1361 }
1362
1363
1364
1365
1366 func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall {
1367 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1368 return c
1369 }
1370
1371
1372 func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall {
1373 c.ctx_ = ctx
1374 return c
1375 }
1376
1377
1378
1379 func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) Header() http.Header {
1380 if c.header_ == nil {
1381 c.header_ = make(http.Header)
1382 }
1383 return c.header_
1384 }
1385
1386 func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
1387 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1388 var body io.Reader = nil
1389 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
1390 if err != nil {
1391 return nil, err
1392 }
1393 c.urlParams_.Set("alt", alt)
1394 c.urlParams_.Set("prettyPrint", "false")
1395 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
1396 urls += "?" + c.urlParams_.Encode()
1397 req, err := http.NewRequest("POST", urls, body)
1398 if err != nil {
1399 return nil, err
1400 }
1401 req.Header = reqHeaders
1402 googleapi.Expand(req.URL, map[string]string{
1403 "resource": c.resource,
1404 })
1405 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1406 }
1407
1408
1409
1410
1411
1412
1413
1414 func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
1415 gensupport.SetOptions(c.urlParams_, opts...)
1416 res, err := c.doRequest("json")
1417 if res != nil && res.StatusCode == http.StatusNotModified {
1418 if res.Body != nil {
1419 res.Body.Close()
1420 }
1421 return nil, gensupport.WrapError(&googleapi.Error{
1422 Code: res.StatusCode,
1423 Header: res.Header,
1424 })
1425 }
1426 if err != nil {
1427 return nil, err
1428 }
1429 defer googleapi.CloseBody(res)
1430 if err := googleapi.CheckResponse(res); err != nil {
1431 return nil, gensupport.WrapError(err)
1432 }
1433 ret := &TestIamPermissionsResponse{
1434 ServerResponse: googleapi.ServerResponse{
1435 Header: res.Header,
1436 HTTPStatusCode: res.StatusCode,
1437 },
1438 }
1439 target := &ret
1440 if err := gensupport.DecodeResponse(target, res); err != nil {
1441 return nil, err
1442 }
1443 return ret, nil
1444 }
1445
1446 type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall struct {
1447 s *Service
1448 resource string
1449 urlParams_ gensupport.URLParams
1450 ifNoneMatch_ string
1451 ctx_ context.Context
1452 header_ http.Header
1453 }
1454
1455
1456
1457
1458
1459
1460
1461 func (r *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService) GetIamPolicy(resource string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall {
1462 c := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1463 c.resource = resource
1464 return c
1465 }
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall {
1480 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
1481 return c
1482 }
1483
1484
1485
1486
1487 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall {
1488 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1489 return c
1490 }
1491
1492
1493
1494
1495 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall {
1496 c.ifNoneMatch_ = entityTag
1497 return c
1498 }
1499
1500
1501 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall {
1502 c.ctx_ = ctx
1503 return c
1504 }
1505
1506
1507
1508 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) Header() http.Header {
1509 if c.header_ == nil {
1510 c.header_ = make(http.Header)
1511 }
1512 return c.header_
1513 }
1514
1515 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1516 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1517 if c.ifNoneMatch_ != "" {
1518 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1519 }
1520 var body io.Reader = nil
1521 c.urlParams_.Set("alt", alt)
1522 c.urlParams_.Set("prettyPrint", "false")
1523 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
1524 urls += "?" + c.urlParams_.Encode()
1525 req, err := http.NewRequest("GET", urls, body)
1526 if err != nil {
1527 return nil, err
1528 }
1529 req.Header = reqHeaders
1530 googleapi.Expand(req.URL, map[string]string{
1531 "resource": c.resource,
1532 })
1533 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1534 }
1535
1536
1537
1538
1539
1540
1541 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1542 gensupport.SetOptions(c.urlParams_, opts...)
1543 res, err := c.doRequest("json")
1544 if res != nil && res.StatusCode == http.StatusNotModified {
1545 if res.Body != nil {
1546 res.Body.Close()
1547 }
1548 return nil, gensupport.WrapError(&googleapi.Error{
1549 Code: res.StatusCode,
1550 Header: res.Header,
1551 })
1552 }
1553 if err != nil {
1554 return nil, err
1555 }
1556 defer googleapi.CloseBody(res)
1557 if err := googleapi.CheckResponse(res); err != nil {
1558 return nil, gensupport.WrapError(err)
1559 }
1560 ret := &Policy{
1561 ServerResponse: googleapi.ServerResponse{
1562 Header: res.Header,
1563 HTTPStatusCode: res.StatusCode,
1564 },
1565 }
1566 target := &ret
1567 if err := gensupport.DecodeResponse(target, res); err != nil {
1568 return nil, err
1569 }
1570 return ret, nil
1571 }
1572
1573 type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall struct {
1574 s *Service
1575 resource string
1576 setiampolicyrequest *SetIamPolicyRequest
1577 urlParams_ gensupport.URLParams
1578 ctx_ context.Context
1579 header_ http.Header
1580 }
1581
1582
1583
1584
1585
1586
1587
1588
1589 func (r *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall {
1590 c := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1591 c.resource = resource
1592 c.setiampolicyrequest = setiampolicyrequest
1593 return c
1594 }
1595
1596
1597
1598
1599 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall {
1600 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1601 return c
1602 }
1603
1604
1605 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall {
1606 c.ctx_ = ctx
1607 return c
1608 }
1609
1610
1611
1612 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) Header() http.Header {
1613 if c.header_ == nil {
1614 c.header_ = make(http.Header)
1615 }
1616 return c.header_
1617 }
1618
1619 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1620 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1621 var body io.Reader = nil
1622 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
1623 if err != nil {
1624 return nil, err
1625 }
1626 c.urlParams_.Set("alt", alt)
1627 c.urlParams_.Set("prettyPrint", "false")
1628 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
1629 urls += "?" + c.urlParams_.Encode()
1630 req, err := http.NewRequest("POST", urls, body)
1631 if err != nil {
1632 return nil, err
1633 }
1634 req.Header = reqHeaders
1635 googleapi.Expand(req.URL, map[string]string{
1636 "resource": c.resource,
1637 })
1638 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1639 }
1640
1641
1642
1643
1644
1645
1646 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1647 gensupport.SetOptions(c.urlParams_, opts...)
1648 res, err := c.doRequest("json")
1649 if res != nil && res.StatusCode == http.StatusNotModified {
1650 if res.Body != nil {
1651 res.Body.Close()
1652 }
1653 return nil, gensupport.WrapError(&googleapi.Error{
1654 Code: res.StatusCode,
1655 Header: res.Header,
1656 })
1657 }
1658 if err != nil {
1659 return nil, err
1660 }
1661 defer googleapi.CloseBody(res)
1662 if err := googleapi.CheckResponse(res); err != nil {
1663 return nil, gensupport.WrapError(err)
1664 }
1665 ret := &Policy{
1666 ServerResponse: googleapi.ServerResponse{
1667 Header: res.Header,
1668 HTTPStatusCode: res.StatusCode,
1669 },
1670 }
1671 target := &ret
1672 if err := gensupport.DecodeResponse(target, res); err != nil {
1673 return nil, err
1674 }
1675 return ret, nil
1676 }
1677
1678 type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall struct {
1679 s *Service
1680 resource string
1681 testiampermissionsrequest *TestIamPermissionsRequest
1682 urlParams_ gensupport.URLParams
1683 ctx_ context.Context
1684 header_ http.Header
1685 }
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697 func (r *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall {
1698 c := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1699 c.resource = resource
1700 c.testiampermissionsrequest = testiampermissionsrequest
1701 return c
1702 }
1703
1704
1705
1706
1707 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall {
1708 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1709 return c
1710 }
1711
1712
1713 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall {
1714 c.ctx_ = ctx
1715 return c
1716 }
1717
1718
1719
1720 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) Header() http.Header {
1721 if c.header_ == nil {
1722 c.header_ = make(http.Header)
1723 }
1724 return c.header_
1725 }
1726
1727 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
1728 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1729 var body io.Reader = nil
1730 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
1731 if err != nil {
1732 return nil, err
1733 }
1734 c.urlParams_.Set("alt", alt)
1735 c.urlParams_.Set("prettyPrint", "false")
1736 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
1737 urls += "?" + c.urlParams_.Encode()
1738 req, err := http.NewRequest("POST", urls, body)
1739 if err != nil {
1740 return nil, err
1741 }
1742 req.Header = reqHeaders
1743 googleapi.Expand(req.URL, map[string]string{
1744 "resource": c.resource,
1745 })
1746 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1747 }
1748
1749
1750
1751
1752
1753
1754
1755 func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
1756 gensupport.SetOptions(c.urlParams_, opts...)
1757 res, err := c.doRequest("json")
1758 if res != nil && res.StatusCode == http.StatusNotModified {
1759 if res.Body != nil {
1760 res.Body.Close()
1761 }
1762 return nil, gensupport.WrapError(&googleapi.Error{
1763 Code: res.StatusCode,
1764 Header: res.Header,
1765 })
1766 }
1767 if err != nil {
1768 return nil, err
1769 }
1770 defer googleapi.CloseBody(res)
1771 if err := googleapi.CheckResponse(res); err != nil {
1772 return nil, gensupport.WrapError(err)
1773 }
1774 ret := &TestIamPermissionsResponse{
1775 ServerResponse: googleapi.ServerResponse{
1776 Header: res.Header,
1777 HTTPStatusCode: res.StatusCode,
1778 },
1779 }
1780 target := &ret
1781 if err := gensupport.DecodeResponse(target, res); err != nil {
1782 return nil, err
1783 }
1784 return ret, nil
1785 }
1786
1787 type ProjectsLocationsOperationsCancelCall struct {
1788 s *Service
1789 name string
1790 canceloperationrequest *CancelOperationRequest
1791 urlParams_ gensupport.URLParams
1792 ctx_ context.Context
1793 header_ http.Header
1794 }
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
1808 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1809 c.name = name
1810 c.canceloperationrequest = canceloperationrequest
1811 return c
1812 }
1813
1814
1815
1816
1817 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
1818 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1819 return c
1820 }
1821
1822
1823 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
1824 c.ctx_ = ctx
1825 return c
1826 }
1827
1828
1829
1830 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
1831 if c.header_ == nil {
1832 c.header_ = make(http.Header)
1833 }
1834 return c.header_
1835 }
1836
1837 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
1838 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1839 var body io.Reader = nil
1840 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
1841 if err != nil {
1842 return nil, err
1843 }
1844 c.urlParams_.Set("alt", alt)
1845 c.urlParams_.Set("prettyPrint", "false")
1846 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel")
1847 urls += "?" + c.urlParams_.Encode()
1848 req, err := http.NewRequest("POST", urls, body)
1849 if err != nil {
1850 return nil, err
1851 }
1852 req.Header = reqHeaders
1853 googleapi.Expand(req.URL, map[string]string{
1854 "name": c.name,
1855 })
1856 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1857 }
1858
1859
1860
1861
1862
1863
1864 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1865 gensupport.SetOptions(c.urlParams_, opts...)
1866 res, err := c.doRequest("json")
1867 if res != nil && res.StatusCode == http.StatusNotModified {
1868 if res.Body != nil {
1869 res.Body.Close()
1870 }
1871 return nil, gensupport.WrapError(&googleapi.Error{
1872 Code: res.StatusCode,
1873 Header: res.Header,
1874 })
1875 }
1876 if err != nil {
1877 return nil, err
1878 }
1879 defer googleapi.CloseBody(res)
1880 if err := googleapi.CheckResponse(res); err != nil {
1881 return nil, gensupport.WrapError(err)
1882 }
1883 ret := &Empty{
1884 ServerResponse: googleapi.ServerResponse{
1885 Header: res.Header,
1886 HTTPStatusCode: res.StatusCode,
1887 },
1888 }
1889 target := &ret
1890 if err := gensupport.DecodeResponse(target, res); err != nil {
1891 return nil, err
1892 }
1893 return ret, nil
1894 }
1895
1896 type ProjectsLocationsOperationsDeleteCall struct {
1897 s *Service
1898 name string
1899 urlParams_ gensupport.URLParams
1900 ctx_ context.Context
1901 header_ http.Header
1902 }
1903
1904
1905
1906
1907
1908
1909
1910 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
1911 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1912 c.name = name
1913 return c
1914 }
1915
1916
1917
1918
1919 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
1920 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1921 return c
1922 }
1923
1924
1925 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
1926 c.ctx_ = ctx
1927 return c
1928 }
1929
1930
1931
1932 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
1933 if c.header_ == nil {
1934 c.header_ = make(http.Header)
1935 }
1936 return c.header_
1937 }
1938
1939 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
1940 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1941 var body io.Reader = nil
1942 c.urlParams_.Set("alt", alt)
1943 c.urlParams_.Set("prettyPrint", "false")
1944 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
1945 urls += "?" + c.urlParams_.Encode()
1946 req, err := http.NewRequest("DELETE", urls, body)
1947 if err != nil {
1948 return nil, err
1949 }
1950 req.Header = reqHeaders
1951 googleapi.Expand(req.URL, map[string]string{
1952 "name": c.name,
1953 })
1954 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1955 }
1956
1957
1958
1959
1960
1961
1962 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1963 gensupport.SetOptions(c.urlParams_, opts...)
1964 res, err := c.doRequest("json")
1965 if res != nil && res.StatusCode == http.StatusNotModified {
1966 if res.Body != nil {
1967 res.Body.Close()
1968 }
1969 return nil, gensupport.WrapError(&googleapi.Error{
1970 Code: res.StatusCode,
1971 Header: res.Header,
1972 })
1973 }
1974 if err != nil {
1975 return nil, err
1976 }
1977 defer googleapi.CloseBody(res)
1978 if err := googleapi.CheckResponse(res); err != nil {
1979 return nil, gensupport.WrapError(err)
1980 }
1981 ret := &Empty{
1982 ServerResponse: googleapi.ServerResponse{
1983 Header: res.Header,
1984 HTTPStatusCode: res.StatusCode,
1985 },
1986 }
1987 target := &ret
1988 if err := gensupport.DecodeResponse(target, res); err != nil {
1989 return nil, err
1990 }
1991 return ret, nil
1992 }
1993
1994 type ProjectsLocationsOperationsGetCall struct {
1995 s *Service
1996 name string
1997 urlParams_ gensupport.URLParams
1998 ifNoneMatch_ string
1999 ctx_ context.Context
2000 header_ http.Header
2001 }
2002
2003
2004
2005
2006
2007
2008 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
2009 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2010 c.name = name
2011 return c
2012 }
2013
2014
2015
2016
2017 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
2018 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2019 return c
2020 }
2021
2022
2023
2024
2025 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
2026 c.ifNoneMatch_ = entityTag
2027 return c
2028 }
2029
2030
2031 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
2032 c.ctx_ = ctx
2033 return c
2034 }
2035
2036
2037
2038 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
2039 if c.header_ == nil {
2040 c.header_ = make(http.Header)
2041 }
2042 return c.header_
2043 }
2044
2045 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
2046 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2047 if c.ifNoneMatch_ != "" {
2048 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2049 }
2050 var body io.Reader = nil
2051 c.urlParams_.Set("alt", alt)
2052 c.urlParams_.Set("prettyPrint", "false")
2053 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2054 urls += "?" + c.urlParams_.Encode()
2055 req, err := http.NewRequest("GET", urls, body)
2056 if err != nil {
2057 return nil, err
2058 }
2059 req.Header = reqHeaders
2060 googleapi.Expand(req.URL, map[string]string{
2061 "name": c.name,
2062 })
2063 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2064 }
2065
2066
2067
2068
2069
2070
2071 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2072 gensupport.SetOptions(c.urlParams_, opts...)
2073 res, err := c.doRequest("json")
2074 if res != nil && res.StatusCode == http.StatusNotModified {
2075 if res.Body != nil {
2076 res.Body.Close()
2077 }
2078 return nil, gensupport.WrapError(&googleapi.Error{
2079 Code: res.StatusCode,
2080 Header: res.Header,
2081 })
2082 }
2083 if err != nil {
2084 return nil, err
2085 }
2086 defer googleapi.CloseBody(res)
2087 if err := googleapi.CheckResponse(res); err != nil {
2088 return nil, gensupport.WrapError(err)
2089 }
2090 ret := &Operation{
2091 ServerResponse: googleapi.ServerResponse{
2092 Header: res.Header,
2093 HTTPStatusCode: res.StatusCode,
2094 },
2095 }
2096 target := &ret
2097 if err := gensupport.DecodeResponse(target, res); err != nil {
2098 return nil, err
2099 }
2100 return ret, nil
2101 }
2102
2103 type ProjectsLocationsOperationsListCall struct {
2104 s *Service
2105 name string
2106 urlParams_ gensupport.URLParams
2107 ifNoneMatch_ string
2108 ctx_ context.Context
2109 header_ http.Header
2110 }
2111
2112
2113
2114
2115
2116 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
2117 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2118 c.name = name
2119 return c
2120 }
2121
2122
2123 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
2124 c.urlParams_.Set("filter", filter)
2125 return c
2126 }
2127
2128
2129
2130 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
2131 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2132 return c
2133 }
2134
2135
2136
2137 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
2138 c.urlParams_.Set("pageToken", pageToken)
2139 return c
2140 }
2141
2142
2143
2144
2145 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
2146 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2147 return c
2148 }
2149
2150
2151
2152
2153 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
2154 c.ifNoneMatch_ = entityTag
2155 return c
2156 }
2157
2158
2159 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
2160 c.ctx_ = ctx
2161 return c
2162 }
2163
2164
2165
2166 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
2167 if c.header_ == nil {
2168 c.header_ = make(http.Header)
2169 }
2170 return c.header_
2171 }
2172
2173 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
2174 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2175 if c.ifNoneMatch_ != "" {
2176 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2177 }
2178 var body io.Reader = nil
2179 c.urlParams_.Set("alt", alt)
2180 c.urlParams_.Set("prettyPrint", "false")
2181 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations")
2182 urls += "?" + c.urlParams_.Encode()
2183 req, err := http.NewRequest("GET", urls, body)
2184 if err != nil {
2185 return nil, err
2186 }
2187 req.Header = reqHeaders
2188 googleapi.Expand(req.URL, map[string]string{
2189 "name": c.name,
2190 })
2191 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2192 }
2193
2194
2195
2196
2197
2198
2199
2200 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
2201 gensupport.SetOptions(c.urlParams_, opts...)
2202 res, err := c.doRequest("json")
2203 if res != nil && res.StatusCode == http.StatusNotModified {
2204 if res.Body != nil {
2205 res.Body.Close()
2206 }
2207 return nil, gensupport.WrapError(&googleapi.Error{
2208 Code: res.StatusCode,
2209 Header: res.Header,
2210 })
2211 }
2212 if err != nil {
2213 return nil, err
2214 }
2215 defer googleapi.CloseBody(res)
2216 if err := googleapi.CheckResponse(res); err != nil {
2217 return nil, gensupport.WrapError(err)
2218 }
2219 ret := &ListOperationsResponse{
2220 ServerResponse: googleapi.ServerResponse{
2221 Header: res.Header,
2222 HTTPStatusCode: res.StatusCode,
2223 },
2224 }
2225 target := &ret
2226 if err := gensupport.DecodeResponse(target, res); err != nil {
2227 return nil, err
2228 }
2229 return ret, nil
2230 }
2231
2232
2233
2234
2235 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
2236 c.ctx_ = ctx
2237 defer c.PageToken(c.urlParams_.Get("pageToken"))
2238 for {
2239 x, err := c.Do()
2240 if err != nil {
2241 return err
2242 }
2243 if err := f(x); err != nil {
2244 return err
2245 }
2246 if x.NextPageToken == "" {
2247 return nil
2248 }
2249 c.PageToken(x.NextPageToken)
2250 }
2251 }
2252
2253 type ProjectsLocationsReusableConfigsGetIamPolicyCall struct {
2254 s *Service
2255 resource string
2256 urlParams_ gensupport.URLParams
2257 ifNoneMatch_ string
2258 ctx_ context.Context
2259 header_ http.Header
2260 }
2261
2262
2263
2264
2265
2266
2267
2268 func (r *ProjectsLocationsReusableConfigsService) GetIamPolicy(resource string) *ProjectsLocationsReusableConfigsGetIamPolicyCall {
2269 c := &ProjectsLocationsReusableConfigsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2270 c.resource = resource
2271 return c
2272 }
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286 func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsReusableConfigsGetIamPolicyCall {
2287 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
2288 return c
2289 }
2290
2291
2292
2293
2294 func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsReusableConfigsGetIamPolicyCall {
2295 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2296 return c
2297 }
2298
2299
2300
2301
2302 func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsReusableConfigsGetIamPolicyCall {
2303 c.ifNoneMatch_ = entityTag
2304 return c
2305 }
2306
2307
2308 func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsReusableConfigsGetIamPolicyCall {
2309 c.ctx_ = ctx
2310 return c
2311 }
2312
2313
2314
2315 func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) Header() http.Header {
2316 if c.header_ == nil {
2317 c.header_ = make(http.Header)
2318 }
2319 return c.header_
2320 }
2321
2322 func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2323 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2324 if c.ifNoneMatch_ != "" {
2325 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2326 }
2327 var body io.Reader = nil
2328 c.urlParams_.Set("alt", alt)
2329 c.urlParams_.Set("prettyPrint", "false")
2330 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
2331 urls += "?" + c.urlParams_.Encode()
2332 req, err := http.NewRequest("GET", urls, body)
2333 if err != nil {
2334 return nil, err
2335 }
2336 req.Header = reqHeaders
2337 googleapi.Expand(req.URL, map[string]string{
2338 "resource": c.resource,
2339 })
2340 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2341 }
2342
2343
2344
2345
2346
2347
2348 func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2349 gensupport.SetOptions(c.urlParams_, opts...)
2350 res, err := c.doRequest("json")
2351 if res != nil && res.StatusCode == http.StatusNotModified {
2352 if res.Body != nil {
2353 res.Body.Close()
2354 }
2355 return nil, gensupport.WrapError(&googleapi.Error{
2356 Code: res.StatusCode,
2357 Header: res.Header,
2358 })
2359 }
2360 if err != nil {
2361 return nil, err
2362 }
2363 defer googleapi.CloseBody(res)
2364 if err := googleapi.CheckResponse(res); err != nil {
2365 return nil, gensupport.WrapError(err)
2366 }
2367 ret := &Policy{
2368 ServerResponse: googleapi.ServerResponse{
2369 Header: res.Header,
2370 HTTPStatusCode: res.StatusCode,
2371 },
2372 }
2373 target := &ret
2374 if err := gensupport.DecodeResponse(target, res); err != nil {
2375 return nil, err
2376 }
2377 return ret, nil
2378 }
2379
2380 type ProjectsLocationsReusableConfigsSetIamPolicyCall struct {
2381 s *Service
2382 resource string
2383 setiampolicyrequest *SetIamPolicyRequest
2384 urlParams_ gensupport.URLParams
2385 ctx_ context.Context
2386 header_ http.Header
2387 }
2388
2389
2390
2391
2392
2393
2394
2395
2396 func (r *ProjectsLocationsReusableConfigsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsReusableConfigsSetIamPolicyCall {
2397 c := &ProjectsLocationsReusableConfigsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2398 c.resource = resource
2399 c.setiampolicyrequest = setiampolicyrequest
2400 return c
2401 }
2402
2403
2404
2405
2406 func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsReusableConfigsSetIamPolicyCall {
2407 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2408 return c
2409 }
2410
2411
2412 func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsReusableConfigsSetIamPolicyCall {
2413 c.ctx_ = ctx
2414 return c
2415 }
2416
2417
2418
2419 func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) Header() http.Header {
2420 if c.header_ == nil {
2421 c.header_ = make(http.Header)
2422 }
2423 return c.header_
2424 }
2425
2426 func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2427 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2428 var body io.Reader = nil
2429 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
2430 if err != nil {
2431 return nil, err
2432 }
2433 c.urlParams_.Set("alt", alt)
2434 c.urlParams_.Set("prettyPrint", "false")
2435 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
2436 urls += "?" + c.urlParams_.Encode()
2437 req, err := http.NewRequest("POST", urls, body)
2438 if err != nil {
2439 return nil, err
2440 }
2441 req.Header = reqHeaders
2442 googleapi.Expand(req.URL, map[string]string{
2443 "resource": c.resource,
2444 })
2445 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2446 }
2447
2448
2449
2450
2451
2452
2453 func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2454 gensupport.SetOptions(c.urlParams_, opts...)
2455 res, err := c.doRequest("json")
2456 if res != nil && res.StatusCode == http.StatusNotModified {
2457 if res.Body != nil {
2458 res.Body.Close()
2459 }
2460 return nil, gensupport.WrapError(&googleapi.Error{
2461 Code: res.StatusCode,
2462 Header: res.Header,
2463 })
2464 }
2465 if err != nil {
2466 return nil, err
2467 }
2468 defer googleapi.CloseBody(res)
2469 if err := googleapi.CheckResponse(res); err != nil {
2470 return nil, gensupport.WrapError(err)
2471 }
2472 ret := &Policy{
2473 ServerResponse: googleapi.ServerResponse{
2474 Header: res.Header,
2475 HTTPStatusCode: res.StatusCode,
2476 },
2477 }
2478 target := &ret
2479 if err := gensupport.DecodeResponse(target, res); err != nil {
2480 return nil, err
2481 }
2482 return ret, nil
2483 }
2484
2485 type ProjectsLocationsReusableConfigsTestIamPermissionsCall struct {
2486 s *Service
2487 resource string
2488 testiampermissionsrequest *TestIamPermissionsRequest
2489 urlParams_ gensupport.URLParams
2490 ctx_ context.Context
2491 header_ http.Header
2492 }
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504 func (r *ProjectsLocationsReusableConfigsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsReusableConfigsTestIamPermissionsCall {
2505 c := &ProjectsLocationsReusableConfigsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2506 c.resource = resource
2507 c.testiampermissionsrequest = testiampermissionsrequest
2508 return c
2509 }
2510
2511
2512
2513
2514 func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsReusableConfigsTestIamPermissionsCall {
2515 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2516 return c
2517 }
2518
2519
2520 func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsReusableConfigsTestIamPermissionsCall {
2521 c.ctx_ = ctx
2522 return c
2523 }
2524
2525
2526
2527 func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) Header() http.Header {
2528 if c.header_ == nil {
2529 c.header_ = make(http.Header)
2530 }
2531 return c.header_
2532 }
2533
2534 func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
2535 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2536 var body io.Reader = nil
2537 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
2538 if err != nil {
2539 return nil, err
2540 }
2541 c.urlParams_.Set("alt", alt)
2542 c.urlParams_.Set("prettyPrint", "false")
2543 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
2544 urls += "?" + c.urlParams_.Encode()
2545 req, err := http.NewRequest("POST", urls, body)
2546 if err != nil {
2547 return nil, err
2548 }
2549 req.Header = reqHeaders
2550 googleapi.Expand(req.URL, map[string]string{
2551 "resource": c.resource,
2552 })
2553 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2554 }
2555
2556
2557
2558
2559
2560
2561
2562 func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
2563 gensupport.SetOptions(c.urlParams_, opts...)
2564 res, err := c.doRequest("json")
2565 if res != nil && res.StatusCode == http.StatusNotModified {
2566 if res.Body != nil {
2567 res.Body.Close()
2568 }
2569 return nil, gensupport.WrapError(&googleapi.Error{
2570 Code: res.StatusCode,
2571 Header: res.Header,
2572 })
2573 }
2574 if err != nil {
2575 return nil, err
2576 }
2577 defer googleapi.CloseBody(res)
2578 if err := googleapi.CheckResponse(res); err != nil {
2579 return nil, gensupport.WrapError(err)
2580 }
2581 ret := &TestIamPermissionsResponse{
2582 ServerResponse: googleapi.ServerResponse{
2583 Header: res.Header,
2584 HTTPStatusCode: res.StatusCode,
2585 },
2586 }
2587 target := &ret
2588 if err := gensupport.DecodeResponse(target, res); err != nil {
2589 return nil, err
2590 }
2591 return ret, nil
2592 }
2593
View as plain text