1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* authentik
*
* Making authentication simple.
*
* The version of the OpenAPI document: 2026.2.2-rc2
* Contact: hello@goauthentik.io
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// NotificationRule : NotificationRule Serializer
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct NotificationRule {
#[serde(rename = "pk")]
pub pk: uuid::Uuid,
#[serde(rename = "name")]
pub name: String,
/// Select which transports should be used to notify the user. If none are selected, the notification will only be shown in the authentik UI.
#[serde(rename = "transports", skip_serializing_if = "Option::is_none")]
pub transports: Option<Vec<uuid::Uuid>>,
/// Controls which severity level the created notifications will have.
#[serde(rename = "severity", skip_serializing_if = "Option::is_none")]
pub severity: Option<models::SeverityEnum>,
/// Define which group of users this notification should be sent and shown to. If left empty, Notification won't ben sent.
#[serde(
rename = "destination_group",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub destination_group: Option<Option<uuid::Uuid>>,
#[serde(rename = "destination_group_obj")]
pub destination_group_obj: models::Group,
/// When enabled, notification will be sent to user the user that triggered the event.When destination_group is configured, notification is sent to both.
#[serde(rename = "destination_event_user", skip_serializing_if = "Option::is_none")]
pub destination_event_user: Option<bool>,
}
impl NotificationRule {
/// NotificationRule Serializer
pub fn new(pk: uuid::Uuid, name: String, destination_group_obj: models::Group) -> NotificationRule {
NotificationRule {
pk,
name,
transports: None,
severity: None,
destination_group: None,
destination_group_obj,
destination_event_user: None,
}
}
}