onesignal_rust_api/models/
outcome_data.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 * The version of the OpenAPI document: 1.4.1
7 * Contact: devrel@onesignal.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct OutcomeData {
16    #[serde(rename = "id")]
17    pub id: String,
18    #[serde(rename = "value")]
19    pub value: i32,
20    #[serde(rename = "aggregation")]
21    pub aggregation: AggregationType,
22}
23
24impl OutcomeData {
25    pub fn new(id: String, value: i32, aggregation: AggregationType) -> OutcomeData {
26        OutcomeData {
27            id,
28            value,
29            aggregation,
30        }
31    }
32}
33
34/// 
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum AggregationType {
37    #[serde(rename = "sum")]
38    Sum,
39    #[serde(rename = "count")]
40    Count,
41}
42
43impl Default for AggregationType {
44    fn default() -> AggregationType {
45        Self::Sum
46    }
47}
48