Skip to main content

authentik_client/models/
stage_prompt.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2026.2.1
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// StagePrompt : Serializer for a single Prompt field
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct StagePrompt {
17    #[serde(rename = "field_key")]
18    pub field_key: String,
19    #[serde(rename = "label")]
20    pub label: String,
21    #[serde(rename = "type")]
22    pub r#type: models::PromptTypeEnum,
23    #[serde(rename = "required")]
24    pub required: bool,
25    #[serde(rename = "placeholder")]
26    pub placeholder: String,
27    #[serde(rename = "initial_value")]
28    pub initial_value: String,
29    #[serde(rename = "order")]
30    pub order: i32,
31    #[serde(rename = "sub_text")]
32    pub sub_text: String,
33    #[serde(rename = "choices", deserialize_with = "Option::deserialize")]
34    pub choices: Option<Vec<models::PromptChoice>>,
35}
36
37impl StagePrompt {
38    /// Serializer for a single Prompt field
39    pub fn new(
40        field_key: String,
41        label: String,
42        r#type: models::PromptTypeEnum,
43        required: bool,
44        placeholder: String,
45        initial_value: String,
46        order: i32,
47        sub_text: String,
48        choices: Option<Vec<models::PromptChoice>>,
49    ) -> StagePrompt {
50        StagePrompt {
51            field_key,
52            label,
53            r#type,
54            required,
55            placeholder,
56            initial_value,
57            order,
58            sub_text,
59            choices,
60        }
61    }
62}