1use rustify_derive::Endpoint;
2use std::fmt::Debug;
3
4use super::responses::{
5 GenerateCredentialsResponse, GetConfigurationResponse, ListRolesResponse, ReadLeaseResponse,
6 ReadRoleResponse, RotateRootCredentialsResponse,
7};
8
9#[derive(Builder, Debug, Default, Endpoint)]
18#[endpoint(path = "{self.mount}/config/root", method = "POST", builder = "true")]
19#[builder(setter(into, strip_option), default)]
20pub struct SetConfigurationRequest {
21 #[endpoint(skip)]
22 pub mount: String,
23 pub max_retries: Option<i32>,
24 pub access_key: String,
25 pub secret_key: String,
26 pub region: Option<String>,
27 pub iam_endpoint: Option<String>,
28 pub sts_endpoint: Option<String>,
29 pub username_template: Option<String>,
30}
31
32#[derive(Builder, Debug, Default, Endpoint)]
41#[endpoint(
42 path = "{self.mount}/config/root",
43 method = "GET",
44 builder = "true",
45 response = "GetConfigurationResponse"
46)]
47#[builder(setter(into, strip_option), default)]
48pub struct GetConfigurationRequest {
49 #[endpoint(skip)]
50 pub mount: String,
51}
52
53#[derive(Builder, Debug, Default, Endpoint)]
62#[endpoint(
63 path = "{self.mount}/config/rotate-root",
64 method = "POST",
65 builder = "true",
66 response = "RotateRootCredentialsResponse"
67)]
68#[builder(setter(into, strip_option), default)]
69pub struct RotateRootCredentialsRequest {
70 #[endpoint(skip)]
71 pub mount: String,
72}
73
74#[derive(Builder, Debug, Default, Endpoint)]
83#[endpoint(path = "{self.mount}/config/lease", method = "POST", builder = "true")]
84#[builder(setter(into, strip_option), default)]
85pub struct ConfigureLeaseRequest {
86 #[endpoint(skip)]
87 pub mount: String,
88
89 pub lease: String,
90 pub lease_max: String,
91}
92
93#[derive(Builder, Debug, Default, Endpoint)]
102#[endpoint(
103 path = "{self.mount}/config/lease",
104 method = "GET",
105 response = "ReadLeaseResponse",
106 builder = "true"
107)]
108#[builder(setter(into, strip_option), default)]
109pub struct ReadLeaseRequest {
110 #[endpoint(skip)]
111 pub mount: String,
112}
113
114#[derive(Builder, Debug, Default, Endpoint)]
123#[endpoint(
124 path = "{self.mount}/roles/{self.name}",
125 method = "POST",
126 builder = "true"
127)]
128#[builder(setter(into, strip_option), default)]
129pub struct CreateUpdateRoleRequest {
130 #[endpoint(skip)]
131 pub mount: String,
132
133 pub name: String,
134 pub credential_type: String,
135 pub role_arns: Option<Vec<String>>,
136 pub policy_arns: Option<Vec<String>>,
137 pub policy_document: String,
138 pub iam_groups: Option<Vec<String>>,
139 pub iam_tags: Option<Vec<String>>,
140 pub default_sts_ttl: Option<u32>,
141 pub max_sts_ttl: Option<u32>,
142 pub user_path: Option<String>,
143 pub permissions_boundary_arn: Option<String>,
144
145 pub policy: Option<String>,
146 pub arn: Option<String>,
147}
148
149#[derive(Builder, Debug, Default, Endpoint)]
158#[endpoint(
159 path = "{self.mount}/roles/{self.name}",
160 method = "GET",
161 response = "ReadRoleResponse",
162 builder = "true"
163)]
164#[builder(setter(into, strip_option), default)]
165pub struct ReadRoleRequest {
166 #[endpoint(skip)]
167 pub mount: String,
168
169 pub name: String,
170}
171
172#[derive(Builder, Debug, Default, Endpoint)]
181#[endpoint(
182 path = "{self.mount}/roles",
183 method = "LIST",
184 response = "ListRolesResponse",
185 builder = "true"
186)]
187#[builder(setter(into, strip_option), default)]
188pub struct ListRolesRequest {
189 #[endpoint(skip)]
190 pub mount: String,
191}
192
193#[derive(Builder, Debug, Default, Endpoint)]
202#[endpoint(
203 path = "{self.mount}/roles/{self.name}",
204 method = "DELETE",
205 builder = "true"
206)]
207#[builder(setter(into, strip_option), default)]
208pub struct DeleteRoleRequest {
209 #[endpoint(skip)]
210 pub mount: String,
211 pub name: String,
212}
213
214#[derive(Builder, Debug, Default, Endpoint)]
223#[endpoint(
224 path = "{self.mount}/creds/{self.name}",
225 method = "GET",
226 response = "GenerateCredentialsResponse",
227 builder = "true"
228)]
229#[builder(setter(into, strip_option), default)]
230pub struct GenerateCredentialsRequest {
231 #[endpoint(skip)]
232 pub mount: String,
233 pub name: String,
234 pub role_arn: Option<String>,
235 pub role_session_name: Option<String>,
236 pub ttl: Option<String>,
237}
238
239#[derive(Builder, Debug, Default, Endpoint)]
248#[endpoint(
249 path = "{self.mount}/sts/{self.name}",
250 method = "POST",
251 response = "GenerateCredentialsResponse",
252 builder = "true"
253)]
254#[builder(setter(into, strip_option), default)]
255pub struct GenerateCredentialsStsRequest {
256 #[endpoint(skip)]
257 pub mount: String,
258 pub name: String,
259 pub role_arn: Option<String>,
260 pub role_session_name: Option<String>,
261 pub ttl: Option<String>,
262}