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