authentik-rust 0.0.1

Making authentication simple.
Documentation
/*
 * authentik
 *
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2024.2.1
 * Contact: hello@goauthentik.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;

/// FlowErrorChallenge : Challenge class when an unhandled error occurs during a stage. Normal users are shown an error message, superusers are shown a full stacktrace.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FlowErrorChallenge {
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")]
    pub flow_info: Option<Box<models::ContextualFlowInfo>>,
    #[serde(rename = "component", skip_serializing_if = "Option::is_none")]
    pub component: Option<String>,
    #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")]
    pub response_errors: Option<std::collections::HashMap<String, Vec<models::ErrorDetail>>>,
    #[serde(rename = "request_id")]
    pub request_id: String,
    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    #[serde(rename = "traceback", skip_serializing_if = "Option::is_none")]
    pub traceback: Option<String>,
}

impl FlowErrorChallenge {
    /// Challenge class when an unhandled error occurs during a stage. Normal users are shown an error message, superusers are shown a full stacktrace.
    pub fn new(request_id: String) -> FlowErrorChallenge {
        FlowErrorChallenge {
            r#type: None,
            flow_info: None,
            component: None,
            response_errors: None,
            request_id,
            error: None,
            traceback: None,
        }
    }
}