authentik_client/models/
patched_telegram_source_request.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2025.10.2
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// PatchedTelegramSourceRequest : Source Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PatchedTelegramSourceRequest {
17    /// Source's display Name.
18    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
19    pub name: Option<String>,
20    /// Internal source name, used in URLs.
21    #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
22    pub slug: Option<String>,
23    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
24    pub enabled: Option<bool>,
25    /// Flow to use when authenticating existing users.
26    #[serde(
27        rename = "authentication_flow",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub authentication_flow: Option<Option<uuid::Uuid>>,
33    /// Flow to use when enrolling new users.
34    #[serde(
35        rename = "enrollment_flow",
36        default,
37        with = "::serde_with::rust::double_option",
38        skip_serializing_if = "Option::is_none"
39    )]
40    pub enrollment_flow: Option<Option<uuid::Uuid>>,
41    #[serde(rename = "user_property_mappings", skip_serializing_if = "Option::is_none")]
42    pub user_property_mappings: Option<Vec<uuid::Uuid>>,
43    #[serde(rename = "group_property_mappings", skip_serializing_if = "Option::is_none")]
44    pub group_property_mappings: Option<Vec<uuid::Uuid>>,
45    #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")]
46    pub policy_engine_mode: Option<models::PolicyEngineMode>,
47    /// How the source determines if an existing user should be authenticated or a new user enrolled.
48    #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")]
49    pub user_matching_mode: Option<models::UserMatchingModeEnum>,
50    #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")]
51    pub user_path_template: Option<String>,
52    /// Telegram bot username
53    #[serde(rename = "bot_username", skip_serializing_if = "Option::is_none")]
54    pub bot_username: Option<String>,
55    /// Telegram bot token
56    #[serde(rename = "bot_token", skip_serializing_if = "Option::is_none")]
57    pub bot_token: Option<String>,
58    /// Request access to send messages from your bot.
59    #[serde(rename = "request_message_access", skip_serializing_if = "Option::is_none")]
60    pub request_message_access: Option<bool>,
61    /// Flow used before authentication.
62    #[serde(rename = "pre_authentication_flow", skip_serializing_if = "Option::is_none")]
63    pub pre_authentication_flow: Option<uuid::Uuid>,
64}
65
66impl PatchedTelegramSourceRequest {
67    /// Source Serializer
68    pub fn new() -> PatchedTelegramSourceRequest {
69        PatchedTelegramSourceRequest {
70            name: None,
71            slug: None,
72            enabled: None,
73            authentication_flow: None,
74            enrollment_flow: None,
75            user_property_mappings: None,
76            group_property_mappings: None,
77            policy_engine_mode: None,
78            user_matching_mode: None,
79            user_path_template: None,
80            bot_username: None,
81            bot_token: None,
82            request_message_access: None,
83            pre_authentication_flow: None,
84        }
85    }
86}