authentik_rust/models/
flow.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/// Flow : Flow Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Flow {
16    #[serde(rename = "pk")]
17    pub pk: uuid::Uuid,
18    #[serde(rename = "policybindingmodel_ptr_id")]
19    pub policybindingmodel_ptr_id: uuid::Uuid,
20    #[serde(rename = "name")]
21    pub name: String,
22    /// Visible in the URL.
23    #[serde(rename = "slug")]
24    pub slug: String,
25    /// Shown as the Title in Flow pages.
26    #[serde(rename = "title")]
27    pub title: String,
28    /// Decides what this Flow is used for. For example, the Authentication flow is redirect to when an un-authenticated user visits authentik.  * `authentication` - Authentication * `authorization` - Authorization * `invalidation` - Invalidation * `enrollment` - Enrollment * `unenrollment` - Unrenollment * `recovery` - Recovery * `stage_configuration` - Stage Configuration
29    #[serde(rename = "designation")]
30    pub designation: models::FlowDesignationEnum,
31    /// Get the URL to the background image. If the name is /static or starts with http it is returned as-is
32    #[serde(rename = "background")]
33    pub background: String,
34    #[serde(rename = "stages")]
35    pub stages: Vec<uuid::Uuid>,
36    #[serde(rename = "policies")]
37    pub policies: Vec<uuid::Uuid>,
38    /// Get count of cached flows
39    #[serde(rename = "cache_count")]
40    pub cache_count: i32,
41    #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")]
42    pub policy_engine_mode: Option<models::PolicyEngineMode>,
43    /// Enable compatibility mode, increases compatibility with password managers on mobile devices.
44    #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")]
45    pub compatibility_mode: Option<bool>,
46    /// Get export URL for flow
47    #[serde(rename = "export_url")]
48    pub export_url: String,
49    #[serde(rename = "layout", skip_serializing_if = "Option::is_none")]
50    pub layout: Option<models::FlowLayoutEnum>,
51    /// Configure what should happen when a flow denies access to a user.  * `message_continue` - Message Continue * `message` - Message * `continue` - Continue
52    #[serde(rename = "denied_action", skip_serializing_if = "Option::is_none")]
53    pub denied_action: Option<models::DeniedActionEnum>,
54    /// Required level of authentication and authorization to access a flow.  * `none` - None * `require_authenticated` - Require Authenticated * `require_unauthenticated` - Require Unauthenticated * `require_superuser` - Require Superuser * `require_outpost` - Require Outpost
55    #[serde(rename = "authentication", skip_serializing_if = "Option::is_none")]
56    pub authentication: Option<models::AuthenticationEnum>,
57}
58
59impl Flow {
60    /// Flow Serializer
61    pub fn new(pk: uuid::Uuid, policybindingmodel_ptr_id: uuid::Uuid, name: String, slug: String, title: String, designation: models::FlowDesignationEnum, background: String, stages: Vec<uuid::Uuid>, policies: Vec<uuid::Uuid>, cache_count: i32, export_url: String) -> Flow {
62        Flow {
63            pk,
64            policybindingmodel_ptr_id,
65            name,
66            slug,
67            title,
68            designation,
69            background,
70            stages,
71            policies,
72            cache_count,
73            policy_engine_mode: None,
74            compatibility_mode: None,
75            export_url,
76            layout: None,
77            denied_action: None,
78            authentication: None,
79        }
80    }
81}
82