Skip to main content

onesignal_rust_api/models/
notification_with_meta.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 NotificationWithMeta {
15    /// 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\"] 
16    #[serde(rename = "included_segments", skip_serializing_if = "Option::is_none")]
17    pub included_segments: Option<Vec<String>>,
18    /// 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\"] 
19    #[serde(rename = "excluded_segments", skip_serializing_if = "Option::is_none")]
20    pub excluded_segments: Option<Vec<String>>,
21    /// Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call 
22    #[serde(rename = "include_subscription_ids", skip_serializing_if = "Option::is_none")]
23    pub include_subscription_ids: Option<Vec<String>>,
24    /// Deprecated alias for `email_to`. 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. Prefer `email_to` in new integrations. 
25    #[serde(rename = "include_email_tokens", skip_serializing_if = "Option::is_none")]
26    pub include_email_tokens: Option<Vec<String>>,
27    /// 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. Supersedes the deprecated `include_email_tokens` field. 
28    #[serde(rename = "email_to", skip_serializing_if = "Option::is_none")]
29    pub email_to: Option<Vec<String>>,
30    /// 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 
31    #[serde(rename = "include_phone_numbers", skip_serializing_if = "Option::is_none")]
32    pub include_phone_numbers: Option<Vec<String>>,
33    /// Not Recommended: Please consider using include_subscription_ids or include_aliases 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 
34    #[serde(rename = "include_ios_tokens", skip_serializing_if = "Option::is_none")]
35    pub include_ios_tokens: Option<Vec<String>>,
36    /// Not Recommended: Please consider using include_subscription_ids or include_aliases 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 
37    #[serde(rename = "include_wp_wns_uris", skip_serializing_if = "Option::is_none")]
38    pub include_wp_wns_uris: Option<Vec<String>>,
39    /// Not Recommended: Please consider using include_subscription_ids or include_aliases 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 
40    #[serde(rename = "include_amazon_reg_ids", skip_serializing_if = "Option::is_none")]
41    pub include_amazon_reg_ids: Option<Vec<String>>,
42    /// Not Recommended: Please consider using include_subscription_ids or include_aliases 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 
43    #[serde(rename = "include_chrome_reg_ids", skip_serializing_if = "Option::is_none")]
44    pub include_chrome_reg_ids: Option<Vec<String>>,
45    /// Not Recommended: Please consider using include_subscription_ids or include_aliases 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 
46    #[serde(rename = "include_chrome_web_reg_ids", skip_serializing_if = "Option::is_none")]
47    pub include_chrome_web_reg_ids: Option<Vec<String>>,
48    /// Not Recommended: Please consider using include_subscription_ids or include_aliases 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 
49    #[serde(rename = "include_android_reg_ids", skip_serializing_if = "Option::is_none")]
50    pub include_android_reg_ids: Option<Vec<String>>,
51    /// Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Keys must match API spellings exactly (for example the label for External ID is the string `external_id`; arbitrary keys such as camelCase variants are not aliases and may yield no recipients). Not compatible with any other targeting parameters. 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 target_channel to indicate you are sending a push or email or sms.
52    #[serde(rename = "include_aliases", skip_serializing_if = "Option::is_none")]
53    pub include_aliases: Option<::std::collections::HashMap<String, Vec<String>>>,
54    #[serde(rename = "target_channel", skip_serializing_if = "Option::is_none")]
55    pub target_channel: Option<TargetChannelType>,
56    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
57    pub id: Option<String>,
58    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
59    pub value: Option<i32>,
60    /// Required for SMS Messages. An identifier for tracking message within the OneSignal dashboard or export analytics. Not shown to end user.
61    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
62    pub name: Option<String>,
63    #[serde(rename = "aggregation", skip_serializing_if = "Option::is_none")]
64    pub aggregation: Option<AggregationType>,
65    /// Indicates whether to send to all devices registered under your app's Apple iOS platform.
66    #[serde(rename = "isIos", skip_serializing_if = "Option::is_none")]
67    pub is_ios: Option<bool>,
68    /// Indicates whether to send to all devices registered under your app's Google Android platform.
69    #[serde(rename = "isAndroid", skip_serializing_if = "Option::is_none")]
70    pub is_android: Option<bool>,
71    /// Indicates whether to send to all devices registered under your app's Huawei Android platform.
72    #[serde(rename = "isHuawei", skip_serializing_if = "Option::is_none")]
73    pub is_huawei: Option<bool>,
74    /// Indicates whether to send to all subscribed web browser users, including Chrome, Firefox, and Safari. You may use this instead as a combined flag instead of separately enabling isChromeWeb, isFirefox, and isSafari, though the three options are equivalent to this one. 
75    #[serde(rename = "isAnyWeb", skip_serializing_if = "Option::is_none")]
76    pub is_any_web: Option<bool>,
77    /// Indicates whether to send to all Google Chrome, Chrome on Android, and Mozilla Firefox users registered under your Chrome & Firefox web push platform.
78    #[serde(rename = "isChromeWeb", skip_serializing_if = "Option::is_none")]
79    pub is_chrome_web: Option<bool>,
80    /// Indicates whether to send to all Mozilla Firefox desktop users registered under your Firefox web push platform.
81    #[serde(rename = "isFirefox", skip_serializing_if = "Option::is_none")]
82    pub is_firefox: Option<bool>,
83    /// Does not support iOS Safari. Indicates whether to send to all Apple's Safari desktop users registered under your Safari web push platform. Read more iOS Safari
84    #[serde(rename = "isSafari", skip_serializing_if = "Option::is_none")]
85    pub is_safari: Option<bool>,
86    /// Indicates whether to send to all devices registered under your app's Windows platform.
87    #[serde(rename = "isWP_WNS", skip_serializing_if = "Option::is_none")]
88    pub is_wp_wns: Option<bool>,
89    /// Indicates whether to send to all devices registered under your app's Amazon Fire platform.
90    #[serde(rename = "isAdm", skip_serializing_if = "Option::is_none")]
91    pub is_adm: Option<bool>,
92    /// This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. 
93    #[serde(rename = "isChrome", skip_serializing_if = "Option::is_none")]
94    pub is_chrome: Option<bool>,
95    /// Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. 
96    #[serde(rename = "app_id")]
97    pub app_id: String,
98    /// This field does **not** target users by their External ID. To send to External IDs, use `include_aliases` with the label `external_id` plus `target_channel` as documented for alias-based targeting.  [DEPRECATED] Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again.   See Idempotent Notification Requests for more details writeOnly: true 
99    #[serde(rename = "external_id", skip_serializing_if = "Option::is_none")]
100    pub external_id: Option<String>,
101    /// Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again.   See Idempotent Notification Requests for more details writeOnly: true 
102    #[serde(rename = "idempotency_key", skip_serializing_if = "Option::is_none")]
103    pub idempotency_key: Option<String>,
104    #[serde(rename = "contents", skip_serializing_if = "Option::is_none")]
105    pub contents: Option<Box<crate::models::LanguageStringMap>>,
106    #[serde(rename = "headings", skip_serializing_if = "Option::is_none")]
107    pub headings: Option<Box<crate::models::LanguageStringMap>>,
108    #[serde(rename = "subtitle", skip_serializing_if = "Option::is_none")]
109    pub subtitle: Option<Box<crate::models::LanguageStringMap>>,
110    /// Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: {\"abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1} 
111    #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
112    pub data: Option<serde_json::Value>,
113    /// Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications. 
114    #[serde(rename = "huawei_msg_type", skip_serializing_if = "Option::is_none")]
115    pub huawei_msg_type: Option<String>,
116    /// Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including web_url or app_url Example: https://onesignal.com 
117    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
118    pub url: Option<String>,
119    /// Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms. Including Chrome, Firefox, Safari, Opera, etc. Example: https://onesignal.com 
120    #[serde(rename = "web_url", skip_serializing_if = "Option::is_none")]
121    pub web_url: Option<String>,
122    /// Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms. Including iOS, Android, macOS, Windows, ChromeApps, etc. Example: https://onesignal.com 
123    #[serde(rename = "app_url", skip_serializing_if = "Option::is_none")]
124    pub app_url: Option<String>,
125    /// Channel: Push Notifications Platform: iOS 10+ Adds media attachments to notifications. Set as JSON object, key as a media id of your choice and the value as a valid local filename or URL. User must press and hold on the notification to view. Do not set mutable_content to download attachments. The OneSignal SDK does this automatically Example: {\"id1\": \"https://domain.com/image.jpg\"} 
126    #[serde(rename = "ios_attachments", skip_serializing_if = "Option::is_none")]
127    pub ios_attachments: Option<serde_json::Value>,
128    /// Channel: Push Notifications Platform: All Use a template you setup on our dashboard. The template_id is the UUID found in the URL when viewing a template on our dashboard. Example: be4a8044-bbd6-11e4-a581-000c2940e62c 
129    #[serde(rename = "template_id", skip_serializing_if = "Option::is_none")]
130    pub template_id: Option<String>,
131    /// Channel: Push Notifications Platform: iOS Sending true wakes your app from background to run custom native code (Apple interprets this as content-available=1). Note: Not applicable if the app is in the \"force-quit\" state (i.e app was swiped away). Omit the contents field to prevent displaying a visible notification. 
132    #[serde(rename = "content_available", skip_serializing_if = "Option::is_none")]
133    pub content_available: Option<bool>,
134    /// Channel: Push Notifications Platform: iOS 10+ Always defaults to true and cannot be turned off. Allows tracking of notification receives and changing of the notification content in your app before it is displayed. Triggers didReceive(_:withContentHandler:) on your UNNotificationServiceExtension. 
135    #[serde(rename = "mutable_content", skip_serializing_if = "Option::is_none")]
136    pub mutable_content: Option<bool>,
137    /// Channel: Push Notifications Platform: iOS 13+ Use to target a specific experience in your App Clip, or to target your notification to a specific window in a multi-scene App. 
138    #[serde(rename = "target_content_identifier", skip_serializing_if = "Option::is_none")]
139    pub target_content_identifier: Option<String>,
140    /// Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. 
141    #[serde(rename = "big_picture", skip_serializing_if = "Option::is_none")]
142    pub big_picture: Option<String>,
143    /// Channel: Push Notifications Platform: All Picture to display on all platforms that support it. Must be a URL to an image file. Platform-specific picture fields (big_picture, huawei_big_picture, adm_big_picture, chrome_web_image, ios_attachments, firefox_icon) take precedence over this value when set. 
144    #[serde(rename = "global_image", skip_serializing_if = "Option::is_none")]
145    pub global_image: Option<String>,
146    /// Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL. 
147    #[serde(rename = "huawei_big_picture", skip_serializing_if = "Option::is_none")]
148    pub huawei_big_picture: Option<String>,
149    /// Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL. 
150    #[serde(rename = "adm_big_picture", skip_serializing_if = "Option::is_none")]
151    pub adm_big_picture: Option<String>,
152    /// Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. 
153    #[serde(rename = "chrome_big_picture", skip_serializing_if = "Option::is_none")]
154    pub chrome_big_picture: Option<String>,
155    /// Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons. 
156    #[serde(rename = "chrome_web_image", skip_serializing_if = "Option::is_none")]
157    pub chrome_web_image: Option<String>,
158    /// Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: [{\"id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"}, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"}] 
159    #[serde(rename = "buttons", skip_serializing_if = "Option::is_none")]
160    pub buttons: Option<Vec<crate::models::Button>>,
161    /// Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] 
162    #[serde(rename = "web_buttons", skip_serializing_if = "Option::is_none")]
163    pub web_buttons: Option<Vec<crate::models::WebButton>>,
164    /// Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category. 
165    #[serde(rename = "ios_category", skip_serializing_if = "Option::is_none")]
166    pub ios_category: Option<String>,
167    /// Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. 
168    #[serde(rename = "android_channel_id", skip_serializing_if = "Option::is_none")]
169    pub android_channel_id: Option<String>,
170    /// Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. 
171    #[serde(rename = "huawei_channel_id", skip_serializing_if = "Option::is_none")]
172    pub huawei_channel_id: Option<String>,
173    /// Channel: Push Notifications Platform: Android Use this if you have client side Android Oreo Channels you have already defined in your app with code. 
174    #[serde(rename = "existing_android_channel_id", skip_serializing_if = "Option::is_none")]
175    pub existing_android_channel_id: Option<String>,
176    /// Channel: Push Notifications Platform: Huawei Use this if you have client side Android Oreo Channels you have already defined in your app with code. 
177    #[serde(rename = "huawei_existing_channel_id", skip_serializing_if = "Option::is_none")]
178    pub huawei_existing_channel_id: Option<String>,
179    #[serde(rename = "android_background_layout", skip_serializing_if = "Option::is_none")]
180    pub android_background_layout: Option<Box<crate::models::BasicNotificationAllOfAndroidBackgroundLayout>>,
181    /// Channel: Push Notifications Platform: Android Icon shown in the status bar and on the top left of the notification. If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name. See: How to create small icons 
182    #[serde(rename = "small_icon", skip_serializing_if = "Option::is_none")]
183    pub small_icon: Option<String>,
184    /// Channel: Push Notifications Platform: Huawei Icon shown in the status bar and on the top left of the notification. Use an Android resource path (E.g. /drawable/small_icon). Defaults to your app icon if not set. 
185    #[serde(rename = "huawei_small_icon", skip_serializing_if = "Option::is_none")]
186    pub huawei_small_icon: Option<String>,
187    /// Channel: Push Notifications Platform: Android Can be a drawable resource name or a URL. See: How to create large icons 
188    #[serde(rename = "large_icon", skip_serializing_if = "Option::is_none")]
189    pub large_icon: Option<String>,
190    /// Channel: Push Notifications Platform: Huawei Can be a drawable resource name or a URL. See: How to create large icons 
191    #[serde(rename = "huawei_large_icon", skip_serializing_if = "Option::is_none")]
192    pub huawei_large_icon: Option<String>,
193    /// Channel: Push Notifications Platform: Amazon If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name. See: How to create small icons 
194    #[serde(rename = "adm_small_icon", skip_serializing_if = "Option::is_none")]
195    pub adm_small_icon: Option<String>,
196    /// Channel: Push Notifications Platform: Amazon If blank the small_icon is used. Can be a drawable resource name or a URL. See: How to create large icons 
197    #[serde(rename = "adm_large_icon", skip_serializing_if = "Option::is_none")]
198    pub adm_large_icon: Option<String>,
199    /// Channel: Push Notifications Platform: Chrome Sets the web push notification's icon. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. Firefox will also use this icon, unless you specify firefox_icon. 
200    #[serde(rename = "chrome_web_icon", skip_serializing_if = "Option::is_none")]
201    pub chrome_web_icon: Option<String>,
202    /// Channel: Push Notifications Platform: Chrome Sets the web push notification icon for Android devices in the notification shade. Please see Web Push Notification Badge. 
203    #[serde(rename = "chrome_web_badge", skip_serializing_if = "Option::is_none")]
204    pub chrome_web_badge: Option<String>,
205    /// Channel: Push Notifications Platform: Firefox Not recommended Few people need to set Firefox-specific icons. We recommend setting chrome_web_icon instead, which Firefox will also use. Sets the web push notification's icon for Firefox. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. 
206    #[serde(rename = "firefox_icon", skip_serializing_if = "Option::is_none")]
207    pub firefox_icon: Option<String>,
208    /// Channel: Push Notifications Platform: ChromeApp This flag is not used for web push For web push, please see chrome_web_icon instead. The local URL to an icon to use. If blank, the app icon will be used. 
209    #[serde(rename = "chrome_icon", skip_serializing_if = "Option::is_none")]
210    pub chrome_icon: Option<String>,
211    /// Channel: Push Notifications Platform: iOS Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable vibration and sound for the notification. Example: \"notification.wav\" 
212    #[serde(rename = "ios_sound", skip_serializing_if = "Option::is_none")]
213    pub ios_sound: Option<String>,
214    /// Channel: Push Notifications Platform: Android &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" 
215    #[serde(rename = "android_sound", skip_serializing_if = "Option::is_none")]
216    pub android_sound: Option<String>,
217    /// Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path.  Example: \"/res/raw/notification\" 
218    #[serde(rename = "huawei_sound", skip_serializing_if = "Option::is_none")]
219    pub huawei_sound: Option<String>,
220    /// Channel: Push Notifications Platform: Amazon &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" 
221    #[serde(rename = "adm_sound", skip_serializing_if = "Option::is_none")]
222    pub adm_sound: Option<String>,
223    /// Channel: Push Notifications Platform: Windows Sound file that is included in your app to play instead of the default device notification sound. Example: \"notification.wav\" 
224    #[serde(rename = "wp_wns_sound", skip_serializing_if = "Option::is_none")]
225    pub wp_wns_sound: Option<String>,
226    /// Channel: Push Notifications Platform: Android &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): \"FF0000FF\" 
227    #[serde(rename = "android_led_color", skip_serializing_if = "Option::is_none")]
228    pub android_led_color: Option<String>,
229    /// Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): \"0000FF\" 
230    #[serde(rename = "huawei_led_color", skip_serializing_if = "Option::is_none")]
231    pub huawei_led_color: Option<String>,
232    /// Channel: Push Notifications Platform: Android Sets the background color of the notification circle to the left of the notification text. Only applies to apps targeting Android API level 21+ on Android 5.0+ devices. Example(Red): \"FFFF0000\" 
233    #[serde(rename = "android_accent_color", skip_serializing_if = "Option::is_none")]
234    pub android_accent_color: Option<String>,
235    /// Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device's theme color if not set. 
236    #[serde(rename = "huawei_accent_color", skip_serializing_if = "Option::is_none")]
237    pub huawei_accent_color: Option<String>,
238    /// Channel: Push Notifications Platform: Android 5.0_ &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) 
239    #[serde(rename = "android_visibility", skip_serializing_if = "Option::is_none")]
240    pub android_visibility: Option<i32>,
241    /// Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) 
242    #[serde(rename = "huawei_visibility", skip_serializing_if = "Option::is_none")]
243    pub huawei_visibility: Option<i32>,
244    /// Channel: Push Notifications Platform: iOS Describes whether to set or increase/decrease your app's iOS badge count by the ios_badgeCount specified count. Can specify None, SetTo, or Increase. `None` leaves the count unaffected. `SetTo` directly sets the badge count to the number specified in ios_badgeCount. `Increase` adds the number specified in ios_badgeCount to the total. Use a negative number to decrease the badge count. 
245    #[serde(rename = "ios_badgeType", skip_serializing_if = "Option::is_none")]
246    pub ios_badge_type: Option<String>,
247    /// Channel: Push Notifications Platform: iOS Used with ios_badgeType, describes the value to set or amount to increase/decrease your app's iOS badge count by. You can use a negative number to decrease the badge count when used with an ios_badgeType of Increase. 
248    #[serde(rename = "ios_badgeCount", skip_serializing_if = "Option::is_none")]
249    pub ios_badge_count: Option<i32>,
250    /// Channel: Push Notifications Platform: iOS 10+, Android Only one notification with the same id will be shown on the device. Use the same id to update an existing notification instead of showing a new one. Limit of 64 characters. 
251    #[serde(rename = "collapse_id", skip_serializing_if = "Option::is_none")]
252    pub collapse_id: Option<String>,
253    /// Channel: Push Notifications Platform: All Browsers Display multiple notifications at once with different topics. 
254    #[serde(rename = "web_push_topic", skip_serializing_if = "Option::is_none")]
255    pub web_push_topic: Option<String>,
256    /// Channel: Push Notifications Platform: iOS 10+ iOS can localize push notification messages on the client using special parameters such as loc-key. When using the Create Notification endpoint, you must include these parameters inside of a field called apns_alert. Please see Apple's guide on localizing push notifications to learn more. 
257    #[serde(rename = "apns_alert", skip_serializing_if = "Option::is_none")]
258    pub apns_alert: Option<serde_json::Value>,
259    /// Channel: All Possible values are: timezone (Deliver at a specific time-of-day in each users own timezone) last-active Same as Intelligent Delivery . (Deliver at the same time of day as each user last used your app). If send_after is used, this takes effect after the send_after time has elapsed. 
260    #[serde(rename = "delayed_option", skip_serializing_if = "Option::is_none")]
261    pub delayed_option: Option<String>,
262    /// Channel: All Use with delayed_option=timezone. Examples: \"9:00AM\" \"21:45\" \"9:45:30\" 
263    #[serde(rename = "delivery_time_of_day", skip_serializing_if = "Option::is_none")]
264    pub delivery_time_of_day: Option<String>,
265    /// Channel: Push Notifications Platform: iOS, Android, Chrome, Firefox, Safari, ChromeWeb Time To Live - In seconds. The notification will be expired if the device does not come back online within this time. The default is 259,200 seconds (3 days). Max value to set is 2419200 seconds (28 days). 
266    #[serde(rename = "ttl", skip_serializing_if = "Option::is_none")]
267    pub ttl: Option<i32>,
268    /// Channel: Push Notifications Platform: Android, Chrome, ChromeWeb Delivery priority through the push server (example GCM/FCM). Pass 10 for high priority or any other integer for normal priority. Defaults to normal priority for Android and high for iOS. For Android 6.0+ devices setting priority to high will wake the device out of doze mode. 
269    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
270    pub priority: Option<i32>,
271    /// Channel: Push Notifications Platform: iOS valid values: voip Set the value to voip for sending VoIP Notifications This field maps to the APNS header apns-push-type. Note: alert and background are automatically set by OneSignal 
272    #[serde(rename = "apns_push_type_override", skip_serializing_if = "Option::is_none")]
273    pub apns_push_type_override: Option<String>,
274    /// number of push notifications sent per minute. Paid Feature Only. If throttling is not enabled for the app or the notification, and for free accounts, null is returned. Refer to Throttling for more details.
275    #[serde(rename = "throttle_rate_per_minute", skip_serializing_if = "Option::is_none")]
276    pub throttle_rate_per_minute: Option<i32>,
277    /// Channel: Push Notifications Platform: Android Notifications with the same group will be stacked together using Android's Notification Grouping feature. 
278    #[serde(rename = "android_group", skip_serializing_if = "Option::is_none")]
279    pub android_group: Option<String>,
280    /// Channel: Push Notifications Platform: Android Note: This only works for Android 6 and older. Android 7+ allows full expansion of all message. Summary message to display when 2+ notifications are stacked together. Default is \"# new messages\". Include $[notif_count] in your message and it will be replaced with the current number. Languages - The value of each key is the message that will be sent to users for that language. \"en\" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. Read more: supported languages. Example: {\"en\": \"You have $[notif_count] new messages\"} 
281    #[serde(rename = "android_group_message", skip_serializing_if = "Option::is_none")]
282    pub android_group_message: Option<String>,
283    /// Channel: Push Notifications Platform: Amazon Notifications with the same group will be stacked together using Android's Notification Grouping feature. 
284    #[serde(rename = "adm_group", skip_serializing_if = "Option::is_none")]
285    pub adm_group: Option<String>,
286    /// Channel: Push Notifications Platform: Amazon Summary message to display when 2+ notifications are stacked together. Default is \"# new messages\". Include $[notif_count] in your message and it will be replaced with the current number. \"en\" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. The value of each key is the message that will be sent to users for that language. Example: {\"en\": \"You have $[notif_count] new messages\"} 
287    #[serde(rename = "adm_group_message", skip_serializing_if = "Option::is_none")]
288    pub adm_group_message: Option<serde_json::Value>,
289    /// Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. 
290    #[serde(rename = "thread_id", skip_serializing_if = "Option::is_none")]
291    pub thread_id: Option<String>,
292    /// Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" 
293    #[serde(rename = "summary_arg", skip_serializing_if = "Option::is_none")]
294    pub summary_arg: Option<String>,
295    /// Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" 
296    #[serde(rename = "summary_arg_count", skip_serializing_if = "Option::is_none")]
297    pub summary_arg_count: Option<i32>,
298    /// Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. 
299    #[serde(rename = "ios_relevance_score", skip_serializing_if = "Option::is_none")]
300    pub ios_relevance_score: Option<f32>,
301    /// Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. 
302    #[serde(rename = "ios_interruption_level", skip_serializing_if = "Option::is_none")]
303    pub ios_interruption_level: Option<String>,
304    /// Channel: Email Required.  The subject of the email. 
305    #[serde(rename = "email_subject", skip_serializing_if = "Option::is_none")]
306    pub email_subject: Option<String>,
307    /// Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. 
308    #[serde(rename = "email_body", skip_serializing_if = "Option::is_none")]
309    pub email_body: Option<String>,
310    /// Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. 
311    #[serde(rename = "email_from_name", skip_serializing_if = "Option::is_none")]
312    pub email_from_name: Option<String>,
313    /// Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings. 
314    #[serde(rename = "email_from_address", skip_serializing_if = "Option::is_none")]
315    pub email_from_address: Option<String>,
316    /// Channel: Email The email address where replies should be sent. If not specified, replies will go to the from address. 
317    #[serde(rename = "email_reply_to_address", skip_serializing_if = "Option::is_none")]
318    pub email_reply_to_address: Option<String>,
319    /// Channel: Email The preheader text of the email. Preheader is the preview text displayed immediately after an email subject that provides additional context about the email content. If not specified, will default to null. 
320    #[serde(rename = "email_preheader", skip_serializing_if = "Option::is_none")]
321    pub email_preheader: Option<String>,
322    /// Channel: Email Default is `false`. If set to `true`, the URLs sent within the email will not include link tracking and will be the same as originally set; otherwise, all the URLs in the email will be tracked.
323    #[serde(rename = "disable_email_click_tracking", skip_serializing_if = "Option::is_none")]
324    pub disable_email_click_tracking: Option<bool>,
325    /// Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared.
326    #[serde(rename = "include_unsubscribed", skip_serializing_if = "Option::is_none")]
327    pub include_unsubscribed: Option<bool>,
328    /// BCC recipients that were set on this email notification.
329    #[serde(rename = "email_bcc", skip_serializing_if = "Option::is_none")]
330    pub email_bcc: Option<Vec<String>>,
331    /// Channel: Email Sender domain to use for the email message. Overrides the default sender domain configured for the app. Only supported when the email service provider is OneSignal Email. 
332    #[serde(rename = "email_sender_domain", skip_serializing_if = "Option::is_none")]
333    pub email_sender_domain: Option<String>,
334    /// Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. 
335    #[serde(rename = "sms_from", skip_serializing_if = "Option::is_none")]
336    pub sms_from: Option<String>,
337    /// Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. 
338    #[serde(rename = "sms_media_urls", skip_serializing_if = "Option::is_none")]
339    pub sms_media_urls: Option<Vec<String>>,
340    #[serde(rename = "filters", skip_serializing_if = "Option::is_none")]
341    pub filters: Option<Vec<crate::models::FilterExpression>>,
342    /// Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} 
343    #[serde(rename = "custom_data", skip_serializing_if = "Option::is_none")]
344    pub custom_data: Option<serde_json::Value>,
345    /// Channel: Push Notifications Platform: Huawei Full path of the app entry activity class
346    #[serde(rename = "huawei_badge_class", skip_serializing_if = "Option::is_none")]
347    pub huawei_badge_class: Option<String>,
348    /// Channel: Push Notifications Platform: Huawei Accumulative badge number, which is an integer ranging from 1 to 99
349    #[serde(rename = "huawei_badge_add_num", skip_serializing_if = "Option::is_none")]
350    pub huawei_badge_add_num: Option<i32>,
351    /// Channel: Push Notifications Platform: Huawei Badge number, which is an integer ranging from 0 to 99
352    #[serde(rename = "huawei_badge_set_num", skip_serializing_if = "Option::is_none")]
353    pub huawei_badge_set_num: Option<i32>,
354    /// Channel: Push Notifications Platform: Huawei Category of the push notification for HMS classification.
355    #[serde(rename = "huawei_category", skip_serializing_if = "Option::is_none")]
356    pub huawei_category: Option<HuaweiCategoryType>,
357    /// Channel: Push Notifications Platform: Huawei A tag used for Huawei business intelligence and analytics.
358    #[serde(rename = "huawei_bi_tag", skip_serializing_if = "Option::is_none")]
359    pub huawei_bi_tag: Option<String>,
360    /// Number of notifications that were successfully delivered.
361    #[serde(rename = "successful", skip_serializing_if = "Option::is_none")]
362    pub successful: Option<i32>,
363    /// Number of notifications that could not be delivered due to those devices being unsubscribed.
364    #[serde(rename = "failed", skip_serializing_if = "Option::is_none")]
365    pub failed: Option<i32>,
366    /// Number of notifications that could not be delivered due to an error. You can find more information by viewing the notification in the dashboard.
367    #[serde(rename = "errored", skip_serializing_if = "Option::is_none")]
368    pub errored: Option<i32>,
369    /// Number of users who have clicked / tapped on your notification.
370    #[serde(rename = "converted", skip_serializing_if = "Option::is_none")]
371    pub converted: Option<i32>,
372    /// Confirmed Deliveries number of devices that received the push notification. Paid Feature Only. Free accounts will see 0.
373    #[serde(rename = "received", skip_serializing_if = "Option::is_none")]
374    pub received: Option<i32>,
375    #[serde(rename = "outcomes", skip_serializing_if = "Option::is_none")]
376    pub outcomes: Option<Vec<crate::models::OutcomeData>>,
377    /// Number of notifications that have not been sent out yet. This can mean either our system is still processing the notification or you have delayed options set.
378    #[serde(rename = "remaining", skip_serializing_if = "Option::is_none")]
379    pub remaining: Option<i32>,
380    /// Unix timestamp indicating when the notification was created.
381    #[serde(rename = "queued_at", skip_serializing_if = "Option::is_none")]
382    pub queued_at: Option<i64>,
383    /// Unix timestamp indicating when notification delivery should begin.
384    #[serde(rename = "send_after", skip_serializing_if = "Option::is_none")]
385    pub send_after: Option<i64>,
386    /// Unix timestamp indicating when notification delivery completed. The delivery duration from start to finish can be calculated with completed_at - send_after.
387    #[serde(rename = "completed_at", skip_serializing_if = "Option::is_none")]
388    pub completed_at: Option<i64>,
389    #[serde(rename = "platform_delivery_stats", skip_serializing_if = "Option::is_none")]
390    pub platform_delivery_stats: Option<Box<crate::models::PlatformDeliveryData>>,
391    /// Indicates whether the notification was canceled before it could be sent.
392    #[serde(rename = "canceled", skip_serializing_if = "Option::is_none")]
393    pub canceled: Option<bool>,
394    /// Number of BCC copies successfully sent for this notification.
395    #[serde(rename = "bcc_sent", skip_serializing_if = "Option::is_none")]
396    pub bcc_sent: Option<i32>,
397}
398
399impl NotificationWithMeta {
400    pub fn new(app_id: String) -> NotificationWithMeta {
401        NotificationWithMeta {
402            included_segments: None,
403            excluded_segments: None,
404            include_subscription_ids: None,
405            include_email_tokens: None,
406            email_to: None,
407            include_phone_numbers: None,
408            include_ios_tokens: None,
409            include_wp_wns_uris: None,
410            include_amazon_reg_ids: None,
411            include_chrome_reg_ids: None,
412            include_chrome_web_reg_ids: None,
413            include_android_reg_ids: None,
414            include_aliases: None,
415            target_channel: None,
416            id: None,
417            value: None,
418            name: None,
419            aggregation: None,
420            is_ios: None,
421            is_android: None,
422            is_huawei: None,
423            is_any_web: None,
424            is_chrome_web: None,
425            is_firefox: None,
426            is_safari: None,
427            is_wp_wns: None,
428            is_adm: None,
429            is_chrome: None,
430            app_id,
431            external_id: None,
432            idempotency_key: None,
433            contents: None,
434            headings: None,
435            subtitle: None,
436            data: None,
437            huawei_msg_type: None,
438            url: None,
439            web_url: None,
440            app_url: None,
441            ios_attachments: None,
442            template_id: None,
443            content_available: None,
444            mutable_content: None,
445            target_content_identifier: None,
446            big_picture: None,
447            global_image: None,
448            huawei_big_picture: None,
449            adm_big_picture: None,
450            chrome_big_picture: None,
451            chrome_web_image: None,
452            buttons: None,
453            web_buttons: None,
454            ios_category: None,
455            android_channel_id: None,
456            huawei_channel_id: None,
457            existing_android_channel_id: None,
458            huawei_existing_channel_id: None,
459            android_background_layout: None,
460            small_icon: None,
461            huawei_small_icon: None,
462            large_icon: None,
463            huawei_large_icon: None,
464            adm_small_icon: None,
465            adm_large_icon: None,
466            chrome_web_icon: None,
467            chrome_web_badge: None,
468            firefox_icon: None,
469            chrome_icon: None,
470            ios_sound: None,
471            android_sound: None,
472            huawei_sound: None,
473            adm_sound: None,
474            wp_wns_sound: None,
475            android_led_color: None,
476            huawei_led_color: None,
477            android_accent_color: None,
478            huawei_accent_color: None,
479            android_visibility: None,
480            huawei_visibility: None,
481            ios_badge_type: None,
482            ios_badge_count: None,
483            collapse_id: None,
484            web_push_topic: None,
485            apns_alert: None,
486            delayed_option: None,
487            delivery_time_of_day: None,
488            ttl: None,
489            priority: None,
490            apns_push_type_override: None,
491            throttle_rate_per_minute: None,
492            android_group: None,
493            android_group_message: None,
494            adm_group: None,
495            adm_group_message: None,
496            thread_id: None,
497            summary_arg: None,
498            summary_arg_count: None,
499            ios_relevance_score: None,
500            ios_interruption_level: None,
501            email_subject: None,
502            email_body: None,
503            email_from_name: None,
504            email_from_address: None,
505            email_reply_to_address: None,
506            email_preheader: None,
507            disable_email_click_tracking: None,
508            include_unsubscribed: None,
509            email_bcc: None,
510            email_sender_domain: None,
511            sms_from: None,
512            sms_media_urls: None,
513            filters: None,
514            custom_data: None,
515            huawei_badge_class: None,
516            huawei_badge_add_num: None,
517            huawei_badge_set_num: None,
518            huawei_category: None,
519            huawei_bi_tag: None,
520            successful: None,
521            failed: None,
522            errored: None,
523            converted: None,
524            received: None,
525            outcomes: None,
526            remaining: None,
527            queued_at: None,
528            send_after: None,
529            completed_at: None,
530            platform_delivery_stats: None,
531            canceled: None,
532            bcc_sent: None,
533        }
534    }
535}
536
537/// 
538#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
539pub enum TargetChannelType {
540    #[serde(rename = "push")]
541    Push,
542    #[serde(rename = "email")]
543    Email,
544    #[serde(rename = "sms")]
545    Sms,
546}
547
548impl Default for TargetChannelType {
549    fn default() -> TargetChannelType {
550        Self::Push
551    }
552}
553/// 
554#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
555pub enum AggregationType {
556    #[serde(rename = "sum")]
557    Sum,
558    #[serde(rename = "count")]
559    Count,
560}
561
562impl Default for AggregationType {
563    fn default() -> AggregationType {
564        Self::Sum
565    }
566}
567/// Channel: Push Notifications Platform: Huawei Category of the push notification for HMS classification.
568#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
569pub enum HuaweiCategoryType {
570    #[serde(rename = "IM")]
571    IM,
572    #[serde(rename = "VOIP")]
573    VOIP,
574    #[serde(rename = "SUBSCRIPTION")]
575    SUBSCRIPTION,
576    #[serde(rename = "TRAVEL")]
577    TRAVEL,
578    #[serde(rename = "HEALTH")]
579    HEALTH,
580    #[serde(rename = "WORK")]
581    WORK,
582    #[serde(rename = "ACCOUNT")]
583    ACCOUNT,
584    #[serde(rename = "EXPRESS")]
585    EXPRESS,
586    #[serde(rename = "FINANCE")]
587    FINANCE,
588    #[serde(rename = "DEVICE_REMINDER")]
589    DEVICEREMINDER,
590    #[serde(rename = "MAIL")]
591    MAIL,
592    #[serde(rename = "MARKETING")]
593    MARKETING,
594}
595
596impl Default for HuaweiCategoryType {
597    fn default() -> HuaweiCategoryType {
598        Self::IM
599    }
600}
601