1use super::responses::{
2 CreateCustomSecretIDResponse, GenerateNewSecretIDResponse, ListRolesResponse,
3 ListSecretIDResponse, ReadAppRoleResponse, ReadRoleIDResponse, ReadSecretIDResponse,
4};
5use rustify_derive::Endpoint;
6
7#[derive(Builder, Debug, Endpoint)]
15#[endpoint(path = "/auth/{self.mount}/login", method = "POST", builder = "true")]
16#[builder(setter(into))]
17pub struct LoginWithApproleRequest {
18 #[endpoint(skip)]
19 pub mount: String,
20 pub role_id: String,
21 pub secret_id: String,
22}
23
24#[derive(Builder, Debug, Default, Endpoint)]
32#[endpoint(
33 path = "/auth/{self.mount}/role",
34 method = "LIST",
35 response = "ListRolesResponse",
36 builder = "true"
37)]
38#[builder(setter(into, strip_option), default)]
39pub struct ListRolesRequest {
40 #[endpoint(skip)]
41 pub mount: String,
42}
43
44#[derive(Builder, Debug, Default, Endpoint)]
52#[endpoint(
53 path = "/auth/{self.mount}/role/{self.role_name}",
54 method = "POST",
55 builder = "true"
56)]
57#[builder(setter(into, strip_option), default)]
58pub struct SetAppRoleRequest {
59 #[endpoint(skip)]
60 pub mount: String,
61 #[endpoint(skip)]
62 pub role_name: String,
63 pub bind_secret_id: Option<bool>,
64 pub secret_id_bound_cidrs: Option<Vec<String>>,
65 pub secret_id_num_uses: Option<u64>,
66 pub secret_id_ttl: Option<String>,
67 pub enable_local_secret_ids: Option<bool>,
68 pub token_ttl: Option<String>,
69 pub token_max_ttl: Option<String>,
70 pub token_policies: Option<Vec<String>>,
71 pub token_bound_cidrs: Option<Vec<String>>,
72 pub token_explicit_max_ttl: Option<String>,
73 pub token_no_default_policy: Option<bool>,
74 pub token_num_uses: Option<u64>,
75 pub token_period: Option<String>,
76 pub token_type: Option<String>,
77}
78
79#[derive(Builder, Debug, Default, Endpoint)]
87#[endpoint(
88 path = "/auth/{self.mount}/role/{self.role_name}",
89 response = "ReadAppRoleResponse",
90 builder = "true"
91)]
92#[builder(setter(into, strip_option), default)]
93pub struct ReadAppRoleRequest {
94 #[endpoint(skip)]
95 pub mount: String,
96 #[endpoint(skip)]
97 pub role_name: String,
98}
99
100#[derive(Builder, Debug, Default, Endpoint)]
108#[endpoint(
109 path = "/auth/{self.mount}/role/{self.role_name}",
110 method = "DELETE",
111 builder = "true"
112)]
113#[builder(setter(into, strip_option), default)]
114pub struct DeleteAppRoleRequest {
115 #[endpoint(skip)]
116 pub mount: String,
117 #[endpoint(skip)]
118 pub role_name: String,
119}
120
121#[derive(Builder, Debug, Default, Endpoint)]
129#[endpoint(
130 path = "/auth/{self.mount}/role/{self.role_name}/role-id",
131 response = "ReadRoleIDResponse",
132 builder = "true"
133)]
134#[builder(setter(into, strip_option), default)]
135pub struct ReadRoleIDRequest {
136 #[endpoint(skip)]
137 pub mount: String,
138 #[endpoint(skip)]
139 pub role_name: String,
140}
141
142#[derive(Builder, Debug, Default, Endpoint)]
150#[endpoint(
151 path = "/auth/{self.mount}/role/{self.role_name}/role-id",
152 method = "POST",
153 builder = "true"
154)]
155#[builder(setter(into, strip_option), default)]
156pub struct UpdateRoleIDRequest {
157 #[endpoint(skip)]
158 pub mount: String,
159 #[endpoint(skip)]
160 pub role_name: String,
161 pub role_id: String,
162}
163
164#[derive(Builder, Debug, Default, Endpoint)]
172#[endpoint(
173 path = "/auth/{self.mount}/role/{self.role_name}/secret-id",
174 method = "POST",
175 response = "GenerateNewSecretIDResponse",
176 builder = "true"
177)]
178#[builder(setter(into, strip_option), default)]
179pub struct GenerateNewSecretIDRequest {
180 #[endpoint(skip)]
181 pub mount: String,
182 #[endpoint(skip)]
183 pub role_name: String,
184 pub metadata: Option<String>,
185 pub cidr_list: Option<Vec<String>>,
186 pub token_bound_cidrs: Option<Vec<String>>,
187}
188
189#[derive(Builder, Debug, Default, Endpoint)]
197#[endpoint(
198 path = "/auth/{self.mount}/role/{self.role_name}/secret-id",
199 method = "LIST",
200 response = "ListSecretIDResponse",
201 builder = "true"
202)]
203#[builder(setter(into, strip_option), default)]
204pub struct ListSecretIDRequest {
205 #[endpoint(skip)]
206 pub mount: String,
207 #[endpoint(skip)]
208 pub role_name: String,
209}
210
211#[derive(Builder, Debug, Default, Endpoint)]
219#[endpoint(
220 path = "/auth/{self.mount}/role/{self.role_name}/secret-id/lookup",
221 method = "POST",
222 response = "ReadSecretIDResponse",
223 builder = "true"
224)]
225#[builder(setter(into, strip_option), default)]
226pub struct ReadSecretIDRequest {
227 #[endpoint(skip)]
228 pub mount: String,
229 #[endpoint(skip)]
230 pub role_name: String,
231 pub secret_id: String,
232}
233
234#[derive(Builder, Debug, Default, Endpoint)]
242#[endpoint(
243 path = "/auth/{self.mount}/role/{self.role_name}/secret-id/destroy",
244 method = "POST",
245 builder = "true"
246)]
247#[builder(setter(into, strip_option), default)]
248pub struct DeleteSecretIDRequest {
249 #[endpoint(skip)]
250 pub mount: String,
251 #[endpoint(skip)]
252 pub role_name: String,
253 pub secret_id: String,
254}
255
256#[derive(Builder, Debug, Default, Endpoint)]
264#[endpoint(
265 path = "/auth/{self.mount}/role/{self.role_name}/secret-id-accessor/lookup",
266 method = "POST",
267 response = "ReadSecretIDResponse",
268 builder = "true"
269)]
270#[builder(setter(into, strip_option), default)]
271pub struct ReadSecretIDAccessorRequest {
272 #[endpoint(skip)]
273 pub mount: String,
274 #[endpoint(skip)]
275 pub role_name: String,
276 pub secret_id_accessor: String,
277}
278
279#[derive(Builder, Debug, Default, Endpoint)]
287#[endpoint(
288 path = "/auth/{self.mount}/role/{self.role_name}/secret-id-accessor/destroy",
289 method = "POST",
290 builder = "true"
291)]
292#[builder(setter(into, strip_option), default)]
293pub struct DeleteSecretIDAccessorRequest {
294 #[endpoint(skip)]
295 pub mount: String,
296 #[endpoint(skip)]
297 pub role_name: String,
298 pub secret_id_accessor: String,
299}
300
301#[derive(Builder, Debug, Default, Endpoint)]
309#[endpoint(
310 path = "/auth/{self.mount}/role/{self.role_name}/custom-secret-id",
311 method = "POST",
312 response = "CreateCustomSecretIDResponse",
313 builder = "true"
314)]
315#[builder(setter(into, strip_option), default)]
316pub struct CreateCustomSecretIDRequest {
317 #[endpoint(skip)]
318 pub mount: String,
319 #[endpoint(skip)]
320 pub role_name: String,
321 pub secret_id: String,
322 pub metadata: Option<String>,
323 pub cidr_list: Option<Vec<String>>,
324 pub token_bound_cidrs: Option<Vec<String>>,
325}
326
327#[derive(Builder, Debug, Default, Endpoint)]
336#[endpoint(
337 path = "/auth/{self.mount}/tidy/secret-id",
338 method = "POST",
339 builder = "true"
340)]
341#[builder(setter(into, strip_option), default)]
342pub struct TidyRequest {
343 #[endpoint(skip)]
344 pub mount: String,
345}