authentik_rust/models/
notification_rule.rs

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