onesignal-rust-api 5.4.0

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
Documentation
/*
 * OneSignal
 *
 * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
 *
 * The version of the OpenAPI document: 5.4.0
 * Contact: devrel@onesignal.com
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CustomEvent {
    /// The identifier or name of the event. Maximum 128 characters.
    #[serde(rename = "name")]
    pub name: String,
    /// The external ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required.
    #[serde(rename = "external_id", skip_serializing_if = "Option::is_none")]
    pub external_id: Option<String>,
    /// The OneSignal ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required.
    #[serde(rename = "onesignal_id", skip_serializing_if = "Option::is_none")]
    pub onesignal_id: Option<String>,
    /// Time the event occurred as an ISO8601 formatted string. Defaults to now if not included or past date provided.
    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
    pub timestamp: Option<String>,
    /// Properties or data related to the event, like {\"geography\": \"USA\"}
    #[serde(rename = "payload", skip_serializing_if = "Option::is_none")]
    pub payload: Option<::std::collections::HashMap<String, serde_json::Value>>,
}

impl CustomEvent {
    pub fn new(name: String) -> CustomEvent {
        CustomEvent {
            name,
            external_id: None,
            onesignal_id: None,
            timestamp: None,
            payload: None,
        }
    }
}