Skip to main content

onesignal_rust_api/models/
get_notification_history_request_body.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
11
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct GetNotificationHistoryRequestBody {
15    /// -> \"sent\" - All the devices by player_id that were sent the specified notification_id.  Notifications targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. \"clicked\" - All the devices by `player_id` that clicked the specified notification_id.
16    #[serde(rename = "events", skip_serializing_if = "Option::is_none")]
17    pub events: Option<EventsType>,
18    /// The email address you would like the report sent.
19    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
20    pub email: Option<String>,
21    #[serde(rename = "app_id", skip_serializing_if = "Option::is_none")]
22    pub app_id: Option<String>,
23}
24
25impl GetNotificationHistoryRequestBody {
26    pub fn new() -> GetNotificationHistoryRequestBody {
27        GetNotificationHistoryRequestBody {
28            events: None,
29            email: None,
30            app_id: None,
31        }
32    }
33}
34
35/// -> \"sent\" - All the devices by player_id that were sent the specified notification_id.  Notifications targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. \"clicked\" - All the devices by `player_id` that clicked the specified notification_id.
36#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
37pub enum EventsType {
38    #[serde(rename = "sent")]
39    Sent,
40    #[serde(rename = "clicked")]
41    Clicked,
42}
43
44impl Default for EventsType {
45    fn default() -> EventsType {
46        Self::Sent
47    }
48}
49