authentik_client/models/
flow.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2025.12.1
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    /// Background shown during execution
33    #[serde(rename = "background", skip_serializing_if = "Option::is_none")]
34    pub background: Option<String>,
35    /// Get the URL to the background image
36    #[serde(rename = "background_url")]
37    pub background_url: String,
38    #[serde(rename = "stages")]
39    pub stages: Vec<uuid::Uuid>,
40    #[serde(rename = "policies")]
41    pub policies: Vec<uuid::Uuid>,
42    /// Get count of cached flows
43    #[serde(rename = "cache_count")]
44    pub cache_count: i32,
45    #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")]
46    pub policy_engine_mode: Option<models::PolicyEngineMode>,
47    /// Enable compatibility mode, increases compatibility with password managers on mobile devices.
48    #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")]
49    pub compatibility_mode: Option<bool>,
50    /// Get export URL for flow
51    #[serde(rename = "export_url")]
52    pub export_url: String,
53    #[serde(rename = "layout", skip_serializing_if = "Option::is_none")]
54    pub layout: Option<models::FlowLayoutEnum>,
55    /// Configure what should happen when a flow denies access to a user.
56    #[serde(rename = "denied_action", skip_serializing_if = "Option::is_none")]
57    pub denied_action: Option<models::DeniedActionEnum>,
58    /// Required level of authentication and authorization to access a flow.
59    #[serde(rename = "authentication", skip_serializing_if = "Option::is_none")]
60    pub authentication: Option<models::AuthenticationEnum>,
61}
62
63impl Flow {
64    /// Flow Serializer
65    pub fn new(
66        pk: uuid::Uuid,
67        policybindingmodel_ptr_id: uuid::Uuid,
68        name: String,
69        slug: String,
70        title: String,
71        designation: models::FlowDesignationEnum,
72        background_url: String,
73        stages: Vec<uuid::Uuid>,
74        policies: Vec<uuid::Uuid>,
75        cache_count: i32,
76        export_url: String,
77    ) -> Flow {
78        Flow {
79            pk,
80            policybindingmodel_ptr_id,
81            name,
82            slug,
83            title,
84            designation,
85            background: None,
86            background_url,
87            stages,
88            policies,
89            cache_count,
90            policy_engine_mode: None,
91            compatibility_mode: None,
92            export_url,
93            layout: None,
94            denied_action: None,
95            authentication: None,
96        }
97    }
98}