authentik_rust/models/notification_rule_request.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/// NotificationRuleRequest : NotificationRule Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct NotificationRuleRequest {
16 #[serde(rename = "name")]
17 pub name: String,
18 /// Select which transports should be used to notify the user. If none are selected, the notification will only be shown in the authentik UI.
19 #[serde(rename = "transports", skip_serializing_if = "Option::is_none")]
20 pub transports: Option<Vec<uuid::Uuid>>,
21 /// Controls which severity level the created notifications will have. * `notice` - Notice * `warning` - Warning * `alert` - Alert
22 #[serde(rename = "severity", skip_serializing_if = "Option::is_none")]
23 pub severity: Option<models::SeverityEnum>,
24 /// Define which group of users this notification should be sent and shown to. If left empty, Notification won't ben sent.
25 #[serde(rename = "group", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26 pub group: Option<Option<uuid::Uuid>>,
27}
28
29impl NotificationRuleRequest {
30 /// NotificationRule Serializer
31 pub fn new(name: String) -> NotificationRuleRequest {
32 NotificationRuleRequest {
33 name,
34 transports: None,
35 severity: None,
36 group: None,
37 }
38 }
39}
40