authentik_client/models/
event.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/// Event : Event Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Event {
17    #[serde(rename = "pk")]
18    pub pk: uuid::Uuid,
19    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
20    pub user: Option<std::collections::HashMap<String, serde_json::Value>>,
21    #[serde(rename = "action")]
22    pub action: models::EventActions,
23    #[serde(rename = "app")]
24    pub app: String,
25    #[serde(rename = "context", skip_serializing_if = "Option::is_none")]
26    pub context: Option<std::collections::HashMap<String, serde_json::Value>>,
27    #[serde(
28        rename = "client_ip",
29        default,
30        with = "::serde_with::rust::double_option",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub client_ip: Option<Option<String>>,
34    #[serde(rename = "created")]
35    pub created: String,
36    #[serde(rename = "expires", skip_serializing_if = "Option::is_none")]
37    pub expires: Option<String>,
38    #[serde(rename = "brand", skip_serializing_if = "Option::is_none")]
39    pub brand: Option<std::collections::HashMap<String, serde_json::Value>>,
40}
41
42impl Event {
43    /// Event Serializer
44    pub fn new(pk: uuid::Uuid, action: models::EventActions, app: String, created: String) -> Event {
45        Event {
46            pk,
47            user: None,
48            action,
49            app,
50            context: None,
51            client_ip: None,
52            created,
53            expires: None,
54            brand: None,
55        }
56    }
57}