authentik_rust/models/
redirect_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/// RedirectChallenge : Challenge type to redirect the client
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct RedirectChallenge {
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 = "to")]
25    pub to: String,
26}
27
28impl RedirectChallenge {
29    /// Challenge type to redirect the client
30    pub fn new(r#type: models::ChallengeChoices, to: String) -> RedirectChallenge {
31        RedirectChallenge {
32            r#type,
33            flow_info: None,
34            component: None,
35            response_errors: None,
36            to,
37        }
38    }
39}
40