authentik-client 2026.2.3

Making authentication simple.
Documentation
/*
 * authentik
 *
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.2.3
 * Contact: hello@goauthentik.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// PatchedTelegramSourceRequest : Source Serializer
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PatchedTelegramSourceRequest {
    /// Source's display Name.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Internal source name, used in URLs.
    #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
    pub slug: Option<String>,
    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon.
    #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")]
    pub promoted: Option<bool>,
    /// Flow to use when authenticating existing users.
    #[serde(
        rename = "authentication_flow",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub authentication_flow: Option<Option<uuid::Uuid>>,
    /// Flow to use when enrolling new users.
    #[serde(
        rename = "enrollment_flow",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub enrollment_flow: Option<Option<uuid::Uuid>>,
    #[serde(rename = "user_property_mappings", skip_serializing_if = "Option::is_none")]
    pub user_property_mappings: Option<Vec<uuid::Uuid>>,
    #[serde(rename = "group_property_mappings", skip_serializing_if = "Option::is_none")]
    pub group_property_mappings: Option<Vec<uuid::Uuid>>,
    #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")]
    pub policy_engine_mode: Option<models::PolicyEngineMode>,
    /// How the source determines if an existing user should be authenticated or a new user enrolled.
    #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")]
    pub user_matching_mode: Option<models::UserMatchingModeEnum>,
    #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")]
    pub user_path_template: Option<String>,
    #[serde(rename = "icon", skip_serializing_if = "Option::is_none")]
    pub icon: Option<String>,
    /// Telegram bot username
    #[serde(rename = "bot_username", skip_serializing_if = "Option::is_none")]
    pub bot_username: Option<String>,
    /// Telegram bot token
    #[serde(rename = "bot_token", skip_serializing_if = "Option::is_none")]
    pub bot_token: Option<String>,
    /// Request access to send messages from your bot.
    #[serde(rename = "request_message_access", skip_serializing_if = "Option::is_none")]
    pub request_message_access: Option<bool>,
    /// Flow used before authentication.
    #[serde(rename = "pre_authentication_flow", skip_serializing_if = "Option::is_none")]
    pub pre_authentication_flow: Option<uuid::Uuid>,
}

impl PatchedTelegramSourceRequest {
    /// Source Serializer
    pub fn new() -> PatchedTelegramSourceRequest {
        PatchedTelegramSourceRequest {
            name: None,
            slug: None,
            enabled: None,
            promoted: None,
            authentication_flow: None,
            enrollment_flow: None,
            user_property_mappings: None,
            group_property_mappings: None,
            policy_engine_mode: None,
            user_matching_mode: None,
            user_path_template: None,
            icon: None,
            bot_username: None,
            bot_token: None,
            request_message_access: None,
            pre_authentication_flow: None,
        }
    }
}