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;

/// UserMatchingModeEnum : * `identifier` - Use the source-specific identifier * `email_link` - Link to a user with identical email address. Can have security implications when a source doesn't validate email addresses. * `email_deny` - Use the user's email address, but deny enrollment when the email address already exists. * `username_link` - Link to a user with identical username. Can have security implications when a username is used with another source. * `username_deny` - Use the user's username, but deny enrollment when the username already exists.
/// * `identifier` - Use the source-specific identifier * `email_link` - Link to a user with identical email address. Can have security implications when a source doesn't validate email addresses. * `email_deny` - Use the user's email address, but deny enrollment when the email address already exists. * `username_link` - Link to a user with identical username. Can have security implications when a username is used with another source. * `username_deny` - Use the user's username, but deny enrollment when the username already exists.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum UserMatchingModeEnum {
    #[serde(rename = "identifier")]
    Identifier,
    #[serde(rename = "email_link")]
    EmailLink,
    #[serde(rename = "email_deny")]
    EmailDeny,
    #[serde(rename = "username_link")]
    UsernameLink,
    #[serde(rename = "username_deny")]
    UsernameDeny,

}

impl ToString for UserMatchingModeEnum {
    fn to_string(&self) -> String {
        match self {
            Self::Identifier => String::from("identifier"),
            Self::EmailLink => String::from("email_link"),
            Self::EmailDeny => String::from("email_deny"),
            Self::UsernameLink => String::from("username_link"),
            Self::UsernameDeny => String::from("username_deny"),
        }
    }
}

impl Default for UserMatchingModeEnum {
    fn default() -> UserMatchingModeEnum {
        Self::Identifier
    }
}