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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
 * 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: 1.0.1
 * Contact: devrel@onesignal.com
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct NotificationTarget {
    /// The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] 
    #[serde(rename = "included_segments", skip_serializing_if = "Option::is_none")]
    pub included_segments: Option<Vec<String>>,
    /// Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] 
    #[serde(rename = "excluded_segments", skip_serializing_if = "Option::is_none")]
    pub excluded_segments: Option<Vec<String>>,
    /// relation = \">\" or \"<\" hours_ago = number of hours before or after the users last session. Example: \"1.1\" 
    #[serde(rename = "last_session", skip_serializing_if = "Option::is_none")]
    pub last_session: Option<String>,
    /// relation = \">\" or \"<\" hours_ago = number of hours before or after the users first session. Example: \"1.1\" 
    #[serde(rename = "first_session", skip_serializing_if = "Option::is_none")]
    pub first_session: Option<String>,
    /// relation = \">\", \"<\", \"=\" or \"!=\" value = number sessions. Example: \"1\" 
    #[serde(rename = "session_count", skip_serializing_if = "Option::is_none")]
    pub session_count: Option<String>,
    /// relation = \">\", \"<\", \"=\" or \"!=\" value = Time in seconds the user has been in your app. Example: \"3600\" 
    #[serde(rename = "session_time", skip_serializing_if = "Option::is_none")]
    pub session_time: Option<String>,
    /// relation = \">\", \"<\", or \"=\" value = Amount in USD a user has spent on IAP (In App Purchases). Example: \"0.99\" 
    #[serde(rename = "amount_spent", skip_serializing_if = "Option::is_none")]
    pub amount_spent: Option<String>,
    /// relation = \">\", \"<\" or \"=\" key = SKU purchased in your app as an IAP (In App Purchases). Example: \"com.domain.100coinpack\" value = value of SKU to compare to. Example: \"0.99\" 
    #[serde(rename = "bought_sku", skip_serializing_if = "Option::is_none")]
    pub bought_sku: Option<String>,
    /// relation = \">\", \"<\", \"=\", \"!=\", \"exists\", \"not_exists\", \"time_elapsed_gt\" (paid plan only) or \"time_elapsed_lt\" (paid plan only) See Time Operators key = Tag key to compare. value = Tag value to compare. Not required for \"exists\" or \"not_exists\". Example: See Formatting Filters 
    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
    pub tag: Option<String>,
    /// relation = \"=\" or \"!=\" value = 2 character language code. Example: \"en\". For a list of all language codes see Language & Localization. 
    #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
    pub language: Option<String>,
    /// relation = \">\", \"<\", \"=\" or \"!=\" value = app version. Example: \"1.0.0\" 
    #[serde(rename = "app_version", skip_serializing_if = "Option::is_none")]
    pub app_version: Option<String>,
    /// radius = in meters lat = latitude long = longitude 
    #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
    pub location: Option<String>,
    /// value = email address Only for sending Push Notifications Use this for targeting push subscribers associated with an email set with all SDK setEmail methods To send emails to specific email addresses use include_email_tokens parameter 
    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    /// relation = \"=\" value = 2-digit Country code Example: \"field\": \"country\", \"relation\": \"=\", \"value\", \"US\" 
    #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
    pub country: Option<String>,
    /// Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call 
    #[serde(rename = "include_player_ids", skip_serializing_if = "Option::is_none")]
    pub include_player_ids: Option<Vec<String>>,
    /// Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. 
    #[serde(rename = "include_external_user_ids", skip_serializing_if = "Option::is_none")]
    pub include_external_user_ids: Option<Vec<String>>,
    /// Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call 
    #[serde(rename = "include_email_tokens", skip_serializing_if = "Option::is_none")]
    pub include_email_tokens: Option<Vec<String>>,
    /// Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call 
    #[serde(rename = "include_phone_numbers", skip_serializing_if = "Option::is_none")]
    pub include_phone_numbers: Option<Vec<String>>,
    /// Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call 
    #[serde(rename = "include_ios_tokens", skip_serializing_if = "Option::is_none")]
    pub include_ios_tokens: Option<Vec<String>>,
    /// Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call 
    #[serde(rename = "include_wp_wns_uris", skip_serializing_if = "Option::is_none")]
    pub include_wp_wns_uris: Option<Vec<String>>,
    /// Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call 
    #[serde(rename = "include_amazon_reg_ids", skip_serializing_if = "Option::is_none")]
    pub include_amazon_reg_ids: Option<Vec<String>>,
    /// Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call 
    #[serde(rename = "include_chrome_reg_ids", skip_serializing_if = "Option::is_none")]
    pub include_chrome_reg_ids: Option<Vec<String>>,
    /// Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call 
    #[serde(rename = "include_chrome_web_reg_ids", skip_serializing_if = "Option::is_none")]
    pub include_chrome_web_reg_ids: Option<Vec<String>>,
    /// Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call 
    #[serde(rename = "include_android_reg_ids", skip_serializing_if = "Option::is_none")]
    pub include_android_reg_ids: Option<Vec<String>>,
}

impl NotificationTarget {
    pub fn new() -> NotificationTarget {
        NotificationTarget {
            included_segments: None,
            excluded_segments: None,
            last_session: None,
            first_session: None,
            session_count: None,
            session_time: None,
            amount_spent: None,
            bought_sku: None,
            tag: None,
            language: None,
            app_version: None,
            location: None,
            email: None,
            country: None,
            include_player_ids: None,
            include_external_user_ids: None,
            include_email_tokens: None,
            include_phone_numbers: None,
            include_ios_tokens: None,
            include_wp_wns_uris: None,
            include_amazon_reg_ids: None,
            include_chrome_reg_ids: None,
            include_chrome_web_reg_ids: None,
            include_android_reg_ids: None,
        }
    }
}