authentik_rust/models/
identification_stage.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/// IdentificationStage : IdentificationStage Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct IdentificationStage {
16    #[serde(rename = "pk")]
17    pub pk: uuid::Uuid,
18    #[serde(rename = "name")]
19    pub name: String,
20    /// Get object type so that we know how to edit the object
21    #[serde(rename = "component")]
22    pub component: String,
23    /// Return object's verbose_name
24    #[serde(rename = "verbose_name")]
25    pub verbose_name: String,
26    /// Return object's plural verbose_name
27    #[serde(rename = "verbose_name_plural")]
28    pub verbose_name_plural: String,
29    /// Return internal model name
30    #[serde(rename = "meta_model_name")]
31    pub meta_model_name: String,
32    #[serde(rename = "flow_set", skip_serializing_if = "Option::is_none")]
33    pub flow_set: Option<Vec<models::FlowSet>>,
34    /// Fields of the user object to match against. (Hold shift to select multiple options)
35    #[serde(rename = "user_fields", skip_serializing_if = "Option::is_none")]
36    pub user_fields: Option<Vec<models::UserFieldsEnum>>,
37    /// When set, shows a password field, instead of showing the password field as seaprate step.
38    #[serde(rename = "password_stage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
39    pub password_stage: Option<Option<uuid::Uuid>>,
40    /// When enabled, user fields are matched regardless of their casing.
41    #[serde(rename = "case_insensitive_matching", skip_serializing_if = "Option::is_none")]
42    pub case_insensitive_matching: Option<bool>,
43    /// When a valid username/email has been entered, and this option is enabled, the user's username and avatar will be shown. Otherwise, the text that the user entered will be shown
44    #[serde(rename = "show_matched_user", skip_serializing_if = "Option::is_none")]
45    pub show_matched_user: Option<bool>,
46    /// Optional enrollment flow, which is linked at the bottom of the page.
47    #[serde(rename = "enrollment_flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
48    pub enrollment_flow: Option<Option<uuid::Uuid>>,
49    /// Optional recovery flow, which is linked at the bottom of the page.
50    #[serde(rename = "recovery_flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
51    pub recovery_flow: Option<Option<uuid::Uuid>>,
52    /// Optional passwordless flow, which is linked at the bottom of the page.
53    #[serde(rename = "passwordless_flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
54    pub passwordless_flow: Option<Option<uuid::Uuid>>,
55    /// Specify which sources should be shown.
56    #[serde(rename = "sources", skip_serializing_if = "Option::is_none")]
57    pub sources: Option<Vec<uuid::Uuid>>,
58    #[serde(rename = "show_source_labels", skip_serializing_if = "Option::is_none")]
59    pub show_source_labels: Option<bool>,
60    /// When enabled, the stage will succeed and continue even when incorrect user info is entered.
61    #[serde(rename = "pretend_user_exists", skip_serializing_if = "Option::is_none")]
62    pub pretend_user_exists: Option<bool>,
63}
64
65impl IdentificationStage {
66    /// IdentificationStage Serializer
67    pub fn new(pk: uuid::Uuid, name: String, component: String, verbose_name: String, verbose_name_plural: String, meta_model_name: String) -> IdentificationStage {
68        IdentificationStage {
69            pk,
70            name,
71            component,
72            verbose_name,
73            verbose_name_plural,
74            meta_model_name,
75            flow_set: None,
76            user_fields: None,
77            password_stage: None,
78            case_insensitive_matching: None,
79            show_matched_user: None,
80            enrollment_flow: None,
81            recovery_flow: None,
82            passwordless_flow: None,
83            sources: None,
84            show_source_labels: None,
85            pretend_user_exists: None,
86        }
87    }
88}
89