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 secretmanager
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 = "secretmanager:v1beta1"
90 const apiName = "secretmanager"
91 const apiVersion = "v1beta1"
92 const basePath = "https://secretmanager.googleapis.com/"
93 const basePathTemplate = "https://secretmanager.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://secretmanager.mtls.googleapis.com/"
95
96
97 const (
98
99
100 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
101 )
102
103
104 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
105 scopesOption := internaloption.WithDefaultScopes(
106 "https://www.googleapis.com/auth/cloud-platform",
107 )
108
109 opts = append([]option.ClientOption{scopesOption}, opts...)
110 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
111 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
112 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
113 opts = append(opts, internaloption.EnableNewAuthLibrary())
114 client, endpoint, err := htransport.NewClient(ctx, opts...)
115 if err != nil {
116 return nil, err
117 }
118 s, err := New(client)
119 if err != nil {
120 return nil, err
121 }
122 if endpoint != "" {
123 s.BasePath = endpoint
124 }
125 return s, nil
126 }
127
128
129
130
131
132
133 func New(client *http.Client) (*Service, error) {
134 if client == nil {
135 return nil, errors.New("client is nil")
136 }
137 s := &Service{client: client, BasePath: basePath}
138 s.Projects = NewProjectsService(s)
139 return s, nil
140 }
141
142 type Service struct {
143 client *http.Client
144 BasePath string
145 UserAgent string
146
147 Projects *ProjectsService
148 }
149
150 func (s *Service) userAgent() string {
151 if s.UserAgent == "" {
152 return googleapi.UserAgent
153 }
154 return googleapi.UserAgent + " " + s.UserAgent
155 }
156
157 func NewProjectsService(s *Service) *ProjectsService {
158 rs := &ProjectsService{s: s}
159 rs.Locations = NewProjectsLocationsService(s)
160 rs.Secrets = NewProjectsSecretsService(s)
161 return rs
162 }
163
164 type ProjectsService struct {
165 s *Service
166
167 Locations *ProjectsLocationsService
168
169 Secrets *ProjectsSecretsService
170 }
171
172 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
173 rs := &ProjectsLocationsService{s: s}
174 return rs
175 }
176
177 type ProjectsLocationsService struct {
178 s *Service
179 }
180
181 func NewProjectsSecretsService(s *Service) *ProjectsSecretsService {
182 rs := &ProjectsSecretsService{s: s}
183 rs.Versions = NewProjectsSecretsVersionsService(s)
184 return rs
185 }
186
187 type ProjectsSecretsService struct {
188 s *Service
189
190 Versions *ProjectsSecretsVersionsService
191 }
192
193 func NewProjectsSecretsVersionsService(s *Service) *ProjectsSecretsVersionsService {
194 rs := &ProjectsSecretsVersionsService{s: s}
195 return rs
196 }
197
198 type ProjectsSecretsVersionsService struct {
199 s *Service
200 }
201
202
203
204 type AccessSecretVersionResponse struct {
205
206
207 Name string `json:"name,omitempty"`
208
209 Payload *SecretPayload `json:"payload,omitempty"`
210
211
212 googleapi.ServerResponse `json:"-"`
213
214
215
216
217
218 ForceSendFields []string `json:"-"`
219
220
221
222
223 NullFields []string `json:"-"`
224 }
225
226 func (s *AccessSecretVersionResponse) MarshalJSON() ([]byte, error) {
227 type NoMethod AccessSecretVersionResponse
228 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
229 }
230
231
232
233 type AddSecretVersionRequest struct {
234
235 Payload *SecretPayload `json:"payload,omitempty"`
236
237
238
239
240
241 ForceSendFields []string `json:"-"`
242
243
244
245
246 NullFields []string `json:"-"`
247 }
248
249 func (s *AddSecretVersionRequest) MarshalJSON() ([]byte, error) {
250 type NoMethod AddSecretVersionRequest
251 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
252 }
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270 type AuditConfig struct {
271
272 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
273
274
275
276 Service string `json:"service,omitempty"`
277
278
279
280
281
282 ForceSendFields []string `json:"-"`
283
284
285
286
287 NullFields []string `json:"-"`
288 }
289
290 func (s *AuditConfig) MarshalJSON() ([]byte, error) {
291 type NoMethod AuditConfig
292 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
293 }
294
295
296
297
298
299
300 type AuditLogConfig struct {
301
302
303 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
304
305
306
307
308
309
310
311 LogType string `json:"logType,omitempty"`
312
313
314
315
316
317 ForceSendFields []string `json:"-"`
318
319
320
321
322 NullFields []string `json:"-"`
323 }
324
325 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
326 type NoMethod AuditLogConfig
327 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
328 }
329
330
331
332 type Automatic struct {
333 }
334
335
336 type Binding struct {
337
338
339
340
341
342
343
344
345 Condition *Expr `json:"condition,omitempty"`
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408 Members []string `json:"members,omitempty"`
409
410
411
412
413
414
415 Role string `json:"role,omitempty"`
416
417
418
419
420
421 ForceSendFields []string `json:"-"`
422
423
424
425
426 NullFields []string `json:"-"`
427 }
428
429 func (s *Binding) MarshalJSON() ([]byte, error) {
430 type NoMethod Binding
431 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
432 }
433
434
435
436 type DestroySecretVersionRequest struct {
437 }
438
439
440
441 type DisableSecretVersionRequest struct {
442 }
443
444
445
446
447
448 type Empty struct {
449
450 googleapi.ServerResponse `json:"-"`
451 }
452
453
454
455 type EnableSecretVersionRequest struct {
456 }
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474 type Expr struct {
475
476
477 Description string `json:"description,omitempty"`
478
479
480 Expression string `json:"expression,omitempty"`
481
482
483 Location string `json:"location,omitempty"`
484
485
486
487 Title string `json:"title,omitempty"`
488
489
490
491
492
493 ForceSendFields []string `json:"-"`
494
495
496
497
498 NullFields []string `json:"-"`
499 }
500
501 func (s *Expr) MarshalJSON() ([]byte, error) {
502 type NoMethod Expr
503 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
504 }
505
506
507 type ListLocationsResponse struct {
508
509
510 Locations []*Location `json:"locations,omitempty"`
511
512 NextPageToken string `json:"nextPageToken,omitempty"`
513
514
515 googleapi.ServerResponse `json:"-"`
516
517
518
519
520
521 ForceSendFields []string `json:"-"`
522
523
524
525
526 NullFields []string `json:"-"`
527 }
528
529 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
530 type NoMethod ListLocationsResponse
531 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
532 }
533
534
535
536 type ListSecretVersionsResponse struct {
537
538
539 NextPageToken string `json:"nextPageToken,omitempty"`
540
541 TotalSize int64 `json:"totalSize,omitempty"`
542
543
544 Versions []*SecretVersion `json:"versions,omitempty"`
545
546
547 googleapi.ServerResponse `json:"-"`
548
549
550
551
552
553 ForceSendFields []string `json:"-"`
554
555
556
557
558 NullFields []string `json:"-"`
559 }
560
561 func (s *ListSecretVersionsResponse) MarshalJSON() ([]byte, error) {
562 type NoMethod ListSecretVersionsResponse
563 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
564 }
565
566
567 type ListSecretsResponse struct {
568
569
570 NextPageToken string `json:"nextPageToken,omitempty"`
571
572
573 Secrets []*Secret `json:"secrets,omitempty"`
574
575 TotalSize int64 `json:"totalSize,omitempty"`
576
577
578 googleapi.ServerResponse `json:"-"`
579
580
581
582
583
584 ForceSendFields []string `json:"-"`
585
586
587
588
589 NullFields []string `json:"-"`
590 }
591
592 func (s *ListSecretsResponse) MarshalJSON() ([]byte, error) {
593 type NoMethod ListSecretsResponse
594 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
595 }
596
597
598 type Location struct {
599
600
601 DisplayName string `json:"displayName,omitempty"`
602
603
604 Labels map[string]string `json:"labels,omitempty"`
605
606 LocationId string `json:"locationId,omitempty"`
607
608
609 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
610
611
612
613 Name string `json:"name,omitempty"`
614
615
616 googleapi.ServerResponse `json:"-"`
617
618
619
620
621
622 ForceSendFields []string `json:"-"`
623
624
625
626
627 NullFields []string `json:"-"`
628 }
629
630 func (s *Location) MarshalJSON() ([]byte, error) {
631 type NoMethod Location
632 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
633 }
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665 type Policy struct {
666
667 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
668
669
670
671
672
673
674
675
676
677 Bindings []*Binding `json:"bindings,omitempty"`
678
679
680
681
682
683
684
685
686
687
688
689 Etag string `json:"etag,omitempty"`
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705 Version int64 `json:"version,omitempty"`
706
707
708 googleapi.ServerResponse `json:"-"`
709
710
711
712
713
714 ForceSendFields []string `json:"-"`
715
716
717
718
719 NullFields []string `json:"-"`
720 }
721
722 func (s *Policy) MarshalJSON() ([]byte, error) {
723 type NoMethod Policy
724 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
725 }
726
727
728 type Replica struct {
729
730
731 Location string `json:"location,omitempty"`
732
733
734
735
736
737 ForceSendFields []string `json:"-"`
738
739
740
741
742 NullFields []string `json:"-"`
743 }
744
745 func (s *Replica) MarshalJSON() ([]byte, error) {
746 type NoMethod Replica
747 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
748 }
749
750
751 type Replication struct {
752
753
754 Automatic *Automatic `json:"automatic,omitempty"`
755
756
757 UserManaged *UserManaged `json:"userManaged,omitempty"`
758
759
760
761
762
763 ForceSendFields []string `json:"-"`
764
765
766
767
768 NullFields []string `json:"-"`
769 }
770
771 func (s *Replication) MarshalJSON() ([]byte, error) {
772 type NoMethod Replication
773 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
774 }
775
776
777
778
779 type Secret struct {
780
781 CreateTime string `json:"createTime,omitempty"`
782
783
784
785
786
787
788
789 Labels map[string]string `json:"labels,omitempty"`
790
791
792 Name string `json:"name,omitempty"`
793
794
795
796 Replication *Replication `json:"replication,omitempty"`
797
798
799 googleapi.ServerResponse `json:"-"`
800
801
802
803
804
805 ForceSendFields []string `json:"-"`
806
807
808
809
810 NullFields []string `json:"-"`
811 }
812
813 func (s *Secret) MarshalJSON() ([]byte, error) {
814 type NoMethod Secret
815 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
816 }
817
818
819
820 type SecretPayload struct {
821
822 Data string `json:"data,omitempty"`
823
824
825
826
827
828 ForceSendFields []string `json:"-"`
829
830
831
832
833 NullFields []string `json:"-"`
834 }
835
836 func (s *SecretPayload) MarshalJSON() ([]byte, error) {
837 type NoMethod SecretPayload
838 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
839 }
840
841
842 type SecretVersion struct {
843
844 CreateTime string `json:"createTime,omitempty"`
845
846
847 DestroyTime string `json:"destroyTime,omitempty"`
848
849
850
851 Name string `json:"name,omitempty"`
852
853
854
855
856
857
858
859
860
861 State string `json:"state,omitempty"`
862
863
864 googleapi.ServerResponse `json:"-"`
865
866
867
868
869
870 ForceSendFields []string `json:"-"`
871
872
873
874
875 NullFields []string `json:"-"`
876 }
877
878 func (s *SecretVersion) MarshalJSON() ([]byte, error) {
879 type NoMethod SecretVersion
880 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
881 }
882
883
884 type SetIamPolicyRequest struct {
885
886
887
888
889 Policy *Policy `json:"policy,omitempty"`
890
891
892
893 UpdateMask string `json:"updateMask,omitempty"`
894
895
896
897
898
899 ForceSendFields []string `json:"-"`
900
901
902
903
904 NullFields []string `json:"-"`
905 }
906
907 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
908 type NoMethod SetIamPolicyRequest
909 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
910 }
911
912
913 type TestIamPermissionsRequest struct {
914
915
916
917
918 Permissions []string `json:"permissions,omitempty"`
919
920
921
922
923
924 ForceSendFields []string `json:"-"`
925
926
927
928
929 NullFields []string `json:"-"`
930 }
931
932 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
933 type NoMethod TestIamPermissionsRequest
934 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
935 }
936
937
938
939 type TestIamPermissionsResponse struct {
940
941
942 Permissions []string `json:"permissions,omitempty"`
943
944
945 googleapi.ServerResponse `json:"-"`
946
947
948
949
950
951 ForceSendFields []string `json:"-"`
952
953
954
955
956 NullFields []string `json:"-"`
957 }
958
959 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
960 type NoMethod TestIamPermissionsResponse
961 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
962 }
963
964
965
966 type UserManaged struct {
967
968 Replicas []*Replica `json:"replicas,omitempty"`
969
970
971
972
973
974 ForceSendFields []string `json:"-"`
975
976
977
978
979 NullFields []string `json:"-"`
980 }
981
982 func (s *UserManaged) MarshalJSON() ([]byte, error) {
983 type NoMethod UserManaged
984 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
985 }
986
987 type ProjectsLocationsGetCall struct {
988 s *Service
989 name string
990 urlParams_ gensupport.URLParams
991 ifNoneMatch_ string
992 ctx_ context.Context
993 header_ http.Header
994 }
995
996
997
998
999 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
1000 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1001 c.name = name
1002 return c
1003 }
1004
1005
1006
1007
1008 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
1009 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1010 return c
1011 }
1012
1013
1014
1015
1016 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
1017 c.ifNoneMatch_ = entityTag
1018 return c
1019 }
1020
1021
1022 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
1023 c.ctx_ = ctx
1024 return c
1025 }
1026
1027
1028
1029 func (c *ProjectsLocationsGetCall) Header() http.Header {
1030 if c.header_ == nil {
1031 c.header_ = make(http.Header)
1032 }
1033 return c.header_
1034 }
1035
1036 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
1037 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1038 if c.ifNoneMatch_ != "" {
1039 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1040 }
1041 var body io.Reader = nil
1042 c.urlParams_.Set("alt", alt)
1043 c.urlParams_.Set("prettyPrint", "false")
1044 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
1045 urls += "?" + c.urlParams_.Encode()
1046 req, err := http.NewRequest("GET", urls, body)
1047 if err != nil {
1048 return nil, err
1049 }
1050 req.Header = reqHeaders
1051 googleapi.Expand(req.URL, map[string]string{
1052 "name": c.name,
1053 })
1054 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1055 }
1056
1057
1058
1059
1060
1061
1062 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, 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 := &Location{
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 ProjectsLocationsListCall struct {
1095 s *Service
1096 name string
1097 urlParams_ gensupport.URLParams
1098 ifNoneMatch_ string
1099 ctx_ context.Context
1100 header_ http.Header
1101 }
1102
1103
1104
1105
1106 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
1107 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1108 c.name = name
1109 return c
1110 }
1111
1112
1113
1114
1115
1116 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
1117 c.urlParams_.Set("filter", filter)
1118 return c
1119 }
1120
1121
1122
1123 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
1124 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1125 return c
1126 }
1127
1128
1129
1130
1131 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
1132 c.urlParams_.Set("pageToken", pageToken)
1133 return c
1134 }
1135
1136
1137
1138
1139 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
1140 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1141 return c
1142 }
1143
1144
1145
1146
1147 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
1148 c.ifNoneMatch_ = entityTag
1149 return c
1150 }
1151
1152
1153 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
1154 c.ctx_ = ctx
1155 return c
1156 }
1157
1158
1159
1160 func (c *ProjectsLocationsListCall) Header() http.Header {
1161 if c.header_ == nil {
1162 c.header_ = make(http.Header)
1163 }
1164 return c.header_
1165 }
1166
1167 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
1168 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1169 if c.ifNoneMatch_ != "" {
1170 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1171 }
1172 var body io.Reader = nil
1173 c.urlParams_.Set("alt", alt)
1174 c.urlParams_.Set("prettyPrint", "false")
1175 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations")
1176 urls += "?" + c.urlParams_.Encode()
1177 req, err := http.NewRequest("GET", urls, body)
1178 if err != nil {
1179 return nil, err
1180 }
1181 req.Header = reqHeaders
1182 googleapi.Expand(req.URL, map[string]string{
1183 "name": c.name,
1184 })
1185 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1186 }
1187
1188
1189
1190
1191
1192
1193
1194 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
1195 gensupport.SetOptions(c.urlParams_, opts...)
1196 res, err := c.doRequest("json")
1197 if res != nil && res.StatusCode == http.StatusNotModified {
1198 if res.Body != nil {
1199 res.Body.Close()
1200 }
1201 return nil, gensupport.WrapError(&googleapi.Error{
1202 Code: res.StatusCode,
1203 Header: res.Header,
1204 })
1205 }
1206 if err != nil {
1207 return nil, err
1208 }
1209 defer googleapi.CloseBody(res)
1210 if err := googleapi.CheckResponse(res); err != nil {
1211 return nil, gensupport.WrapError(err)
1212 }
1213 ret := &ListLocationsResponse{
1214 ServerResponse: googleapi.ServerResponse{
1215 Header: res.Header,
1216 HTTPStatusCode: res.StatusCode,
1217 },
1218 }
1219 target := &ret
1220 if err := gensupport.DecodeResponse(target, res); err != nil {
1221 return nil, err
1222 }
1223 return ret, nil
1224 }
1225
1226
1227
1228
1229 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
1230 c.ctx_ = ctx
1231 defer c.PageToken(c.urlParams_.Get("pageToken"))
1232 for {
1233 x, err := c.Do()
1234 if err != nil {
1235 return err
1236 }
1237 if err := f(x); err != nil {
1238 return err
1239 }
1240 if x.NextPageToken == "" {
1241 return nil
1242 }
1243 c.PageToken(x.NextPageToken)
1244 }
1245 }
1246
1247 type ProjectsSecretsAddVersionCall struct {
1248 s *Service
1249 parent string
1250 addsecretversionrequest *AddSecretVersionRequest
1251 urlParams_ gensupport.URLParams
1252 ctx_ context.Context
1253 header_ http.Header
1254 }
1255
1256
1257
1258
1259
1260
1261 func (r *ProjectsSecretsService) AddVersion(parent string, addsecretversionrequest *AddSecretVersionRequest) *ProjectsSecretsAddVersionCall {
1262 c := &ProjectsSecretsAddVersionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1263 c.parent = parent
1264 c.addsecretversionrequest = addsecretversionrequest
1265 return c
1266 }
1267
1268
1269
1270
1271 func (c *ProjectsSecretsAddVersionCall) Fields(s ...googleapi.Field) *ProjectsSecretsAddVersionCall {
1272 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1273 return c
1274 }
1275
1276
1277 func (c *ProjectsSecretsAddVersionCall) Context(ctx context.Context) *ProjectsSecretsAddVersionCall {
1278 c.ctx_ = ctx
1279 return c
1280 }
1281
1282
1283
1284 func (c *ProjectsSecretsAddVersionCall) Header() http.Header {
1285 if c.header_ == nil {
1286 c.header_ = make(http.Header)
1287 }
1288 return c.header_
1289 }
1290
1291 func (c *ProjectsSecretsAddVersionCall) doRequest(alt string) (*http.Response, error) {
1292 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1293 var body io.Reader = nil
1294 body, err := googleapi.WithoutDataWrapper.JSONReader(c.addsecretversionrequest)
1295 if err != nil {
1296 return nil, err
1297 }
1298 c.urlParams_.Set("alt", alt)
1299 c.urlParams_.Set("prettyPrint", "false")
1300 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:addVersion")
1301 urls += "?" + c.urlParams_.Encode()
1302 req, err := http.NewRequest("POST", urls, body)
1303 if err != nil {
1304 return nil, err
1305 }
1306 req.Header = reqHeaders
1307 googleapi.Expand(req.URL, map[string]string{
1308 "parent": c.parent,
1309 })
1310 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1311 }
1312
1313
1314
1315
1316
1317
1318 func (c *ProjectsSecretsAddVersionCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
1319 gensupport.SetOptions(c.urlParams_, opts...)
1320 res, err := c.doRequest("json")
1321 if res != nil && res.StatusCode == http.StatusNotModified {
1322 if res.Body != nil {
1323 res.Body.Close()
1324 }
1325 return nil, gensupport.WrapError(&googleapi.Error{
1326 Code: res.StatusCode,
1327 Header: res.Header,
1328 })
1329 }
1330 if err != nil {
1331 return nil, err
1332 }
1333 defer googleapi.CloseBody(res)
1334 if err := googleapi.CheckResponse(res); err != nil {
1335 return nil, gensupport.WrapError(err)
1336 }
1337 ret := &SecretVersion{
1338 ServerResponse: googleapi.ServerResponse{
1339 Header: res.Header,
1340 HTTPStatusCode: res.StatusCode,
1341 },
1342 }
1343 target := &ret
1344 if err := gensupport.DecodeResponse(target, res); err != nil {
1345 return nil, err
1346 }
1347 return ret, nil
1348 }
1349
1350 type ProjectsSecretsCreateCall struct {
1351 s *Service
1352 parent string
1353 secret *Secret
1354 urlParams_ gensupport.URLParams
1355 ctx_ context.Context
1356 header_ http.Header
1357 }
1358
1359
1360
1361
1362
1363 func (r *ProjectsSecretsService) Create(parent string, secret *Secret) *ProjectsSecretsCreateCall {
1364 c := &ProjectsSecretsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1365 c.parent = parent
1366 c.secret = secret
1367 return c
1368 }
1369
1370
1371
1372
1373
1374 func (c *ProjectsSecretsCreateCall) SecretId(secretId string) *ProjectsSecretsCreateCall {
1375 c.urlParams_.Set("secretId", secretId)
1376 return c
1377 }
1378
1379
1380
1381
1382 func (c *ProjectsSecretsCreateCall) Fields(s ...googleapi.Field) *ProjectsSecretsCreateCall {
1383 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1384 return c
1385 }
1386
1387
1388 func (c *ProjectsSecretsCreateCall) Context(ctx context.Context) *ProjectsSecretsCreateCall {
1389 c.ctx_ = ctx
1390 return c
1391 }
1392
1393
1394
1395 func (c *ProjectsSecretsCreateCall) Header() http.Header {
1396 if c.header_ == nil {
1397 c.header_ = make(http.Header)
1398 }
1399 return c.header_
1400 }
1401
1402 func (c *ProjectsSecretsCreateCall) doRequest(alt string) (*http.Response, error) {
1403 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1404 var body io.Reader = nil
1405 body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret)
1406 if err != nil {
1407 return nil, err
1408 }
1409 c.urlParams_.Set("alt", alt)
1410 c.urlParams_.Set("prettyPrint", "false")
1411 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/secrets")
1412 urls += "?" + c.urlParams_.Encode()
1413 req, err := http.NewRequest("POST", urls, body)
1414 if err != nil {
1415 return nil, err
1416 }
1417 req.Header = reqHeaders
1418 googleapi.Expand(req.URL, map[string]string{
1419 "parent": c.parent,
1420 })
1421 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1422 }
1423
1424
1425
1426
1427
1428
1429 func (c *ProjectsSecretsCreateCall) Do(opts ...googleapi.CallOption) (*Secret, error) {
1430 gensupport.SetOptions(c.urlParams_, opts...)
1431 res, err := c.doRequest("json")
1432 if res != nil && res.StatusCode == http.StatusNotModified {
1433 if res.Body != nil {
1434 res.Body.Close()
1435 }
1436 return nil, gensupport.WrapError(&googleapi.Error{
1437 Code: res.StatusCode,
1438 Header: res.Header,
1439 })
1440 }
1441 if err != nil {
1442 return nil, err
1443 }
1444 defer googleapi.CloseBody(res)
1445 if err := googleapi.CheckResponse(res); err != nil {
1446 return nil, gensupport.WrapError(err)
1447 }
1448 ret := &Secret{
1449 ServerResponse: googleapi.ServerResponse{
1450 Header: res.Header,
1451 HTTPStatusCode: res.StatusCode,
1452 },
1453 }
1454 target := &ret
1455 if err := gensupport.DecodeResponse(target, res); err != nil {
1456 return nil, err
1457 }
1458 return ret, nil
1459 }
1460
1461 type ProjectsSecretsDeleteCall struct {
1462 s *Service
1463 name string
1464 urlParams_ gensupport.URLParams
1465 ctx_ context.Context
1466 header_ http.Header
1467 }
1468
1469
1470
1471
1472
1473 func (r *ProjectsSecretsService) Delete(name string) *ProjectsSecretsDeleteCall {
1474 c := &ProjectsSecretsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1475 c.name = name
1476 return c
1477 }
1478
1479
1480
1481
1482 func (c *ProjectsSecretsDeleteCall) Fields(s ...googleapi.Field) *ProjectsSecretsDeleteCall {
1483 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1484 return c
1485 }
1486
1487
1488 func (c *ProjectsSecretsDeleteCall) Context(ctx context.Context) *ProjectsSecretsDeleteCall {
1489 c.ctx_ = ctx
1490 return c
1491 }
1492
1493
1494
1495 func (c *ProjectsSecretsDeleteCall) Header() http.Header {
1496 if c.header_ == nil {
1497 c.header_ = make(http.Header)
1498 }
1499 return c.header_
1500 }
1501
1502 func (c *ProjectsSecretsDeleteCall) doRequest(alt string) (*http.Response, error) {
1503 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1504 var body io.Reader = nil
1505 c.urlParams_.Set("alt", alt)
1506 c.urlParams_.Set("prettyPrint", "false")
1507 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
1508 urls += "?" + c.urlParams_.Encode()
1509 req, err := http.NewRequest("DELETE", urls, body)
1510 if err != nil {
1511 return nil, err
1512 }
1513 req.Header = reqHeaders
1514 googleapi.Expand(req.URL, map[string]string{
1515 "name": c.name,
1516 })
1517 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1518 }
1519
1520
1521
1522
1523
1524
1525 func (c *ProjectsSecretsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1526 gensupport.SetOptions(c.urlParams_, opts...)
1527 res, err := c.doRequest("json")
1528 if res != nil && res.StatusCode == http.StatusNotModified {
1529 if res.Body != nil {
1530 res.Body.Close()
1531 }
1532 return nil, gensupport.WrapError(&googleapi.Error{
1533 Code: res.StatusCode,
1534 Header: res.Header,
1535 })
1536 }
1537 if err != nil {
1538 return nil, err
1539 }
1540 defer googleapi.CloseBody(res)
1541 if err := googleapi.CheckResponse(res); err != nil {
1542 return nil, gensupport.WrapError(err)
1543 }
1544 ret := &Empty{
1545 ServerResponse: googleapi.ServerResponse{
1546 Header: res.Header,
1547 HTTPStatusCode: res.StatusCode,
1548 },
1549 }
1550 target := &ret
1551 if err := gensupport.DecodeResponse(target, res); err != nil {
1552 return nil, err
1553 }
1554 return ret, nil
1555 }
1556
1557 type ProjectsSecretsGetCall struct {
1558 s *Service
1559 name string
1560 urlParams_ gensupport.URLParams
1561 ifNoneMatch_ string
1562 ctx_ context.Context
1563 header_ http.Header
1564 }
1565
1566
1567
1568
1569
1570 func (r *ProjectsSecretsService) Get(name string) *ProjectsSecretsGetCall {
1571 c := &ProjectsSecretsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1572 c.name = name
1573 return c
1574 }
1575
1576
1577
1578
1579 func (c *ProjectsSecretsGetCall) Fields(s ...googleapi.Field) *ProjectsSecretsGetCall {
1580 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1581 return c
1582 }
1583
1584
1585
1586
1587 func (c *ProjectsSecretsGetCall) IfNoneMatch(entityTag string) *ProjectsSecretsGetCall {
1588 c.ifNoneMatch_ = entityTag
1589 return c
1590 }
1591
1592
1593 func (c *ProjectsSecretsGetCall) Context(ctx context.Context) *ProjectsSecretsGetCall {
1594 c.ctx_ = ctx
1595 return c
1596 }
1597
1598
1599
1600 func (c *ProjectsSecretsGetCall) Header() http.Header {
1601 if c.header_ == nil {
1602 c.header_ = make(http.Header)
1603 }
1604 return c.header_
1605 }
1606
1607 func (c *ProjectsSecretsGetCall) doRequest(alt string) (*http.Response, error) {
1608 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1609 if c.ifNoneMatch_ != "" {
1610 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1611 }
1612 var body io.Reader = nil
1613 c.urlParams_.Set("alt", alt)
1614 c.urlParams_.Set("prettyPrint", "false")
1615 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
1616 urls += "?" + c.urlParams_.Encode()
1617 req, err := http.NewRequest("GET", urls, body)
1618 if err != nil {
1619 return nil, err
1620 }
1621 req.Header = reqHeaders
1622 googleapi.Expand(req.URL, map[string]string{
1623 "name": c.name,
1624 })
1625 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1626 }
1627
1628
1629
1630
1631
1632
1633 func (c *ProjectsSecretsGetCall) Do(opts ...googleapi.CallOption) (*Secret, error) {
1634 gensupport.SetOptions(c.urlParams_, opts...)
1635 res, err := c.doRequest("json")
1636 if res != nil && res.StatusCode == http.StatusNotModified {
1637 if res.Body != nil {
1638 res.Body.Close()
1639 }
1640 return nil, gensupport.WrapError(&googleapi.Error{
1641 Code: res.StatusCode,
1642 Header: res.Header,
1643 })
1644 }
1645 if err != nil {
1646 return nil, err
1647 }
1648 defer googleapi.CloseBody(res)
1649 if err := googleapi.CheckResponse(res); err != nil {
1650 return nil, gensupport.WrapError(err)
1651 }
1652 ret := &Secret{
1653 ServerResponse: googleapi.ServerResponse{
1654 Header: res.Header,
1655 HTTPStatusCode: res.StatusCode,
1656 },
1657 }
1658 target := &ret
1659 if err := gensupport.DecodeResponse(target, res); err != nil {
1660 return nil, err
1661 }
1662 return ret, nil
1663 }
1664
1665 type ProjectsSecretsGetIamPolicyCall struct {
1666 s *Service
1667 resource string
1668 urlParams_ gensupport.URLParams
1669 ifNoneMatch_ string
1670 ctx_ context.Context
1671 header_ http.Header
1672 }
1673
1674
1675
1676
1677
1678
1679
1680 func (r *ProjectsSecretsService) GetIamPolicy(resource string) *ProjectsSecretsGetIamPolicyCall {
1681 c := &ProjectsSecretsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1682 c.resource = resource
1683 return c
1684 }
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698 func (c *ProjectsSecretsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsSecretsGetIamPolicyCall {
1699 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
1700 return c
1701 }
1702
1703
1704
1705
1706 func (c *ProjectsSecretsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSecretsGetIamPolicyCall {
1707 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1708 return c
1709 }
1710
1711
1712
1713
1714 func (c *ProjectsSecretsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsSecretsGetIamPolicyCall {
1715 c.ifNoneMatch_ = entityTag
1716 return c
1717 }
1718
1719
1720 func (c *ProjectsSecretsGetIamPolicyCall) Context(ctx context.Context) *ProjectsSecretsGetIamPolicyCall {
1721 c.ctx_ = ctx
1722 return c
1723 }
1724
1725
1726
1727 func (c *ProjectsSecretsGetIamPolicyCall) Header() http.Header {
1728 if c.header_ == nil {
1729 c.header_ = make(http.Header)
1730 }
1731 return c.header_
1732 }
1733
1734 func (c *ProjectsSecretsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1735 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1736 if c.ifNoneMatch_ != "" {
1737 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1738 }
1739 var body io.Reader = nil
1740 c.urlParams_.Set("alt", alt)
1741 c.urlParams_.Set("prettyPrint", "false")
1742 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
1743 urls += "?" + c.urlParams_.Encode()
1744 req, err := http.NewRequest("GET", urls, body)
1745 if err != nil {
1746 return nil, err
1747 }
1748 req.Header = reqHeaders
1749 googleapi.Expand(req.URL, map[string]string{
1750 "resource": c.resource,
1751 })
1752 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1753 }
1754
1755
1756
1757
1758
1759
1760 func (c *ProjectsSecretsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1761 gensupport.SetOptions(c.urlParams_, opts...)
1762 res, err := c.doRequest("json")
1763 if res != nil && res.StatusCode == http.StatusNotModified {
1764 if res.Body != nil {
1765 res.Body.Close()
1766 }
1767 return nil, gensupport.WrapError(&googleapi.Error{
1768 Code: res.StatusCode,
1769 Header: res.Header,
1770 })
1771 }
1772 if err != nil {
1773 return nil, err
1774 }
1775 defer googleapi.CloseBody(res)
1776 if err := googleapi.CheckResponse(res); err != nil {
1777 return nil, gensupport.WrapError(err)
1778 }
1779 ret := &Policy{
1780 ServerResponse: googleapi.ServerResponse{
1781 Header: res.Header,
1782 HTTPStatusCode: res.StatusCode,
1783 },
1784 }
1785 target := &ret
1786 if err := gensupport.DecodeResponse(target, res); err != nil {
1787 return nil, err
1788 }
1789 return ret, nil
1790 }
1791
1792 type ProjectsSecretsListCall struct {
1793 s *Service
1794 parent string
1795 urlParams_ gensupport.URLParams
1796 ifNoneMatch_ string
1797 ctx_ context.Context
1798 header_ http.Header
1799 }
1800
1801
1802
1803
1804
1805 func (r *ProjectsSecretsService) List(parent string) *ProjectsSecretsListCall {
1806 c := &ProjectsSecretsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1807 c.parent = parent
1808 return c
1809 }
1810
1811
1812
1813
1814
1815 func (c *ProjectsSecretsListCall) PageSize(pageSize int64) *ProjectsSecretsListCall {
1816 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1817 return c
1818 }
1819
1820
1821
1822 func (c *ProjectsSecretsListCall) PageToken(pageToken string) *ProjectsSecretsListCall {
1823 c.urlParams_.Set("pageToken", pageToken)
1824 return c
1825 }
1826
1827
1828
1829
1830 func (c *ProjectsSecretsListCall) Fields(s ...googleapi.Field) *ProjectsSecretsListCall {
1831 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1832 return c
1833 }
1834
1835
1836
1837
1838 func (c *ProjectsSecretsListCall) IfNoneMatch(entityTag string) *ProjectsSecretsListCall {
1839 c.ifNoneMatch_ = entityTag
1840 return c
1841 }
1842
1843
1844 func (c *ProjectsSecretsListCall) Context(ctx context.Context) *ProjectsSecretsListCall {
1845 c.ctx_ = ctx
1846 return c
1847 }
1848
1849
1850
1851 func (c *ProjectsSecretsListCall) Header() http.Header {
1852 if c.header_ == nil {
1853 c.header_ = make(http.Header)
1854 }
1855 return c.header_
1856 }
1857
1858 func (c *ProjectsSecretsListCall) doRequest(alt string) (*http.Response, error) {
1859 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1860 if c.ifNoneMatch_ != "" {
1861 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1862 }
1863 var body io.Reader = nil
1864 c.urlParams_.Set("alt", alt)
1865 c.urlParams_.Set("prettyPrint", "false")
1866 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/secrets")
1867 urls += "?" + c.urlParams_.Encode()
1868 req, err := http.NewRequest("GET", urls, body)
1869 if err != nil {
1870 return nil, err
1871 }
1872 req.Header = reqHeaders
1873 googleapi.Expand(req.URL, map[string]string{
1874 "parent": c.parent,
1875 })
1876 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1877 }
1878
1879
1880
1881
1882
1883
1884
1885 func (c *ProjectsSecretsListCall) Do(opts ...googleapi.CallOption) (*ListSecretsResponse, error) {
1886 gensupport.SetOptions(c.urlParams_, opts...)
1887 res, err := c.doRequest("json")
1888 if res != nil && res.StatusCode == http.StatusNotModified {
1889 if res.Body != nil {
1890 res.Body.Close()
1891 }
1892 return nil, gensupport.WrapError(&googleapi.Error{
1893 Code: res.StatusCode,
1894 Header: res.Header,
1895 })
1896 }
1897 if err != nil {
1898 return nil, err
1899 }
1900 defer googleapi.CloseBody(res)
1901 if err := googleapi.CheckResponse(res); err != nil {
1902 return nil, gensupport.WrapError(err)
1903 }
1904 ret := &ListSecretsResponse{
1905 ServerResponse: googleapi.ServerResponse{
1906 Header: res.Header,
1907 HTTPStatusCode: res.StatusCode,
1908 },
1909 }
1910 target := &ret
1911 if err := gensupport.DecodeResponse(target, res); err != nil {
1912 return nil, err
1913 }
1914 return ret, nil
1915 }
1916
1917
1918
1919
1920 func (c *ProjectsSecretsListCall) Pages(ctx context.Context, f func(*ListSecretsResponse) error) error {
1921 c.ctx_ = ctx
1922 defer c.PageToken(c.urlParams_.Get("pageToken"))
1923 for {
1924 x, err := c.Do()
1925 if err != nil {
1926 return err
1927 }
1928 if err := f(x); err != nil {
1929 return err
1930 }
1931 if x.NextPageToken == "" {
1932 return nil
1933 }
1934 c.PageToken(x.NextPageToken)
1935 }
1936 }
1937
1938 type ProjectsSecretsPatchCall struct {
1939 s *Service
1940 name string
1941 secret *Secret
1942 urlParams_ gensupport.URLParams
1943 ctx_ context.Context
1944 header_ http.Header
1945 }
1946
1947
1948
1949
1950
1951 func (r *ProjectsSecretsService) Patch(name string, secret *Secret) *ProjectsSecretsPatchCall {
1952 c := &ProjectsSecretsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1953 c.name = name
1954 c.secret = secret
1955 return c
1956 }
1957
1958
1959
1960 func (c *ProjectsSecretsPatchCall) UpdateMask(updateMask string) *ProjectsSecretsPatchCall {
1961 c.urlParams_.Set("updateMask", updateMask)
1962 return c
1963 }
1964
1965
1966
1967
1968 func (c *ProjectsSecretsPatchCall) Fields(s ...googleapi.Field) *ProjectsSecretsPatchCall {
1969 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1970 return c
1971 }
1972
1973
1974 func (c *ProjectsSecretsPatchCall) Context(ctx context.Context) *ProjectsSecretsPatchCall {
1975 c.ctx_ = ctx
1976 return c
1977 }
1978
1979
1980
1981 func (c *ProjectsSecretsPatchCall) Header() http.Header {
1982 if c.header_ == nil {
1983 c.header_ = make(http.Header)
1984 }
1985 return c.header_
1986 }
1987
1988 func (c *ProjectsSecretsPatchCall) doRequest(alt string) (*http.Response, error) {
1989 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1990 var body io.Reader = nil
1991 body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret)
1992 if err != nil {
1993 return nil, err
1994 }
1995 c.urlParams_.Set("alt", alt)
1996 c.urlParams_.Set("prettyPrint", "false")
1997 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
1998 urls += "?" + c.urlParams_.Encode()
1999 req, err := http.NewRequest("PATCH", urls, body)
2000 if err != nil {
2001 return nil, err
2002 }
2003 req.Header = reqHeaders
2004 googleapi.Expand(req.URL, map[string]string{
2005 "name": c.name,
2006 })
2007 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2008 }
2009
2010
2011
2012
2013
2014
2015 func (c *ProjectsSecretsPatchCall) Do(opts ...googleapi.CallOption) (*Secret, error) {
2016 gensupport.SetOptions(c.urlParams_, opts...)
2017 res, err := c.doRequest("json")
2018 if res != nil && res.StatusCode == http.StatusNotModified {
2019 if res.Body != nil {
2020 res.Body.Close()
2021 }
2022 return nil, gensupport.WrapError(&googleapi.Error{
2023 Code: res.StatusCode,
2024 Header: res.Header,
2025 })
2026 }
2027 if err != nil {
2028 return nil, err
2029 }
2030 defer googleapi.CloseBody(res)
2031 if err := googleapi.CheckResponse(res); err != nil {
2032 return nil, gensupport.WrapError(err)
2033 }
2034 ret := &Secret{
2035 ServerResponse: googleapi.ServerResponse{
2036 Header: res.Header,
2037 HTTPStatusCode: res.StatusCode,
2038 },
2039 }
2040 target := &ret
2041 if err := gensupport.DecodeResponse(target, res); err != nil {
2042 return nil, err
2043 }
2044 return ret, nil
2045 }
2046
2047 type ProjectsSecretsSetIamPolicyCall struct {
2048 s *Service
2049 resource string
2050 setiampolicyrequest *SetIamPolicyRequest
2051 urlParams_ gensupport.URLParams
2052 ctx_ context.Context
2053 header_ http.Header
2054 }
2055
2056
2057
2058
2059
2060
2061
2062
2063 func (r *ProjectsSecretsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsSecretsSetIamPolicyCall {
2064 c := &ProjectsSecretsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2065 c.resource = resource
2066 c.setiampolicyrequest = setiampolicyrequest
2067 return c
2068 }
2069
2070
2071
2072
2073 func (c *ProjectsSecretsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSecretsSetIamPolicyCall {
2074 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2075 return c
2076 }
2077
2078
2079 func (c *ProjectsSecretsSetIamPolicyCall) Context(ctx context.Context) *ProjectsSecretsSetIamPolicyCall {
2080 c.ctx_ = ctx
2081 return c
2082 }
2083
2084
2085
2086 func (c *ProjectsSecretsSetIamPolicyCall) Header() http.Header {
2087 if c.header_ == nil {
2088 c.header_ = make(http.Header)
2089 }
2090 return c.header_
2091 }
2092
2093 func (c *ProjectsSecretsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2094 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2095 var body io.Reader = nil
2096 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
2097 if err != nil {
2098 return nil, err
2099 }
2100 c.urlParams_.Set("alt", alt)
2101 c.urlParams_.Set("prettyPrint", "false")
2102 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
2103 urls += "?" + c.urlParams_.Encode()
2104 req, err := http.NewRequest("POST", urls, body)
2105 if err != nil {
2106 return nil, err
2107 }
2108 req.Header = reqHeaders
2109 googleapi.Expand(req.URL, map[string]string{
2110 "resource": c.resource,
2111 })
2112 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2113 }
2114
2115
2116
2117
2118
2119
2120 func (c *ProjectsSecretsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2121 gensupport.SetOptions(c.urlParams_, opts...)
2122 res, err := c.doRequest("json")
2123 if res != nil && res.StatusCode == http.StatusNotModified {
2124 if res.Body != nil {
2125 res.Body.Close()
2126 }
2127 return nil, gensupport.WrapError(&googleapi.Error{
2128 Code: res.StatusCode,
2129 Header: res.Header,
2130 })
2131 }
2132 if err != nil {
2133 return nil, err
2134 }
2135 defer googleapi.CloseBody(res)
2136 if err := googleapi.CheckResponse(res); err != nil {
2137 return nil, gensupport.WrapError(err)
2138 }
2139 ret := &Policy{
2140 ServerResponse: googleapi.ServerResponse{
2141 Header: res.Header,
2142 HTTPStatusCode: res.StatusCode,
2143 },
2144 }
2145 target := &ret
2146 if err := gensupport.DecodeResponse(target, res); err != nil {
2147 return nil, err
2148 }
2149 return ret, nil
2150 }
2151
2152 type ProjectsSecretsTestIamPermissionsCall struct {
2153 s *Service
2154 resource string
2155 testiampermissionsrequest *TestIamPermissionsRequest
2156 urlParams_ gensupport.URLParams
2157 ctx_ context.Context
2158 header_ http.Header
2159 }
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171 func (r *ProjectsSecretsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsSecretsTestIamPermissionsCall {
2172 c := &ProjectsSecretsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2173 c.resource = resource
2174 c.testiampermissionsrequest = testiampermissionsrequest
2175 return c
2176 }
2177
2178
2179
2180
2181 func (c *ProjectsSecretsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsSecretsTestIamPermissionsCall {
2182 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2183 return c
2184 }
2185
2186
2187 func (c *ProjectsSecretsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsSecretsTestIamPermissionsCall {
2188 c.ctx_ = ctx
2189 return c
2190 }
2191
2192
2193
2194 func (c *ProjectsSecretsTestIamPermissionsCall) Header() http.Header {
2195 if c.header_ == nil {
2196 c.header_ = make(http.Header)
2197 }
2198 return c.header_
2199 }
2200
2201 func (c *ProjectsSecretsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
2202 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2203 var body io.Reader = nil
2204 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
2205 if err != nil {
2206 return nil, err
2207 }
2208 c.urlParams_.Set("alt", alt)
2209 c.urlParams_.Set("prettyPrint", "false")
2210 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
2211 urls += "?" + c.urlParams_.Encode()
2212 req, err := http.NewRequest("POST", urls, body)
2213 if err != nil {
2214 return nil, err
2215 }
2216 req.Header = reqHeaders
2217 googleapi.Expand(req.URL, map[string]string{
2218 "resource": c.resource,
2219 })
2220 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2221 }
2222
2223
2224
2225
2226
2227
2228
2229 func (c *ProjectsSecretsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
2230 gensupport.SetOptions(c.urlParams_, opts...)
2231 res, err := c.doRequest("json")
2232 if res != nil && res.StatusCode == http.StatusNotModified {
2233 if res.Body != nil {
2234 res.Body.Close()
2235 }
2236 return nil, gensupport.WrapError(&googleapi.Error{
2237 Code: res.StatusCode,
2238 Header: res.Header,
2239 })
2240 }
2241 if err != nil {
2242 return nil, err
2243 }
2244 defer googleapi.CloseBody(res)
2245 if err := googleapi.CheckResponse(res); err != nil {
2246 return nil, gensupport.WrapError(err)
2247 }
2248 ret := &TestIamPermissionsResponse{
2249 ServerResponse: googleapi.ServerResponse{
2250 Header: res.Header,
2251 HTTPStatusCode: res.StatusCode,
2252 },
2253 }
2254 target := &ret
2255 if err := gensupport.DecodeResponse(target, res); err != nil {
2256 return nil, err
2257 }
2258 return ret, nil
2259 }
2260
2261 type ProjectsSecretsVersionsAccessCall struct {
2262 s *Service
2263 name string
2264 urlParams_ gensupport.URLParams
2265 ifNoneMatch_ string
2266 ctx_ context.Context
2267 header_ http.Header
2268 }
2269
2270
2271
2272
2273
2274
2275
2276 func (r *ProjectsSecretsVersionsService) Access(name string) *ProjectsSecretsVersionsAccessCall {
2277 c := &ProjectsSecretsVersionsAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2278 c.name = name
2279 return c
2280 }
2281
2282
2283
2284
2285 func (c *ProjectsSecretsVersionsAccessCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsAccessCall {
2286 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2287 return c
2288 }
2289
2290
2291
2292
2293 func (c *ProjectsSecretsVersionsAccessCall) IfNoneMatch(entityTag string) *ProjectsSecretsVersionsAccessCall {
2294 c.ifNoneMatch_ = entityTag
2295 return c
2296 }
2297
2298
2299 func (c *ProjectsSecretsVersionsAccessCall) Context(ctx context.Context) *ProjectsSecretsVersionsAccessCall {
2300 c.ctx_ = ctx
2301 return c
2302 }
2303
2304
2305
2306 func (c *ProjectsSecretsVersionsAccessCall) Header() http.Header {
2307 if c.header_ == nil {
2308 c.header_ = make(http.Header)
2309 }
2310 return c.header_
2311 }
2312
2313 func (c *ProjectsSecretsVersionsAccessCall) doRequest(alt string) (*http.Response, error) {
2314 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2315 if c.ifNoneMatch_ != "" {
2316 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2317 }
2318 var body io.Reader = nil
2319 c.urlParams_.Set("alt", alt)
2320 c.urlParams_.Set("prettyPrint", "false")
2321 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:access")
2322 urls += "?" + c.urlParams_.Encode()
2323 req, err := http.NewRequest("GET", urls, body)
2324 if err != nil {
2325 return nil, err
2326 }
2327 req.Header = reqHeaders
2328 googleapi.Expand(req.URL, map[string]string{
2329 "name": c.name,
2330 })
2331 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2332 }
2333
2334
2335
2336
2337
2338
2339
2340 func (c *ProjectsSecretsVersionsAccessCall) Do(opts ...googleapi.CallOption) (*AccessSecretVersionResponse, error) {
2341 gensupport.SetOptions(c.urlParams_, opts...)
2342 res, err := c.doRequest("json")
2343 if res != nil && res.StatusCode == http.StatusNotModified {
2344 if res.Body != nil {
2345 res.Body.Close()
2346 }
2347 return nil, gensupport.WrapError(&googleapi.Error{
2348 Code: res.StatusCode,
2349 Header: res.Header,
2350 })
2351 }
2352 if err != nil {
2353 return nil, err
2354 }
2355 defer googleapi.CloseBody(res)
2356 if err := googleapi.CheckResponse(res); err != nil {
2357 return nil, gensupport.WrapError(err)
2358 }
2359 ret := &AccessSecretVersionResponse{
2360 ServerResponse: googleapi.ServerResponse{
2361 Header: res.Header,
2362 HTTPStatusCode: res.StatusCode,
2363 },
2364 }
2365 target := &ret
2366 if err := gensupport.DecodeResponse(target, res); err != nil {
2367 return nil, err
2368 }
2369 return ret, nil
2370 }
2371
2372 type ProjectsSecretsVersionsDestroyCall struct {
2373 s *Service
2374 name string
2375 destroysecretversionrequest *DestroySecretVersionRequest
2376 urlParams_ gensupport.URLParams
2377 ctx_ context.Context
2378 header_ http.Header
2379 }
2380
2381
2382
2383
2384
2385
2386 func (r *ProjectsSecretsVersionsService) Destroy(name string, destroysecretversionrequest *DestroySecretVersionRequest) *ProjectsSecretsVersionsDestroyCall {
2387 c := &ProjectsSecretsVersionsDestroyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2388 c.name = name
2389 c.destroysecretversionrequest = destroysecretversionrequest
2390 return c
2391 }
2392
2393
2394
2395
2396 func (c *ProjectsSecretsVersionsDestroyCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsDestroyCall {
2397 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2398 return c
2399 }
2400
2401
2402 func (c *ProjectsSecretsVersionsDestroyCall) Context(ctx context.Context) *ProjectsSecretsVersionsDestroyCall {
2403 c.ctx_ = ctx
2404 return c
2405 }
2406
2407
2408
2409 func (c *ProjectsSecretsVersionsDestroyCall) Header() http.Header {
2410 if c.header_ == nil {
2411 c.header_ = make(http.Header)
2412 }
2413 return c.header_
2414 }
2415
2416 func (c *ProjectsSecretsVersionsDestroyCall) doRequest(alt string) (*http.Response, error) {
2417 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2418 var body io.Reader = nil
2419 body, err := googleapi.WithoutDataWrapper.JSONReader(c.destroysecretversionrequest)
2420 if err != nil {
2421 return nil, err
2422 }
2423 c.urlParams_.Set("alt", alt)
2424 c.urlParams_.Set("prettyPrint", "false")
2425 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:destroy")
2426 urls += "?" + c.urlParams_.Encode()
2427 req, err := http.NewRequest("POST", urls, body)
2428 if err != nil {
2429 return nil, err
2430 }
2431 req.Header = reqHeaders
2432 googleapi.Expand(req.URL, map[string]string{
2433 "name": c.name,
2434 })
2435 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2436 }
2437
2438
2439
2440
2441
2442
2443 func (c *ProjectsSecretsVersionsDestroyCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
2444 gensupport.SetOptions(c.urlParams_, opts...)
2445 res, err := c.doRequest("json")
2446 if res != nil && res.StatusCode == http.StatusNotModified {
2447 if res.Body != nil {
2448 res.Body.Close()
2449 }
2450 return nil, gensupport.WrapError(&googleapi.Error{
2451 Code: res.StatusCode,
2452 Header: res.Header,
2453 })
2454 }
2455 if err != nil {
2456 return nil, err
2457 }
2458 defer googleapi.CloseBody(res)
2459 if err := googleapi.CheckResponse(res); err != nil {
2460 return nil, gensupport.WrapError(err)
2461 }
2462 ret := &SecretVersion{
2463 ServerResponse: googleapi.ServerResponse{
2464 Header: res.Header,
2465 HTTPStatusCode: res.StatusCode,
2466 },
2467 }
2468 target := &ret
2469 if err := gensupport.DecodeResponse(target, res); err != nil {
2470 return nil, err
2471 }
2472 return ret, nil
2473 }
2474
2475 type ProjectsSecretsVersionsDisableCall struct {
2476 s *Service
2477 name string
2478 disablesecretversionrequest *DisableSecretVersionRequest
2479 urlParams_ gensupport.URLParams
2480 ctx_ context.Context
2481 header_ http.Header
2482 }
2483
2484
2485
2486
2487
2488
2489 func (r *ProjectsSecretsVersionsService) Disable(name string, disablesecretversionrequest *DisableSecretVersionRequest) *ProjectsSecretsVersionsDisableCall {
2490 c := &ProjectsSecretsVersionsDisableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2491 c.name = name
2492 c.disablesecretversionrequest = disablesecretversionrequest
2493 return c
2494 }
2495
2496
2497
2498
2499 func (c *ProjectsSecretsVersionsDisableCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsDisableCall {
2500 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2501 return c
2502 }
2503
2504
2505 func (c *ProjectsSecretsVersionsDisableCall) Context(ctx context.Context) *ProjectsSecretsVersionsDisableCall {
2506 c.ctx_ = ctx
2507 return c
2508 }
2509
2510
2511
2512 func (c *ProjectsSecretsVersionsDisableCall) Header() http.Header {
2513 if c.header_ == nil {
2514 c.header_ = make(http.Header)
2515 }
2516 return c.header_
2517 }
2518
2519 func (c *ProjectsSecretsVersionsDisableCall) doRequest(alt string) (*http.Response, error) {
2520 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2521 var body io.Reader = nil
2522 body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablesecretversionrequest)
2523 if err != nil {
2524 return nil, err
2525 }
2526 c.urlParams_.Set("alt", alt)
2527 c.urlParams_.Set("prettyPrint", "false")
2528 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:disable")
2529 urls += "?" + c.urlParams_.Encode()
2530 req, err := http.NewRequest("POST", urls, body)
2531 if err != nil {
2532 return nil, err
2533 }
2534 req.Header = reqHeaders
2535 googleapi.Expand(req.URL, map[string]string{
2536 "name": c.name,
2537 })
2538 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2539 }
2540
2541
2542
2543
2544
2545
2546 func (c *ProjectsSecretsVersionsDisableCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
2547 gensupport.SetOptions(c.urlParams_, opts...)
2548 res, err := c.doRequest("json")
2549 if res != nil && res.StatusCode == http.StatusNotModified {
2550 if res.Body != nil {
2551 res.Body.Close()
2552 }
2553 return nil, gensupport.WrapError(&googleapi.Error{
2554 Code: res.StatusCode,
2555 Header: res.Header,
2556 })
2557 }
2558 if err != nil {
2559 return nil, err
2560 }
2561 defer googleapi.CloseBody(res)
2562 if err := googleapi.CheckResponse(res); err != nil {
2563 return nil, gensupport.WrapError(err)
2564 }
2565 ret := &SecretVersion{
2566 ServerResponse: googleapi.ServerResponse{
2567 Header: res.Header,
2568 HTTPStatusCode: res.StatusCode,
2569 },
2570 }
2571 target := &ret
2572 if err := gensupport.DecodeResponse(target, res); err != nil {
2573 return nil, err
2574 }
2575 return ret, nil
2576 }
2577
2578 type ProjectsSecretsVersionsEnableCall struct {
2579 s *Service
2580 name string
2581 enablesecretversionrequest *EnableSecretVersionRequest
2582 urlParams_ gensupport.URLParams
2583 ctx_ context.Context
2584 header_ http.Header
2585 }
2586
2587
2588
2589
2590
2591
2592 func (r *ProjectsSecretsVersionsService) Enable(name string, enablesecretversionrequest *EnableSecretVersionRequest) *ProjectsSecretsVersionsEnableCall {
2593 c := &ProjectsSecretsVersionsEnableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2594 c.name = name
2595 c.enablesecretversionrequest = enablesecretversionrequest
2596 return c
2597 }
2598
2599
2600
2601
2602 func (c *ProjectsSecretsVersionsEnableCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsEnableCall {
2603 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2604 return c
2605 }
2606
2607
2608 func (c *ProjectsSecretsVersionsEnableCall) Context(ctx context.Context) *ProjectsSecretsVersionsEnableCall {
2609 c.ctx_ = ctx
2610 return c
2611 }
2612
2613
2614
2615 func (c *ProjectsSecretsVersionsEnableCall) Header() http.Header {
2616 if c.header_ == nil {
2617 c.header_ = make(http.Header)
2618 }
2619 return c.header_
2620 }
2621
2622 func (c *ProjectsSecretsVersionsEnableCall) doRequest(alt string) (*http.Response, error) {
2623 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2624 var body io.Reader = nil
2625 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablesecretversionrequest)
2626 if err != nil {
2627 return nil, err
2628 }
2629 c.urlParams_.Set("alt", alt)
2630 c.urlParams_.Set("prettyPrint", "false")
2631 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:enable")
2632 urls += "?" + c.urlParams_.Encode()
2633 req, err := http.NewRequest("POST", urls, body)
2634 if err != nil {
2635 return nil, err
2636 }
2637 req.Header = reqHeaders
2638 googleapi.Expand(req.URL, map[string]string{
2639 "name": c.name,
2640 })
2641 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2642 }
2643
2644
2645
2646
2647
2648
2649 func (c *ProjectsSecretsVersionsEnableCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
2650 gensupport.SetOptions(c.urlParams_, opts...)
2651 res, err := c.doRequest("json")
2652 if res != nil && res.StatusCode == http.StatusNotModified {
2653 if res.Body != nil {
2654 res.Body.Close()
2655 }
2656 return nil, gensupport.WrapError(&googleapi.Error{
2657 Code: res.StatusCode,
2658 Header: res.Header,
2659 })
2660 }
2661 if err != nil {
2662 return nil, err
2663 }
2664 defer googleapi.CloseBody(res)
2665 if err := googleapi.CheckResponse(res); err != nil {
2666 return nil, gensupport.WrapError(err)
2667 }
2668 ret := &SecretVersion{
2669 ServerResponse: googleapi.ServerResponse{
2670 Header: res.Header,
2671 HTTPStatusCode: res.StatusCode,
2672 },
2673 }
2674 target := &ret
2675 if err := gensupport.DecodeResponse(target, res); err != nil {
2676 return nil, err
2677 }
2678 return ret, nil
2679 }
2680
2681 type ProjectsSecretsVersionsGetCall struct {
2682 s *Service
2683 name string
2684 urlParams_ gensupport.URLParams
2685 ifNoneMatch_ string
2686 ctx_ context.Context
2687 header_ http.Header
2688 }
2689
2690
2691
2692
2693
2694
2695
2696
2697 func (r *ProjectsSecretsVersionsService) Get(name string) *ProjectsSecretsVersionsGetCall {
2698 c := &ProjectsSecretsVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2699 c.name = name
2700 return c
2701 }
2702
2703
2704
2705
2706 func (c *ProjectsSecretsVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsGetCall {
2707 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2708 return c
2709 }
2710
2711
2712
2713
2714 func (c *ProjectsSecretsVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsSecretsVersionsGetCall {
2715 c.ifNoneMatch_ = entityTag
2716 return c
2717 }
2718
2719
2720 func (c *ProjectsSecretsVersionsGetCall) Context(ctx context.Context) *ProjectsSecretsVersionsGetCall {
2721 c.ctx_ = ctx
2722 return c
2723 }
2724
2725
2726
2727 func (c *ProjectsSecretsVersionsGetCall) Header() http.Header {
2728 if c.header_ == nil {
2729 c.header_ = make(http.Header)
2730 }
2731 return c.header_
2732 }
2733
2734 func (c *ProjectsSecretsVersionsGetCall) doRequest(alt string) (*http.Response, error) {
2735 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2736 if c.ifNoneMatch_ != "" {
2737 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2738 }
2739 var body io.Reader = nil
2740 c.urlParams_.Set("alt", alt)
2741 c.urlParams_.Set("prettyPrint", "false")
2742 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2743 urls += "?" + c.urlParams_.Encode()
2744 req, err := http.NewRequest("GET", urls, body)
2745 if err != nil {
2746 return nil, err
2747 }
2748 req.Header = reqHeaders
2749 googleapi.Expand(req.URL, map[string]string{
2750 "name": c.name,
2751 })
2752 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2753 }
2754
2755
2756
2757
2758
2759
2760 func (c *ProjectsSecretsVersionsGetCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
2761 gensupport.SetOptions(c.urlParams_, opts...)
2762 res, err := c.doRequest("json")
2763 if res != nil && res.StatusCode == http.StatusNotModified {
2764 if res.Body != nil {
2765 res.Body.Close()
2766 }
2767 return nil, gensupport.WrapError(&googleapi.Error{
2768 Code: res.StatusCode,
2769 Header: res.Header,
2770 })
2771 }
2772 if err != nil {
2773 return nil, err
2774 }
2775 defer googleapi.CloseBody(res)
2776 if err := googleapi.CheckResponse(res); err != nil {
2777 return nil, gensupport.WrapError(err)
2778 }
2779 ret := &SecretVersion{
2780 ServerResponse: googleapi.ServerResponse{
2781 Header: res.Header,
2782 HTTPStatusCode: res.StatusCode,
2783 },
2784 }
2785 target := &ret
2786 if err := gensupport.DecodeResponse(target, res); err != nil {
2787 return nil, err
2788 }
2789 return ret, nil
2790 }
2791
2792 type ProjectsSecretsVersionsListCall struct {
2793 s *Service
2794 parent string
2795 urlParams_ gensupport.URLParams
2796 ifNoneMatch_ string
2797 ctx_ context.Context
2798 header_ http.Header
2799 }
2800
2801
2802
2803
2804
2805 func (r *ProjectsSecretsVersionsService) List(parent string) *ProjectsSecretsVersionsListCall {
2806 c := &ProjectsSecretsVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2807 c.parent = parent
2808 return c
2809 }
2810
2811
2812
2813
2814
2815 func (c *ProjectsSecretsVersionsListCall) PageSize(pageSize int64) *ProjectsSecretsVersionsListCall {
2816 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2817 return c
2818 }
2819
2820
2821
2822 func (c *ProjectsSecretsVersionsListCall) PageToken(pageToken string) *ProjectsSecretsVersionsListCall {
2823 c.urlParams_.Set("pageToken", pageToken)
2824 return c
2825 }
2826
2827
2828
2829
2830 func (c *ProjectsSecretsVersionsListCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsListCall {
2831 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2832 return c
2833 }
2834
2835
2836
2837
2838 func (c *ProjectsSecretsVersionsListCall) IfNoneMatch(entityTag string) *ProjectsSecretsVersionsListCall {
2839 c.ifNoneMatch_ = entityTag
2840 return c
2841 }
2842
2843
2844 func (c *ProjectsSecretsVersionsListCall) Context(ctx context.Context) *ProjectsSecretsVersionsListCall {
2845 c.ctx_ = ctx
2846 return c
2847 }
2848
2849
2850
2851 func (c *ProjectsSecretsVersionsListCall) Header() http.Header {
2852 if c.header_ == nil {
2853 c.header_ = make(http.Header)
2854 }
2855 return c.header_
2856 }
2857
2858 func (c *ProjectsSecretsVersionsListCall) doRequest(alt string) (*http.Response, error) {
2859 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2860 if c.ifNoneMatch_ != "" {
2861 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2862 }
2863 var body io.Reader = nil
2864 c.urlParams_.Set("alt", alt)
2865 c.urlParams_.Set("prettyPrint", "false")
2866 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions")
2867 urls += "?" + c.urlParams_.Encode()
2868 req, err := http.NewRequest("GET", urls, body)
2869 if err != nil {
2870 return nil, err
2871 }
2872 req.Header = reqHeaders
2873 googleapi.Expand(req.URL, map[string]string{
2874 "parent": c.parent,
2875 })
2876 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2877 }
2878
2879
2880
2881
2882
2883
2884
2885 func (c *ProjectsSecretsVersionsListCall) Do(opts ...googleapi.CallOption) (*ListSecretVersionsResponse, error) {
2886 gensupport.SetOptions(c.urlParams_, opts...)
2887 res, err := c.doRequest("json")
2888 if res != nil && res.StatusCode == http.StatusNotModified {
2889 if res.Body != nil {
2890 res.Body.Close()
2891 }
2892 return nil, gensupport.WrapError(&googleapi.Error{
2893 Code: res.StatusCode,
2894 Header: res.Header,
2895 })
2896 }
2897 if err != nil {
2898 return nil, err
2899 }
2900 defer googleapi.CloseBody(res)
2901 if err := googleapi.CheckResponse(res); err != nil {
2902 return nil, gensupport.WrapError(err)
2903 }
2904 ret := &ListSecretVersionsResponse{
2905 ServerResponse: googleapi.ServerResponse{
2906 Header: res.Header,
2907 HTTPStatusCode: res.StatusCode,
2908 },
2909 }
2910 target := &ret
2911 if err := gensupport.DecodeResponse(target, res); err != nil {
2912 return nil, err
2913 }
2914 return ret, nil
2915 }
2916
2917
2918
2919
2920 func (c *ProjectsSecretsVersionsListCall) Pages(ctx context.Context, f func(*ListSecretVersionsResponse) error) error {
2921 c.ctx_ = ctx
2922 defer c.PageToken(c.urlParams_.Get("pageToken"))
2923 for {
2924 x, err := c.Do()
2925 if err != nil {
2926 return err
2927 }
2928 if err := f(x); err != nil {
2929 return err
2930 }
2931 if x.NextPageToken == "" {
2932 return nil
2933 }
2934 c.PageToken(x.NextPageToken)
2935 }
2936 }
2937
View as plain text