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