authentik_rust/models/
stage_prompt.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/// StagePrompt : Serializer for a single Prompt field
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct StagePrompt {
16    #[serde(rename = "field_key")]
17    pub field_key: String,
18    #[serde(rename = "label")]
19    pub label: String,
20    #[serde(rename = "type")]
21    pub r#type: models::PromptTypeEnum,
22    #[serde(rename = "required")]
23    pub required: bool,
24    #[serde(rename = "placeholder")]
25    pub placeholder: String,
26    #[serde(rename = "initial_value")]
27    pub initial_value: String,
28    #[serde(rename = "order")]
29    pub order: i32,
30    #[serde(rename = "sub_text")]
31    pub sub_text: String,
32    #[serde(rename = "choices", deserialize_with = "Option::deserialize")]
33    pub choices: Option<Vec<String>>,
34}
35
36impl StagePrompt {
37    /// Serializer for a single Prompt field
38    pub fn new(field_key: String, label: String, r#type: models::PromptTypeEnum, required: bool, placeholder: String, initial_value: String, order: i32, sub_text: String, choices: Option<Vec<String>>) -> StagePrompt {
39        StagePrompt {
40            field_key,
41            label,
42            r#type,
43            required,
44            placeholder,
45            initial_value,
46            order,
47            sub_text,
48            choices,
49        }
50    }
51}
52