casdoor_sdk/apis/
user_api.rs

1
2
3use reqwest;
4
5use crate::{apis::ResponseContent, models};
6use super::{Error, configuration};
7
8/// struct for passing parameters to the method [`add_user`]
9#[derive(Clone, Debug)]
10pub struct ApiControllerAddUserParams {
11    /// The details of the user
12    pub body: models::User
13}
14
15/// struct for passing parameters to the method [`delete_user`]
16#[derive(Clone, Debug)]
17pub struct ApiControllerDeleteUserParams {
18    /// The details of the user
19    pub body: models::User
20}
21
22/// struct for passing parameters to the method [`get_email_and_phone`]
23#[derive(Clone, Debug)]
24pub struct ApiControllerGetEmailAndPhoneParams {
25    /// The username of the user
26    pub username: String,
27    /// The organization of the user
28    pub organization: String
29}
30
31/// struct for passing parameters to the method [`get_sorted_users`]
32#[derive(Clone, Debug)]
33pub struct ApiControllerGetSortedUsersParams {
34    /// The owner of users
35    pub owner: String,
36    /// The DB column name to sort by, e.g., created_time
37    pub sorter: String,
38    /// The count of users to return, e.g., 25
39    pub limit: String
40}
41
42/// struct for passing parameters to the method [`get_user`]
43#[derive(Clone, Debug)]
44pub struct ApiControllerGetUserParams {
45    /// The id ( owner/name ) of the user
46    pub id: Option<String>,
47    /// The owner of the user
48    pub owner: Option<String>,
49    /// The email of the user
50    pub email: Option<String>,
51    /// The phone of the user
52    pub phone: Option<String>,
53    /// The userId of the user
54    pub user_id: Option<String>
55}
56
57/// struct for passing parameters to the method [`get_user_count`]
58#[derive(Clone, Debug)]
59pub struct ApiControllerGetUserCountParams {
60    /// The owner of users
61    pub owner: String,
62    /// The filter for query, 1 for online, 0 for offline, empty string for all users
63    pub is_online: String
64}
65
66/// struct for passing parameters to the method [`get_users`]
67#[derive(Clone, Debug)]
68pub struct ApiControllerGetUsersParams {
69    /// The owner of users
70    pub owner: String
71}
72
73/// struct for passing parameters to the method [`update_user`]
74#[derive(Clone, Debug)]
75pub struct ApiControllerUpdateUserParams {
76    /// The id ( owner/name ) of the user
77    pub id: String,
78    /// The details of the user
79    pub body: models::User
80}
81
82/// struct for passing parameters to the method [`web_authn_signup_finish`]
83#[derive(Clone, Debug)]
84pub struct ApiControllerWebAuthnSignupFinishParams {
85    /// authenticator attestation Response
86    pub body: serde_json::Value
87}
88
89
90/// struct for typed errors of method [`add_user`]
91#[derive(Debug, Clone, Serialize, Deserialize)]
92#[serde(untagged)]
93pub enum ApiControllerAddUserError {
94    UnknownValue(serde_json::Value),
95}
96
97/// struct for typed errors of method [`add_user_keys`]
98#[derive(Debug, Clone, Serialize, Deserialize)]
99#[serde(untagged)]
100pub enum ApiControllerAddUserKeysError {
101    UnknownValue(serde_json::Value),
102}
103
104/// struct for typed errors of method [`check_user_password`]
105#[derive(Debug, Clone, Serialize, Deserialize)]
106#[serde(untagged)]
107pub enum ApiControllerCheckUserPasswordError {
108    UnknownValue(serde_json::Value),
109}
110
111/// struct for typed errors of method [`delete_user`]
112#[derive(Debug, Clone, Serialize, Deserialize)]
113#[serde(untagged)]
114pub enum ApiControllerDeleteUserError {
115    UnknownValue(serde_json::Value),
116}
117
118/// struct for typed errors of method [`get_email_and_phone`]
119#[derive(Debug, Clone, Serialize, Deserialize)]
120#[serde(untagged)]
121pub enum ApiControllerGetEmailAndPhoneError {
122    UnknownValue(serde_json::Value),
123}
124
125/// struct for typed errors of method [`get_global_users`]
126#[derive(Debug, Clone, Serialize, Deserialize)]
127#[serde(untagged)]
128pub enum ApiControllerGetGlobalUsersError {
129    UnknownValue(serde_json::Value),
130}
131
132/// struct for typed errors of method [`get_sorted_users`]
133#[derive(Debug, Clone, Serialize, Deserialize)]
134#[serde(untagged)]
135pub enum ApiControllerGetSortedUsersError {
136    UnknownValue(serde_json::Value),
137}
138
139/// struct for typed errors of method [`get_user`]
140#[derive(Debug, Clone, Serialize, Deserialize)]
141#[serde(untagged)]
142pub enum ApiControllerGetUserError {
143    UnknownValue(serde_json::Value),
144}
145
146/// struct for typed errors of method [`get_user_count`]
147#[derive(Debug, Clone, Serialize, Deserialize)]
148#[serde(untagged)]
149pub enum ApiControllerGetUserCountError {
150    UnknownValue(serde_json::Value),
151}
152
153/// struct for typed errors of method [`get_users`]
154#[derive(Debug, Clone, Serialize, Deserialize)]
155#[serde(untagged)]
156pub enum ApiControllerGetUsersError {
157    UnknownValue(serde_json::Value),
158}
159
160/// struct for typed errors of method [`update_user`]
161#[derive(Debug, Clone, Serialize, Deserialize)]
162#[serde(untagged)]
163pub enum ApiControllerUpdateUserError {
164    UnknownValue(serde_json::Value),
165}
166
167/// struct for typed errors of method [`web_authn_signup_begin`]
168#[derive(Debug, Clone, Serialize, Deserialize)]
169#[serde(untagged)]
170pub enum ApiControllerWebAuthnSignupBeginError {
171    UnknownValue(serde_json::Value),
172}
173
174/// struct for typed errors of method [`web_authn_signup_finish`]
175#[derive(Debug, Clone, Serialize, Deserialize)]
176#[serde(untagged)]
177pub enum ApiControllerWebAuthnSignupFinishError {
178    UnknownValue(serde_json::Value),
179}
180
181
182/// add user
183pub async fn add_user(configuration: &configuration::Configuration, params: ApiControllerAddUserParams) -> Result<models::ControllersResponse, Error<ApiControllerAddUserError>> {
184    let local_var_configuration = configuration;
185
186    // unbox the parameters
187    let body = params.body;
188
189
190    let local_var_client = &local_var_configuration.client;
191
192    let local_var_uri_str = format!("{}/api/add-user", local_var_configuration.base_path);
193    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
194
195    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
196        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
197    }
198    local_var_req_builder = local_var_req_builder.json(&body);
199
200    let local_var_req = local_var_req_builder.build()?;
201    let local_var_resp = local_var_client.execute(local_var_req).await?;
202
203    let local_var_status = local_var_resp.status();
204    let local_var_content = local_var_resp.text().await?;
205
206    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
207        serde_json::from_str(&local_var_content).map_err(Error::from)
208    } else {
209        let local_var_entity: Option<ApiControllerAddUserError> = serde_json::from_str(&local_var_content).ok();
210        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
211        Err(Error::ResponseError(local_var_error))
212    }
213}
214
215pub async fn add_user_keys(configuration: &configuration::Configuration) -> Result<models::Userinfo, Error<ApiControllerAddUserKeysError>> {
216    let local_var_configuration = configuration;
217
218    // unbox the parameters
219
220
221    let local_var_client = &local_var_configuration.client;
222
223    let local_var_uri_str = format!("{}/api/add-user-keys", local_var_configuration.base_path);
224    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
225
226    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
227        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
228    }
229
230    let local_var_req = local_var_req_builder.build()?;
231    let local_var_resp = local_var_client.execute(local_var_req).await?;
232
233    let local_var_status = local_var_resp.status();
234    let local_var_content = local_var_resp.text().await?;
235
236    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
237        serde_json::from_str(&local_var_content).map_err(Error::from)
238    } else {
239        let local_var_entity: Option<ApiControllerAddUserKeysError> = serde_json::from_str(&local_var_content).ok();
240        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
241        Err(Error::ResponseError(local_var_error))
242    }
243}
244
245pub async fn check_user_password(configuration: &configuration::Configuration) -> Result<models::Userinfo, Error<ApiControllerCheckUserPasswordError>> {
246    let local_var_configuration = configuration;
247
248    // unbox the parameters
249
250
251    let local_var_client = &local_var_configuration.client;
252
253    let local_var_uri_str = format!("{}/api/check-user-password", local_var_configuration.base_path);
254    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
255
256    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
257        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
258    }
259
260    let local_var_req = local_var_req_builder.build()?;
261    let local_var_resp = local_var_client.execute(local_var_req).await?;
262
263    let local_var_status = local_var_resp.status();
264    let local_var_content = local_var_resp.text().await?;
265
266    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
267        serde_json::from_str(&local_var_content).map_err(Error::from)
268    } else {
269        let local_var_entity: Option<ApiControllerCheckUserPasswordError> = serde_json::from_str(&local_var_content).ok();
270        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
271        Err(Error::ResponseError(local_var_error))
272    }
273}
274
275/// delete user
276pub async fn delete_user(configuration: &configuration::Configuration, params: ApiControllerDeleteUserParams) -> Result<models::ControllersResponse, Error<ApiControllerDeleteUserError>> {
277    let local_var_configuration = configuration;
278
279    // unbox the parameters
280    let body = params.body;
281
282
283    let local_var_client = &local_var_configuration.client;
284
285    let local_var_uri_str = format!("{}/api/delete-user", local_var_configuration.base_path);
286    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
287
288    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
289        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
290    }
291    local_var_req_builder = local_var_req_builder.json(&body);
292
293    let local_var_req = local_var_req_builder.build()?;
294    let local_var_resp = local_var_client.execute(local_var_req).await?;
295
296    let local_var_status = local_var_resp.status();
297    let local_var_content = local_var_resp.text().await?;
298
299    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
300        serde_json::from_str(&local_var_content).map_err(Error::from)
301    } else {
302        let local_var_entity: Option<ApiControllerDeleteUserError> = serde_json::from_str(&local_var_content).ok();
303        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
304        Err(Error::ResponseError(local_var_error))
305    }
306}
307
308/// get email and phone by username
309pub async fn get_email_and_phone(configuration: &configuration::Configuration, params: ApiControllerGetEmailAndPhoneParams) -> Result<models::ControllersResponse, Error<ApiControllerGetEmailAndPhoneError>> {
310    let local_var_configuration = configuration;
311
312    // unbox the parameters
313    let username = params.username;
314    let organization = params.organization;
315
316
317    let local_var_client = &local_var_configuration.client;
318
319    let local_var_uri_str = format!("{}/api/get-email-and-phone", local_var_configuration.base_path);
320    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
321
322    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
323        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
324    }
325    let mut local_var_form = reqwest::multipart::Form::new();
326    local_var_form = local_var_form.text("username", username.to_string());
327    local_var_form = local_var_form.text("organization", organization.to_string());
328    local_var_req_builder = local_var_req_builder.multipart(local_var_form);
329
330    let local_var_req = local_var_req_builder.build()?;
331    let local_var_resp = local_var_client.execute(local_var_req).await?;
332
333    let local_var_status = local_var_resp.status();
334    let local_var_content = local_var_resp.text().await?;
335
336    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
337        serde_json::from_str(&local_var_content).map_err(Error::from)
338    } else {
339        let local_var_entity: Option<ApiControllerGetEmailAndPhoneError> = serde_json::from_str(&local_var_content).ok();
340        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
341        Err(Error::ResponseError(local_var_error))
342    }
343}
344
345/// get global users
346pub async fn get_global_users(configuration: &configuration::Configuration) -> Result<Vec<models::User>, Error<ApiControllerGetGlobalUsersError>> {
347    let local_var_configuration = configuration;
348
349    // unbox the parameters
350
351
352    let local_var_client = &local_var_configuration.client;
353
354    let local_var_uri_str = format!("{}/api/get-global-users", local_var_configuration.base_path);
355    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
356
357    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
358        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
359    }
360
361    let local_var_req = local_var_req_builder.build()?;
362    let local_var_resp = local_var_client.execute(local_var_req).await?;
363
364    let local_var_status = local_var_resp.status();
365    let local_var_content = local_var_resp.text().await?;
366
367    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
368        serde_json::from_str(&local_var_content).map_err(Error::from)
369    } else {
370        let local_var_entity: Option<ApiControllerGetGlobalUsersError> = serde_json::from_str(&local_var_content).ok();
371        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
372        Err(Error::ResponseError(local_var_error))
373    }
374}
375
376pub async fn get_sorted_users(configuration: &configuration::Configuration, params: ApiControllerGetSortedUsersParams) -> Result<Vec<models::User>, Error<ApiControllerGetSortedUsersError>> {
377    let local_var_configuration = configuration;
378
379    // unbox the parameters
380    let owner = params.owner;
381    let sorter = params.sorter;
382    let limit = params.limit;
383
384
385    let local_var_client = &local_var_configuration.client;
386
387    let local_var_uri_str = format!("{}/api/get-sorted-users", local_var_configuration.base_path);
388    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
389
390    local_var_req_builder = local_var_req_builder.query(&[("owner", &owner.to_string())]);
391    local_var_req_builder = local_var_req_builder.query(&[("sorter", &sorter.to_string())]);
392    local_var_req_builder = local_var_req_builder.query(&[("limit", &limit.to_string())]);
393    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
394        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
395    }
396
397    let local_var_req = local_var_req_builder.build()?;
398    let local_var_resp = local_var_client.execute(local_var_req).await?;
399
400    let local_var_status = local_var_resp.status();
401    let local_var_content = local_var_resp.text().await?;
402
403    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
404        serde_json::from_str(&local_var_content).map_err(Error::from)
405    } else {
406        let local_var_entity: Option<ApiControllerGetSortedUsersError> = serde_json::from_str(&local_var_content).ok();
407        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
408        Err(Error::ResponseError(local_var_error))
409    }
410}
411
412/// get user
413pub async fn get_user(configuration: &configuration::Configuration, params: ApiControllerGetUserParams) -> Result<models::User, Error<ApiControllerGetUserError>> {
414    let local_var_configuration = configuration;
415
416    // unbox the parameters
417    let id = params.id;
418    let owner = params.owner;
419    let email = params.email;
420    let phone = params.phone;
421    let user_id = params.user_id;
422
423
424    let local_var_client = &local_var_configuration.client;
425
426    let local_var_uri_str = format!("{}/api/get-user", local_var_configuration.base_path);
427    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
428
429    if let Some(ref local_var_str) = id {
430        local_var_req_builder = local_var_req_builder.query(&[("id", &local_var_str.to_string())]);
431    }
432    if let Some(ref local_var_str) = owner {
433        local_var_req_builder = local_var_req_builder.query(&[("owner", &local_var_str.to_string())]);
434    }
435    if let Some(ref local_var_str) = email {
436        local_var_req_builder = local_var_req_builder.query(&[("email", &local_var_str.to_string())]);
437    }
438    if let Some(ref local_var_str) = phone {
439        local_var_req_builder = local_var_req_builder.query(&[("phone", &local_var_str.to_string())]);
440    }
441    if let Some(ref local_var_str) = user_id {
442        local_var_req_builder = local_var_req_builder.query(&[("userId", &local_var_str.to_string())]);
443    }
444    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
445        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
446    }
447
448    let local_var_req = local_var_req_builder.build()?;
449    let local_var_resp = local_var_client.execute(local_var_req).await?;
450
451    let local_var_status = local_var_resp.status();
452    let local_var_content = local_var_resp.text().await?;
453
454    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
455        serde_json::from_str(&local_var_content).map_err(Error::from)
456    } else {
457        let local_var_entity: Option<ApiControllerGetUserError> = serde_json::from_str(&local_var_content).ok();
458        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
459        Err(Error::ResponseError(local_var_error))
460    }
461}
462
463pub async fn get_user_count(configuration: &configuration::Configuration, params: ApiControllerGetUserCountParams) -> Result<(), Error<ApiControllerGetUserCountError>> {
464    let local_var_configuration = configuration;
465
466    // unbox the parameters
467    let owner = params.owner;
468    let is_online = params.is_online;
469
470
471    let local_var_client = &local_var_configuration.client;
472
473    let local_var_uri_str = format!("{}/api/get-user-count", local_var_configuration.base_path);
474    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
475
476    local_var_req_builder = local_var_req_builder.query(&[("owner", &owner.to_string())]);
477    local_var_req_builder = local_var_req_builder.query(&[("isOnline", &is_online.to_string())]);
478    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
479        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
480    }
481
482    let local_var_req = local_var_req_builder.build()?;
483    let local_var_resp = local_var_client.execute(local_var_req).await?;
484
485    let local_var_status = local_var_resp.status();
486    let local_var_content = local_var_resp.text().await?;
487
488    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
489        Ok(())
490    } else {
491        let local_var_entity: Option<ApiControllerGetUserCountError> = serde_json::from_str(&local_var_content).ok();
492        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
493        Err(Error::ResponseError(local_var_error))
494    }
495}
496
497pub async fn get_users(configuration: &configuration::Configuration, params: ApiControllerGetUsersParams) -> Result<Vec<models::User>, Error<ApiControllerGetUsersError>> {
498    let local_var_configuration = configuration;
499
500    // unbox the parameters
501    let owner = params.owner;
502
503
504    let local_var_client = &local_var_configuration.client;
505
506    let local_var_uri_str = format!("{}/api/get-users", local_var_configuration.base_path);
507    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
508
509    local_var_req_builder = local_var_req_builder.query(&[("owner", &owner.to_string())]);
510    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
511        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
512    }
513
514    let local_var_req = local_var_req_builder.build()?;
515    let local_var_resp = local_var_client.execute(local_var_req).await?;
516
517    let local_var_status = local_var_resp.status();
518    let local_var_content = local_var_resp.text().await?;
519
520    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
521        serde_json::from_str(&local_var_content).map_err(Error::from)
522    } else {
523        let local_var_entity: Option<ApiControllerGetUsersError> = serde_json::from_str(&local_var_content).ok();
524        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
525        Err(Error::ResponseError(local_var_error))
526    }
527}
528
529/// update user
530pub async fn update_user(configuration: &configuration::Configuration, params: ApiControllerUpdateUserParams) -> Result<models::ControllersResponse, Error<ApiControllerUpdateUserError>> {
531    let local_var_configuration = configuration;
532
533    // unbox the parameters
534    let id = params.id;
535    let body = params.body;
536
537
538    let local_var_client = &local_var_configuration.client;
539
540    let local_var_uri_str = format!("{}/api/update-user", local_var_configuration.base_path);
541    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
542
543    local_var_req_builder = local_var_req_builder.query(&[("id", &id.to_string())]);
544    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
545        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
546    }
547    local_var_req_builder = local_var_req_builder.json(&body);
548
549    let local_var_req = local_var_req_builder.build()?;
550    let local_var_resp = local_var_client.execute(local_var_req).await?;
551
552    let local_var_status = local_var_resp.status();
553    let local_var_content = local_var_resp.text().await?;
554
555    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
556        serde_json::from_str(&local_var_content).map_err(Error::from)
557    } else {
558        let local_var_entity: Option<ApiControllerUpdateUserError> = serde_json::from_str(&local_var_content).ok();
559        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
560        Err(Error::ResponseError(local_var_error))
561    }
562}
563
564/// WebAuthn Registration Flow 1st stage
565pub async fn web_authn_signup_begin(configuration: &configuration::Configuration) -> Result<serde_json::Value, Error<ApiControllerWebAuthnSignupBeginError>> {
566    let local_var_configuration = configuration;
567
568    // unbox the parameters
569
570
571    let local_var_client = &local_var_configuration.client;
572
573    let local_var_uri_str = format!("{}/api/webauthn/signup/begin", local_var_configuration.base_path);
574    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
575
576    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
577        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
578    }
579
580    let local_var_req = local_var_req_builder.build()?;
581    let local_var_resp = local_var_client.execute(local_var_req).await?;
582
583    let local_var_status = local_var_resp.status();
584    let local_var_content = local_var_resp.text().await?;
585
586    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
587        serde_json::from_str(&local_var_content).map_err(Error::from)
588    } else {
589        let local_var_entity: Option<ApiControllerWebAuthnSignupBeginError> = serde_json::from_str(&local_var_content).ok();
590        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
591        Err(Error::ResponseError(local_var_error))
592    }
593}
594
595/// WebAuthn Registration Flow 2nd stage
596pub async fn web_authn_signup_finish(configuration: &configuration::Configuration, params: ApiControllerWebAuthnSignupFinishParams) -> Result<models::ControllersResponse, Error<ApiControllerWebAuthnSignupFinishError>> {
597    let local_var_configuration = configuration;
598
599    // unbox the parameters
600    let body = params.body;
601
602
603    let local_var_client = &local_var_configuration.client;
604
605    let local_var_uri_str = format!("{}/api/webauthn/signup/finish", local_var_configuration.base_path);
606    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
607
608    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
609        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
610    }
611    local_var_req_builder = local_var_req_builder.json(&body);
612
613    let local_var_req = local_var_req_builder.build()?;
614    let local_var_resp = local_var_client.execute(local_var_req).await?;
615
616    let local_var_status = local_var_resp.status();
617    let local_var_content = local_var_resp.text().await?;
618
619    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
620        serde_json::from_str(&local_var_content).map_err(Error::from)
621    } else {
622        let local_var_entity: Option<ApiControllerWebAuthnSignupFinishError> = serde_json::from_str(&local_var_content).ok();
623        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
624        Err(Error::ResponseError(local_var_error))
625    }
626}
627