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;

/// SubModeEnum : * `hashed_user_id` - Based on the Hashed User ID * `user_id` - Based on user ID * `user_uuid` - Based on user UUID * `user_username` - Based on the username * `user_email` - Based on the User's Email. This is recommended over the UPN method. * `user_upn` - Based on the User's UPN, only works if user has a 'upn' attribute set. Use this method only if you have different UPN and Mail domains.
/// * `hashed_user_id` - Based on the Hashed User ID * `user_id` - Based on user ID * `user_uuid` - Based on user UUID * `user_username` - Based on the username * `user_email` - Based on the User's Email. This is recommended over the UPN method. * `user_upn` - Based on the User's UPN, only works if user has a 'upn' attribute set. Use this method only if you have different UPN and Mail domains.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SubModeEnum {
    #[serde(rename = "hashed_user_id")]
    HashedUserId,
    #[serde(rename = "user_id")]
    UserId,
    #[serde(rename = "user_uuid")]
    UserUuid,
    #[serde(rename = "user_username")]
    UserUsername,
    #[serde(rename = "user_email")]
    UserEmail,
    #[serde(rename = "user_upn")]
    UserUpn,

}

impl ToString for SubModeEnum {
    fn to_string(&self) -> String {
        match self {
            Self::HashedUserId => String::from("hashed_user_id"),
            Self::UserId => String::from("user_id"),
            Self::UserUuid => String::from("user_uuid"),
            Self::UserUsername => String::from("user_username"),
            Self::UserEmail => String::from("user_email"),
            Self::UserUpn => String::from("user_upn"),
        }
    }
}

impl Default for SubModeEnum {
    fn default() -> SubModeEnum {
        Self::HashedUserId
    }
}