authentik_rust/models/
event_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/// EventRequest : Event Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct EventRequest {
16    #[serde(rename = "user", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
17    pub user: Option<Option<serde_json::Value>>,
18    #[serde(rename = "action")]
19    pub action: models::EventActions,
20    #[serde(rename = "app")]
21    pub app: String,
22    #[serde(rename = "context", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub context: Option<Option<serde_json::Value>>,
24    #[serde(rename = "client_ip", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub client_ip: Option<Option<String>>,
26    #[serde(rename = "expires", skip_serializing_if = "Option::is_none")]
27    pub expires: Option<String>,
28    #[serde(rename = "brand", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub brand: Option<Option<serde_json::Value>>,
30}
31
32impl EventRequest {
33    /// Event Serializer
34    pub fn new(action: models::EventActions, app: String) -> EventRequest {
35        EventRequest {
36            user: None,
37            action,
38            app,
39            context: None,
40            client_ip: None,
41            expires: None,
42            brand: None,
43        }
44    }
45}
46