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;

/// AppleLoginChallenge : Special challenge for apple-native authentication flow, which happens on the client.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AppleLoginChallenge {
    #[serde(rename = "type")]
    pub r#type: models::ChallengeChoices,
    #[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 = "client_id")]
    pub client_id: String,
    #[serde(rename = "scope")]
    pub scope: String,
    #[serde(rename = "redirect_uri")]
    pub redirect_uri: String,
    #[serde(rename = "state")]
    pub state: String,
}

impl AppleLoginChallenge {
    /// Special challenge for apple-native authentication flow, which happens on the client.
    pub fn new(r#type: models::ChallengeChoices, client_id: String, scope: String, redirect_uri: String, state: String) -> AppleLoginChallenge {
        AppleLoginChallenge {
            r#type,
            flow_info: None,
            component: None,
            response_errors: None,
            client_id,
            scope,
            redirect_uri,
            state,
        }
    }
}