Skip to main content

onesignal_rust_api/models/
audit_log_context.rs

1/*
2 * OneSignal
3 *
4 * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5 *
6 * Contact: devrel@onesignal.com
7 * Generated by: https://openapi-generator.tech
8 */
9
10/// AuditLogContext : Request context at the time of the event. Absent if context was not captured.
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct AuditLogContext {
16    /// Country code derived from the request IP.
17    #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
18    pub country: Option<String>,
19    /// IP address the request originated from.
20    #[serde(rename = "ip", skip_serializing_if = "Option::is_none")]
21    pub ip: Option<String>,
22    /// Additional context-specific data.
23    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
24    pub metadata: Option<serde_json::Value>,
25    /// User agent of the client that made the request.
26    #[serde(rename = "user_agent", skip_serializing_if = "Option::is_none")]
27    pub user_agent: Option<String>,
28}
29
30impl AuditLogContext {
31    /// Request context at the time of the event. Absent if context was not captured.
32    pub fn new() -> AuditLogContext {
33        AuditLogContext {
34            country: None,
35            ip: None,
36            metadata: None,
37            user_agent: None,
38        }
39    }
40}
41
42