authentik_rust/models/
notification.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/// Notification : Notification Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Notification {
16    #[serde(rename = "pk")]
17    pub pk: uuid::Uuid,
18    #[serde(rename = "severity")]
19    pub severity: models::SeverityEnum,
20    #[serde(rename = "body")]
21    pub body: String,
22    #[serde(rename = "created")]
23    pub created: String,
24    #[serde(rename = "event", skip_serializing_if = "Option::is_none")]
25    pub event: Option<Box<models::Event>>,
26    #[serde(rename = "seen", skip_serializing_if = "Option::is_none")]
27    pub seen: Option<bool>,
28}
29
30impl Notification {
31    /// Notification Serializer
32    pub fn new(pk: uuid::Uuid, severity: models::SeverityEnum, body: String, created: String) -> Notification {
33        Notification {
34            pk,
35            severity,
36            body,
37            created,
38            event: None,
39            seen: None,
40        }
41    }
42}
43