Skip to main content

authentik_client/models/
identification_stage.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2026.2.1
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// IdentificationStage : IdentificationStage Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct IdentificationStage {
17    #[serde(rename = "pk")]
18    pub pk: uuid::Uuid,
19    #[serde(rename = "name")]
20    pub name: String,
21    /// Get object type so that we know how to edit the object
22    #[serde(rename = "component")]
23    pub component: String,
24    /// Return object's verbose_name
25    #[serde(rename = "verbose_name")]
26    pub verbose_name: String,
27    /// Return object's plural verbose_name
28    #[serde(rename = "verbose_name_plural")]
29    pub verbose_name_plural: String,
30    /// Return internal model name
31    #[serde(rename = "meta_model_name")]
32    pub meta_model_name: String,
33    #[serde(rename = "flow_set")]
34    pub flow_set: Vec<models::FlowSet>,
35    /// Fields of the user object to match against. (Hold shift to select multiple options)
36    #[serde(rename = "user_fields", skip_serializing_if = "Option::is_none")]
37    pub user_fields: Option<Vec<models::UserFieldsEnum>>,
38    /// When set, shows a password field, instead of showing the password field as separate step.
39    #[serde(
40        rename = "password_stage",
41        default,
42        with = "::serde_with::rust::double_option",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub password_stage: Option<Option<uuid::Uuid>>,
46    /// When set, adds functionality exactly like a Captcha stage, but baked into the Identification stage.
47    #[serde(
48        rename = "captcha_stage",
49        default,
50        with = "::serde_with::rust::double_option",
51        skip_serializing_if = "Option::is_none"
52    )]
53    pub captcha_stage: Option<Option<uuid::Uuid>>,
54    /// When enabled, user fields are matched regardless of their casing.
55    #[serde(rename = "case_insensitive_matching", skip_serializing_if = "Option::is_none")]
56    pub case_insensitive_matching: Option<bool>,
57    /// 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
58    #[serde(rename = "show_matched_user", skip_serializing_if = "Option::is_none")]
59    pub show_matched_user: Option<bool>,
60    /// Optional enrollment flow, which is linked at the bottom of the page.
61    #[serde(
62        rename = "enrollment_flow",
63        default,
64        with = "::serde_with::rust::double_option",
65        skip_serializing_if = "Option::is_none"
66    )]
67    pub enrollment_flow: Option<Option<uuid::Uuid>>,
68    /// Optional recovery flow, which is linked at the bottom of the page.
69    #[serde(
70        rename = "recovery_flow",
71        default,
72        with = "::serde_with::rust::double_option",
73        skip_serializing_if = "Option::is_none"
74    )]
75    pub recovery_flow: Option<Option<uuid::Uuid>>,
76    /// Optional passwordless flow, which is linked at the bottom of the page.
77    #[serde(
78        rename = "passwordless_flow",
79        default,
80        with = "::serde_with::rust::double_option",
81        skip_serializing_if = "Option::is_none"
82    )]
83    pub passwordless_flow: Option<Option<uuid::Uuid>>,
84    /// Specify which sources should be shown.
85    #[serde(rename = "sources", skip_serializing_if = "Option::is_none")]
86    pub sources: Option<Vec<uuid::Uuid>>,
87    #[serde(rename = "show_source_labels", skip_serializing_if = "Option::is_none")]
88    pub show_source_labels: Option<bool>,
89    /// When enabled, the stage will succeed and continue even when incorrect user info is entered.
90    #[serde(rename = "pretend_user_exists", skip_serializing_if = "Option::is_none")]
91    pub pretend_user_exists: Option<bool>,
92    /// Show the user the 'Remember me on this device' toggle, allowing repeat users to skip straight to entering their password.
93    #[serde(rename = "enable_remember_me", skip_serializing_if = "Option::is_none")]
94    pub enable_remember_me: Option<bool>,
95    /// When set, and conditional WebAuthn is available, allow the user to use their passkey as a first factor.
96    #[serde(
97        rename = "webauthn_stage",
98        default,
99        with = "::serde_with::rust::double_option",
100        skip_serializing_if = "Option::is_none"
101    )]
102    pub webauthn_stage: Option<Option<uuid::Uuid>>,
103}
104
105impl IdentificationStage {
106    /// IdentificationStage Serializer
107    pub fn new(
108        pk: uuid::Uuid,
109        name: String,
110        component: String,
111        verbose_name: String,
112        verbose_name_plural: String,
113        meta_model_name: String,
114        flow_set: Vec<models::FlowSet>,
115    ) -> IdentificationStage {
116        IdentificationStage {
117            pk,
118            name,
119            component,
120            verbose_name,
121            verbose_name_plural,
122            meta_model_name,
123            flow_set,
124            user_fields: None,
125            password_stage: None,
126            captcha_stage: None,
127            case_insensitive_matching: None,
128            show_matched_user: None,
129            enrollment_flow: None,
130            recovery_flow: None,
131            passwordless_flow: None,
132            sources: None,
133            show_source_labels: None,
134            pretend_user_exists: None,
135            enable_remember_me: None,
136            webauthn_stage: None,
137        }
138    }
139}