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