authentik_client/models/
notification_transport_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/// NotificationTransportRequest : NotificationTransport Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NotificationTransportRequest {
17    #[serde(rename = "name")]
18    pub name: String,
19    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
20    pub mode: Option<models::NotificationTransportModeEnum>,
21    #[serde(rename = "webhook_url", skip_serializing_if = "Option::is_none")]
22    pub webhook_url: Option<String>,
23    /// Customize the body of the request. Mapping should return data that is JSON-serializable.
24    #[serde(
25        rename = "webhook_mapping_body",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub webhook_mapping_body: Option<Option<uuid::Uuid>>,
31    /// Configure additional headers to be sent. Mapping should return a dictionary of key-value pairs
32    #[serde(
33        rename = "webhook_mapping_headers",
34        default,
35        with = "::serde_with::rust::double_option",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub webhook_mapping_headers: Option<Option<uuid::Uuid>>,
39    #[serde(rename = "email_subject_prefix", skip_serializing_if = "Option::is_none")]
40    pub email_subject_prefix: Option<String>,
41    #[serde(rename = "email_template", skip_serializing_if = "Option::is_none")]
42    pub email_template: Option<String>,
43    /// Only send notification once, for example when sending a webhook into a chat channel.
44    #[serde(rename = "send_once", skip_serializing_if = "Option::is_none")]
45    pub send_once: Option<bool>,
46}
47
48impl NotificationTransportRequest {
49    /// NotificationTransport Serializer
50    pub fn new(name: String) -> NotificationTransportRequest {
51        NotificationTransportRequest {
52            name,
53            mode: None,
54            webhook_url: None,
55            webhook_mapping_body: None,
56            webhook_mapping_headers: None,
57            email_subject_prefix: None,
58            email_template: None,
59            send_once: None,
60        }
61    }
62}