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