authentik_rust/models/
captcha_challenge.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2024.2.1
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13/// CaptchaChallenge : Site public key
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CaptchaChallenge {
16    #[serde(rename = "type")]
17    pub r#type: models::ChallengeChoices,
18    #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")]
19    pub flow_info: Option<Box<models::ContextualFlowInfo>>,
20    #[serde(rename = "component", skip_serializing_if = "Option::is_none")]
21    pub component: Option<String>,
22    #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")]
23    pub response_errors: Option<std::collections::HashMap<String, Vec<models::ErrorDetail>>>,
24    #[serde(rename = "pending_user")]
25    pub pending_user: String,
26    #[serde(rename = "pending_user_avatar")]
27    pub pending_user_avatar: String,
28    #[serde(rename = "site_key")]
29    pub site_key: String,
30    #[serde(rename = "js_url")]
31    pub js_url: String,
32}
33
34impl CaptchaChallenge {
35    /// Site public key
36    pub fn new(r#type: models::ChallengeChoices, pending_user: String, pending_user_avatar: String, site_key: String, js_url: String) -> CaptchaChallenge {
37        CaptchaChallenge {
38            r#type,
39            flow_info: None,
40            component: None,
41            response_errors: None,
42            pending_user,
43            pending_user_avatar,
44            site_key,
45            js_url,
46        }
47    }
48}
49