Skip to main content

authentik_client/models/
notification_rule_request.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/// NotificationRuleRequest : NotificationRule Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NotificationRuleRequest {
17    #[serde(rename = "name")]
18    pub name: String,
19    /// Select which transports should be used to notify the user. If none are selected, the notification will only be shown in the authentik UI.
20    #[serde(rename = "transports", skip_serializing_if = "Option::is_none")]
21    pub transports: Option<Vec<uuid::Uuid>>,
22    /// Controls which severity level the created notifications will have.
23    #[serde(rename = "severity", skip_serializing_if = "Option::is_none")]
24    pub severity: Option<models::SeverityEnum>,
25    /// Define which group of users this notification should be sent and shown to. If left empty, Notification won't ben sent.
26    #[serde(
27        rename = "destination_group",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub destination_group: Option<Option<uuid::Uuid>>,
33    /// When enabled, notification will be sent to user the user that triggered the event.When destination_group is configured, notification is sent to both.
34    #[serde(rename = "destination_event_user", skip_serializing_if = "Option::is_none")]
35    pub destination_event_user: Option<bool>,
36}
37
38impl NotificationRuleRequest {
39    /// NotificationRule Serializer
40    pub fn new(name: String) -> NotificationRuleRequest {
41        NotificationRuleRequest {
42            name,
43            transports: None,
44            severity: None,
45            destination_group: None,
46            destination_event_user: None,
47        }
48    }
49}