authentik_rust/models/sub_mode_enum.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/// 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.
14/// * `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.
15#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
16pub enum SubModeEnum {
17 #[serde(rename = "hashed_user_id")]
18 HashedUserId,
19 #[serde(rename = "user_id")]
20 UserId,
21 #[serde(rename = "user_uuid")]
22 UserUuid,
23 #[serde(rename = "user_username")]
24 UserUsername,
25 #[serde(rename = "user_email")]
26 UserEmail,
27 #[serde(rename = "user_upn")]
28 UserUpn,
29
30}
31
32impl ToString for SubModeEnum {
33 fn to_string(&self) -> String {
34 match self {
35 Self::HashedUserId => String::from("hashed_user_id"),
36 Self::UserId => String::from("user_id"),
37 Self::UserUuid => String::from("user_uuid"),
38 Self::UserUsername => String::from("user_username"),
39 Self::UserEmail => String::from("user_email"),
40 Self::UserUpn => String::from("user_upn"),
41 }
42 }
43}
44
45impl Default for SubModeEnum {
46 fn default() -> SubModeEnum {
47 Self::HashedUserId
48 }
49}
50