authentik_rust/models/flow_request.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/// FlowRequest : Flow Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct FlowRequest {
16 #[serde(rename = "name")]
17 pub name: String,
18 /// Visible in the URL.
19 #[serde(rename = "slug")]
20 pub slug: String,
21 /// Shown as the Title in Flow pages.
22 #[serde(rename = "title")]
23 pub title: String,
24 /// 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
25 #[serde(rename = "designation")]
26 pub designation: models::FlowDesignationEnum,
27 #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")]
28 pub policy_engine_mode: Option<models::PolicyEngineMode>,
29 /// Enable compatibility mode, increases compatibility with password managers on mobile devices.
30 #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")]
31 pub compatibility_mode: Option<bool>,
32 #[serde(rename = "layout", skip_serializing_if = "Option::is_none")]
33 pub layout: Option<models::FlowLayoutEnum>,
34 /// Configure what should happen when a flow denies access to a user. * `message_continue` - Message Continue * `message` - Message * `continue` - Continue
35 #[serde(rename = "denied_action", skip_serializing_if = "Option::is_none")]
36 pub denied_action: Option<models::DeniedActionEnum>,
37 /// 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
38 #[serde(rename = "authentication", skip_serializing_if = "Option::is_none")]
39 pub authentication: Option<models::AuthenticationEnum>,
40}
41
42impl FlowRequest {
43 /// Flow Serializer
44 pub fn new(name: String, slug: String, title: String, designation: models::FlowDesignationEnum) -> FlowRequest {
45 FlowRequest {
46 name,
47 slug,
48 title,
49 designation,
50 policy_engine_mode: None,
51 compatibility_mode: None,
52 layout: None,
53 denied_action: None,
54 authentication: None,
55 }
56 }
57}
58