1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* 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,
}
}
}