Skip to main content

authentik_client/models/
prompt.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2026.2.0
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Prompt : Prompt Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Prompt {
17    #[serde(rename = "pk")]
18    pub pk: uuid::Uuid,
19    #[serde(rename = "name")]
20    pub name: String,
21    /// Name of the form field, also used to store the value
22    #[serde(rename = "field_key")]
23    pub field_key: String,
24    #[serde(rename = "label")]
25    pub label: String,
26    #[serde(rename = "type")]
27    pub r#type: models::PromptTypeEnum,
28    #[serde(rename = "required", skip_serializing_if = "Option::is_none")]
29    pub required: Option<bool>,
30    /// Optionally provide a short hint that describes the expected input value. When creating a fixed choice field, enable interpreting as expression and return a list to return multiple choices.
31    #[serde(rename = "placeholder", skip_serializing_if = "Option::is_none")]
32    pub placeholder: Option<String>,
33    /// Optionally pre-fill the input with an initial value. When creating a fixed choice field, enable interpreting as expression and return a list to return multiple default choices.
34    #[serde(rename = "initial_value", skip_serializing_if = "Option::is_none")]
35    pub initial_value: Option<String>,
36    #[serde(rename = "order", skip_serializing_if = "Option::is_none")]
37    pub order: Option<i32>,
38    #[serde(rename = "prompt_stages_obj")]
39    pub prompt_stages_obj: Vec<models::PromptStage>,
40    #[serde(rename = "sub_text", skip_serializing_if = "Option::is_none")]
41    pub sub_text: Option<String>,
42    #[serde(rename = "placeholder_expression", skip_serializing_if = "Option::is_none")]
43    pub placeholder_expression: Option<bool>,
44    #[serde(rename = "initial_value_expression", skip_serializing_if = "Option::is_none")]
45    pub initial_value_expression: Option<bool>,
46}
47
48impl Prompt {
49    /// Prompt Serializer
50    pub fn new(
51        pk: uuid::Uuid,
52        name: String,
53        field_key: String,
54        label: String,
55        r#type: models::PromptTypeEnum,
56        prompt_stages_obj: Vec<models::PromptStage>,
57    ) -> Prompt {
58        Prompt {
59            pk,
60            name,
61            field_key,
62            label,
63            r#type,
64            required: None,
65            placeholder: None,
66            initial_value: None,
67            order: None,
68            prompt_stages_obj,
69            sub_text: None,
70            placeholder_expression: None,
71            initial_value_expression: None,
72        }
73    }
74}