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:v1beta2"
90 const apiName = "secretmanager"
91 const apiVersion = "v1beta2"
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 rs.Secrets = NewProjectsLocationsSecretsService(s)
175 return rs
176 }
177
178 type ProjectsLocationsService struct {
179 s *Service
180
181 Secrets *ProjectsLocationsSecretsService
182 }
183
184 func NewProjectsLocationsSecretsService(s *Service) *ProjectsLocationsSecretsService {
185 rs := &ProjectsLocationsSecretsService{s: s}
186 rs.Versions = NewProjectsLocationsSecretsVersionsService(s)
187 return rs
188 }
189
190 type ProjectsLocationsSecretsService struct {
191 s *Service
192
193 Versions *ProjectsLocationsSecretsVersionsService
194 }
195
196 func NewProjectsLocationsSecretsVersionsService(s *Service) *ProjectsLocationsSecretsVersionsService {
197 rs := &ProjectsLocationsSecretsVersionsService{s: s}
198 return rs
199 }
200
201 type ProjectsLocationsSecretsVersionsService struct {
202 s *Service
203 }
204
205 func NewProjectsSecretsService(s *Service) *ProjectsSecretsService {
206 rs := &ProjectsSecretsService{s: s}
207 rs.Versions = NewProjectsSecretsVersionsService(s)
208 return rs
209 }
210
211 type ProjectsSecretsService struct {
212 s *Service
213
214 Versions *ProjectsSecretsVersionsService
215 }
216
217 func NewProjectsSecretsVersionsService(s *Service) *ProjectsSecretsVersionsService {
218 rs := &ProjectsSecretsVersionsService{s: s}
219 return rs
220 }
221
222 type ProjectsSecretsVersionsService struct {
223 s *Service
224 }
225
226
227
228 type AccessSecretVersionResponse struct {
229
230
231
232 Name string `json:"name,omitempty"`
233
234 Payload *SecretPayload `json:"payload,omitempty"`
235
236
237 googleapi.ServerResponse `json:"-"`
238
239
240
241
242
243 ForceSendFields []string `json:"-"`
244
245
246
247
248 NullFields []string `json:"-"`
249 }
250
251 func (s *AccessSecretVersionResponse) MarshalJSON() ([]byte, error) {
252 type NoMethod AccessSecretVersionResponse
253 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
254 }
255
256
257
258 type AddSecretVersionRequest struct {
259
260 Payload *SecretPayload `json:"payload,omitempty"`
261
262
263
264
265
266 ForceSendFields []string `json:"-"`
267
268
269
270
271 NullFields []string `json:"-"`
272 }
273
274 func (s *AddSecretVersionRequest) MarshalJSON() ([]byte, error) {
275 type NoMethod AddSecretVersionRequest
276 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
277 }
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295 type AuditConfig struct {
296
297 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
298
299
300
301 Service string `json:"service,omitempty"`
302
303
304
305
306
307 ForceSendFields []string `json:"-"`
308
309
310
311
312 NullFields []string `json:"-"`
313 }
314
315 func (s *AuditConfig) MarshalJSON() ([]byte, error) {
316 type NoMethod AuditConfig
317 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
318 }
319
320
321
322
323
324
325 type AuditLogConfig struct {
326
327
328 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
329
330
331
332
333
334
335
336 LogType string `json:"logType,omitempty"`
337
338
339
340
341
342 ForceSendFields []string `json:"-"`
343
344
345
346
347 NullFields []string `json:"-"`
348 }
349
350 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
351 type NoMethod AuditLogConfig
352 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
353 }
354
355
356
357 type Automatic struct {
358
359
360
361
362
363 CustomerManagedEncryption *CustomerManagedEncryption `json:"customerManagedEncryption,omitempty"`
364
365
366
367
368
369 ForceSendFields []string `json:"-"`
370
371
372
373
374 NullFields []string `json:"-"`
375 }
376
377 func (s *Automatic) MarshalJSON() ([]byte, error) {
378 type NoMethod Automatic
379 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
380 }
381
382
383
384
385 type AutomaticStatus struct {
386
387
388
389 CustomerManagedEncryption *CustomerManagedEncryptionStatus `json:"customerManagedEncryption,omitempty"`
390
391
392
393
394
395 ForceSendFields []string `json:"-"`
396
397
398
399
400 NullFields []string `json:"-"`
401 }
402
403 func (s *AutomaticStatus) MarshalJSON() ([]byte, error) {
404 type NoMethod AutomaticStatus
405 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
406 }
407
408
409 type Binding struct {
410
411
412
413
414
415
416
417
418 Condition *Expr `json:"condition,omitempty"`
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481 Members []string `json:"members,omitempty"`
482
483
484
485
486
487
488 Role string `json:"role,omitempty"`
489
490
491
492
493
494 ForceSendFields []string `json:"-"`
495
496
497
498
499 NullFields []string `json:"-"`
500 }
501
502 func (s *Binding) MarshalJSON() ([]byte, error) {
503 type NoMethod Binding
504 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
505 }
506
507
508
509 type CustomerManagedEncryption struct {
510
511
512
513
514
515
516 KmsKeyName string `json:"kmsKeyName,omitempty"`
517
518
519
520
521
522 ForceSendFields []string `json:"-"`
523
524
525
526
527 NullFields []string `json:"-"`
528 }
529
530 func (s *CustomerManagedEncryption) MarshalJSON() ([]byte, error) {
531 type NoMethod CustomerManagedEncryption
532 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
533 }
534
535
536
537 type CustomerManagedEncryptionStatus struct {
538
539
540
541 KmsKeyVersionName string `json:"kmsKeyVersionName,omitempty"`
542
543
544
545
546
547 ForceSendFields []string `json:"-"`
548
549
550
551
552 NullFields []string `json:"-"`
553 }
554
555 func (s *CustomerManagedEncryptionStatus) MarshalJSON() ([]byte, error) {
556 type NoMethod CustomerManagedEncryptionStatus
557 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
558 }
559
560
561
562 type DestroySecretVersionRequest struct {
563
564
565
566 Etag string `json:"etag,omitempty"`
567
568
569
570
571
572 ForceSendFields []string `json:"-"`
573
574
575
576
577 NullFields []string `json:"-"`
578 }
579
580 func (s *DestroySecretVersionRequest) MarshalJSON() ([]byte, error) {
581 type NoMethod DestroySecretVersionRequest
582 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
583 }
584
585
586
587 type DisableSecretVersionRequest struct {
588
589
590
591 Etag string `json:"etag,omitempty"`
592
593
594
595
596
597 ForceSendFields []string `json:"-"`
598
599
600
601
602 NullFields []string `json:"-"`
603 }
604
605 func (s *DisableSecretVersionRequest) MarshalJSON() ([]byte, error) {
606 type NoMethod DisableSecretVersionRequest
607 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
608 }
609
610
611
612
613
614 type Empty struct {
615
616 googleapi.ServerResponse `json:"-"`
617 }
618
619
620
621 type EnableSecretVersionRequest struct {
622
623
624
625 Etag string `json:"etag,omitempty"`
626
627
628
629
630
631 ForceSendFields []string `json:"-"`
632
633
634
635
636 NullFields []string `json:"-"`
637 }
638
639 func (s *EnableSecretVersionRequest) MarshalJSON() ([]byte, error) {
640 type NoMethod EnableSecretVersionRequest
641 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
642 }
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660 type Expr struct {
661
662
663 Description string `json:"description,omitempty"`
664
665
666 Expression string `json:"expression,omitempty"`
667
668
669 Location string `json:"location,omitempty"`
670
671
672
673 Title string `json:"title,omitempty"`
674
675
676
677
678
679 ForceSendFields []string `json:"-"`
680
681
682
683
684 NullFields []string `json:"-"`
685 }
686
687 func (s *Expr) MarshalJSON() ([]byte, error) {
688 type NoMethod Expr
689 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
690 }
691
692
693 type ListLocationsResponse struct {
694
695
696 Locations []*Location `json:"locations,omitempty"`
697
698 NextPageToken string `json:"nextPageToken,omitempty"`
699
700
701 googleapi.ServerResponse `json:"-"`
702
703
704
705
706
707 ForceSendFields []string `json:"-"`
708
709
710
711
712 NullFields []string `json:"-"`
713 }
714
715 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
716 type NoMethod ListLocationsResponse
717 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
718 }
719
720
721
722 type ListSecretVersionsResponse struct {
723
724
725 NextPageToken string `json:"nextPageToken,omitempty"`
726
727
728 TotalSize int64 `json:"totalSize,omitempty"`
729
730
731 Versions []*SecretVersion `json:"versions,omitempty"`
732
733
734 googleapi.ServerResponse `json:"-"`
735
736
737
738
739
740 ForceSendFields []string `json:"-"`
741
742
743
744
745 NullFields []string `json:"-"`
746 }
747
748 func (s *ListSecretVersionsResponse) MarshalJSON() ([]byte, error) {
749 type NoMethod ListSecretVersionsResponse
750 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
751 }
752
753
754 type ListSecretsResponse struct {
755
756
757 NextPageToken string `json:"nextPageToken,omitempty"`
758
759
760 Secrets []*Secret `json:"secrets,omitempty"`
761
762
763 TotalSize int64 `json:"totalSize,omitempty"`
764
765
766 googleapi.ServerResponse `json:"-"`
767
768
769
770
771
772 ForceSendFields []string `json:"-"`
773
774
775
776
777 NullFields []string `json:"-"`
778 }
779
780 func (s *ListSecretsResponse) MarshalJSON() ([]byte, error) {
781 type NoMethod ListSecretsResponse
782 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
783 }
784
785
786 type Location struct {
787
788
789 DisplayName string `json:"displayName,omitempty"`
790
791
792 Labels map[string]string `json:"labels,omitempty"`
793
794 LocationId string `json:"locationId,omitempty"`
795
796
797 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
798
799
800
801 Name string `json:"name,omitempty"`
802
803
804 googleapi.ServerResponse `json:"-"`
805
806
807
808
809
810 ForceSendFields []string `json:"-"`
811
812
813
814
815 NullFields []string `json:"-"`
816 }
817
818 func (s *Location) MarshalJSON() ([]byte, error) {
819 type NoMethod Location
820 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
821 }
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853 type Policy struct {
854
855 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
856
857
858
859
860
861
862
863
864
865 Bindings []*Binding `json:"bindings,omitempty"`
866
867
868
869
870
871
872
873
874
875
876
877 Etag string `json:"etag,omitempty"`
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893 Version int64 `json:"version,omitempty"`
894
895
896 googleapi.ServerResponse `json:"-"`
897
898
899
900
901
902 ForceSendFields []string `json:"-"`
903
904
905
906
907 NullFields []string `json:"-"`
908 }
909
910 func (s *Policy) MarshalJSON() ([]byte, error) {
911 type NoMethod Policy
912 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
913 }
914
915
916 type Replica struct {
917
918
919
920
921
922 CustomerManagedEncryption *CustomerManagedEncryption `json:"customerManagedEncryption,omitempty"`
923
924
925 Location string `json:"location,omitempty"`
926
927
928
929
930
931 ForceSendFields []string `json:"-"`
932
933
934
935
936 NullFields []string `json:"-"`
937 }
938
939 func (s *Replica) MarshalJSON() ([]byte, error) {
940 type NoMethod Replica
941 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
942 }
943
944
945
946 type ReplicaStatus struct {
947
948
949
950 CustomerManagedEncryption *CustomerManagedEncryptionStatus `json:"customerManagedEncryption,omitempty"`
951
952
953 Location string `json:"location,omitempty"`
954
955
956
957
958
959 ForceSendFields []string `json:"-"`
960
961
962
963
964 NullFields []string `json:"-"`
965 }
966
967 func (s *ReplicaStatus) MarshalJSON() ([]byte, error) {
968 type NoMethod ReplicaStatus
969 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
970 }
971
972
973
974 type Replication struct {
975
976
977 Automatic *Automatic `json:"automatic,omitempty"`
978
979
980 UserManaged *UserManaged `json:"userManaged,omitempty"`
981
982
983
984
985
986 ForceSendFields []string `json:"-"`
987
988
989
990
991 NullFields []string `json:"-"`
992 }
993
994 func (s *Replication) MarshalJSON() ([]byte, error) {
995 type NoMethod Replication
996 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
997 }
998
999
1000 type ReplicationStatus struct {
1001
1002
1003
1004 Automatic *AutomaticStatus `json:"automatic,omitempty"`
1005
1006
1007
1008 UserManaged *UserManagedStatus `json:"userManaged,omitempty"`
1009
1010
1011
1012
1013
1014 ForceSendFields []string `json:"-"`
1015
1016
1017
1018
1019 NullFields []string `json:"-"`
1020 }
1021
1022 func (s *ReplicationStatus) MarshalJSON() ([]byte, error) {
1023 type NoMethod ReplicationStatus
1024 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1025 }
1026
1027
1028
1029
1030 type Rotation struct {
1031
1032
1033
1034
1035 NextRotationTime string `json:"nextRotationTime,omitempty"`
1036
1037
1038
1039
1040
1041 RotationPeriod string `json:"rotationPeriod,omitempty"`
1042
1043
1044
1045
1046
1047 ForceSendFields []string `json:"-"`
1048
1049
1050
1051
1052 NullFields []string `json:"-"`
1053 }
1054
1055 func (s *Rotation) MarshalJSON() ([]byte, error) {
1056 type NoMethod Rotation
1057 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1058 }
1059
1060
1061
1062
1063 type Secret struct {
1064
1065
1066
1067
1068
1069
1070
1071
1072 Annotations map[string]string `json:"annotations,omitempty"`
1073
1074 CreateTime string `json:"createTime,omitempty"`
1075
1076
1077
1078
1079
1080 CustomerManagedEncryption *CustomerManagedEncryption `json:"customerManagedEncryption,omitempty"`
1081
1082 Etag string `json:"etag,omitempty"`
1083
1084
1085
1086 ExpireTime string `json:"expireTime,omitempty"`
1087
1088
1089
1090
1091
1092
1093
1094 Labels map[string]string `json:"labels,omitempty"`
1095
1096
1097 Name string `json:"name,omitempty"`
1098
1099
1100
1101 Replication *Replication `json:"replication,omitempty"`
1102
1103
1104 Rotation *Rotation `json:"rotation,omitempty"`
1105
1106
1107
1108 Topics []*Topic `json:"topics,omitempty"`
1109
1110 Ttl string `json:"ttl,omitempty"`
1111
1112
1113
1114
1115
1116
1117
1118
1119 VersionAliases map[string]string `json:"versionAliases,omitempty"`
1120
1121
1122
1123
1124
1125 VersionDestroyTtl string `json:"versionDestroyTtl,omitempty"`
1126
1127
1128 googleapi.ServerResponse `json:"-"`
1129
1130
1131
1132
1133
1134 ForceSendFields []string `json:"-"`
1135
1136
1137
1138
1139 NullFields []string `json:"-"`
1140 }
1141
1142 func (s *Secret) MarshalJSON() ([]byte, error) {
1143 type NoMethod Secret
1144 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1145 }
1146
1147
1148
1149
1150 type SecretPayload struct {
1151
1152 Data string `json:"data,omitempty"`
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162 DataCrc32c int64 `json:"dataCrc32c,omitempty,string"`
1163
1164
1165
1166
1167
1168 ForceSendFields []string `json:"-"`
1169
1170
1171
1172
1173 NullFields []string `json:"-"`
1174 }
1175
1176 func (s *SecretPayload) MarshalJSON() ([]byte, error) {
1177 type NoMethod SecretPayload
1178 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1179 }
1180
1181
1182 type SecretVersion struct {
1183
1184
1185
1186 ClientSpecifiedPayloadChecksum bool `json:"clientSpecifiedPayloadChecksum,omitempty"`
1187
1188 CreateTime string `json:"createTime,omitempty"`
1189
1190
1191
1192 CustomerManagedEncryption *CustomerManagedEncryptionStatus `json:"customerManagedEncryption,omitempty"`
1193
1194
1195 DestroyTime string `json:"destroyTime,omitempty"`
1196
1197 Etag string `json:"etag,omitempty"`
1198
1199
1200
1201 Name string `json:"name,omitempty"`
1202
1203 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"`
1204
1205
1206
1207
1208
1209 ScheduledDestroyTime string `json:"scheduledDestroyTime,omitempty"`
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219 State string `json:"state,omitempty"`
1220
1221
1222 googleapi.ServerResponse `json:"-"`
1223
1224
1225
1226
1227
1228
1229 ForceSendFields []string `json:"-"`
1230
1231
1232
1233
1234 NullFields []string `json:"-"`
1235 }
1236
1237 func (s *SecretVersion) MarshalJSON() ([]byte, error) {
1238 type NoMethod SecretVersion
1239 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1240 }
1241
1242
1243 type SetIamPolicyRequest struct {
1244
1245
1246
1247
1248 Policy *Policy `json:"policy,omitempty"`
1249
1250
1251
1252 UpdateMask string `json:"updateMask,omitempty"`
1253
1254
1255
1256
1257
1258 ForceSendFields []string `json:"-"`
1259
1260
1261
1262
1263 NullFields []string `json:"-"`
1264 }
1265
1266 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
1267 type NoMethod SetIamPolicyRequest
1268 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1269 }
1270
1271
1272 type TestIamPermissionsRequest struct {
1273
1274
1275
1276
1277 Permissions []string `json:"permissions,omitempty"`
1278
1279
1280
1281
1282
1283 ForceSendFields []string `json:"-"`
1284
1285
1286
1287
1288 NullFields []string `json:"-"`
1289 }
1290
1291 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
1292 type NoMethod TestIamPermissionsRequest
1293 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1294 }
1295
1296
1297
1298 type TestIamPermissionsResponse struct {
1299
1300
1301 Permissions []string `json:"permissions,omitempty"`
1302
1303
1304 googleapi.ServerResponse `json:"-"`
1305
1306
1307
1308
1309
1310 ForceSendFields []string `json:"-"`
1311
1312
1313
1314
1315 NullFields []string `json:"-"`
1316 }
1317
1318 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
1319 type NoMethod TestIamPermissionsResponse
1320 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1321 }
1322
1323
1324
1325 type Topic struct {
1326
1327
1328
1329
1330
1331 Name string `json:"name,omitempty"`
1332
1333
1334
1335
1336
1337 ForceSendFields []string `json:"-"`
1338
1339
1340
1341
1342 NullFields []string `json:"-"`
1343 }
1344
1345 func (s *Topic) MarshalJSON() ([]byte, error) {
1346 type NoMethod Topic
1347 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1348 }
1349
1350
1351
1352 type UserManaged struct {
1353
1354 Replicas []*Replica `json:"replicas,omitempty"`
1355
1356
1357
1358
1359
1360 ForceSendFields []string `json:"-"`
1361
1362
1363
1364
1365 NullFields []string `json:"-"`
1366 }
1367
1368 func (s *UserManaged) MarshalJSON() ([]byte, error) {
1369 type NoMethod UserManaged
1370 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1371 }
1372
1373
1374
1375
1376 type UserManagedStatus struct {
1377
1378 Replicas []*ReplicaStatus `json:"replicas,omitempty"`
1379
1380
1381
1382
1383
1384 ForceSendFields []string `json:"-"`
1385
1386
1387
1388
1389 NullFields []string `json:"-"`
1390 }
1391
1392 func (s *UserManagedStatus) MarshalJSON() ([]byte, error) {
1393 type NoMethod UserManagedStatus
1394 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1395 }
1396
1397 type ProjectsLocationsGetCall struct {
1398 s *Service
1399 name string
1400 urlParams_ gensupport.URLParams
1401 ifNoneMatch_ string
1402 ctx_ context.Context
1403 header_ http.Header
1404 }
1405
1406
1407
1408
1409 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
1410 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1411 c.name = name
1412 return c
1413 }
1414
1415
1416
1417
1418 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
1419 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1420 return c
1421 }
1422
1423
1424
1425
1426 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
1427 c.ifNoneMatch_ = entityTag
1428 return c
1429 }
1430
1431
1432 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
1433 c.ctx_ = ctx
1434 return c
1435 }
1436
1437
1438
1439 func (c *ProjectsLocationsGetCall) Header() http.Header {
1440 if c.header_ == nil {
1441 c.header_ = make(http.Header)
1442 }
1443 return c.header_
1444 }
1445
1446 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
1447 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1448 if c.ifNoneMatch_ != "" {
1449 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1450 }
1451 var body io.Reader = nil
1452 c.urlParams_.Set("alt", alt)
1453 c.urlParams_.Set("prettyPrint", "false")
1454 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
1455 urls += "?" + c.urlParams_.Encode()
1456 req, err := http.NewRequest("GET", urls, body)
1457 if err != nil {
1458 return nil, err
1459 }
1460 req.Header = reqHeaders
1461 googleapi.Expand(req.URL, map[string]string{
1462 "name": c.name,
1463 })
1464 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1465 }
1466
1467
1468
1469
1470
1471
1472 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
1473 gensupport.SetOptions(c.urlParams_, opts...)
1474 res, err := c.doRequest("json")
1475 if res != nil && res.StatusCode == http.StatusNotModified {
1476 if res.Body != nil {
1477 res.Body.Close()
1478 }
1479 return nil, gensupport.WrapError(&googleapi.Error{
1480 Code: res.StatusCode,
1481 Header: res.Header,
1482 })
1483 }
1484 if err != nil {
1485 return nil, err
1486 }
1487 defer googleapi.CloseBody(res)
1488 if err := googleapi.CheckResponse(res); err != nil {
1489 return nil, gensupport.WrapError(err)
1490 }
1491 ret := &Location{
1492 ServerResponse: googleapi.ServerResponse{
1493 Header: res.Header,
1494 HTTPStatusCode: res.StatusCode,
1495 },
1496 }
1497 target := &ret
1498 if err := gensupport.DecodeResponse(target, res); err != nil {
1499 return nil, err
1500 }
1501 return ret, nil
1502 }
1503
1504 type ProjectsLocationsListCall struct {
1505 s *Service
1506 name string
1507 urlParams_ gensupport.URLParams
1508 ifNoneMatch_ string
1509 ctx_ context.Context
1510 header_ http.Header
1511 }
1512
1513
1514
1515
1516 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
1517 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1518 c.name = name
1519 return c
1520 }
1521
1522
1523
1524
1525
1526 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
1527 c.urlParams_.Set("filter", filter)
1528 return c
1529 }
1530
1531
1532
1533 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
1534 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1535 return c
1536 }
1537
1538
1539
1540
1541 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
1542 c.urlParams_.Set("pageToken", pageToken)
1543 return c
1544 }
1545
1546
1547
1548
1549 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
1550 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1551 return c
1552 }
1553
1554
1555
1556
1557 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
1558 c.ifNoneMatch_ = entityTag
1559 return c
1560 }
1561
1562
1563 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
1564 c.ctx_ = ctx
1565 return c
1566 }
1567
1568
1569
1570 func (c *ProjectsLocationsListCall) Header() http.Header {
1571 if c.header_ == nil {
1572 c.header_ = make(http.Header)
1573 }
1574 return c.header_
1575 }
1576
1577 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
1578 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1579 if c.ifNoneMatch_ != "" {
1580 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1581 }
1582 var body io.Reader = nil
1583 c.urlParams_.Set("alt", alt)
1584 c.urlParams_.Set("prettyPrint", "false")
1585 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}/locations")
1586 urls += "?" + c.urlParams_.Encode()
1587 req, err := http.NewRequest("GET", urls, body)
1588 if err != nil {
1589 return nil, err
1590 }
1591 req.Header = reqHeaders
1592 googleapi.Expand(req.URL, map[string]string{
1593 "name": c.name,
1594 })
1595 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1596 }
1597
1598
1599
1600
1601
1602
1603
1604 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
1605 gensupport.SetOptions(c.urlParams_, opts...)
1606 res, err := c.doRequest("json")
1607 if res != nil && res.StatusCode == http.StatusNotModified {
1608 if res.Body != nil {
1609 res.Body.Close()
1610 }
1611 return nil, gensupport.WrapError(&googleapi.Error{
1612 Code: res.StatusCode,
1613 Header: res.Header,
1614 })
1615 }
1616 if err != nil {
1617 return nil, err
1618 }
1619 defer googleapi.CloseBody(res)
1620 if err := googleapi.CheckResponse(res); err != nil {
1621 return nil, gensupport.WrapError(err)
1622 }
1623 ret := &ListLocationsResponse{
1624 ServerResponse: googleapi.ServerResponse{
1625 Header: res.Header,
1626 HTTPStatusCode: res.StatusCode,
1627 },
1628 }
1629 target := &ret
1630 if err := gensupport.DecodeResponse(target, res); err != nil {
1631 return nil, err
1632 }
1633 return ret, nil
1634 }
1635
1636
1637
1638
1639 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
1640 c.ctx_ = ctx
1641 defer c.PageToken(c.urlParams_.Get("pageToken"))
1642 for {
1643 x, err := c.Do()
1644 if err != nil {
1645 return err
1646 }
1647 if err := f(x); err != nil {
1648 return err
1649 }
1650 if x.NextPageToken == "" {
1651 return nil
1652 }
1653 c.PageToken(x.NextPageToken)
1654 }
1655 }
1656
1657 type ProjectsLocationsSecretsAddVersionCall struct {
1658 s *Service
1659 parent string
1660 addsecretversionrequest *AddSecretVersionRequest
1661 urlParams_ gensupport.URLParams
1662 ctx_ context.Context
1663 header_ http.Header
1664 }
1665
1666
1667
1668
1669
1670
1671
1672 func (r *ProjectsLocationsSecretsService) AddVersion(parent string, addsecretversionrequest *AddSecretVersionRequest) *ProjectsLocationsSecretsAddVersionCall {
1673 c := &ProjectsLocationsSecretsAddVersionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1674 c.parent = parent
1675 c.addsecretversionrequest = addsecretversionrequest
1676 return c
1677 }
1678
1679
1680
1681
1682 func (c *ProjectsLocationsSecretsAddVersionCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsAddVersionCall {
1683 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1684 return c
1685 }
1686
1687
1688 func (c *ProjectsLocationsSecretsAddVersionCall) Context(ctx context.Context) *ProjectsLocationsSecretsAddVersionCall {
1689 c.ctx_ = ctx
1690 return c
1691 }
1692
1693
1694
1695 func (c *ProjectsLocationsSecretsAddVersionCall) Header() http.Header {
1696 if c.header_ == nil {
1697 c.header_ = make(http.Header)
1698 }
1699 return c.header_
1700 }
1701
1702 func (c *ProjectsLocationsSecretsAddVersionCall) doRequest(alt string) (*http.Response, error) {
1703 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1704 var body io.Reader = nil
1705 body, err := googleapi.WithoutDataWrapper.JSONReader(c.addsecretversionrequest)
1706 if err != nil {
1707 return nil, err
1708 }
1709 c.urlParams_.Set("alt", alt)
1710 c.urlParams_.Set("prettyPrint", "false")
1711 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}:addVersion")
1712 urls += "?" + c.urlParams_.Encode()
1713 req, err := http.NewRequest("POST", urls, body)
1714 if err != nil {
1715 return nil, err
1716 }
1717 req.Header = reqHeaders
1718 googleapi.Expand(req.URL, map[string]string{
1719 "parent": c.parent,
1720 })
1721 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1722 }
1723
1724
1725
1726
1727
1728
1729 func (c *ProjectsLocationsSecretsAddVersionCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
1730 gensupport.SetOptions(c.urlParams_, opts...)
1731 res, err := c.doRequest("json")
1732 if res != nil && res.StatusCode == http.StatusNotModified {
1733 if res.Body != nil {
1734 res.Body.Close()
1735 }
1736 return nil, gensupport.WrapError(&googleapi.Error{
1737 Code: res.StatusCode,
1738 Header: res.Header,
1739 })
1740 }
1741 if err != nil {
1742 return nil, err
1743 }
1744 defer googleapi.CloseBody(res)
1745 if err := googleapi.CheckResponse(res); err != nil {
1746 return nil, gensupport.WrapError(err)
1747 }
1748 ret := &SecretVersion{
1749 ServerResponse: googleapi.ServerResponse{
1750 Header: res.Header,
1751 HTTPStatusCode: res.StatusCode,
1752 },
1753 }
1754 target := &ret
1755 if err := gensupport.DecodeResponse(target, res); err != nil {
1756 return nil, err
1757 }
1758 return ret, nil
1759 }
1760
1761 type ProjectsLocationsSecretsCreateCall struct {
1762 s *Service
1763 parent string
1764 secret *Secret
1765 urlParams_ gensupport.URLParams
1766 ctx_ context.Context
1767 header_ http.Header
1768 }
1769
1770
1771
1772
1773
1774 func (r *ProjectsLocationsSecretsService) Create(parent string, secret *Secret) *ProjectsLocationsSecretsCreateCall {
1775 c := &ProjectsLocationsSecretsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1776 c.parent = parent
1777 c.secret = secret
1778 return c
1779 }
1780
1781
1782
1783
1784
1785 func (c *ProjectsLocationsSecretsCreateCall) SecretId(secretId string) *ProjectsLocationsSecretsCreateCall {
1786 c.urlParams_.Set("secretId", secretId)
1787 return c
1788 }
1789
1790
1791
1792
1793 func (c *ProjectsLocationsSecretsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsCreateCall {
1794 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1795 return c
1796 }
1797
1798
1799 func (c *ProjectsLocationsSecretsCreateCall) Context(ctx context.Context) *ProjectsLocationsSecretsCreateCall {
1800 c.ctx_ = ctx
1801 return c
1802 }
1803
1804
1805
1806 func (c *ProjectsLocationsSecretsCreateCall) Header() http.Header {
1807 if c.header_ == nil {
1808 c.header_ = make(http.Header)
1809 }
1810 return c.header_
1811 }
1812
1813 func (c *ProjectsLocationsSecretsCreateCall) doRequest(alt string) (*http.Response, error) {
1814 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1815 var body io.Reader = nil
1816 body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret)
1817 if err != nil {
1818 return nil, err
1819 }
1820 c.urlParams_.Set("alt", alt)
1821 c.urlParams_.Set("prettyPrint", "false")
1822 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/secrets")
1823 urls += "?" + c.urlParams_.Encode()
1824 req, err := http.NewRequest("POST", urls, body)
1825 if err != nil {
1826 return nil, err
1827 }
1828 req.Header = reqHeaders
1829 googleapi.Expand(req.URL, map[string]string{
1830 "parent": c.parent,
1831 })
1832 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1833 }
1834
1835
1836
1837
1838
1839
1840 func (c *ProjectsLocationsSecretsCreateCall) Do(opts ...googleapi.CallOption) (*Secret, error) {
1841 gensupport.SetOptions(c.urlParams_, opts...)
1842 res, err := c.doRequest("json")
1843 if res != nil && res.StatusCode == http.StatusNotModified {
1844 if res.Body != nil {
1845 res.Body.Close()
1846 }
1847 return nil, gensupport.WrapError(&googleapi.Error{
1848 Code: res.StatusCode,
1849 Header: res.Header,
1850 })
1851 }
1852 if err != nil {
1853 return nil, err
1854 }
1855 defer googleapi.CloseBody(res)
1856 if err := googleapi.CheckResponse(res); err != nil {
1857 return nil, gensupport.WrapError(err)
1858 }
1859 ret := &Secret{
1860 ServerResponse: googleapi.ServerResponse{
1861 Header: res.Header,
1862 HTTPStatusCode: res.StatusCode,
1863 },
1864 }
1865 target := &ret
1866 if err := gensupport.DecodeResponse(target, res); err != nil {
1867 return nil, err
1868 }
1869 return ret, nil
1870 }
1871
1872 type ProjectsLocationsSecretsDeleteCall struct {
1873 s *Service
1874 name string
1875 urlParams_ gensupport.URLParams
1876 ctx_ context.Context
1877 header_ http.Header
1878 }
1879
1880
1881
1882
1883
1884 func (r *ProjectsLocationsSecretsService) Delete(name string) *ProjectsLocationsSecretsDeleteCall {
1885 c := &ProjectsLocationsSecretsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1886 c.name = name
1887 return c
1888 }
1889
1890
1891
1892
1893 func (c *ProjectsLocationsSecretsDeleteCall) Etag(etag string) *ProjectsLocationsSecretsDeleteCall {
1894 c.urlParams_.Set("etag", etag)
1895 return c
1896 }
1897
1898
1899
1900
1901 func (c *ProjectsLocationsSecretsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsDeleteCall {
1902 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1903 return c
1904 }
1905
1906
1907 func (c *ProjectsLocationsSecretsDeleteCall) Context(ctx context.Context) *ProjectsLocationsSecretsDeleteCall {
1908 c.ctx_ = ctx
1909 return c
1910 }
1911
1912
1913
1914 func (c *ProjectsLocationsSecretsDeleteCall) Header() http.Header {
1915 if c.header_ == nil {
1916 c.header_ = make(http.Header)
1917 }
1918 return c.header_
1919 }
1920
1921 func (c *ProjectsLocationsSecretsDeleteCall) doRequest(alt string) (*http.Response, error) {
1922 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1923 var body io.Reader = nil
1924 c.urlParams_.Set("alt", alt)
1925 c.urlParams_.Set("prettyPrint", "false")
1926 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
1927 urls += "?" + c.urlParams_.Encode()
1928 req, err := http.NewRequest("DELETE", urls, body)
1929 if err != nil {
1930 return nil, err
1931 }
1932 req.Header = reqHeaders
1933 googleapi.Expand(req.URL, map[string]string{
1934 "name": c.name,
1935 })
1936 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1937 }
1938
1939
1940
1941
1942
1943
1944 func (c *ProjectsLocationsSecretsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1945 gensupport.SetOptions(c.urlParams_, opts...)
1946 res, err := c.doRequest("json")
1947 if res != nil && res.StatusCode == http.StatusNotModified {
1948 if res.Body != nil {
1949 res.Body.Close()
1950 }
1951 return nil, gensupport.WrapError(&googleapi.Error{
1952 Code: res.StatusCode,
1953 Header: res.Header,
1954 })
1955 }
1956 if err != nil {
1957 return nil, err
1958 }
1959 defer googleapi.CloseBody(res)
1960 if err := googleapi.CheckResponse(res); err != nil {
1961 return nil, gensupport.WrapError(err)
1962 }
1963 ret := &Empty{
1964 ServerResponse: googleapi.ServerResponse{
1965 Header: res.Header,
1966 HTTPStatusCode: res.StatusCode,
1967 },
1968 }
1969 target := &ret
1970 if err := gensupport.DecodeResponse(target, res); err != nil {
1971 return nil, err
1972 }
1973 return ret, nil
1974 }
1975
1976 type ProjectsLocationsSecretsGetCall struct {
1977 s *Service
1978 name string
1979 urlParams_ gensupport.URLParams
1980 ifNoneMatch_ string
1981 ctx_ context.Context
1982 header_ http.Header
1983 }
1984
1985
1986
1987
1988
1989 func (r *ProjectsLocationsSecretsService) Get(name string) *ProjectsLocationsSecretsGetCall {
1990 c := &ProjectsLocationsSecretsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1991 c.name = name
1992 return c
1993 }
1994
1995
1996
1997
1998 func (c *ProjectsLocationsSecretsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsGetCall {
1999 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2000 return c
2001 }
2002
2003
2004
2005
2006 func (c *ProjectsLocationsSecretsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsSecretsGetCall {
2007 c.ifNoneMatch_ = entityTag
2008 return c
2009 }
2010
2011
2012 func (c *ProjectsLocationsSecretsGetCall) Context(ctx context.Context) *ProjectsLocationsSecretsGetCall {
2013 c.ctx_ = ctx
2014 return c
2015 }
2016
2017
2018
2019 func (c *ProjectsLocationsSecretsGetCall) Header() http.Header {
2020 if c.header_ == nil {
2021 c.header_ = make(http.Header)
2022 }
2023 return c.header_
2024 }
2025
2026 func (c *ProjectsLocationsSecretsGetCall) doRequest(alt string) (*http.Response, error) {
2027 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2028 if c.ifNoneMatch_ != "" {
2029 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2030 }
2031 var body io.Reader = nil
2032 c.urlParams_.Set("alt", alt)
2033 c.urlParams_.Set("prettyPrint", "false")
2034 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
2035 urls += "?" + c.urlParams_.Encode()
2036 req, err := http.NewRequest("GET", urls, body)
2037 if err != nil {
2038 return nil, err
2039 }
2040 req.Header = reqHeaders
2041 googleapi.Expand(req.URL, map[string]string{
2042 "name": c.name,
2043 })
2044 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2045 }
2046
2047
2048
2049
2050
2051
2052 func (c *ProjectsLocationsSecretsGetCall) Do(opts ...googleapi.CallOption) (*Secret, error) {
2053 gensupport.SetOptions(c.urlParams_, opts...)
2054 res, err := c.doRequest("json")
2055 if res != nil && res.StatusCode == http.StatusNotModified {
2056 if res.Body != nil {
2057 res.Body.Close()
2058 }
2059 return nil, gensupport.WrapError(&googleapi.Error{
2060 Code: res.StatusCode,
2061 Header: res.Header,
2062 })
2063 }
2064 if err != nil {
2065 return nil, err
2066 }
2067 defer googleapi.CloseBody(res)
2068 if err := googleapi.CheckResponse(res); err != nil {
2069 return nil, gensupport.WrapError(err)
2070 }
2071 ret := &Secret{
2072 ServerResponse: googleapi.ServerResponse{
2073 Header: res.Header,
2074 HTTPStatusCode: res.StatusCode,
2075 },
2076 }
2077 target := &ret
2078 if err := gensupport.DecodeResponse(target, res); err != nil {
2079 return nil, err
2080 }
2081 return ret, nil
2082 }
2083
2084 type ProjectsLocationsSecretsGetIamPolicyCall struct {
2085 s *Service
2086 resource string
2087 urlParams_ gensupport.URLParams
2088 ifNoneMatch_ string
2089 ctx_ context.Context
2090 header_ http.Header
2091 }
2092
2093
2094
2095
2096
2097
2098
2099 func (r *ProjectsLocationsSecretsService) GetIamPolicy(resource string) *ProjectsLocationsSecretsGetIamPolicyCall {
2100 c := &ProjectsLocationsSecretsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2101 c.resource = resource
2102 return c
2103 }
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117 func (c *ProjectsLocationsSecretsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsSecretsGetIamPolicyCall {
2118 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
2119 return c
2120 }
2121
2122
2123
2124
2125 func (c *ProjectsLocationsSecretsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsGetIamPolicyCall {
2126 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2127 return c
2128 }
2129
2130
2131
2132
2133 func (c *ProjectsLocationsSecretsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsSecretsGetIamPolicyCall {
2134 c.ifNoneMatch_ = entityTag
2135 return c
2136 }
2137
2138
2139 func (c *ProjectsLocationsSecretsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsSecretsGetIamPolicyCall {
2140 c.ctx_ = ctx
2141 return c
2142 }
2143
2144
2145
2146 func (c *ProjectsLocationsSecretsGetIamPolicyCall) Header() http.Header {
2147 if c.header_ == nil {
2148 c.header_ = make(http.Header)
2149 }
2150 return c.header_
2151 }
2152
2153 func (c *ProjectsLocationsSecretsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2154 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2155 if c.ifNoneMatch_ != "" {
2156 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2157 }
2158 var body io.Reader = nil
2159 c.urlParams_.Set("alt", alt)
2160 c.urlParams_.Set("prettyPrint", "false")
2161 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy")
2162 urls += "?" + c.urlParams_.Encode()
2163 req, err := http.NewRequest("GET", urls, body)
2164 if err != nil {
2165 return nil, err
2166 }
2167 req.Header = reqHeaders
2168 googleapi.Expand(req.URL, map[string]string{
2169 "resource": c.resource,
2170 })
2171 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2172 }
2173
2174
2175
2176
2177
2178
2179 func (c *ProjectsLocationsSecretsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2180 gensupport.SetOptions(c.urlParams_, opts...)
2181 res, err := c.doRequest("json")
2182 if res != nil && res.StatusCode == http.StatusNotModified {
2183 if res.Body != nil {
2184 res.Body.Close()
2185 }
2186 return nil, gensupport.WrapError(&googleapi.Error{
2187 Code: res.StatusCode,
2188 Header: res.Header,
2189 })
2190 }
2191 if err != nil {
2192 return nil, err
2193 }
2194 defer googleapi.CloseBody(res)
2195 if err := googleapi.CheckResponse(res); err != nil {
2196 return nil, gensupport.WrapError(err)
2197 }
2198 ret := &Policy{
2199 ServerResponse: googleapi.ServerResponse{
2200 Header: res.Header,
2201 HTTPStatusCode: res.StatusCode,
2202 },
2203 }
2204 target := &ret
2205 if err := gensupport.DecodeResponse(target, res); err != nil {
2206 return nil, err
2207 }
2208 return ret, nil
2209 }
2210
2211 type ProjectsLocationsSecretsListCall struct {
2212 s *Service
2213 parent string
2214 urlParams_ gensupport.URLParams
2215 ifNoneMatch_ string
2216 ctx_ context.Context
2217 header_ http.Header
2218 }
2219
2220
2221
2222
2223
2224 func (r *ProjectsLocationsSecretsService) List(parent string) *ProjectsLocationsSecretsListCall {
2225 c := &ProjectsLocationsSecretsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2226 c.parent = parent
2227 return c
2228 }
2229
2230
2231
2232
2233
2234 func (c *ProjectsLocationsSecretsListCall) Filter(filter string) *ProjectsLocationsSecretsListCall {
2235 c.urlParams_.Set("filter", filter)
2236 return c
2237 }
2238
2239
2240
2241
2242
2243 func (c *ProjectsLocationsSecretsListCall) PageSize(pageSize int64) *ProjectsLocationsSecretsListCall {
2244 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2245 return c
2246 }
2247
2248
2249
2250 func (c *ProjectsLocationsSecretsListCall) PageToken(pageToken string) *ProjectsLocationsSecretsListCall {
2251 c.urlParams_.Set("pageToken", pageToken)
2252 return c
2253 }
2254
2255
2256
2257
2258 func (c *ProjectsLocationsSecretsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsListCall {
2259 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2260 return c
2261 }
2262
2263
2264
2265
2266 func (c *ProjectsLocationsSecretsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsSecretsListCall {
2267 c.ifNoneMatch_ = entityTag
2268 return c
2269 }
2270
2271
2272 func (c *ProjectsLocationsSecretsListCall) Context(ctx context.Context) *ProjectsLocationsSecretsListCall {
2273 c.ctx_ = ctx
2274 return c
2275 }
2276
2277
2278
2279 func (c *ProjectsLocationsSecretsListCall) Header() http.Header {
2280 if c.header_ == nil {
2281 c.header_ = make(http.Header)
2282 }
2283 return c.header_
2284 }
2285
2286 func (c *ProjectsLocationsSecretsListCall) doRequest(alt string) (*http.Response, error) {
2287 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2288 if c.ifNoneMatch_ != "" {
2289 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2290 }
2291 var body io.Reader = nil
2292 c.urlParams_.Set("alt", alt)
2293 c.urlParams_.Set("prettyPrint", "false")
2294 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/secrets")
2295 urls += "?" + c.urlParams_.Encode()
2296 req, err := http.NewRequest("GET", urls, body)
2297 if err != nil {
2298 return nil, err
2299 }
2300 req.Header = reqHeaders
2301 googleapi.Expand(req.URL, map[string]string{
2302 "parent": c.parent,
2303 })
2304 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2305 }
2306
2307
2308
2309
2310
2311
2312
2313 func (c *ProjectsLocationsSecretsListCall) Do(opts ...googleapi.CallOption) (*ListSecretsResponse, error) {
2314 gensupport.SetOptions(c.urlParams_, opts...)
2315 res, err := c.doRequest("json")
2316 if res != nil && res.StatusCode == http.StatusNotModified {
2317 if res.Body != nil {
2318 res.Body.Close()
2319 }
2320 return nil, gensupport.WrapError(&googleapi.Error{
2321 Code: res.StatusCode,
2322 Header: res.Header,
2323 })
2324 }
2325 if err != nil {
2326 return nil, err
2327 }
2328 defer googleapi.CloseBody(res)
2329 if err := googleapi.CheckResponse(res); err != nil {
2330 return nil, gensupport.WrapError(err)
2331 }
2332 ret := &ListSecretsResponse{
2333 ServerResponse: googleapi.ServerResponse{
2334 Header: res.Header,
2335 HTTPStatusCode: res.StatusCode,
2336 },
2337 }
2338 target := &ret
2339 if err := gensupport.DecodeResponse(target, res); err != nil {
2340 return nil, err
2341 }
2342 return ret, nil
2343 }
2344
2345
2346
2347
2348 func (c *ProjectsLocationsSecretsListCall) Pages(ctx context.Context, f func(*ListSecretsResponse) error) error {
2349 c.ctx_ = ctx
2350 defer c.PageToken(c.urlParams_.Get("pageToken"))
2351 for {
2352 x, err := c.Do()
2353 if err != nil {
2354 return err
2355 }
2356 if err := f(x); err != nil {
2357 return err
2358 }
2359 if x.NextPageToken == "" {
2360 return nil
2361 }
2362 c.PageToken(x.NextPageToken)
2363 }
2364 }
2365
2366 type ProjectsLocationsSecretsPatchCall struct {
2367 s *Service
2368 name string
2369 secret *Secret
2370 urlParams_ gensupport.URLParams
2371 ctx_ context.Context
2372 header_ http.Header
2373 }
2374
2375
2376
2377
2378
2379 func (r *ProjectsLocationsSecretsService) Patch(name string, secret *Secret) *ProjectsLocationsSecretsPatchCall {
2380 c := &ProjectsLocationsSecretsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2381 c.name = name
2382 c.secret = secret
2383 return c
2384 }
2385
2386
2387
2388 func (c *ProjectsLocationsSecretsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsSecretsPatchCall {
2389 c.urlParams_.Set("updateMask", updateMask)
2390 return c
2391 }
2392
2393
2394
2395
2396 func (c *ProjectsLocationsSecretsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsPatchCall {
2397 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2398 return c
2399 }
2400
2401
2402 func (c *ProjectsLocationsSecretsPatchCall) Context(ctx context.Context) *ProjectsLocationsSecretsPatchCall {
2403 c.ctx_ = ctx
2404 return c
2405 }
2406
2407
2408
2409 func (c *ProjectsLocationsSecretsPatchCall) Header() http.Header {
2410 if c.header_ == nil {
2411 c.header_ = make(http.Header)
2412 }
2413 return c.header_
2414 }
2415
2416 func (c *ProjectsLocationsSecretsPatchCall) 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.secret)
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, "v1beta2/{+name}")
2426 urls += "?" + c.urlParams_.Encode()
2427 req, err := http.NewRequest("PATCH", 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 *ProjectsLocationsSecretsPatchCall) Do(opts ...googleapi.CallOption) (*Secret, 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 := &Secret{
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 ProjectsLocationsSecretsSetIamPolicyCall struct {
2476 s *Service
2477 resource string
2478 setiampolicyrequest *SetIamPolicyRequest
2479 urlParams_ gensupport.URLParams
2480 ctx_ context.Context
2481 header_ http.Header
2482 }
2483
2484
2485
2486
2487
2488
2489
2490
2491 func (r *ProjectsLocationsSecretsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsSecretsSetIamPolicyCall {
2492 c := &ProjectsLocationsSecretsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2493 c.resource = resource
2494 c.setiampolicyrequest = setiampolicyrequest
2495 return c
2496 }
2497
2498
2499
2500
2501 func (c *ProjectsLocationsSecretsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsSetIamPolicyCall {
2502 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2503 return c
2504 }
2505
2506
2507 func (c *ProjectsLocationsSecretsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsSecretsSetIamPolicyCall {
2508 c.ctx_ = ctx
2509 return c
2510 }
2511
2512
2513
2514 func (c *ProjectsLocationsSecretsSetIamPolicyCall) Header() http.Header {
2515 if c.header_ == nil {
2516 c.header_ = make(http.Header)
2517 }
2518 return c.header_
2519 }
2520
2521 func (c *ProjectsLocationsSecretsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2522 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2523 var body io.Reader = nil
2524 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
2525 if err != nil {
2526 return nil, err
2527 }
2528 c.urlParams_.Set("alt", alt)
2529 c.urlParams_.Set("prettyPrint", "false")
2530 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy")
2531 urls += "?" + c.urlParams_.Encode()
2532 req, err := http.NewRequest("POST", urls, body)
2533 if err != nil {
2534 return nil, err
2535 }
2536 req.Header = reqHeaders
2537 googleapi.Expand(req.URL, map[string]string{
2538 "resource": c.resource,
2539 })
2540 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2541 }
2542
2543
2544
2545
2546
2547
2548 func (c *ProjectsLocationsSecretsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2549 gensupport.SetOptions(c.urlParams_, opts...)
2550 res, err := c.doRequest("json")
2551 if res != nil && res.StatusCode == http.StatusNotModified {
2552 if res.Body != nil {
2553 res.Body.Close()
2554 }
2555 return nil, gensupport.WrapError(&googleapi.Error{
2556 Code: res.StatusCode,
2557 Header: res.Header,
2558 })
2559 }
2560 if err != nil {
2561 return nil, err
2562 }
2563 defer googleapi.CloseBody(res)
2564 if err := googleapi.CheckResponse(res); err != nil {
2565 return nil, gensupport.WrapError(err)
2566 }
2567 ret := &Policy{
2568 ServerResponse: googleapi.ServerResponse{
2569 Header: res.Header,
2570 HTTPStatusCode: res.StatusCode,
2571 },
2572 }
2573 target := &ret
2574 if err := gensupport.DecodeResponse(target, res); err != nil {
2575 return nil, err
2576 }
2577 return ret, nil
2578 }
2579
2580 type ProjectsLocationsSecretsTestIamPermissionsCall struct {
2581 s *Service
2582 resource string
2583 testiampermissionsrequest *TestIamPermissionsRequest
2584 urlParams_ gensupport.URLParams
2585 ctx_ context.Context
2586 header_ http.Header
2587 }
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599 func (r *ProjectsLocationsSecretsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsSecretsTestIamPermissionsCall {
2600 c := &ProjectsLocationsSecretsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2601 c.resource = resource
2602 c.testiampermissionsrequest = testiampermissionsrequest
2603 return c
2604 }
2605
2606
2607
2608
2609 func (c *ProjectsLocationsSecretsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsTestIamPermissionsCall {
2610 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2611 return c
2612 }
2613
2614
2615 func (c *ProjectsLocationsSecretsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsSecretsTestIamPermissionsCall {
2616 c.ctx_ = ctx
2617 return c
2618 }
2619
2620
2621
2622 func (c *ProjectsLocationsSecretsTestIamPermissionsCall) Header() http.Header {
2623 if c.header_ == nil {
2624 c.header_ = make(http.Header)
2625 }
2626 return c.header_
2627 }
2628
2629 func (c *ProjectsLocationsSecretsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
2630 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2631 var body io.Reader = nil
2632 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
2633 if err != nil {
2634 return nil, err
2635 }
2636 c.urlParams_.Set("alt", alt)
2637 c.urlParams_.Set("prettyPrint", "false")
2638 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions")
2639 urls += "?" + c.urlParams_.Encode()
2640 req, err := http.NewRequest("POST", urls, body)
2641 if err != nil {
2642 return nil, err
2643 }
2644 req.Header = reqHeaders
2645 googleapi.Expand(req.URL, map[string]string{
2646 "resource": c.resource,
2647 })
2648 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2649 }
2650
2651
2652
2653
2654
2655
2656
2657 func (c *ProjectsLocationsSecretsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
2658 gensupport.SetOptions(c.urlParams_, opts...)
2659 res, err := c.doRequest("json")
2660 if res != nil && res.StatusCode == http.StatusNotModified {
2661 if res.Body != nil {
2662 res.Body.Close()
2663 }
2664 return nil, gensupport.WrapError(&googleapi.Error{
2665 Code: res.StatusCode,
2666 Header: res.Header,
2667 })
2668 }
2669 if err != nil {
2670 return nil, err
2671 }
2672 defer googleapi.CloseBody(res)
2673 if err := googleapi.CheckResponse(res); err != nil {
2674 return nil, gensupport.WrapError(err)
2675 }
2676 ret := &TestIamPermissionsResponse{
2677 ServerResponse: googleapi.ServerResponse{
2678 Header: res.Header,
2679 HTTPStatusCode: res.StatusCode,
2680 },
2681 }
2682 target := &ret
2683 if err := gensupport.DecodeResponse(target, res); err != nil {
2684 return nil, err
2685 }
2686 return ret, nil
2687 }
2688
2689 type ProjectsLocationsSecretsVersionsAccessCall struct {
2690 s *Service
2691 name string
2692 urlParams_ gensupport.URLParams
2693 ifNoneMatch_ string
2694 ctx_ context.Context
2695 header_ http.Header
2696 }
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708 func (r *ProjectsLocationsSecretsVersionsService) Access(name string) *ProjectsLocationsSecretsVersionsAccessCall {
2709 c := &ProjectsLocationsSecretsVersionsAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2710 c.name = name
2711 return c
2712 }
2713
2714
2715
2716
2717 func (c *ProjectsLocationsSecretsVersionsAccessCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsVersionsAccessCall {
2718 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2719 return c
2720 }
2721
2722
2723
2724
2725 func (c *ProjectsLocationsSecretsVersionsAccessCall) IfNoneMatch(entityTag string) *ProjectsLocationsSecretsVersionsAccessCall {
2726 c.ifNoneMatch_ = entityTag
2727 return c
2728 }
2729
2730
2731 func (c *ProjectsLocationsSecretsVersionsAccessCall) Context(ctx context.Context) *ProjectsLocationsSecretsVersionsAccessCall {
2732 c.ctx_ = ctx
2733 return c
2734 }
2735
2736
2737
2738 func (c *ProjectsLocationsSecretsVersionsAccessCall) Header() http.Header {
2739 if c.header_ == nil {
2740 c.header_ = make(http.Header)
2741 }
2742 return c.header_
2743 }
2744
2745 func (c *ProjectsLocationsSecretsVersionsAccessCall) doRequest(alt string) (*http.Response, error) {
2746 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2747 if c.ifNoneMatch_ != "" {
2748 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2749 }
2750 var body io.Reader = nil
2751 c.urlParams_.Set("alt", alt)
2752 c.urlParams_.Set("prettyPrint", "false")
2753 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:access")
2754 urls += "?" + c.urlParams_.Encode()
2755 req, err := http.NewRequest("GET", urls, body)
2756 if err != nil {
2757 return nil, err
2758 }
2759 req.Header = reqHeaders
2760 googleapi.Expand(req.URL, map[string]string{
2761 "name": c.name,
2762 })
2763 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2764 }
2765
2766
2767
2768
2769
2770
2771
2772 func (c *ProjectsLocationsSecretsVersionsAccessCall) Do(opts ...googleapi.CallOption) (*AccessSecretVersionResponse, error) {
2773 gensupport.SetOptions(c.urlParams_, opts...)
2774 res, err := c.doRequest("json")
2775 if res != nil && res.StatusCode == http.StatusNotModified {
2776 if res.Body != nil {
2777 res.Body.Close()
2778 }
2779 return nil, gensupport.WrapError(&googleapi.Error{
2780 Code: res.StatusCode,
2781 Header: res.Header,
2782 })
2783 }
2784 if err != nil {
2785 return nil, err
2786 }
2787 defer googleapi.CloseBody(res)
2788 if err := googleapi.CheckResponse(res); err != nil {
2789 return nil, gensupport.WrapError(err)
2790 }
2791 ret := &AccessSecretVersionResponse{
2792 ServerResponse: googleapi.ServerResponse{
2793 Header: res.Header,
2794 HTTPStatusCode: res.StatusCode,
2795 },
2796 }
2797 target := &ret
2798 if err := gensupport.DecodeResponse(target, res); err != nil {
2799 return nil, err
2800 }
2801 return ret, nil
2802 }
2803
2804 type ProjectsLocationsSecretsVersionsDestroyCall struct {
2805 s *Service
2806 name string
2807 destroysecretversionrequest *DestroySecretVersionRequest
2808 urlParams_ gensupport.URLParams
2809 ctx_ context.Context
2810 header_ http.Header
2811 }
2812
2813
2814
2815
2816
2817
2818
2819 func (r *ProjectsLocationsSecretsVersionsService) Destroy(name string, destroysecretversionrequest *DestroySecretVersionRequest) *ProjectsLocationsSecretsVersionsDestroyCall {
2820 c := &ProjectsLocationsSecretsVersionsDestroyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2821 c.name = name
2822 c.destroysecretversionrequest = destroysecretversionrequest
2823 return c
2824 }
2825
2826
2827
2828
2829 func (c *ProjectsLocationsSecretsVersionsDestroyCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsVersionsDestroyCall {
2830 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2831 return c
2832 }
2833
2834
2835 func (c *ProjectsLocationsSecretsVersionsDestroyCall) Context(ctx context.Context) *ProjectsLocationsSecretsVersionsDestroyCall {
2836 c.ctx_ = ctx
2837 return c
2838 }
2839
2840
2841
2842 func (c *ProjectsLocationsSecretsVersionsDestroyCall) Header() http.Header {
2843 if c.header_ == nil {
2844 c.header_ = make(http.Header)
2845 }
2846 return c.header_
2847 }
2848
2849 func (c *ProjectsLocationsSecretsVersionsDestroyCall) doRequest(alt string) (*http.Response, error) {
2850 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2851 var body io.Reader = nil
2852 body, err := googleapi.WithoutDataWrapper.JSONReader(c.destroysecretversionrequest)
2853 if err != nil {
2854 return nil, err
2855 }
2856 c.urlParams_.Set("alt", alt)
2857 c.urlParams_.Set("prettyPrint", "false")
2858 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:destroy")
2859 urls += "?" + c.urlParams_.Encode()
2860 req, err := http.NewRequest("POST", urls, body)
2861 if err != nil {
2862 return nil, err
2863 }
2864 req.Header = reqHeaders
2865 googleapi.Expand(req.URL, map[string]string{
2866 "name": c.name,
2867 })
2868 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2869 }
2870
2871
2872
2873
2874
2875
2876 func (c *ProjectsLocationsSecretsVersionsDestroyCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
2877 gensupport.SetOptions(c.urlParams_, opts...)
2878 res, err := c.doRequest("json")
2879 if res != nil && res.StatusCode == http.StatusNotModified {
2880 if res.Body != nil {
2881 res.Body.Close()
2882 }
2883 return nil, gensupport.WrapError(&googleapi.Error{
2884 Code: res.StatusCode,
2885 Header: res.Header,
2886 })
2887 }
2888 if err != nil {
2889 return nil, err
2890 }
2891 defer googleapi.CloseBody(res)
2892 if err := googleapi.CheckResponse(res); err != nil {
2893 return nil, gensupport.WrapError(err)
2894 }
2895 ret := &SecretVersion{
2896 ServerResponse: googleapi.ServerResponse{
2897 Header: res.Header,
2898 HTTPStatusCode: res.StatusCode,
2899 },
2900 }
2901 target := &ret
2902 if err := gensupport.DecodeResponse(target, res); err != nil {
2903 return nil, err
2904 }
2905 return ret, nil
2906 }
2907
2908 type ProjectsLocationsSecretsVersionsDisableCall struct {
2909 s *Service
2910 name string
2911 disablesecretversionrequest *DisableSecretVersionRequest
2912 urlParams_ gensupport.URLParams
2913 ctx_ context.Context
2914 header_ http.Header
2915 }
2916
2917
2918
2919
2920
2921
2922
2923 func (r *ProjectsLocationsSecretsVersionsService) Disable(name string, disablesecretversionrequest *DisableSecretVersionRequest) *ProjectsLocationsSecretsVersionsDisableCall {
2924 c := &ProjectsLocationsSecretsVersionsDisableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2925 c.name = name
2926 c.disablesecretversionrequest = disablesecretversionrequest
2927 return c
2928 }
2929
2930
2931
2932
2933 func (c *ProjectsLocationsSecretsVersionsDisableCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsVersionsDisableCall {
2934 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2935 return c
2936 }
2937
2938
2939 func (c *ProjectsLocationsSecretsVersionsDisableCall) Context(ctx context.Context) *ProjectsLocationsSecretsVersionsDisableCall {
2940 c.ctx_ = ctx
2941 return c
2942 }
2943
2944
2945
2946 func (c *ProjectsLocationsSecretsVersionsDisableCall) Header() http.Header {
2947 if c.header_ == nil {
2948 c.header_ = make(http.Header)
2949 }
2950 return c.header_
2951 }
2952
2953 func (c *ProjectsLocationsSecretsVersionsDisableCall) doRequest(alt string) (*http.Response, error) {
2954 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2955 var body io.Reader = nil
2956 body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablesecretversionrequest)
2957 if err != nil {
2958 return nil, err
2959 }
2960 c.urlParams_.Set("alt", alt)
2961 c.urlParams_.Set("prettyPrint", "false")
2962 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:disable")
2963 urls += "?" + c.urlParams_.Encode()
2964 req, err := http.NewRequest("POST", urls, body)
2965 if err != nil {
2966 return nil, err
2967 }
2968 req.Header = reqHeaders
2969 googleapi.Expand(req.URL, map[string]string{
2970 "name": c.name,
2971 })
2972 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2973 }
2974
2975
2976
2977
2978
2979
2980 func (c *ProjectsLocationsSecretsVersionsDisableCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
2981 gensupport.SetOptions(c.urlParams_, opts...)
2982 res, err := c.doRequest("json")
2983 if res != nil && res.StatusCode == http.StatusNotModified {
2984 if res.Body != nil {
2985 res.Body.Close()
2986 }
2987 return nil, gensupport.WrapError(&googleapi.Error{
2988 Code: res.StatusCode,
2989 Header: res.Header,
2990 })
2991 }
2992 if err != nil {
2993 return nil, err
2994 }
2995 defer googleapi.CloseBody(res)
2996 if err := googleapi.CheckResponse(res); err != nil {
2997 return nil, gensupport.WrapError(err)
2998 }
2999 ret := &SecretVersion{
3000 ServerResponse: googleapi.ServerResponse{
3001 Header: res.Header,
3002 HTTPStatusCode: res.StatusCode,
3003 },
3004 }
3005 target := &ret
3006 if err := gensupport.DecodeResponse(target, res); err != nil {
3007 return nil, err
3008 }
3009 return ret, nil
3010 }
3011
3012 type ProjectsLocationsSecretsVersionsEnableCall struct {
3013 s *Service
3014 name string
3015 enablesecretversionrequest *EnableSecretVersionRequest
3016 urlParams_ gensupport.URLParams
3017 ctx_ context.Context
3018 header_ http.Header
3019 }
3020
3021
3022
3023
3024
3025
3026
3027 func (r *ProjectsLocationsSecretsVersionsService) Enable(name string, enablesecretversionrequest *EnableSecretVersionRequest) *ProjectsLocationsSecretsVersionsEnableCall {
3028 c := &ProjectsLocationsSecretsVersionsEnableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3029 c.name = name
3030 c.enablesecretversionrequest = enablesecretversionrequest
3031 return c
3032 }
3033
3034
3035
3036
3037 func (c *ProjectsLocationsSecretsVersionsEnableCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsVersionsEnableCall {
3038 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3039 return c
3040 }
3041
3042
3043 func (c *ProjectsLocationsSecretsVersionsEnableCall) Context(ctx context.Context) *ProjectsLocationsSecretsVersionsEnableCall {
3044 c.ctx_ = ctx
3045 return c
3046 }
3047
3048
3049
3050 func (c *ProjectsLocationsSecretsVersionsEnableCall) Header() http.Header {
3051 if c.header_ == nil {
3052 c.header_ = make(http.Header)
3053 }
3054 return c.header_
3055 }
3056
3057 func (c *ProjectsLocationsSecretsVersionsEnableCall) doRequest(alt string) (*http.Response, error) {
3058 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3059 var body io.Reader = nil
3060 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablesecretversionrequest)
3061 if err != nil {
3062 return nil, err
3063 }
3064 c.urlParams_.Set("alt", alt)
3065 c.urlParams_.Set("prettyPrint", "false")
3066 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:enable")
3067 urls += "?" + c.urlParams_.Encode()
3068 req, err := http.NewRequest("POST", urls, body)
3069 if err != nil {
3070 return nil, err
3071 }
3072 req.Header = reqHeaders
3073 googleapi.Expand(req.URL, map[string]string{
3074 "name": c.name,
3075 })
3076 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3077 }
3078
3079
3080
3081
3082
3083
3084 func (c *ProjectsLocationsSecretsVersionsEnableCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
3085 gensupport.SetOptions(c.urlParams_, opts...)
3086 res, err := c.doRequest("json")
3087 if res != nil && res.StatusCode == http.StatusNotModified {
3088 if res.Body != nil {
3089 res.Body.Close()
3090 }
3091 return nil, gensupport.WrapError(&googleapi.Error{
3092 Code: res.StatusCode,
3093 Header: res.Header,
3094 })
3095 }
3096 if err != nil {
3097 return nil, err
3098 }
3099 defer googleapi.CloseBody(res)
3100 if err := googleapi.CheckResponse(res); err != nil {
3101 return nil, gensupport.WrapError(err)
3102 }
3103 ret := &SecretVersion{
3104 ServerResponse: googleapi.ServerResponse{
3105 Header: res.Header,
3106 HTTPStatusCode: res.StatusCode,
3107 },
3108 }
3109 target := &ret
3110 if err := gensupport.DecodeResponse(target, res); err != nil {
3111 return nil, err
3112 }
3113 return ret, nil
3114 }
3115
3116 type ProjectsLocationsSecretsVersionsGetCall struct {
3117 s *Service
3118 name string
3119 urlParams_ gensupport.URLParams
3120 ifNoneMatch_ string
3121 ctx_ context.Context
3122 header_ http.Header
3123 }
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135 func (r *ProjectsLocationsSecretsVersionsService) Get(name string) *ProjectsLocationsSecretsVersionsGetCall {
3136 c := &ProjectsLocationsSecretsVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3137 c.name = name
3138 return c
3139 }
3140
3141
3142
3143
3144 func (c *ProjectsLocationsSecretsVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsVersionsGetCall {
3145 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3146 return c
3147 }
3148
3149
3150
3151
3152 func (c *ProjectsLocationsSecretsVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsSecretsVersionsGetCall {
3153 c.ifNoneMatch_ = entityTag
3154 return c
3155 }
3156
3157
3158 func (c *ProjectsLocationsSecretsVersionsGetCall) Context(ctx context.Context) *ProjectsLocationsSecretsVersionsGetCall {
3159 c.ctx_ = ctx
3160 return c
3161 }
3162
3163
3164
3165 func (c *ProjectsLocationsSecretsVersionsGetCall) Header() http.Header {
3166 if c.header_ == nil {
3167 c.header_ = make(http.Header)
3168 }
3169 return c.header_
3170 }
3171
3172 func (c *ProjectsLocationsSecretsVersionsGetCall) doRequest(alt string) (*http.Response, error) {
3173 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3174 if c.ifNoneMatch_ != "" {
3175 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3176 }
3177 var body io.Reader = nil
3178 c.urlParams_.Set("alt", alt)
3179 c.urlParams_.Set("prettyPrint", "false")
3180 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
3181 urls += "?" + c.urlParams_.Encode()
3182 req, err := http.NewRequest("GET", urls, body)
3183 if err != nil {
3184 return nil, err
3185 }
3186 req.Header = reqHeaders
3187 googleapi.Expand(req.URL, map[string]string{
3188 "name": c.name,
3189 })
3190 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3191 }
3192
3193
3194
3195
3196
3197
3198 func (c *ProjectsLocationsSecretsVersionsGetCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
3199 gensupport.SetOptions(c.urlParams_, opts...)
3200 res, err := c.doRequest("json")
3201 if res != nil && res.StatusCode == http.StatusNotModified {
3202 if res.Body != nil {
3203 res.Body.Close()
3204 }
3205 return nil, gensupport.WrapError(&googleapi.Error{
3206 Code: res.StatusCode,
3207 Header: res.Header,
3208 })
3209 }
3210 if err != nil {
3211 return nil, err
3212 }
3213 defer googleapi.CloseBody(res)
3214 if err := googleapi.CheckResponse(res); err != nil {
3215 return nil, gensupport.WrapError(err)
3216 }
3217 ret := &SecretVersion{
3218 ServerResponse: googleapi.ServerResponse{
3219 Header: res.Header,
3220 HTTPStatusCode: res.StatusCode,
3221 },
3222 }
3223 target := &ret
3224 if err := gensupport.DecodeResponse(target, res); err != nil {
3225 return nil, err
3226 }
3227 return ret, nil
3228 }
3229
3230 type ProjectsLocationsSecretsVersionsListCall struct {
3231 s *Service
3232 parent string
3233 urlParams_ gensupport.URLParams
3234 ifNoneMatch_ string
3235 ctx_ context.Context
3236 header_ http.Header
3237 }
3238
3239
3240
3241
3242
3243
3244 func (r *ProjectsLocationsSecretsVersionsService) List(parent string) *ProjectsLocationsSecretsVersionsListCall {
3245 c := &ProjectsLocationsSecretsVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3246 c.parent = parent
3247 return c
3248 }
3249
3250
3251
3252
3253
3254
3255 func (c *ProjectsLocationsSecretsVersionsListCall) Filter(filter string) *ProjectsLocationsSecretsVersionsListCall {
3256 c.urlParams_.Set("filter", filter)
3257 return c
3258 }
3259
3260
3261
3262
3263
3264 func (c *ProjectsLocationsSecretsVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsSecretsVersionsListCall {
3265 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3266 return c
3267 }
3268
3269
3270
3271 func (c *ProjectsLocationsSecretsVersionsListCall) PageToken(pageToken string) *ProjectsLocationsSecretsVersionsListCall {
3272 c.urlParams_.Set("pageToken", pageToken)
3273 return c
3274 }
3275
3276
3277
3278
3279 func (c *ProjectsLocationsSecretsVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsSecretsVersionsListCall {
3280 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3281 return c
3282 }
3283
3284
3285
3286
3287 func (c *ProjectsLocationsSecretsVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsSecretsVersionsListCall {
3288 c.ifNoneMatch_ = entityTag
3289 return c
3290 }
3291
3292
3293 func (c *ProjectsLocationsSecretsVersionsListCall) Context(ctx context.Context) *ProjectsLocationsSecretsVersionsListCall {
3294 c.ctx_ = ctx
3295 return c
3296 }
3297
3298
3299
3300 func (c *ProjectsLocationsSecretsVersionsListCall) Header() http.Header {
3301 if c.header_ == nil {
3302 c.header_ = make(http.Header)
3303 }
3304 return c.header_
3305 }
3306
3307 func (c *ProjectsLocationsSecretsVersionsListCall) doRequest(alt string) (*http.Response, error) {
3308 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3309 if c.ifNoneMatch_ != "" {
3310 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3311 }
3312 var body io.Reader = nil
3313 c.urlParams_.Set("alt", alt)
3314 c.urlParams_.Set("prettyPrint", "false")
3315 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/versions")
3316 urls += "?" + c.urlParams_.Encode()
3317 req, err := http.NewRequest("GET", urls, body)
3318 if err != nil {
3319 return nil, err
3320 }
3321 req.Header = reqHeaders
3322 googleapi.Expand(req.URL, map[string]string{
3323 "parent": c.parent,
3324 })
3325 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3326 }
3327
3328
3329
3330
3331
3332
3333
3334 func (c *ProjectsLocationsSecretsVersionsListCall) Do(opts ...googleapi.CallOption) (*ListSecretVersionsResponse, error) {
3335 gensupport.SetOptions(c.urlParams_, opts...)
3336 res, err := c.doRequest("json")
3337 if res != nil && res.StatusCode == http.StatusNotModified {
3338 if res.Body != nil {
3339 res.Body.Close()
3340 }
3341 return nil, gensupport.WrapError(&googleapi.Error{
3342 Code: res.StatusCode,
3343 Header: res.Header,
3344 })
3345 }
3346 if err != nil {
3347 return nil, err
3348 }
3349 defer googleapi.CloseBody(res)
3350 if err := googleapi.CheckResponse(res); err != nil {
3351 return nil, gensupport.WrapError(err)
3352 }
3353 ret := &ListSecretVersionsResponse{
3354 ServerResponse: googleapi.ServerResponse{
3355 Header: res.Header,
3356 HTTPStatusCode: res.StatusCode,
3357 },
3358 }
3359 target := &ret
3360 if err := gensupport.DecodeResponse(target, res); err != nil {
3361 return nil, err
3362 }
3363 return ret, nil
3364 }
3365
3366
3367
3368
3369 func (c *ProjectsLocationsSecretsVersionsListCall) Pages(ctx context.Context, f func(*ListSecretVersionsResponse) error) error {
3370 c.ctx_ = ctx
3371 defer c.PageToken(c.urlParams_.Get("pageToken"))
3372 for {
3373 x, err := c.Do()
3374 if err != nil {
3375 return err
3376 }
3377 if err := f(x); err != nil {
3378 return err
3379 }
3380 if x.NextPageToken == "" {
3381 return nil
3382 }
3383 c.PageToken(x.NextPageToken)
3384 }
3385 }
3386
3387 type ProjectsSecretsAddVersionCall struct {
3388 s *Service
3389 parent string
3390 addsecretversionrequest *AddSecretVersionRequest
3391 urlParams_ gensupport.URLParams
3392 ctx_ context.Context
3393 header_ http.Header
3394 }
3395
3396
3397
3398
3399
3400
3401
3402 func (r *ProjectsSecretsService) AddVersion(parent string, addsecretversionrequest *AddSecretVersionRequest) *ProjectsSecretsAddVersionCall {
3403 c := &ProjectsSecretsAddVersionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3404 c.parent = parent
3405 c.addsecretversionrequest = addsecretversionrequest
3406 return c
3407 }
3408
3409
3410
3411
3412 func (c *ProjectsSecretsAddVersionCall) Fields(s ...googleapi.Field) *ProjectsSecretsAddVersionCall {
3413 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3414 return c
3415 }
3416
3417
3418 func (c *ProjectsSecretsAddVersionCall) Context(ctx context.Context) *ProjectsSecretsAddVersionCall {
3419 c.ctx_ = ctx
3420 return c
3421 }
3422
3423
3424
3425 func (c *ProjectsSecretsAddVersionCall) Header() http.Header {
3426 if c.header_ == nil {
3427 c.header_ = make(http.Header)
3428 }
3429 return c.header_
3430 }
3431
3432 func (c *ProjectsSecretsAddVersionCall) doRequest(alt string) (*http.Response, error) {
3433 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3434 var body io.Reader = nil
3435 body, err := googleapi.WithoutDataWrapper.JSONReader(c.addsecretversionrequest)
3436 if err != nil {
3437 return nil, err
3438 }
3439 c.urlParams_.Set("alt", alt)
3440 c.urlParams_.Set("prettyPrint", "false")
3441 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}:addVersion")
3442 urls += "?" + c.urlParams_.Encode()
3443 req, err := http.NewRequest("POST", urls, body)
3444 if err != nil {
3445 return nil, err
3446 }
3447 req.Header = reqHeaders
3448 googleapi.Expand(req.URL, map[string]string{
3449 "parent": c.parent,
3450 })
3451 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3452 }
3453
3454
3455
3456
3457
3458
3459 func (c *ProjectsSecretsAddVersionCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
3460 gensupport.SetOptions(c.urlParams_, opts...)
3461 res, err := c.doRequest("json")
3462 if res != nil && res.StatusCode == http.StatusNotModified {
3463 if res.Body != nil {
3464 res.Body.Close()
3465 }
3466 return nil, gensupport.WrapError(&googleapi.Error{
3467 Code: res.StatusCode,
3468 Header: res.Header,
3469 })
3470 }
3471 if err != nil {
3472 return nil, err
3473 }
3474 defer googleapi.CloseBody(res)
3475 if err := googleapi.CheckResponse(res); err != nil {
3476 return nil, gensupport.WrapError(err)
3477 }
3478 ret := &SecretVersion{
3479 ServerResponse: googleapi.ServerResponse{
3480 Header: res.Header,
3481 HTTPStatusCode: res.StatusCode,
3482 },
3483 }
3484 target := &ret
3485 if err := gensupport.DecodeResponse(target, res); err != nil {
3486 return nil, err
3487 }
3488 return ret, nil
3489 }
3490
3491 type ProjectsSecretsCreateCall struct {
3492 s *Service
3493 parent string
3494 secret *Secret
3495 urlParams_ gensupport.URLParams
3496 ctx_ context.Context
3497 header_ http.Header
3498 }
3499
3500
3501
3502
3503
3504 func (r *ProjectsSecretsService) Create(parent string, secret *Secret) *ProjectsSecretsCreateCall {
3505 c := &ProjectsSecretsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3506 c.parent = parent
3507 c.secret = secret
3508 return c
3509 }
3510
3511
3512
3513
3514
3515 func (c *ProjectsSecretsCreateCall) SecretId(secretId string) *ProjectsSecretsCreateCall {
3516 c.urlParams_.Set("secretId", secretId)
3517 return c
3518 }
3519
3520
3521
3522
3523 func (c *ProjectsSecretsCreateCall) Fields(s ...googleapi.Field) *ProjectsSecretsCreateCall {
3524 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3525 return c
3526 }
3527
3528
3529 func (c *ProjectsSecretsCreateCall) Context(ctx context.Context) *ProjectsSecretsCreateCall {
3530 c.ctx_ = ctx
3531 return c
3532 }
3533
3534
3535
3536 func (c *ProjectsSecretsCreateCall) Header() http.Header {
3537 if c.header_ == nil {
3538 c.header_ = make(http.Header)
3539 }
3540 return c.header_
3541 }
3542
3543 func (c *ProjectsSecretsCreateCall) doRequest(alt string) (*http.Response, error) {
3544 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3545 var body io.Reader = nil
3546 body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret)
3547 if err != nil {
3548 return nil, err
3549 }
3550 c.urlParams_.Set("alt", alt)
3551 c.urlParams_.Set("prettyPrint", "false")
3552 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/secrets")
3553 urls += "?" + c.urlParams_.Encode()
3554 req, err := http.NewRequest("POST", urls, body)
3555 if err != nil {
3556 return nil, err
3557 }
3558 req.Header = reqHeaders
3559 googleapi.Expand(req.URL, map[string]string{
3560 "parent": c.parent,
3561 })
3562 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3563 }
3564
3565
3566
3567
3568
3569
3570 func (c *ProjectsSecretsCreateCall) Do(opts ...googleapi.CallOption) (*Secret, error) {
3571 gensupport.SetOptions(c.urlParams_, opts...)
3572 res, err := c.doRequest("json")
3573 if res != nil && res.StatusCode == http.StatusNotModified {
3574 if res.Body != nil {
3575 res.Body.Close()
3576 }
3577 return nil, gensupport.WrapError(&googleapi.Error{
3578 Code: res.StatusCode,
3579 Header: res.Header,
3580 })
3581 }
3582 if err != nil {
3583 return nil, err
3584 }
3585 defer googleapi.CloseBody(res)
3586 if err := googleapi.CheckResponse(res); err != nil {
3587 return nil, gensupport.WrapError(err)
3588 }
3589 ret := &Secret{
3590 ServerResponse: googleapi.ServerResponse{
3591 Header: res.Header,
3592 HTTPStatusCode: res.StatusCode,
3593 },
3594 }
3595 target := &ret
3596 if err := gensupport.DecodeResponse(target, res); err != nil {
3597 return nil, err
3598 }
3599 return ret, nil
3600 }
3601
3602 type ProjectsSecretsDeleteCall struct {
3603 s *Service
3604 name string
3605 urlParams_ gensupport.URLParams
3606 ctx_ context.Context
3607 header_ http.Header
3608 }
3609
3610
3611
3612
3613
3614 func (r *ProjectsSecretsService) Delete(name string) *ProjectsSecretsDeleteCall {
3615 c := &ProjectsSecretsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3616 c.name = name
3617 return c
3618 }
3619
3620
3621
3622
3623 func (c *ProjectsSecretsDeleteCall) Etag(etag string) *ProjectsSecretsDeleteCall {
3624 c.urlParams_.Set("etag", etag)
3625 return c
3626 }
3627
3628
3629
3630
3631 func (c *ProjectsSecretsDeleteCall) Fields(s ...googleapi.Field) *ProjectsSecretsDeleteCall {
3632 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3633 return c
3634 }
3635
3636
3637 func (c *ProjectsSecretsDeleteCall) Context(ctx context.Context) *ProjectsSecretsDeleteCall {
3638 c.ctx_ = ctx
3639 return c
3640 }
3641
3642
3643
3644 func (c *ProjectsSecretsDeleteCall) Header() http.Header {
3645 if c.header_ == nil {
3646 c.header_ = make(http.Header)
3647 }
3648 return c.header_
3649 }
3650
3651 func (c *ProjectsSecretsDeleteCall) doRequest(alt string) (*http.Response, error) {
3652 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3653 var body io.Reader = nil
3654 c.urlParams_.Set("alt", alt)
3655 c.urlParams_.Set("prettyPrint", "false")
3656 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
3657 urls += "?" + c.urlParams_.Encode()
3658 req, err := http.NewRequest("DELETE", urls, body)
3659 if err != nil {
3660 return nil, err
3661 }
3662 req.Header = reqHeaders
3663 googleapi.Expand(req.URL, map[string]string{
3664 "name": c.name,
3665 })
3666 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3667 }
3668
3669
3670
3671
3672
3673
3674 func (c *ProjectsSecretsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3675 gensupport.SetOptions(c.urlParams_, opts...)
3676 res, err := c.doRequest("json")
3677 if res != nil && res.StatusCode == http.StatusNotModified {
3678 if res.Body != nil {
3679 res.Body.Close()
3680 }
3681 return nil, gensupport.WrapError(&googleapi.Error{
3682 Code: res.StatusCode,
3683 Header: res.Header,
3684 })
3685 }
3686 if err != nil {
3687 return nil, err
3688 }
3689 defer googleapi.CloseBody(res)
3690 if err := googleapi.CheckResponse(res); err != nil {
3691 return nil, gensupport.WrapError(err)
3692 }
3693 ret := &Empty{
3694 ServerResponse: googleapi.ServerResponse{
3695 Header: res.Header,
3696 HTTPStatusCode: res.StatusCode,
3697 },
3698 }
3699 target := &ret
3700 if err := gensupport.DecodeResponse(target, res); err != nil {
3701 return nil, err
3702 }
3703 return ret, nil
3704 }
3705
3706 type ProjectsSecretsGetCall struct {
3707 s *Service
3708 name string
3709 urlParams_ gensupport.URLParams
3710 ifNoneMatch_ string
3711 ctx_ context.Context
3712 header_ http.Header
3713 }
3714
3715
3716
3717
3718
3719 func (r *ProjectsSecretsService) Get(name string) *ProjectsSecretsGetCall {
3720 c := &ProjectsSecretsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3721 c.name = name
3722 return c
3723 }
3724
3725
3726
3727
3728 func (c *ProjectsSecretsGetCall) Fields(s ...googleapi.Field) *ProjectsSecretsGetCall {
3729 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3730 return c
3731 }
3732
3733
3734
3735
3736 func (c *ProjectsSecretsGetCall) IfNoneMatch(entityTag string) *ProjectsSecretsGetCall {
3737 c.ifNoneMatch_ = entityTag
3738 return c
3739 }
3740
3741
3742 func (c *ProjectsSecretsGetCall) Context(ctx context.Context) *ProjectsSecretsGetCall {
3743 c.ctx_ = ctx
3744 return c
3745 }
3746
3747
3748
3749 func (c *ProjectsSecretsGetCall) Header() http.Header {
3750 if c.header_ == nil {
3751 c.header_ = make(http.Header)
3752 }
3753 return c.header_
3754 }
3755
3756 func (c *ProjectsSecretsGetCall) doRequest(alt string) (*http.Response, error) {
3757 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3758 if c.ifNoneMatch_ != "" {
3759 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3760 }
3761 var body io.Reader = nil
3762 c.urlParams_.Set("alt", alt)
3763 c.urlParams_.Set("prettyPrint", "false")
3764 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
3765 urls += "?" + c.urlParams_.Encode()
3766 req, err := http.NewRequest("GET", urls, body)
3767 if err != nil {
3768 return nil, err
3769 }
3770 req.Header = reqHeaders
3771 googleapi.Expand(req.URL, map[string]string{
3772 "name": c.name,
3773 })
3774 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3775 }
3776
3777
3778
3779
3780
3781
3782 func (c *ProjectsSecretsGetCall) Do(opts ...googleapi.CallOption) (*Secret, error) {
3783 gensupport.SetOptions(c.urlParams_, opts...)
3784 res, err := c.doRequest("json")
3785 if res != nil && res.StatusCode == http.StatusNotModified {
3786 if res.Body != nil {
3787 res.Body.Close()
3788 }
3789 return nil, gensupport.WrapError(&googleapi.Error{
3790 Code: res.StatusCode,
3791 Header: res.Header,
3792 })
3793 }
3794 if err != nil {
3795 return nil, err
3796 }
3797 defer googleapi.CloseBody(res)
3798 if err := googleapi.CheckResponse(res); err != nil {
3799 return nil, gensupport.WrapError(err)
3800 }
3801 ret := &Secret{
3802 ServerResponse: googleapi.ServerResponse{
3803 Header: res.Header,
3804 HTTPStatusCode: res.StatusCode,
3805 },
3806 }
3807 target := &ret
3808 if err := gensupport.DecodeResponse(target, res); err != nil {
3809 return nil, err
3810 }
3811 return ret, nil
3812 }
3813
3814 type ProjectsSecretsGetIamPolicyCall struct {
3815 s *Service
3816 resource string
3817 urlParams_ gensupport.URLParams
3818 ifNoneMatch_ string
3819 ctx_ context.Context
3820 header_ http.Header
3821 }
3822
3823
3824
3825
3826
3827
3828
3829 func (r *ProjectsSecretsService) GetIamPolicy(resource string) *ProjectsSecretsGetIamPolicyCall {
3830 c := &ProjectsSecretsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3831 c.resource = resource
3832 return c
3833 }
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847 func (c *ProjectsSecretsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsSecretsGetIamPolicyCall {
3848 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
3849 return c
3850 }
3851
3852
3853
3854
3855 func (c *ProjectsSecretsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSecretsGetIamPolicyCall {
3856 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3857 return c
3858 }
3859
3860
3861
3862
3863 func (c *ProjectsSecretsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsSecretsGetIamPolicyCall {
3864 c.ifNoneMatch_ = entityTag
3865 return c
3866 }
3867
3868
3869 func (c *ProjectsSecretsGetIamPolicyCall) Context(ctx context.Context) *ProjectsSecretsGetIamPolicyCall {
3870 c.ctx_ = ctx
3871 return c
3872 }
3873
3874
3875
3876 func (c *ProjectsSecretsGetIamPolicyCall) Header() http.Header {
3877 if c.header_ == nil {
3878 c.header_ = make(http.Header)
3879 }
3880 return c.header_
3881 }
3882
3883 func (c *ProjectsSecretsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3884 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3885 if c.ifNoneMatch_ != "" {
3886 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3887 }
3888 var body io.Reader = nil
3889 c.urlParams_.Set("alt", alt)
3890 c.urlParams_.Set("prettyPrint", "false")
3891 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy")
3892 urls += "?" + c.urlParams_.Encode()
3893 req, err := http.NewRequest("GET", urls, body)
3894 if err != nil {
3895 return nil, err
3896 }
3897 req.Header = reqHeaders
3898 googleapi.Expand(req.URL, map[string]string{
3899 "resource": c.resource,
3900 })
3901 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3902 }
3903
3904
3905
3906
3907
3908
3909 func (c *ProjectsSecretsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3910 gensupport.SetOptions(c.urlParams_, opts...)
3911 res, err := c.doRequest("json")
3912 if res != nil && res.StatusCode == http.StatusNotModified {
3913 if res.Body != nil {
3914 res.Body.Close()
3915 }
3916 return nil, gensupport.WrapError(&googleapi.Error{
3917 Code: res.StatusCode,
3918 Header: res.Header,
3919 })
3920 }
3921 if err != nil {
3922 return nil, err
3923 }
3924 defer googleapi.CloseBody(res)
3925 if err := googleapi.CheckResponse(res); err != nil {
3926 return nil, gensupport.WrapError(err)
3927 }
3928 ret := &Policy{
3929 ServerResponse: googleapi.ServerResponse{
3930 Header: res.Header,
3931 HTTPStatusCode: res.StatusCode,
3932 },
3933 }
3934 target := &ret
3935 if err := gensupport.DecodeResponse(target, res); err != nil {
3936 return nil, err
3937 }
3938 return ret, nil
3939 }
3940
3941 type ProjectsSecretsListCall struct {
3942 s *Service
3943 parent string
3944 urlParams_ gensupport.URLParams
3945 ifNoneMatch_ string
3946 ctx_ context.Context
3947 header_ http.Header
3948 }
3949
3950
3951
3952
3953
3954 func (r *ProjectsSecretsService) List(parent string) *ProjectsSecretsListCall {
3955 c := &ProjectsSecretsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3956 c.parent = parent
3957 return c
3958 }
3959
3960
3961
3962
3963
3964 func (c *ProjectsSecretsListCall) Filter(filter string) *ProjectsSecretsListCall {
3965 c.urlParams_.Set("filter", filter)
3966 return c
3967 }
3968
3969
3970
3971
3972
3973 func (c *ProjectsSecretsListCall) PageSize(pageSize int64) *ProjectsSecretsListCall {
3974 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3975 return c
3976 }
3977
3978
3979
3980 func (c *ProjectsSecretsListCall) PageToken(pageToken string) *ProjectsSecretsListCall {
3981 c.urlParams_.Set("pageToken", pageToken)
3982 return c
3983 }
3984
3985
3986
3987
3988 func (c *ProjectsSecretsListCall) Fields(s ...googleapi.Field) *ProjectsSecretsListCall {
3989 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3990 return c
3991 }
3992
3993
3994
3995
3996 func (c *ProjectsSecretsListCall) IfNoneMatch(entityTag string) *ProjectsSecretsListCall {
3997 c.ifNoneMatch_ = entityTag
3998 return c
3999 }
4000
4001
4002 func (c *ProjectsSecretsListCall) Context(ctx context.Context) *ProjectsSecretsListCall {
4003 c.ctx_ = ctx
4004 return c
4005 }
4006
4007
4008
4009 func (c *ProjectsSecretsListCall) Header() http.Header {
4010 if c.header_ == nil {
4011 c.header_ = make(http.Header)
4012 }
4013 return c.header_
4014 }
4015
4016 func (c *ProjectsSecretsListCall) doRequest(alt string) (*http.Response, error) {
4017 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4018 if c.ifNoneMatch_ != "" {
4019 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4020 }
4021 var body io.Reader = nil
4022 c.urlParams_.Set("alt", alt)
4023 c.urlParams_.Set("prettyPrint", "false")
4024 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/secrets")
4025 urls += "?" + c.urlParams_.Encode()
4026 req, err := http.NewRequest("GET", urls, body)
4027 if err != nil {
4028 return nil, err
4029 }
4030 req.Header = reqHeaders
4031 googleapi.Expand(req.URL, map[string]string{
4032 "parent": c.parent,
4033 })
4034 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4035 }
4036
4037
4038
4039
4040
4041
4042
4043 func (c *ProjectsSecretsListCall) Do(opts ...googleapi.CallOption) (*ListSecretsResponse, error) {
4044 gensupport.SetOptions(c.urlParams_, opts...)
4045 res, err := c.doRequest("json")
4046 if res != nil && res.StatusCode == http.StatusNotModified {
4047 if res.Body != nil {
4048 res.Body.Close()
4049 }
4050 return nil, gensupport.WrapError(&googleapi.Error{
4051 Code: res.StatusCode,
4052 Header: res.Header,
4053 })
4054 }
4055 if err != nil {
4056 return nil, err
4057 }
4058 defer googleapi.CloseBody(res)
4059 if err := googleapi.CheckResponse(res); err != nil {
4060 return nil, gensupport.WrapError(err)
4061 }
4062 ret := &ListSecretsResponse{
4063 ServerResponse: googleapi.ServerResponse{
4064 Header: res.Header,
4065 HTTPStatusCode: res.StatusCode,
4066 },
4067 }
4068 target := &ret
4069 if err := gensupport.DecodeResponse(target, res); err != nil {
4070 return nil, err
4071 }
4072 return ret, nil
4073 }
4074
4075
4076
4077
4078 func (c *ProjectsSecretsListCall) Pages(ctx context.Context, f func(*ListSecretsResponse) error) error {
4079 c.ctx_ = ctx
4080 defer c.PageToken(c.urlParams_.Get("pageToken"))
4081 for {
4082 x, err := c.Do()
4083 if err != nil {
4084 return err
4085 }
4086 if err := f(x); err != nil {
4087 return err
4088 }
4089 if x.NextPageToken == "" {
4090 return nil
4091 }
4092 c.PageToken(x.NextPageToken)
4093 }
4094 }
4095
4096 type ProjectsSecretsPatchCall struct {
4097 s *Service
4098 name string
4099 secret *Secret
4100 urlParams_ gensupport.URLParams
4101 ctx_ context.Context
4102 header_ http.Header
4103 }
4104
4105
4106
4107
4108
4109 func (r *ProjectsSecretsService) Patch(name string, secret *Secret) *ProjectsSecretsPatchCall {
4110 c := &ProjectsSecretsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4111 c.name = name
4112 c.secret = secret
4113 return c
4114 }
4115
4116
4117
4118 func (c *ProjectsSecretsPatchCall) UpdateMask(updateMask string) *ProjectsSecretsPatchCall {
4119 c.urlParams_.Set("updateMask", updateMask)
4120 return c
4121 }
4122
4123
4124
4125
4126 func (c *ProjectsSecretsPatchCall) Fields(s ...googleapi.Field) *ProjectsSecretsPatchCall {
4127 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4128 return c
4129 }
4130
4131
4132 func (c *ProjectsSecretsPatchCall) Context(ctx context.Context) *ProjectsSecretsPatchCall {
4133 c.ctx_ = ctx
4134 return c
4135 }
4136
4137
4138
4139 func (c *ProjectsSecretsPatchCall) Header() http.Header {
4140 if c.header_ == nil {
4141 c.header_ = make(http.Header)
4142 }
4143 return c.header_
4144 }
4145
4146 func (c *ProjectsSecretsPatchCall) doRequest(alt string) (*http.Response, error) {
4147 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4148 var body io.Reader = nil
4149 body, err := googleapi.WithoutDataWrapper.JSONReader(c.secret)
4150 if err != nil {
4151 return nil, err
4152 }
4153 c.urlParams_.Set("alt", alt)
4154 c.urlParams_.Set("prettyPrint", "false")
4155 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
4156 urls += "?" + c.urlParams_.Encode()
4157 req, err := http.NewRequest("PATCH", urls, body)
4158 if err != nil {
4159 return nil, err
4160 }
4161 req.Header = reqHeaders
4162 googleapi.Expand(req.URL, map[string]string{
4163 "name": c.name,
4164 })
4165 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4166 }
4167
4168
4169
4170
4171
4172
4173 func (c *ProjectsSecretsPatchCall) Do(opts ...googleapi.CallOption) (*Secret, error) {
4174 gensupport.SetOptions(c.urlParams_, opts...)
4175 res, err := c.doRequest("json")
4176 if res != nil && res.StatusCode == http.StatusNotModified {
4177 if res.Body != nil {
4178 res.Body.Close()
4179 }
4180 return nil, gensupport.WrapError(&googleapi.Error{
4181 Code: res.StatusCode,
4182 Header: res.Header,
4183 })
4184 }
4185 if err != nil {
4186 return nil, err
4187 }
4188 defer googleapi.CloseBody(res)
4189 if err := googleapi.CheckResponse(res); err != nil {
4190 return nil, gensupport.WrapError(err)
4191 }
4192 ret := &Secret{
4193 ServerResponse: googleapi.ServerResponse{
4194 Header: res.Header,
4195 HTTPStatusCode: res.StatusCode,
4196 },
4197 }
4198 target := &ret
4199 if err := gensupport.DecodeResponse(target, res); err != nil {
4200 return nil, err
4201 }
4202 return ret, nil
4203 }
4204
4205 type ProjectsSecretsSetIamPolicyCall struct {
4206 s *Service
4207 resource string
4208 setiampolicyrequest *SetIamPolicyRequest
4209 urlParams_ gensupport.URLParams
4210 ctx_ context.Context
4211 header_ http.Header
4212 }
4213
4214
4215
4216
4217
4218
4219
4220
4221 func (r *ProjectsSecretsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsSecretsSetIamPolicyCall {
4222 c := &ProjectsSecretsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4223 c.resource = resource
4224 c.setiampolicyrequest = setiampolicyrequest
4225 return c
4226 }
4227
4228
4229
4230
4231 func (c *ProjectsSecretsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSecretsSetIamPolicyCall {
4232 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4233 return c
4234 }
4235
4236
4237 func (c *ProjectsSecretsSetIamPolicyCall) Context(ctx context.Context) *ProjectsSecretsSetIamPolicyCall {
4238 c.ctx_ = ctx
4239 return c
4240 }
4241
4242
4243
4244 func (c *ProjectsSecretsSetIamPolicyCall) Header() http.Header {
4245 if c.header_ == nil {
4246 c.header_ = make(http.Header)
4247 }
4248 return c.header_
4249 }
4250
4251 func (c *ProjectsSecretsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4252 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4253 var body io.Reader = nil
4254 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
4255 if err != nil {
4256 return nil, err
4257 }
4258 c.urlParams_.Set("alt", alt)
4259 c.urlParams_.Set("prettyPrint", "false")
4260 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy")
4261 urls += "?" + c.urlParams_.Encode()
4262 req, err := http.NewRequest("POST", urls, body)
4263 if err != nil {
4264 return nil, err
4265 }
4266 req.Header = reqHeaders
4267 googleapi.Expand(req.URL, map[string]string{
4268 "resource": c.resource,
4269 })
4270 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4271 }
4272
4273
4274
4275
4276
4277
4278 func (c *ProjectsSecretsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4279 gensupport.SetOptions(c.urlParams_, opts...)
4280 res, err := c.doRequest("json")
4281 if res != nil && res.StatusCode == http.StatusNotModified {
4282 if res.Body != nil {
4283 res.Body.Close()
4284 }
4285 return nil, gensupport.WrapError(&googleapi.Error{
4286 Code: res.StatusCode,
4287 Header: res.Header,
4288 })
4289 }
4290 if err != nil {
4291 return nil, err
4292 }
4293 defer googleapi.CloseBody(res)
4294 if err := googleapi.CheckResponse(res); err != nil {
4295 return nil, gensupport.WrapError(err)
4296 }
4297 ret := &Policy{
4298 ServerResponse: googleapi.ServerResponse{
4299 Header: res.Header,
4300 HTTPStatusCode: res.StatusCode,
4301 },
4302 }
4303 target := &ret
4304 if err := gensupport.DecodeResponse(target, res); err != nil {
4305 return nil, err
4306 }
4307 return ret, nil
4308 }
4309
4310 type ProjectsSecretsTestIamPermissionsCall struct {
4311 s *Service
4312 resource string
4313 testiampermissionsrequest *TestIamPermissionsRequest
4314 urlParams_ gensupport.URLParams
4315 ctx_ context.Context
4316 header_ http.Header
4317 }
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329 func (r *ProjectsSecretsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsSecretsTestIamPermissionsCall {
4330 c := &ProjectsSecretsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4331 c.resource = resource
4332 c.testiampermissionsrequest = testiampermissionsrequest
4333 return c
4334 }
4335
4336
4337
4338
4339 func (c *ProjectsSecretsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsSecretsTestIamPermissionsCall {
4340 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4341 return c
4342 }
4343
4344
4345 func (c *ProjectsSecretsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsSecretsTestIamPermissionsCall {
4346 c.ctx_ = ctx
4347 return c
4348 }
4349
4350
4351
4352 func (c *ProjectsSecretsTestIamPermissionsCall) Header() http.Header {
4353 if c.header_ == nil {
4354 c.header_ = make(http.Header)
4355 }
4356 return c.header_
4357 }
4358
4359 func (c *ProjectsSecretsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
4360 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4361 var body io.Reader = nil
4362 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
4363 if err != nil {
4364 return nil, err
4365 }
4366 c.urlParams_.Set("alt", alt)
4367 c.urlParams_.Set("prettyPrint", "false")
4368 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions")
4369 urls += "?" + c.urlParams_.Encode()
4370 req, err := http.NewRequest("POST", urls, body)
4371 if err != nil {
4372 return nil, err
4373 }
4374 req.Header = reqHeaders
4375 googleapi.Expand(req.URL, map[string]string{
4376 "resource": c.resource,
4377 })
4378 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4379 }
4380
4381
4382
4383
4384
4385
4386
4387 func (c *ProjectsSecretsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
4388 gensupport.SetOptions(c.urlParams_, opts...)
4389 res, err := c.doRequest("json")
4390 if res != nil && res.StatusCode == http.StatusNotModified {
4391 if res.Body != nil {
4392 res.Body.Close()
4393 }
4394 return nil, gensupport.WrapError(&googleapi.Error{
4395 Code: res.StatusCode,
4396 Header: res.Header,
4397 })
4398 }
4399 if err != nil {
4400 return nil, err
4401 }
4402 defer googleapi.CloseBody(res)
4403 if err := googleapi.CheckResponse(res); err != nil {
4404 return nil, gensupport.WrapError(err)
4405 }
4406 ret := &TestIamPermissionsResponse{
4407 ServerResponse: googleapi.ServerResponse{
4408 Header: res.Header,
4409 HTTPStatusCode: res.StatusCode,
4410 },
4411 }
4412 target := &ret
4413 if err := gensupport.DecodeResponse(target, res); err != nil {
4414 return nil, err
4415 }
4416 return ret, nil
4417 }
4418
4419 type ProjectsSecretsVersionsAccessCall struct {
4420 s *Service
4421 name string
4422 urlParams_ gensupport.URLParams
4423 ifNoneMatch_ string
4424 ctx_ context.Context
4425 header_ http.Header
4426 }
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438 func (r *ProjectsSecretsVersionsService) Access(name string) *ProjectsSecretsVersionsAccessCall {
4439 c := &ProjectsSecretsVersionsAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4440 c.name = name
4441 return c
4442 }
4443
4444
4445
4446
4447 func (c *ProjectsSecretsVersionsAccessCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsAccessCall {
4448 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4449 return c
4450 }
4451
4452
4453
4454
4455 func (c *ProjectsSecretsVersionsAccessCall) IfNoneMatch(entityTag string) *ProjectsSecretsVersionsAccessCall {
4456 c.ifNoneMatch_ = entityTag
4457 return c
4458 }
4459
4460
4461 func (c *ProjectsSecretsVersionsAccessCall) Context(ctx context.Context) *ProjectsSecretsVersionsAccessCall {
4462 c.ctx_ = ctx
4463 return c
4464 }
4465
4466
4467
4468 func (c *ProjectsSecretsVersionsAccessCall) Header() http.Header {
4469 if c.header_ == nil {
4470 c.header_ = make(http.Header)
4471 }
4472 return c.header_
4473 }
4474
4475 func (c *ProjectsSecretsVersionsAccessCall) doRequest(alt string) (*http.Response, error) {
4476 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4477 if c.ifNoneMatch_ != "" {
4478 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4479 }
4480 var body io.Reader = nil
4481 c.urlParams_.Set("alt", alt)
4482 c.urlParams_.Set("prettyPrint", "false")
4483 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:access")
4484 urls += "?" + c.urlParams_.Encode()
4485 req, err := http.NewRequest("GET", urls, body)
4486 if err != nil {
4487 return nil, err
4488 }
4489 req.Header = reqHeaders
4490 googleapi.Expand(req.URL, map[string]string{
4491 "name": c.name,
4492 })
4493 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4494 }
4495
4496
4497
4498
4499
4500
4501
4502 func (c *ProjectsSecretsVersionsAccessCall) Do(opts ...googleapi.CallOption) (*AccessSecretVersionResponse, error) {
4503 gensupport.SetOptions(c.urlParams_, opts...)
4504 res, err := c.doRequest("json")
4505 if res != nil && res.StatusCode == http.StatusNotModified {
4506 if res.Body != nil {
4507 res.Body.Close()
4508 }
4509 return nil, gensupport.WrapError(&googleapi.Error{
4510 Code: res.StatusCode,
4511 Header: res.Header,
4512 })
4513 }
4514 if err != nil {
4515 return nil, err
4516 }
4517 defer googleapi.CloseBody(res)
4518 if err := googleapi.CheckResponse(res); err != nil {
4519 return nil, gensupport.WrapError(err)
4520 }
4521 ret := &AccessSecretVersionResponse{
4522 ServerResponse: googleapi.ServerResponse{
4523 Header: res.Header,
4524 HTTPStatusCode: res.StatusCode,
4525 },
4526 }
4527 target := &ret
4528 if err := gensupport.DecodeResponse(target, res); err != nil {
4529 return nil, err
4530 }
4531 return ret, nil
4532 }
4533
4534 type ProjectsSecretsVersionsDestroyCall struct {
4535 s *Service
4536 name string
4537 destroysecretversionrequest *DestroySecretVersionRequest
4538 urlParams_ gensupport.URLParams
4539 ctx_ context.Context
4540 header_ http.Header
4541 }
4542
4543
4544
4545
4546
4547
4548
4549 func (r *ProjectsSecretsVersionsService) Destroy(name string, destroysecretversionrequest *DestroySecretVersionRequest) *ProjectsSecretsVersionsDestroyCall {
4550 c := &ProjectsSecretsVersionsDestroyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4551 c.name = name
4552 c.destroysecretversionrequest = destroysecretversionrequest
4553 return c
4554 }
4555
4556
4557
4558
4559 func (c *ProjectsSecretsVersionsDestroyCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsDestroyCall {
4560 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4561 return c
4562 }
4563
4564
4565 func (c *ProjectsSecretsVersionsDestroyCall) Context(ctx context.Context) *ProjectsSecretsVersionsDestroyCall {
4566 c.ctx_ = ctx
4567 return c
4568 }
4569
4570
4571
4572 func (c *ProjectsSecretsVersionsDestroyCall) Header() http.Header {
4573 if c.header_ == nil {
4574 c.header_ = make(http.Header)
4575 }
4576 return c.header_
4577 }
4578
4579 func (c *ProjectsSecretsVersionsDestroyCall) doRequest(alt string) (*http.Response, error) {
4580 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4581 var body io.Reader = nil
4582 body, err := googleapi.WithoutDataWrapper.JSONReader(c.destroysecretversionrequest)
4583 if err != nil {
4584 return nil, err
4585 }
4586 c.urlParams_.Set("alt", alt)
4587 c.urlParams_.Set("prettyPrint", "false")
4588 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:destroy")
4589 urls += "?" + c.urlParams_.Encode()
4590 req, err := http.NewRequest("POST", urls, body)
4591 if err != nil {
4592 return nil, err
4593 }
4594 req.Header = reqHeaders
4595 googleapi.Expand(req.URL, map[string]string{
4596 "name": c.name,
4597 })
4598 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4599 }
4600
4601
4602
4603
4604
4605
4606 func (c *ProjectsSecretsVersionsDestroyCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
4607 gensupport.SetOptions(c.urlParams_, opts...)
4608 res, err := c.doRequest("json")
4609 if res != nil && res.StatusCode == http.StatusNotModified {
4610 if res.Body != nil {
4611 res.Body.Close()
4612 }
4613 return nil, gensupport.WrapError(&googleapi.Error{
4614 Code: res.StatusCode,
4615 Header: res.Header,
4616 })
4617 }
4618 if err != nil {
4619 return nil, err
4620 }
4621 defer googleapi.CloseBody(res)
4622 if err := googleapi.CheckResponse(res); err != nil {
4623 return nil, gensupport.WrapError(err)
4624 }
4625 ret := &SecretVersion{
4626 ServerResponse: googleapi.ServerResponse{
4627 Header: res.Header,
4628 HTTPStatusCode: res.StatusCode,
4629 },
4630 }
4631 target := &ret
4632 if err := gensupport.DecodeResponse(target, res); err != nil {
4633 return nil, err
4634 }
4635 return ret, nil
4636 }
4637
4638 type ProjectsSecretsVersionsDisableCall struct {
4639 s *Service
4640 name string
4641 disablesecretversionrequest *DisableSecretVersionRequest
4642 urlParams_ gensupport.URLParams
4643 ctx_ context.Context
4644 header_ http.Header
4645 }
4646
4647
4648
4649
4650
4651
4652
4653 func (r *ProjectsSecretsVersionsService) Disable(name string, disablesecretversionrequest *DisableSecretVersionRequest) *ProjectsSecretsVersionsDisableCall {
4654 c := &ProjectsSecretsVersionsDisableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4655 c.name = name
4656 c.disablesecretversionrequest = disablesecretversionrequest
4657 return c
4658 }
4659
4660
4661
4662
4663 func (c *ProjectsSecretsVersionsDisableCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsDisableCall {
4664 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4665 return c
4666 }
4667
4668
4669 func (c *ProjectsSecretsVersionsDisableCall) Context(ctx context.Context) *ProjectsSecretsVersionsDisableCall {
4670 c.ctx_ = ctx
4671 return c
4672 }
4673
4674
4675
4676 func (c *ProjectsSecretsVersionsDisableCall) Header() http.Header {
4677 if c.header_ == nil {
4678 c.header_ = make(http.Header)
4679 }
4680 return c.header_
4681 }
4682
4683 func (c *ProjectsSecretsVersionsDisableCall) doRequest(alt string) (*http.Response, error) {
4684 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4685 var body io.Reader = nil
4686 body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablesecretversionrequest)
4687 if err != nil {
4688 return nil, err
4689 }
4690 c.urlParams_.Set("alt", alt)
4691 c.urlParams_.Set("prettyPrint", "false")
4692 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:disable")
4693 urls += "?" + c.urlParams_.Encode()
4694 req, err := http.NewRequest("POST", urls, body)
4695 if err != nil {
4696 return nil, err
4697 }
4698 req.Header = reqHeaders
4699 googleapi.Expand(req.URL, map[string]string{
4700 "name": c.name,
4701 })
4702 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4703 }
4704
4705
4706
4707
4708
4709
4710 func (c *ProjectsSecretsVersionsDisableCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
4711 gensupport.SetOptions(c.urlParams_, opts...)
4712 res, err := c.doRequest("json")
4713 if res != nil && res.StatusCode == http.StatusNotModified {
4714 if res.Body != nil {
4715 res.Body.Close()
4716 }
4717 return nil, gensupport.WrapError(&googleapi.Error{
4718 Code: res.StatusCode,
4719 Header: res.Header,
4720 })
4721 }
4722 if err != nil {
4723 return nil, err
4724 }
4725 defer googleapi.CloseBody(res)
4726 if err := googleapi.CheckResponse(res); err != nil {
4727 return nil, gensupport.WrapError(err)
4728 }
4729 ret := &SecretVersion{
4730 ServerResponse: googleapi.ServerResponse{
4731 Header: res.Header,
4732 HTTPStatusCode: res.StatusCode,
4733 },
4734 }
4735 target := &ret
4736 if err := gensupport.DecodeResponse(target, res); err != nil {
4737 return nil, err
4738 }
4739 return ret, nil
4740 }
4741
4742 type ProjectsSecretsVersionsEnableCall struct {
4743 s *Service
4744 name string
4745 enablesecretversionrequest *EnableSecretVersionRequest
4746 urlParams_ gensupport.URLParams
4747 ctx_ context.Context
4748 header_ http.Header
4749 }
4750
4751
4752
4753
4754
4755
4756
4757 func (r *ProjectsSecretsVersionsService) Enable(name string, enablesecretversionrequest *EnableSecretVersionRequest) *ProjectsSecretsVersionsEnableCall {
4758 c := &ProjectsSecretsVersionsEnableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4759 c.name = name
4760 c.enablesecretversionrequest = enablesecretversionrequest
4761 return c
4762 }
4763
4764
4765
4766
4767 func (c *ProjectsSecretsVersionsEnableCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsEnableCall {
4768 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4769 return c
4770 }
4771
4772
4773 func (c *ProjectsSecretsVersionsEnableCall) Context(ctx context.Context) *ProjectsSecretsVersionsEnableCall {
4774 c.ctx_ = ctx
4775 return c
4776 }
4777
4778
4779
4780 func (c *ProjectsSecretsVersionsEnableCall) Header() http.Header {
4781 if c.header_ == nil {
4782 c.header_ = make(http.Header)
4783 }
4784 return c.header_
4785 }
4786
4787 func (c *ProjectsSecretsVersionsEnableCall) doRequest(alt string) (*http.Response, error) {
4788 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4789 var body io.Reader = nil
4790 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablesecretversionrequest)
4791 if err != nil {
4792 return nil, err
4793 }
4794 c.urlParams_.Set("alt", alt)
4795 c.urlParams_.Set("prettyPrint", "false")
4796 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:enable")
4797 urls += "?" + c.urlParams_.Encode()
4798 req, err := http.NewRequest("POST", urls, body)
4799 if err != nil {
4800 return nil, err
4801 }
4802 req.Header = reqHeaders
4803 googleapi.Expand(req.URL, map[string]string{
4804 "name": c.name,
4805 })
4806 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4807 }
4808
4809
4810
4811
4812
4813
4814 func (c *ProjectsSecretsVersionsEnableCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
4815 gensupport.SetOptions(c.urlParams_, opts...)
4816 res, err := c.doRequest("json")
4817 if res != nil && res.StatusCode == http.StatusNotModified {
4818 if res.Body != nil {
4819 res.Body.Close()
4820 }
4821 return nil, gensupport.WrapError(&googleapi.Error{
4822 Code: res.StatusCode,
4823 Header: res.Header,
4824 })
4825 }
4826 if err != nil {
4827 return nil, err
4828 }
4829 defer googleapi.CloseBody(res)
4830 if err := googleapi.CheckResponse(res); err != nil {
4831 return nil, gensupport.WrapError(err)
4832 }
4833 ret := &SecretVersion{
4834 ServerResponse: googleapi.ServerResponse{
4835 Header: res.Header,
4836 HTTPStatusCode: res.StatusCode,
4837 },
4838 }
4839 target := &ret
4840 if err := gensupport.DecodeResponse(target, res); err != nil {
4841 return nil, err
4842 }
4843 return ret, nil
4844 }
4845
4846 type ProjectsSecretsVersionsGetCall struct {
4847 s *Service
4848 name string
4849 urlParams_ gensupport.URLParams
4850 ifNoneMatch_ string
4851 ctx_ context.Context
4852 header_ http.Header
4853 }
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865 func (r *ProjectsSecretsVersionsService) Get(name string) *ProjectsSecretsVersionsGetCall {
4866 c := &ProjectsSecretsVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4867 c.name = name
4868 return c
4869 }
4870
4871
4872
4873
4874 func (c *ProjectsSecretsVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsGetCall {
4875 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4876 return c
4877 }
4878
4879
4880
4881
4882 func (c *ProjectsSecretsVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsSecretsVersionsGetCall {
4883 c.ifNoneMatch_ = entityTag
4884 return c
4885 }
4886
4887
4888 func (c *ProjectsSecretsVersionsGetCall) Context(ctx context.Context) *ProjectsSecretsVersionsGetCall {
4889 c.ctx_ = ctx
4890 return c
4891 }
4892
4893
4894
4895 func (c *ProjectsSecretsVersionsGetCall) Header() http.Header {
4896 if c.header_ == nil {
4897 c.header_ = make(http.Header)
4898 }
4899 return c.header_
4900 }
4901
4902 func (c *ProjectsSecretsVersionsGetCall) doRequest(alt string) (*http.Response, error) {
4903 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4904 if c.ifNoneMatch_ != "" {
4905 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4906 }
4907 var body io.Reader = nil
4908 c.urlParams_.Set("alt", alt)
4909 c.urlParams_.Set("prettyPrint", "false")
4910 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
4911 urls += "?" + c.urlParams_.Encode()
4912 req, err := http.NewRequest("GET", urls, body)
4913 if err != nil {
4914 return nil, err
4915 }
4916 req.Header = reqHeaders
4917 googleapi.Expand(req.URL, map[string]string{
4918 "name": c.name,
4919 })
4920 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4921 }
4922
4923
4924
4925
4926
4927
4928 func (c *ProjectsSecretsVersionsGetCall) Do(opts ...googleapi.CallOption) (*SecretVersion, error) {
4929 gensupport.SetOptions(c.urlParams_, opts...)
4930 res, err := c.doRequest("json")
4931 if res != nil && res.StatusCode == http.StatusNotModified {
4932 if res.Body != nil {
4933 res.Body.Close()
4934 }
4935 return nil, gensupport.WrapError(&googleapi.Error{
4936 Code: res.StatusCode,
4937 Header: res.Header,
4938 })
4939 }
4940 if err != nil {
4941 return nil, err
4942 }
4943 defer googleapi.CloseBody(res)
4944 if err := googleapi.CheckResponse(res); err != nil {
4945 return nil, gensupport.WrapError(err)
4946 }
4947 ret := &SecretVersion{
4948 ServerResponse: googleapi.ServerResponse{
4949 Header: res.Header,
4950 HTTPStatusCode: res.StatusCode,
4951 },
4952 }
4953 target := &ret
4954 if err := gensupport.DecodeResponse(target, res); err != nil {
4955 return nil, err
4956 }
4957 return ret, nil
4958 }
4959
4960 type ProjectsSecretsVersionsListCall struct {
4961 s *Service
4962 parent string
4963 urlParams_ gensupport.URLParams
4964 ifNoneMatch_ string
4965 ctx_ context.Context
4966 header_ http.Header
4967 }
4968
4969
4970
4971
4972
4973
4974 func (r *ProjectsSecretsVersionsService) List(parent string) *ProjectsSecretsVersionsListCall {
4975 c := &ProjectsSecretsVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4976 c.parent = parent
4977 return c
4978 }
4979
4980
4981
4982
4983
4984
4985 func (c *ProjectsSecretsVersionsListCall) Filter(filter string) *ProjectsSecretsVersionsListCall {
4986 c.urlParams_.Set("filter", filter)
4987 return c
4988 }
4989
4990
4991
4992
4993
4994 func (c *ProjectsSecretsVersionsListCall) PageSize(pageSize int64) *ProjectsSecretsVersionsListCall {
4995 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4996 return c
4997 }
4998
4999
5000
5001 func (c *ProjectsSecretsVersionsListCall) PageToken(pageToken string) *ProjectsSecretsVersionsListCall {
5002 c.urlParams_.Set("pageToken", pageToken)
5003 return c
5004 }
5005
5006
5007
5008
5009 func (c *ProjectsSecretsVersionsListCall) Fields(s ...googleapi.Field) *ProjectsSecretsVersionsListCall {
5010 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5011 return c
5012 }
5013
5014
5015
5016
5017 func (c *ProjectsSecretsVersionsListCall) IfNoneMatch(entityTag string) *ProjectsSecretsVersionsListCall {
5018 c.ifNoneMatch_ = entityTag
5019 return c
5020 }
5021
5022
5023 func (c *ProjectsSecretsVersionsListCall) Context(ctx context.Context) *ProjectsSecretsVersionsListCall {
5024 c.ctx_ = ctx
5025 return c
5026 }
5027
5028
5029
5030 func (c *ProjectsSecretsVersionsListCall) Header() http.Header {
5031 if c.header_ == nil {
5032 c.header_ = make(http.Header)
5033 }
5034 return c.header_
5035 }
5036
5037 func (c *ProjectsSecretsVersionsListCall) doRequest(alt string) (*http.Response, error) {
5038 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5039 if c.ifNoneMatch_ != "" {
5040 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5041 }
5042 var body io.Reader = nil
5043 c.urlParams_.Set("alt", alt)
5044 c.urlParams_.Set("prettyPrint", "false")
5045 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/versions")
5046 urls += "?" + c.urlParams_.Encode()
5047 req, err := http.NewRequest("GET", urls, body)
5048 if err != nil {
5049 return nil, err
5050 }
5051 req.Header = reqHeaders
5052 googleapi.Expand(req.URL, map[string]string{
5053 "parent": c.parent,
5054 })
5055 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5056 }
5057
5058
5059
5060
5061
5062
5063
5064 func (c *ProjectsSecretsVersionsListCall) Do(opts ...googleapi.CallOption) (*ListSecretVersionsResponse, error) {
5065 gensupport.SetOptions(c.urlParams_, opts...)
5066 res, err := c.doRequest("json")
5067 if res != nil && res.StatusCode == http.StatusNotModified {
5068 if res.Body != nil {
5069 res.Body.Close()
5070 }
5071 return nil, gensupport.WrapError(&googleapi.Error{
5072 Code: res.StatusCode,
5073 Header: res.Header,
5074 })
5075 }
5076 if err != nil {
5077 return nil, err
5078 }
5079 defer googleapi.CloseBody(res)
5080 if err := googleapi.CheckResponse(res); err != nil {
5081 return nil, gensupport.WrapError(err)
5082 }
5083 ret := &ListSecretVersionsResponse{
5084 ServerResponse: googleapi.ServerResponse{
5085 Header: res.Header,
5086 HTTPStatusCode: res.StatusCode,
5087 },
5088 }
5089 target := &ret
5090 if err := gensupport.DecodeResponse(target, res); err != nil {
5091 return nil, err
5092 }
5093 return ret, nil
5094 }
5095
5096
5097
5098
5099 func (c *ProjectsSecretsVersionsListCall) Pages(ctx context.Context, f func(*ListSecretVersionsResponse) error) error {
5100 c.ctx_ = ctx
5101 defer c.PageToken(c.urlParams_.Get("pageToken"))
5102 for {
5103 x, err := c.Do()
5104 if err != nil {
5105 return err
5106 }
5107 if err := f(x); err != nil {
5108 return err
5109 }
5110 if x.NextPageToken == "" {
5111 return nil
5112 }
5113 c.PageToken(x.NextPageToken)
5114 }
5115 }
5116
View as plain text