Skip to main content

authentik_client/models/
flow.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2025.8.6
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Flow : Flow Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Flow {
17    #[serde(rename = "pk")]
18    pub pk: uuid::Uuid,
19    #[serde(rename = "policybindingmodel_ptr_id")]
20    pub policybindingmodel_ptr_id: uuid::Uuid,
21    #[serde(rename = "name")]
22    pub name: String,
23    /// Visible in the URL.
24    #[serde(rename = "slug")]
25    pub slug: String,
26    /// Shown as the Title in Flow pages.
27    #[serde(rename = "title")]
28    pub title: String,
29    /// Decides what this Flow is used for. For example, the Authentication flow is redirect to when an un-authenticated user visits authentik.
30    #[serde(rename = "designation")]
31    pub designation: models::FlowDesignationEnum,
32    /// Get the URL to the background image. If the name is /static or starts with http it is returned as-is
33    #[serde(rename = "background")]
34    pub background: String,
35    #[serde(rename = "stages")]
36    pub stages: Vec<uuid::Uuid>,
37    #[serde(rename = "policies")]
38    pub policies: Vec<uuid::Uuid>,
39    /// Get count of cached flows
40    #[serde(rename = "cache_count")]
41    pub cache_count: i32,
42    #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")]
43    pub policy_engine_mode: Option<models::PolicyEngineMode>,
44    /// Enable compatibility mode, increases compatibility with password managers on mobile devices.
45    #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")]
46    pub compatibility_mode: Option<bool>,
47    /// Get export URL for flow
48    #[serde(rename = "export_url")]
49    pub export_url: String,
50    #[serde(rename = "layout", skip_serializing_if = "Option::is_none")]
51    pub layout: Option<models::FlowLayoutEnum>,
52    /// Configure what should happen when a flow denies access to a user.
53    #[serde(rename = "denied_action", skip_serializing_if = "Option::is_none")]
54    pub denied_action: Option<models::DeniedActionEnum>,
55    /// Required level of authentication and authorization to access a flow.
56    #[serde(rename = "authentication", skip_serializing_if = "Option::is_none")]
57    pub authentication: Option<models::AuthenticationEnum>,
58}
59
60impl Flow {
61    /// Flow Serializer
62    pub fn new(
63        pk: uuid::Uuid,
64        policybindingmodel_ptr_id: uuid::Uuid,
65        name: String,
66        slug: String,
67        title: String,
68        designation: models::FlowDesignationEnum,
69        background: String,
70        stages: Vec<uuid::Uuid>,
71        policies: Vec<uuid::Uuid>,
72        cache_count: i32,
73        export_url: String,
74    ) -> Flow {
75        Flow {
76            pk,
77            policybindingmodel_ptr_id,
78            name,
79            slug,
80            title,
81            designation,
82            background,
83            stages,
84            policies,
85            cache_count,
86            policy_engine_mode: None,
87            compatibility_mode: None,
88            export_url,
89            layout: None,
90            denied_action: None,
91            authentication: None,
92        }
93    }
94}