onesignal_sdk 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (233) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +31 -0
  3. data/Gemfile +9 -0
  4. data/LICENSE +24 -0
  5. data/README.md +210 -0
  6. data/RELEASE_INSTRUCTIONS.md +11 -0
  7. data/Rakefile +10 -0
  8. data/docs/App.md +84 -0
  9. data/docs/BasicNotification.md +228 -0
  10. data/docs/BasicNotificationAllOf.md +200 -0
  11. data/docs/BasicNotificationAllOfAndroidBackgroundLayout.md +22 -0
  12. data/docs/BeginLiveActivityRequest.md +20 -0
  13. data/docs/Button.md +22 -0
  14. data/docs/CancelNotificationSuccessResponse.md +18 -0
  15. data/docs/CreateNotificationSuccessResponse.md +24 -0
  16. data/docs/CreatePlayerSuccessResponse.md +20 -0
  17. data/docs/CreateSegmentConflictResponse.md +20 -0
  18. data/docs/CreateSegmentSuccessResponse.md +20 -0
  19. data/docs/CreateSubscriptionRequestBody.md +20 -0
  20. data/docs/CreateUserConflictResponse.md +18 -0
  21. data/docs/CreateUserConflictResponseErrorsInner.md +22 -0
  22. data/docs/CreateUserConflictResponseErrorsItemsMeta.md +18 -0
  23. data/docs/DefaultApi.md +2713 -0
  24. data/docs/DeletePlayerNotFoundResponse.md +18 -0
  25. data/docs/DeletePlayerSuccessResponse.md +18 -0
  26. data/docs/DeleteSegmentNotFoundResponse.md +18 -0
  27. data/docs/DeleteSegmentSuccessResponse.md +18 -0
  28. data/docs/DeliveryData.md +26 -0
  29. data/docs/ExportEventsSuccessResponse.md +18 -0
  30. data/docs/ExportPlayersRequestBody.md +22 -0
  31. data/docs/ExportPlayersSuccessResponse.md +18 -0
  32. data/docs/Filter.md +24 -0
  33. data/docs/FilterExpressions.md +26 -0
  34. data/docs/GenericError.md +18 -0
  35. data/docs/GenericErrorErrorsInner.md +20 -0
  36. data/docs/GetNotificationRequestBody.md +22 -0
  37. data/docs/InlineResponse200.md +18 -0
  38. data/docs/InlineResponse2003.md +18 -0
  39. data/docs/InlineResponse201.md +18 -0
  40. data/docs/InlineResponse202.md +18 -0
  41. data/docs/InvalidIdentifierError.md +20 -0
  42. data/docs/Notification.md +230 -0
  43. data/docs/Notification200Errors.md +49 -0
  44. data/docs/NotificationAllOf.md +18 -0
  45. data/docs/NotificationHistorySuccessResponse.md +20 -0
  46. data/docs/NotificationSlice.md +24 -0
  47. data/docs/NotificationTarget.md +44 -0
  48. data/docs/NotificationWithMeta.md +250 -0
  49. data/docs/NotificationWithMetaAllOf.md +38 -0
  50. data/docs/Operator.md +18 -0
  51. data/docs/OutcomeData.md +22 -0
  52. data/docs/OutcomesData.md +18 -0
  53. data/docs/PlatformDeliveryData.md +32 -0
  54. data/docs/PlatformDeliveryDataEmailAllOf.md +30 -0
  55. data/docs/PlatformDeliveryDataSmsAllOf.md +22 -0
  56. data/docs/Player.md +70 -0
  57. data/docs/PlayerNotificationTarget.md +40 -0
  58. data/docs/PlayerNotificationTargetIncludeAliases.md +18 -0
  59. data/docs/PlayerSlice.md +24 -0
  60. data/docs/PropertiesDeltas.md +22 -0
  61. data/docs/PropertiesObject.md +38 -0
  62. data/docs/Purchase.md +24 -0
  63. data/docs/RateLimiterError.md +18 -0
  64. data/docs/Segment.md +22 -0
  65. data/docs/SegmentNotificationTarget.md +20 -0
  66. data/docs/StringMap.md +102 -0
  67. data/docs/SubscriptionObject.md +50 -0
  68. data/docs/TransferSubscriptionRequestBody.md +18 -0
  69. data/docs/UpdateLiveActivityRequest.md +24 -0
  70. data/docs/UpdateLiveActivitySuccessResponse.md +20 -0
  71. data/docs/UpdatePlayerSuccessResponse.md +18 -0
  72. data/docs/UpdatePlayerTagsRequestBody.md +18 -0
  73. data/docs/UpdatePlayerTagsSuccessResponse.md +18 -0
  74. data/docs/UpdateSubscriptionRequestBody.md +18 -0
  75. data/docs/UpdateUserRequest.md +22 -0
  76. data/docs/User.md +24 -0
  77. data/docs/UserIdentityRequestBody.md +18 -0
  78. data/docs/UserIdentityResponse.md +18 -0
  79. data/docs/UserSubscriptionOptions.md +18 -0
  80. data/lib/onesignal/api/default_api.rb +2727 -0
  81. data/lib/onesignal/api_client.rb +393 -0
  82. data/lib/onesignal/api_error.rb +57 -0
  83. data/lib/onesignal/configuration.rb +245 -0
  84. data/lib/onesignal/models/app.rb +586 -0
  85. data/lib/onesignal/models/basic_notification.rb +1431 -0
  86. data/lib/onesignal/models/basic_notification_all_of.rb +1241 -0
  87. data/lib/onesignal/models/basic_notification_all_of_android_background_layout.rb +241 -0
  88. data/lib/onesignal/models/begin_live_activity_request.rb +238 -0
  89. data/lib/onesignal/models/button.rb +242 -0
  90. data/lib/onesignal/models/cancel_notification_success_response.rb +219 -0
  91. data/lib/onesignal/models/create_notification_success_response.rb +248 -0
  92. data/lib/onesignal/models/create_player_success_response.rb +228 -0
  93. data/lib/onesignal/models/create_segment_conflict_response.rb +230 -0
  94. data/lib/onesignal/models/create_segment_success_response.rb +229 -0
  95. data/lib/onesignal/models/create_subscription_request_body.rb +228 -0
  96. data/lib/onesignal/models/create_user_conflict_response.rb +221 -0
  97. data/lib/onesignal/models/create_user_conflict_response_errors_inner.rb +237 -0
  98. data/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb +219 -0
  99. data/lib/onesignal/models/delete_player_not_found_response.rb +219 -0
  100. data/lib/onesignal/models/delete_player_success_response.rb +219 -0
  101. data/lib/onesignal/models/delete_segment_not_found_response.rb +219 -0
  102. data/lib/onesignal/models/delete_segment_success_response.rb +219 -0
  103. data/lib/onesignal/models/delivery_data.rb +265 -0
  104. data/lib/onesignal/models/export_events_success_response.rb +219 -0
  105. data/lib/onesignal/models/export_players_request_body.rb +242 -0
  106. data/lib/onesignal/models/export_players_success_response.rb +219 -0
  107. data/lib/onesignal/models/filter.rb +294 -0
  108. data/lib/onesignal/models/filter_expressions.rb +336 -0
  109. data/lib/onesignal/models/generic_error.rb +221 -0
  110. data/lib/onesignal/models/generic_error_errors_inner.rb +228 -0
  111. data/lib/onesignal/models/get_notification_request_body.rb +273 -0
  112. data/lib/onesignal/models/inline_response200.rb +221 -0
  113. data/lib/onesignal/models/inline_response2003.rb +221 -0
  114. data/lib/onesignal/models/inline_response201.rb +219 -0
  115. data/lib/onesignal/models/inline_response202.rb +219 -0
  116. data/lib/onesignal/models/invalid_identifier_error.rb +234 -0
  117. data/lib/onesignal/models/notification.rb +1442 -0
  118. data/lib/onesignal/models/notification200_errors.rb +105 -0
  119. data/lib/onesignal/models/notification_all_of.rb +221 -0
  120. data/lib/onesignal/models/notification_history_success_response.rb +228 -0
  121. data/lib/onesignal/models/notification_slice.rb +248 -0
  122. data/lib/onesignal/models/notification_target.rb +429 -0
  123. data/lib/onesignal/models/notification_with_meta.rb +1546 -0
  124. data/lib/onesignal/models/notification_with_meta_all_of.rb +323 -0
  125. data/lib/onesignal/models/operator.rb +254 -0
  126. data/lib/onesignal/models/outcome_data.rb +286 -0
  127. data/lib/onesignal/models/outcomes_data.rb +221 -0
  128. data/lib/onesignal/models/platform_delivery_data.rb +285 -0
  129. data/lib/onesignal/models/platform_delivery_data_email_all_of.rb +287 -0
  130. data/lib/onesignal/models/platform_delivery_data_sms_all_of.rb +243 -0
  131. data/lib/onesignal/models/player.rb +494 -0
  132. data/lib/onesignal/models/player_notification_target.rb +385 -0
  133. data/lib/onesignal/models/player_notification_target_include_aliases.rb +221 -0
  134. data/lib/onesignal/models/player_slice.rb +248 -0
  135. data/lib/onesignal/models/properties_deltas.rb +239 -0
  136. data/lib/onesignal/models/properties_object.rb +313 -0
  137. data/lib/onesignal/models/purchase.rb +264 -0
  138. data/lib/onesignal/models/rate_limiter_error.rb +221 -0
  139. data/lib/onesignal/models/segment.rb +252 -0
  140. data/lib/onesignal/models/segment_notification_target.rb +234 -0
  141. data/lib/onesignal/models/string_map.rb +640 -0
  142. data/lib/onesignal/models/subscription_object.rb +397 -0
  143. data/lib/onesignal/models/transfer_subscription_request_body.rb +221 -0
  144. data/lib/onesignal/models/update_live_activity_request.rb +309 -0
  145. data/lib/onesignal/models/update_live_activity_success_response.rb +228 -0
  146. data/lib/onesignal/models/update_player_success_response.rb +219 -0
  147. data/lib/onesignal/models/update_player_tags_request_body.rb +220 -0
  148. data/lib/onesignal/models/update_player_tags_success_response.rb +219 -0
  149. data/lib/onesignal/models/update_subscription_request_body.rb +219 -0
  150. data/lib/onesignal/models/update_user_request.rb +239 -0
  151. data/lib/onesignal/models/user.rb +250 -0
  152. data/lib/onesignal/models/user_identity_request_body.rb +221 -0
  153. data/lib/onesignal/models/user_identity_response.rb +221 -0
  154. data/lib/onesignal/models/user_subscription_options.rb +219 -0
  155. data/lib/onesignal/version.rb +15 -0
  156. data/lib/onesignal.rb +111 -0
  157. data/onesignal.gemspec +38 -0
  158. data/spec/api/default_api_spec.rb +522 -0
  159. data/spec/api_client_spec.rb +226 -0
  160. data/spec/configuration_spec.rb +42 -0
  161. data/spec/models/app_spec.rb +236 -0
  162. data/spec/models/basic_notification_all_of_android_background_layout_spec.rb +46 -0
  163. data/spec/models/basic_notification_all_of_spec.rb +584 -0
  164. data/spec/models/basic_notification_spec.rb +672 -0
  165. data/spec/models/begin_live_activity_request_spec.rb +40 -0
  166. data/spec/models/button_spec.rb +46 -0
  167. data/spec/models/cancel_notification_success_response_spec.rb +34 -0
  168. data/spec/models/create_notification_success_response_spec.rb +52 -0
  169. data/spec/models/create_player_success_response_spec.rb +40 -0
  170. data/spec/models/create_segment_conflict_response_spec.rb +40 -0
  171. data/spec/models/create_segment_success_response_spec.rb +40 -0
  172. data/spec/models/create_subscription_request_body_spec.rb +40 -0
  173. data/spec/models/create_user_conflict_response_errors_inner_spec.rb +46 -0
  174. data/spec/models/create_user_conflict_response_errors_items_meta_spec.rb +34 -0
  175. data/spec/models/create_user_conflict_response_spec.rb +34 -0
  176. data/spec/models/delete_player_not_found_response_spec.rb +34 -0
  177. data/spec/models/delete_player_success_response_spec.rb +34 -0
  178. data/spec/models/delete_segment_not_found_response_spec.rb +34 -0
  179. data/spec/models/delete_segment_success_response_spec.rb +34 -0
  180. data/spec/models/delivery_data_spec.rb +58 -0
  181. data/spec/models/export_events_success_response_spec.rb +34 -0
  182. data/spec/models/export_players_request_body_spec.rb +46 -0
  183. data/spec/models/export_players_success_response_spec.rb +34 -0
  184. data/spec/models/filter_expressions_spec.rb +66 -0
  185. data/spec/models/filter_spec.rb +56 -0
  186. data/spec/models/generic_error_errors_inner_spec.rb +40 -0
  187. data/spec/models/generic_error_spec.rb +34 -0
  188. data/spec/models/get_notification_request_body_spec.rb +50 -0
  189. data/spec/models/inline_response2003_spec.rb +34 -0
  190. data/spec/models/inline_response200_spec.rb +34 -0
  191. data/spec/models/inline_response201_spec.rb +34 -0
  192. data/spec/models/inline_response202_spec.rb +34 -0
  193. data/spec/models/invalid_identifier_error_spec.rb +40 -0
  194. data/spec/models/notification200_errors_spec.rb +31 -0
  195. data/spec/models/notification_all_of_spec.rb +34 -0
  196. data/spec/models/notification_history_success_response_spec.rb +40 -0
  197. data/spec/models/notification_slice_spec.rb +52 -0
  198. data/spec/models/notification_spec.rb +678 -0
  199. data/spec/models/notification_target_spec.rb +116 -0
  200. data/spec/models/notification_with_meta_all_of_spec.rb +94 -0
  201. data/spec/models/notification_with_meta_spec.rb +738 -0
  202. data/spec/models/operator_spec.rb +38 -0
  203. data/spec/models/outcome_data_spec.rb +50 -0
  204. data/spec/models/outcomes_data_spec.rb +34 -0
  205. data/spec/models/platform_delivery_data_email_all_of_spec.rb +70 -0
  206. data/spec/models/platform_delivery_data_sms_all_of_spec.rb +46 -0
  207. data/spec/models/platform_delivery_data_spec.rb +76 -0
  208. data/spec/models/player_notification_target_include_aliases_spec.rb +34 -0
  209. data/spec/models/player_notification_target_spec.rb +104 -0
  210. data/spec/models/player_slice_spec.rb +52 -0
  211. data/spec/models/player_spec.rb +190 -0
  212. data/spec/models/properties_deltas_spec.rb +46 -0
  213. data/spec/models/properties_object_spec.rb +94 -0
  214. data/spec/models/purchase_spec.rb +52 -0
  215. data/spec/models/rate_limiter_error_spec.rb +34 -0
  216. data/spec/models/segment_notification_target_spec.rb +40 -0
  217. data/spec/models/segment_spec.rb +46 -0
  218. data/spec/models/string_map_spec.rb +286 -0
  219. data/spec/models/subscription_object_spec.rb +134 -0
  220. data/spec/models/transfer_subscription_request_body_spec.rb +34 -0
  221. data/spec/models/update_live_activity_request_spec.rb +60 -0
  222. data/spec/models/update_live_activity_success_response_spec.rb +40 -0
  223. data/spec/models/update_player_success_response_spec.rb +34 -0
  224. data/spec/models/update_player_tags_request_body_spec.rb +34 -0
  225. data/spec/models/update_player_tags_success_response_spec.rb +34 -0
  226. data/spec/models/update_subscription_request_body_spec.rb +34 -0
  227. data/spec/models/update_user_request_spec.rb +46 -0
  228. data/spec/models/user_identity_request_body_spec.rb +34 -0
  229. data/spec/models/user_identity_response_spec.rb +34 -0
  230. data/spec/models/user_spec.rb +52 -0
  231. data/spec/models/user_subscription_options_spec.rb +34 -0
  232. data/spec/spec_helper.rb +111 -0
  233. metadata +389 -0
@@ -0,0 +1,1546 @@
1
+ =begin
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.2.2
7
+ Contact: devrel@onesignal.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OneSignal
17
+ class NotificationWithMeta
18
+ # 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\"]
19
+ attr_accessor :included_segments
20
+
21
+ # 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\"]
22
+ attr_accessor :excluded_segments
23
+
24
+ # 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
25
+ attr_accessor :include_player_ids
26
+
27
+ # 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.
28
+ attr_accessor :include_external_user_ids
29
+
30
+ # 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
31
+ attr_accessor :include_email_tokens
32
+
33
+ # 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
34
+ attr_accessor :include_phone_numbers
35
+
36
+ # 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
37
+ attr_accessor :include_ios_tokens
38
+
39
+ # 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
40
+ attr_accessor :include_wp_wns_uris
41
+
42
+ # 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
43
+ attr_accessor :include_amazon_reg_ids
44
+
45
+ # 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
46
+ attr_accessor :include_chrome_reg_ids
47
+
48
+ # 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
49
+ attr_accessor :include_chrome_web_reg_ids
50
+
51
+ # 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
52
+ attr_accessor :include_android_reg_ids
53
+
54
+ attr_accessor :include_aliases
55
+
56
+ attr_accessor :target_channel
57
+
58
+ attr_accessor :id
59
+
60
+ attr_accessor :value
61
+
62
+ # Required for SMS Messages. An identifier for tracking message within the OneSignal dashboard or export analytics. Not shown to end user.
63
+ attr_accessor :name
64
+
65
+ attr_accessor :aggregation
66
+
67
+ # Indicates whether to send to all devices registered under your app's Apple iOS platform.
68
+ attr_accessor :is_ios
69
+
70
+ # Indicates whether to send to all devices registered under your app's Google Android platform.
71
+ attr_accessor :is_android
72
+
73
+ # Indicates whether to send to all devices registered under your app's Huawei Android platform.
74
+ attr_accessor :is_huawei
75
+
76
+ # 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.
77
+ attr_accessor :is_any_web
78
+
79
+ # Indicates whether to send to all Google Chrome, Chrome on Android, and Mozilla Firefox users registered under your Chrome & Firefox web push platform.
80
+ attr_accessor :is_chrome_web
81
+
82
+ # Indicates whether to send to all Mozilla Firefox desktop users registered under your Firefox web push platform.
83
+ attr_accessor :is_firefox
84
+
85
+ # 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
86
+ attr_accessor :is_safari
87
+
88
+ # Indicates whether to send to all devices registered under your app's Windows platform.
89
+ attr_accessor :is_wp_wns
90
+
91
+ # Indicates whether to send to all devices registered under your app's Amazon Fire platform.
92
+ attr_accessor :is_adm
93
+
94
+ # 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.
95
+ attr_accessor :is_chrome
96
+
97
+ # Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS.
98
+ attr_accessor :channel_for_external_user_ids
99
+
100
+ # 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.
101
+ attr_accessor :app_id
102
+
103
+ # 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
104
+ attr_accessor :external_id
105
+
106
+ attr_accessor :contents
107
+
108
+ attr_accessor :headings
109
+
110
+ attr_accessor :subtitle
111
+
112
+ # 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}
113
+ attr_accessor :data
114
+
115
+ # Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications.
116
+ attr_accessor :huawei_msg_type
117
+
118
+ # 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
119
+ attr_accessor :url
120
+
121
+ # 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
122
+ attr_accessor :web_url
123
+
124
+ # 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
125
+ attr_accessor :app_url
126
+
127
+ # 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\"}
128
+ attr_accessor :ios_attachments
129
+
130
+ # 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
131
+ attr_accessor :template_id
132
+
133
+ # 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.
134
+ attr_accessor :content_available
135
+
136
+ # 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.
137
+ attr_accessor :mutable_content
138
+
139
+ # 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.
140
+ attr_accessor :target_content_identifier
141
+
142
+ # Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL.
143
+ attr_accessor :big_picture
144
+
145
+ # Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL.
146
+ attr_accessor :huawei_big_picture
147
+
148
+ # Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL.
149
+ attr_accessor :adm_big_picture
150
+
151
+ # Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL.
152
+ attr_accessor :chrome_big_picture
153
+
154
+ # 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.
155
+ attr_accessor :chrome_web_image
156
+
157
+ # 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\"}]
158
+ attr_accessor :buttons
159
+
160
+ # 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\"}]
161
+ attr_accessor :web_buttons
162
+
163
+ # 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.
164
+ attr_accessor :ios_category
165
+
166
+ # 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.
167
+ attr_accessor :android_channel_id
168
+
169
+ # 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.
170
+ attr_accessor :huawei_channel_id
171
+
172
+ # Channel: Push Notifications Platform: Android Use this if you have client side Android Oreo Channels you have already defined in your app with code.
173
+ attr_accessor :existing_android_channel_id
174
+
175
+ # Channel: Push Notifications Platform: Huawei Use this if you have client side Android Oreo Channels you have already defined in your app with code.
176
+ attr_accessor :huawei_existing_channel_id
177
+
178
+ attr_accessor :android_background_layout
179
+
180
+ # 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
181
+ attr_accessor :small_icon
182
+
183
+ # 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.
184
+ attr_accessor :huawei_small_icon
185
+
186
+ # Channel: Push Notifications Platform: Android Can be a drawable resource name or a URL. See: How to create large icons
187
+ attr_accessor :large_icon
188
+
189
+ # Channel: Push Notifications Platform: Huawei Can be a drawable resource name or a URL. See: How to create large icons
190
+ attr_accessor :huawei_large_icon
191
+
192
+ # 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
193
+ attr_accessor :adm_small_icon
194
+
195
+ # 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
196
+ attr_accessor :adm_large_icon
197
+
198
+ # 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.
199
+ attr_accessor :chrome_web_icon
200
+
201
+ # Channel: Push Notifications Platform: Chrome Sets the web push notification icon for Android devices in the notification shade. Please see Web Push Notification Badge.
202
+ attr_accessor :chrome_web_badge
203
+
204
+ # 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.
205
+ attr_accessor :firefox_icon
206
+
207
+ # 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.
208
+ attr_accessor :chrome_icon
209
+
210
+ # 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\"
211
+ attr_accessor :ios_sound
212
+
213
+ # Channel: Push Notifications Platform: Android ⚠️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\"
214
+ attr_accessor :android_sound
215
+
216
+ # Channel: Push Notifications Platform: Huawei ⚠️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\"
217
+ attr_accessor :huawei_sound
218
+
219
+ # Channel: Push Notifications Platform: Amazon ⚠️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\"
220
+ attr_accessor :adm_sound
221
+
222
+ # 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\"
223
+ attr_accessor :wp_wns_sound
224
+
225
+ # Channel: Push Notifications Platform: Android ⚠️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\"
226
+ attr_accessor :android_led_color
227
+
228
+ # Channel: Push Notifications Platform: Huawei ⚠️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\"
229
+ attr_accessor :huawei_led_color
230
+
231
+ # 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\"
232
+ attr_accessor :android_accent_color
233
+
234
+ # 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.
235
+ attr_accessor :huawei_accent_color
236
+
237
+ # Channel: Push Notifications Platform: Android 5.0_ ⚠️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)
238
+ attr_accessor :android_visibility
239
+
240
+ # Channel: Push Notifications Platform: Huawei ⚠️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)
241
+ attr_accessor :huawei_visibility
242
+
243
+ # 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.
244
+ attr_accessor :ios_badge_type
245
+
246
+ # 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.
247
+ attr_accessor :ios_badge_count
248
+
249
+ # 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.
250
+ attr_accessor :collapse_id
251
+
252
+ # Channel: Push Notifications Platform: All Browsers Display multiple notifications at once with different topics.
253
+ attr_accessor :web_push_topic
254
+
255
+ # 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.
256
+ attr_accessor :apns_alert
257
+
258
+ # 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.
259
+ attr_accessor :delayed_option
260
+
261
+ # Channel: All Use with delayed_option=timezone. Examples: \"9:00AM\" \"21:45\" \"9:45:30\"
262
+ attr_accessor :delivery_time_of_day
263
+
264
+ # 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).
265
+ attr_accessor :ttl
266
+
267
+ # 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.
268
+ attr_accessor :priority
269
+
270
+ # 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
271
+ attr_accessor :apns_push_type_override
272
+
273
+ # 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.
274
+ attr_accessor :throttle_rate_per_minute
275
+
276
+ # Channel: Push Notifications Platform: Android Notifications with the same group will be stacked together using Android's Notification Grouping feature.
277
+ attr_accessor :android_group
278
+
279
+ # 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\"}
280
+ attr_accessor :android_group_message
281
+
282
+ # Channel: Push Notifications Platform: Amazon Notifications with the same group will be stacked together using Android's Notification Grouping feature.
283
+ attr_accessor :adm_group
284
+
285
+ # 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\"}
286
+ attr_accessor :adm_group_message
287
+
288
+ # 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.
289
+ attr_accessor :thread_id
290
+
291
+ # 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\"
292
+ attr_accessor :summary_arg
293
+
294
+ # 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\"
295
+ attr_accessor :summary_arg_count
296
+
297
+ # Channel: Email Required. The subject of the email.
298
+ attr_accessor :email_subject
299
+
300
+ # 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.
301
+ attr_accessor :email_body
302
+
303
+ # Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings.
304
+ attr_accessor :email_from_name
305
+
306
+ # Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings.
307
+ attr_accessor :email_from_address
308
+
309
+ # 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.
310
+ attr_accessor :email_preheader
311
+
312
+ # 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.
313
+ attr_accessor :include_unsubscribed
314
+
315
+ # Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format.
316
+ attr_accessor :sms_from
317
+
318
+ # 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.
319
+ attr_accessor :sms_media_urls
320
+
321
+ attr_accessor :filters
322
+
323
+ # 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}
324
+ attr_accessor :custom_data
325
+
326
+ # Number of notifications that were successfully delivered.
327
+ attr_accessor :successful
328
+
329
+ # Number of notifications that could not be delivered due to those devices being unsubscribed.
330
+ attr_accessor :failed
331
+
332
+ # Number of notifications that could not be delivered due to an error. You can find more information by viewing the notification in the dashboard.
333
+ attr_accessor :errored
334
+
335
+ # Number of users who have clicked / tapped on your notification.
336
+ attr_accessor :converted
337
+
338
+ # Confirmed Deliveries number of devices that received the push notification. Paid Feature Only. Free accounts will see 0.
339
+ attr_accessor :received
340
+
341
+ attr_accessor :outcomes
342
+
343
+ # 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.
344
+ attr_accessor :remaining
345
+
346
+ # Unix timestamp indicating when the notification was created.
347
+ attr_accessor :queued_at
348
+
349
+ # Unix timestamp indicating when notification delivery should begin.
350
+ attr_accessor :send_after
351
+
352
+ # Unix timestamp indicating when notification delivery completed. The delivery duration from start to finish can be calculated with completed_at - send_after.
353
+ attr_accessor :completed_at
354
+
355
+ attr_accessor :platform_delivery_stats
356
+
357
+ class EnumAttributeValidator
358
+ attr_reader :datatype
359
+ attr_reader :allowable_values
360
+
361
+ def initialize(datatype, allowable_values)
362
+ @allowable_values = allowable_values.map do |value|
363
+ case datatype.to_s
364
+ when /Integer/i
365
+ value.to_i
366
+ when /Float/i
367
+ value.to_f
368
+ else
369
+ value
370
+ end
371
+ end
372
+ end
373
+
374
+ def valid?(value)
375
+ !value || allowable_values.include?(value)
376
+ end
377
+ end
378
+
379
+ # Attribute mapping from ruby-style variable name to JSON key.
380
+ def self.attribute_map
381
+ {
382
+ :'included_segments' => :'included_segments',
383
+ :'excluded_segments' => :'excluded_segments',
384
+ :'include_player_ids' => :'include_player_ids',
385
+ :'include_external_user_ids' => :'include_external_user_ids',
386
+ :'include_email_tokens' => :'include_email_tokens',
387
+ :'include_phone_numbers' => :'include_phone_numbers',
388
+ :'include_ios_tokens' => :'include_ios_tokens',
389
+ :'include_wp_wns_uris' => :'include_wp_wns_uris',
390
+ :'include_amazon_reg_ids' => :'include_amazon_reg_ids',
391
+ :'include_chrome_reg_ids' => :'include_chrome_reg_ids',
392
+ :'include_chrome_web_reg_ids' => :'include_chrome_web_reg_ids',
393
+ :'include_android_reg_ids' => :'include_android_reg_ids',
394
+ :'include_aliases' => :'include_aliases',
395
+ :'target_channel' => :'target_channel',
396
+ :'id' => :'id',
397
+ :'value' => :'value',
398
+ :'name' => :'name',
399
+ :'aggregation' => :'aggregation',
400
+ :'is_ios' => :'isIos',
401
+ :'is_android' => :'isAndroid',
402
+ :'is_huawei' => :'isHuawei',
403
+ :'is_any_web' => :'isAnyWeb',
404
+ :'is_chrome_web' => :'isChromeWeb',
405
+ :'is_firefox' => :'isFirefox',
406
+ :'is_safari' => :'isSafari',
407
+ :'is_wp_wns' => :'isWP_WNS',
408
+ :'is_adm' => :'isAdm',
409
+ :'is_chrome' => :'isChrome',
410
+ :'channel_for_external_user_ids' => :'channel_for_external_user_ids',
411
+ :'app_id' => :'app_id',
412
+ :'external_id' => :'external_id',
413
+ :'contents' => :'contents',
414
+ :'headings' => :'headings',
415
+ :'subtitle' => :'subtitle',
416
+ :'data' => :'data',
417
+ :'huawei_msg_type' => :'huawei_msg_type',
418
+ :'url' => :'url',
419
+ :'web_url' => :'web_url',
420
+ :'app_url' => :'app_url',
421
+ :'ios_attachments' => :'ios_attachments',
422
+ :'template_id' => :'template_id',
423
+ :'content_available' => :'content_available',
424
+ :'mutable_content' => :'mutable_content',
425
+ :'target_content_identifier' => :'target_content_identifier',
426
+ :'big_picture' => :'big_picture',
427
+ :'huawei_big_picture' => :'huawei_big_picture',
428
+ :'adm_big_picture' => :'adm_big_picture',
429
+ :'chrome_big_picture' => :'chrome_big_picture',
430
+ :'chrome_web_image' => :'chrome_web_image',
431
+ :'buttons' => :'buttons',
432
+ :'web_buttons' => :'web_buttons',
433
+ :'ios_category' => :'ios_category',
434
+ :'android_channel_id' => :'android_channel_id',
435
+ :'huawei_channel_id' => :'huawei_channel_id',
436
+ :'existing_android_channel_id' => :'existing_android_channel_id',
437
+ :'huawei_existing_channel_id' => :'huawei_existing_channel_id',
438
+ :'android_background_layout' => :'android_background_layout',
439
+ :'small_icon' => :'small_icon',
440
+ :'huawei_small_icon' => :'huawei_small_icon',
441
+ :'large_icon' => :'large_icon',
442
+ :'huawei_large_icon' => :'huawei_large_icon',
443
+ :'adm_small_icon' => :'adm_small_icon',
444
+ :'adm_large_icon' => :'adm_large_icon',
445
+ :'chrome_web_icon' => :'chrome_web_icon',
446
+ :'chrome_web_badge' => :'chrome_web_badge',
447
+ :'firefox_icon' => :'firefox_icon',
448
+ :'chrome_icon' => :'chrome_icon',
449
+ :'ios_sound' => :'ios_sound',
450
+ :'android_sound' => :'android_sound',
451
+ :'huawei_sound' => :'huawei_sound',
452
+ :'adm_sound' => :'adm_sound',
453
+ :'wp_wns_sound' => :'wp_wns_sound',
454
+ :'android_led_color' => :'android_led_color',
455
+ :'huawei_led_color' => :'huawei_led_color',
456
+ :'android_accent_color' => :'android_accent_color',
457
+ :'huawei_accent_color' => :'huawei_accent_color',
458
+ :'android_visibility' => :'android_visibility',
459
+ :'huawei_visibility' => :'huawei_visibility',
460
+ :'ios_badge_type' => :'ios_badgeType',
461
+ :'ios_badge_count' => :'ios_badgeCount',
462
+ :'collapse_id' => :'collapse_id',
463
+ :'web_push_topic' => :'web_push_topic',
464
+ :'apns_alert' => :'apns_alert',
465
+ :'delayed_option' => :'delayed_option',
466
+ :'delivery_time_of_day' => :'delivery_time_of_day',
467
+ :'ttl' => :'ttl',
468
+ :'priority' => :'priority',
469
+ :'apns_push_type_override' => :'apns_push_type_override',
470
+ :'throttle_rate_per_minute' => :'throttle_rate_per_minute',
471
+ :'android_group' => :'android_group',
472
+ :'android_group_message' => :'android_group_message',
473
+ :'adm_group' => :'adm_group',
474
+ :'adm_group_message' => :'adm_group_message',
475
+ :'thread_id' => :'thread_id',
476
+ :'summary_arg' => :'summary_arg',
477
+ :'summary_arg_count' => :'summary_arg_count',
478
+ :'email_subject' => :'email_subject',
479
+ :'email_body' => :'email_body',
480
+ :'email_from_name' => :'email_from_name',
481
+ :'email_from_address' => :'email_from_address',
482
+ :'email_preheader' => :'email_preheader',
483
+ :'include_unsubscribed' => :'include_unsubscribed',
484
+ :'sms_from' => :'sms_from',
485
+ :'sms_media_urls' => :'sms_media_urls',
486
+ :'filters' => :'filters',
487
+ :'custom_data' => :'custom_data',
488
+ :'successful' => :'successful',
489
+ :'failed' => :'failed',
490
+ :'errored' => :'errored',
491
+ :'converted' => :'converted',
492
+ :'received' => :'received',
493
+ :'outcomes' => :'outcomes',
494
+ :'remaining' => :'remaining',
495
+ :'queued_at' => :'queued_at',
496
+ :'send_after' => :'send_after',
497
+ :'completed_at' => :'completed_at',
498
+ :'platform_delivery_stats' => :'platform_delivery_stats'
499
+ }
500
+ end
501
+
502
+ # Returns all the JSON keys this model knows about
503
+ def self.acceptable_attributes
504
+ attribute_map.values
505
+ end
506
+
507
+ # Attribute type mapping.
508
+ def self.openapi_types
509
+ {
510
+ :'included_segments' => :'Array<String>',
511
+ :'excluded_segments' => :'Array<String>',
512
+ :'include_player_ids' => :'Array<String>',
513
+ :'include_external_user_ids' => :'Array<String>',
514
+ :'include_email_tokens' => :'Array<String>',
515
+ :'include_phone_numbers' => :'Array<String>',
516
+ :'include_ios_tokens' => :'Array<String>',
517
+ :'include_wp_wns_uris' => :'Array<String>',
518
+ :'include_amazon_reg_ids' => :'Array<String>',
519
+ :'include_chrome_reg_ids' => :'Array<String>',
520
+ :'include_chrome_web_reg_ids' => :'Array<String>',
521
+ :'include_android_reg_ids' => :'Array<String>',
522
+ :'include_aliases' => :'PlayerNotificationTargetIncludeAliases',
523
+ :'target_channel' => :'String',
524
+ :'id' => :'String',
525
+ :'value' => :'Integer',
526
+ :'name' => :'String',
527
+ :'aggregation' => :'String',
528
+ :'is_ios' => :'Boolean',
529
+ :'is_android' => :'Boolean',
530
+ :'is_huawei' => :'Boolean',
531
+ :'is_any_web' => :'Boolean',
532
+ :'is_chrome_web' => :'Boolean',
533
+ :'is_firefox' => :'Boolean',
534
+ :'is_safari' => :'Boolean',
535
+ :'is_wp_wns' => :'Boolean',
536
+ :'is_adm' => :'Boolean',
537
+ :'is_chrome' => :'Boolean',
538
+ :'channel_for_external_user_ids' => :'String',
539
+ :'app_id' => :'String',
540
+ :'external_id' => :'String',
541
+ :'contents' => :'StringMap',
542
+ :'headings' => :'StringMap',
543
+ :'subtitle' => :'StringMap',
544
+ :'data' => :'Object',
545
+ :'huawei_msg_type' => :'String',
546
+ :'url' => :'String',
547
+ :'web_url' => :'String',
548
+ :'app_url' => :'String',
549
+ :'ios_attachments' => :'Object',
550
+ :'template_id' => :'String',
551
+ :'content_available' => :'Boolean',
552
+ :'mutable_content' => :'Boolean',
553
+ :'target_content_identifier' => :'String',
554
+ :'big_picture' => :'String',
555
+ :'huawei_big_picture' => :'String',
556
+ :'adm_big_picture' => :'String',
557
+ :'chrome_big_picture' => :'String',
558
+ :'chrome_web_image' => :'String',
559
+ :'buttons' => :'Array<Button>',
560
+ :'web_buttons' => :'Array<Button>',
561
+ :'ios_category' => :'String',
562
+ :'android_channel_id' => :'String',
563
+ :'huawei_channel_id' => :'String',
564
+ :'existing_android_channel_id' => :'String',
565
+ :'huawei_existing_channel_id' => :'String',
566
+ :'android_background_layout' => :'BasicNotificationAllOfAndroidBackgroundLayout',
567
+ :'small_icon' => :'String',
568
+ :'huawei_small_icon' => :'String',
569
+ :'large_icon' => :'String',
570
+ :'huawei_large_icon' => :'String',
571
+ :'adm_small_icon' => :'String',
572
+ :'adm_large_icon' => :'String',
573
+ :'chrome_web_icon' => :'String',
574
+ :'chrome_web_badge' => :'String',
575
+ :'firefox_icon' => :'String',
576
+ :'chrome_icon' => :'String',
577
+ :'ios_sound' => :'String',
578
+ :'android_sound' => :'String',
579
+ :'huawei_sound' => :'String',
580
+ :'adm_sound' => :'String',
581
+ :'wp_wns_sound' => :'String',
582
+ :'android_led_color' => :'String',
583
+ :'huawei_led_color' => :'String',
584
+ :'android_accent_color' => :'String',
585
+ :'huawei_accent_color' => :'String',
586
+ :'android_visibility' => :'Integer',
587
+ :'huawei_visibility' => :'Integer',
588
+ :'ios_badge_type' => :'String',
589
+ :'ios_badge_count' => :'Integer',
590
+ :'collapse_id' => :'String',
591
+ :'web_push_topic' => :'String',
592
+ :'apns_alert' => :'Object',
593
+ :'delayed_option' => :'String',
594
+ :'delivery_time_of_day' => :'String',
595
+ :'ttl' => :'Integer',
596
+ :'priority' => :'Integer',
597
+ :'apns_push_type_override' => :'String',
598
+ :'throttle_rate_per_minute' => :'Integer',
599
+ :'android_group' => :'String',
600
+ :'android_group_message' => :'String',
601
+ :'adm_group' => :'String',
602
+ :'adm_group_message' => :'Object',
603
+ :'thread_id' => :'String',
604
+ :'summary_arg' => :'String',
605
+ :'summary_arg_count' => :'Integer',
606
+ :'email_subject' => :'String',
607
+ :'email_body' => :'String',
608
+ :'email_from_name' => :'String',
609
+ :'email_from_address' => :'String',
610
+ :'email_preheader' => :'String',
611
+ :'include_unsubscribed' => :'Boolean',
612
+ :'sms_from' => :'String',
613
+ :'sms_media_urls' => :'Array<String>',
614
+ :'filters' => :'Array<Filter>',
615
+ :'custom_data' => :'Object',
616
+ :'successful' => :'Integer',
617
+ :'failed' => :'Integer',
618
+ :'errored' => :'Integer',
619
+ :'converted' => :'Integer',
620
+ :'received' => :'Integer',
621
+ :'outcomes' => :'Array<OutcomeData>',
622
+ :'remaining' => :'Integer',
623
+ :'queued_at' => :'Integer',
624
+ :'send_after' => :'Integer',
625
+ :'completed_at' => :'Integer',
626
+ :'platform_delivery_stats' => :'PlatformDeliveryData'
627
+ }
628
+ end
629
+
630
+ # List of attributes with nullable: true
631
+ def self.openapi_nullable
632
+ Set.new([
633
+ :'include_player_ids',
634
+ :'include_external_user_ids',
635
+ :'include_aliases',
636
+ :'name',
637
+ :'is_ios',
638
+ :'is_android',
639
+ :'is_huawei',
640
+ :'is_any_web',
641
+ :'is_chrome_web',
642
+ :'is_firefox',
643
+ :'is_safari',
644
+ :'is_wp_wns',
645
+ :'is_adm',
646
+ :'is_chrome',
647
+ :'external_id',
648
+ :'contents',
649
+ :'headings',
650
+ :'subtitle',
651
+ :'data',
652
+ :'huawei_msg_type',
653
+ :'url',
654
+ :'web_url',
655
+ :'app_url',
656
+ :'ios_attachments',
657
+ :'template_id',
658
+ :'content_available',
659
+ :'target_content_identifier',
660
+ :'big_picture',
661
+ :'huawei_big_picture',
662
+ :'adm_big_picture',
663
+ :'chrome_big_picture',
664
+ :'chrome_web_image',
665
+ :'buttons',
666
+ :'web_buttons',
667
+ :'ios_category',
668
+ :'huawei_channel_id',
669
+ :'huawei_existing_channel_id',
670
+ :'small_icon',
671
+ :'huawei_small_icon',
672
+ :'large_icon',
673
+ :'huawei_large_icon',
674
+ :'adm_small_icon',
675
+ :'adm_large_icon',
676
+ :'chrome_web_icon',
677
+ :'chrome_web_badge',
678
+ :'firefox_icon',
679
+ :'chrome_icon',
680
+ :'ios_sound',
681
+ :'android_sound',
682
+ :'huawei_sound',
683
+ :'adm_sound',
684
+ :'wp_wns_sound',
685
+ :'android_led_color',
686
+ :'huawei_led_color',
687
+ :'android_accent_color',
688
+ :'huawei_accent_color',
689
+ :'android_visibility',
690
+ :'huawei_visibility',
691
+ :'ios_badge_type',
692
+ :'ios_badge_count',
693
+ :'web_push_topic',
694
+ :'apns_alert',
695
+ :'delayed_option',
696
+ :'delivery_time_of_day',
697
+ :'ttl',
698
+ :'priority',
699
+ :'throttle_rate_per_minute',
700
+ :'android_group',
701
+ :'android_group_message',
702
+ :'adm_group',
703
+ :'adm_group_message',
704
+ :'thread_id',
705
+ :'email_subject',
706
+ :'email_from_name',
707
+ :'email_from_address',
708
+ :'email_preheader',
709
+ :'sms_from',
710
+ :'sms_media_urls',
711
+ :'filters',
712
+ :'custom_data',
713
+ :'received',
714
+ :'send_after',
715
+ :'completed_at',
716
+ ])
717
+ end
718
+
719
+ # List of class defined in allOf (OpenAPI v3)
720
+ def self.openapi_all_of
721
+ [
722
+ :'BasicNotification',
723
+ :'DeliveryData',
724
+ :'NotificationWithMetaAllOf',
725
+ :'OutcomesData'
726
+ ]
727
+ end
728
+
729
+ # Initializes the object
730
+ # @param [Hash] attributes Model attributes in the form of hash
731
+ def initialize(attributes = {})
732
+ if (!attributes.is_a?(Hash))
733
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::NotificationWithMeta` initialize method"
734
+ end
735
+
736
+ # check to see if the attribute exists and convert string to symbol for hash key
737
+ attributes = attributes.each_with_object({}) { |(k, v), h|
738
+ if (!self.class.attribute_map.key?(k.to_sym))
739
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::NotificationWithMeta`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
740
+ end
741
+ h[k.to_sym] = v
742
+ }
743
+
744
+ if attributes.key?(:'included_segments')
745
+ if (value = attributes[:'included_segments']).is_a?(Array)
746
+ self.included_segments = value
747
+ end
748
+ end
749
+
750
+ if attributes.key?(:'excluded_segments')
751
+ if (value = attributes[:'excluded_segments']).is_a?(Array)
752
+ self.excluded_segments = value
753
+ end
754
+ end
755
+
756
+ if attributes.key?(:'include_player_ids')
757
+ if (value = attributes[:'include_player_ids']).is_a?(Array)
758
+ self.include_player_ids = value
759
+ end
760
+ end
761
+
762
+ if attributes.key?(:'include_external_user_ids')
763
+ if (value = attributes[:'include_external_user_ids']).is_a?(Array)
764
+ self.include_external_user_ids = value
765
+ end
766
+ end
767
+
768
+ if attributes.key?(:'include_email_tokens')
769
+ if (value = attributes[:'include_email_tokens']).is_a?(Array)
770
+ self.include_email_tokens = value
771
+ end
772
+ end
773
+
774
+ if attributes.key?(:'include_phone_numbers')
775
+ if (value = attributes[:'include_phone_numbers']).is_a?(Array)
776
+ self.include_phone_numbers = value
777
+ end
778
+ end
779
+
780
+ if attributes.key?(:'include_ios_tokens')
781
+ if (value = attributes[:'include_ios_tokens']).is_a?(Array)
782
+ self.include_ios_tokens = value
783
+ end
784
+ end
785
+
786
+ if attributes.key?(:'include_wp_wns_uris')
787
+ if (value = attributes[:'include_wp_wns_uris']).is_a?(Array)
788
+ self.include_wp_wns_uris = value
789
+ end
790
+ end
791
+
792
+ if attributes.key?(:'include_amazon_reg_ids')
793
+ if (value = attributes[:'include_amazon_reg_ids']).is_a?(Array)
794
+ self.include_amazon_reg_ids = value
795
+ end
796
+ end
797
+
798
+ if attributes.key?(:'include_chrome_reg_ids')
799
+ if (value = attributes[:'include_chrome_reg_ids']).is_a?(Array)
800
+ self.include_chrome_reg_ids = value
801
+ end
802
+ end
803
+
804
+ if attributes.key?(:'include_chrome_web_reg_ids')
805
+ if (value = attributes[:'include_chrome_web_reg_ids']).is_a?(Array)
806
+ self.include_chrome_web_reg_ids = value
807
+ end
808
+ end
809
+
810
+ if attributes.key?(:'include_android_reg_ids')
811
+ if (value = attributes[:'include_android_reg_ids']).is_a?(Array)
812
+ self.include_android_reg_ids = value
813
+ end
814
+ end
815
+
816
+ if attributes.key?(:'include_aliases')
817
+ self.include_aliases = attributes[:'include_aliases']
818
+ end
819
+
820
+ if attributes.key?(:'target_channel')
821
+ self.target_channel = attributes[:'target_channel']
822
+ end
823
+
824
+ if attributes.key?(:'id')
825
+ self.id = attributes[:'id']
826
+ end
827
+
828
+ if attributes.key?(:'value')
829
+ self.value = attributes[:'value']
830
+ end
831
+
832
+ if attributes.key?(:'name')
833
+ self.name = attributes[:'name']
834
+ end
835
+
836
+ if attributes.key?(:'aggregation')
837
+ self.aggregation = attributes[:'aggregation']
838
+ end
839
+
840
+ if attributes.key?(:'is_ios')
841
+ self.is_ios = attributes[:'is_ios']
842
+ end
843
+
844
+ if attributes.key?(:'is_android')
845
+ self.is_android = attributes[:'is_android']
846
+ end
847
+
848
+ if attributes.key?(:'is_huawei')
849
+ self.is_huawei = attributes[:'is_huawei']
850
+ end
851
+
852
+ if attributes.key?(:'is_any_web')
853
+ self.is_any_web = attributes[:'is_any_web']
854
+ end
855
+
856
+ if attributes.key?(:'is_chrome_web')
857
+ self.is_chrome_web = attributes[:'is_chrome_web']
858
+ end
859
+
860
+ if attributes.key?(:'is_firefox')
861
+ self.is_firefox = attributes[:'is_firefox']
862
+ end
863
+
864
+ if attributes.key?(:'is_safari')
865
+ self.is_safari = attributes[:'is_safari']
866
+ end
867
+
868
+ if attributes.key?(:'is_wp_wns')
869
+ self.is_wp_wns = attributes[:'is_wp_wns']
870
+ end
871
+
872
+ if attributes.key?(:'is_adm')
873
+ self.is_adm = attributes[:'is_adm']
874
+ end
875
+
876
+ if attributes.key?(:'is_chrome')
877
+ self.is_chrome = attributes[:'is_chrome']
878
+ end
879
+
880
+ if attributes.key?(:'channel_for_external_user_ids')
881
+ self.channel_for_external_user_ids = attributes[:'channel_for_external_user_ids']
882
+ end
883
+
884
+ if attributes.key?(:'app_id')
885
+ self.app_id = attributes[:'app_id']
886
+ end
887
+
888
+ if attributes.key?(:'external_id')
889
+ self.external_id = attributes[:'external_id']
890
+ end
891
+
892
+ if attributes.key?(:'contents')
893
+ self.contents = attributes[:'contents']
894
+ end
895
+
896
+ if attributes.key?(:'headings')
897
+ self.headings = attributes[:'headings']
898
+ end
899
+
900
+ if attributes.key?(:'subtitle')
901
+ self.subtitle = attributes[:'subtitle']
902
+ end
903
+
904
+ if attributes.key?(:'data')
905
+ self.data = attributes[:'data']
906
+ end
907
+
908
+ if attributes.key?(:'huawei_msg_type')
909
+ self.huawei_msg_type = attributes[:'huawei_msg_type']
910
+ end
911
+
912
+ if attributes.key?(:'url')
913
+ self.url = attributes[:'url']
914
+ end
915
+
916
+ if attributes.key?(:'web_url')
917
+ self.web_url = attributes[:'web_url']
918
+ end
919
+
920
+ if attributes.key?(:'app_url')
921
+ self.app_url = attributes[:'app_url']
922
+ end
923
+
924
+ if attributes.key?(:'ios_attachments')
925
+ self.ios_attachments = attributes[:'ios_attachments']
926
+ end
927
+
928
+ if attributes.key?(:'template_id')
929
+ self.template_id = attributes[:'template_id']
930
+ end
931
+
932
+ if attributes.key?(:'content_available')
933
+ self.content_available = attributes[:'content_available']
934
+ end
935
+
936
+ if attributes.key?(:'mutable_content')
937
+ self.mutable_content = attributes[:'mutable_content']
938
+ end
939
+
940
+ if attributes.key?(:'target_content_identifier')
941
+ self.target_content_identifier = attributes[:'target_content_identifier']
942
+ end
943
+
944
+ if attributes.key?(:'big_picture')
945
+ self.big_picture = attributes[:'big_picture']
946
+ end
947
+
948
+ if attributes.key?(:'huawei_big_picture')
949
+ self.huawei_big_picture = attributes[:'huawei_big_picture']
950
+ end
951
+
952
+ if attributes.key?(:'adm_big_picture')
953
+ self.adm_big_picture = attributes[:'adm_big_picture']
954
+ end
955
+
956
+ if attributes.key?(:'chrome_big_picture')
957
+ self.chrome_big_picture = attributes[:'chrome_big_picture']
958
+ end
959
+
960
+ if attributes.key?(:'chrome_web_image')
961
+ self.chrome_web_image = attributes[:'chrome_web_image']
962
+ end
963
+
964
+ if attributes.key?(:'buttons')
965
+ if (value = attributes[:'buttons']).is_a?(Array)
966
+ self.buttons = value
967
+ end
968
+ end
969
+
970
+ if attributes.key?(:'web_buttons')
971
+ if (value = attributes[:'web_buttons']).is_a?(Array)
972
+ self.web_buttons = value
973
+ end
974
+ end
975
+
976
+ if attributes.key?(:'ios_category')
977
+ self.ios_category = attributes[:'ios_category']
978
+ end
979
+
980
+ if attributes.key?(:'android_channel_id')
981
+ self.android_channel_id = attributes[:'android_channel_id']
982
+ end
983
+
984
+ if attributes.key?(:'huawei_channel_id')
985
+ self.huawei_channel_id = attributes[:'huawei_channel_id']
986
+ end
987
+
988
+ if attributes.key?(:'existing_android_channel_id')
989
+ self.existing_android_channel_id = attributes[:'existing_android_channel_id']
990
+ end
991
+
992
+ if attributes.key?(:'huawei_existing_channel_id')
993
+ self.huawei_existing_channel_id = attributes[:'huawei_existing_channel_id']
994
+ end
995
+
996
+ if attributes.key?(:'android_background_layout')
997
+ self.android_background_layout = attributes[:'android_background_layout']
998
+ end
999
+
1000
+ if attributes.key?(:'small_icon')
1001
+ self.small_icon = attributes[:'small_icon']
1002
+ end
1003
+
1004
+ if attributes.key?(:'huawei_small_icon')
1005
+ self.huawei_small_icon = attributes[:'huawei_small_icon']
1006
+ end
1007
+
1008
+ if attributes.key?(:'large_icon')
1009
+ self.large_icon = attributes[:'large_icon']
1010
+ end
1011
+
1012
+ if attributes.key?(:'huawei_large_icon')
1013
+ self.huawei_large_icon = attributes[:'huawei_large_icon']
1014
+ end
1015
+
1016
+ if attributes.key?(:'adm_small_icon')
1017
+ self.adm_small_icon = attributes[:'adm_small_icon']
1018
+ end
1019
+
1020
+ if attributes.key?(:'adm_large_icon')
1021
+ self.adm_large_icon = attributes[:'adm_large_icon']
1022
+ end
1023
+
1024
+ if attributes.key?(:'chrome_web_icon')
1025
+ self.chrome_web_icon = attributes[:'chrome_web_icon']
1026
+ end
1027
+
1028
+ if attributes.key?(:'chrome_web_badge')
1029
+ self.chrome_web_badge = attributes[:'chrome_web_badge']
1030
+ end
1031
+
1032
+ if attributes.key?(:'firefox_icon')
1033
+ self.firefox_icon = attributes[:'firefox_icon']
1034
+ end
1035
+
1036
+ if attributes.key?(:'chrome_icon')
1037
+ self.chrome_icon = attributes[:'chrome_icon']
1038
+ end
1039
+
1040
+ if attributes.key?(:'ios_sound')
1041
+ self.ios_sound = attributes[:'ios_sound']
1042
+ end
1043
+
1044
+ if attributes.key?(:'android_sound')
1045
+ self.android_sound = attributes[:'android_sound']
1046
+ end
1047
+
1048
+ if attributes.key?(:'huawei_sound')
1049
+ self.huawei_sound = attributes[:'huawei_sound']
1050
+ end
1051
+
1052
+ if attributes.key?(:'adm_sound')
1053
+ self.adm_sound = attributes[:'adm_sound']
1054
+ end
1055
+
1056
+ if attributes.key?(:'wp_wns_sound')
1057
+ self.wp_wns_sound = attributes[:'wp_wns_sound']
1058
+ end
1059
+
1060
+ if attributes.key?(:'android_led_color')
1061
+ self.android_led_color = attributes[:'android_led_color']
1062
+ end
1063
+
1064
+ if attributes.key?(:'huawei_led_color')
1065
+ self.huawei_led_color = attributes[:'huawei_led_color']
1066
+ end
1067
+
1068
+ if attributes.key?(:'android_accent_color')
1069
+ self.android_accent_color = attributes[:'android_accent_color']
1070
+ end
1071
+
1072
+ if attributes.key?(:'huawei_accent_color')
1073
+ self.huawei_accent_color = attributes[:'huawei_accent_color']
1074
+ end
1075
+
1076
+ if attributes.key?(:'android_visibility')
1077
+ self.android_visibility = attributes[:'android_visibility']
1078
+ end
1079
+
1080
+ if attributes.key?(:'huawei_visibility')
1081
+ self.huawei_visibility = attributes[:'huawei_visibility']
1082
+ end
1083
+
1084
+ if attributes.key?(:'ios_badge_type')
1085
+ self.ios_badge_type = attributes[:'ios_badge_type']
1086
+ end
1087
+
1088
+ if attributes.key?(:'ios_badge_count')
1089
+ self.ios_badge_count = attributes[:'ios_badge_count']
1090
+ end
1091
+
1092
+ if attributes.key?(:'collapse_id')
1093
+ self.collapse_id = attributes[:'collapse_id']
1094
+ end
1095
+
1096
+ if attributes.key?(:'web_push_topic')
1097
+ self.web_push_topic = attributes[:'web_push_topic']
1098
+ end
1099
+
1100
+ if attributes.key?(:'apns_alert')
1101
+ self.apns_alert = attributes[:'apns_alert']
1102
+ end
1103
+
1104
+ if attributes.key?(:'delayed_option')
1105
+ self.delayed_option = attributes[:'delayed_option']
1106
+ end
1107
+
1108
+ if attributes.key?(:'delivery_time_of_day')
1109
+ self.delivery_time_of_day = attributes[:'delivery_time_of_day']
1110
+ end
1111
+
1112
+ if attributes.key?(:'ttl')
1113
+ self.ttl = attributes[:'ttl']
1114
+ end
1115
+
1116
+ if attributes.key?(:'priority')
1117
+ self.priority = attributes[:'priority']
1118
+ end
1119
+
1120
+ if attributes.key?(:'apns_push_type_override')
1121
+ self.apns_push_type_override = attributes[:'apns_push_type_override']
1122
+ end
1123
+
1124
+ if attributes.key?(:'throttle_rate_per_minute')
1125
+ self.throttle_rate_per_minute = attributes[:'throttle_rate_per_minute']
1126
+ end
1127
+
1128
+ if attributes.key?(:'android_group')
1129
+ self.android_group = attributes[:'android_group']
1130
+ end
1131
+
1132
+ if attributes.key?(:'android_group_message')
1133
+ self.android_group_message = attributes[:'android_group_message']
1134
+ end
1135
+
1136
+ if attributes.key?(:'adm_group')
1137
+ self.adm_group = attributes[:'adm_group']
1138
+ end
1139
+
1140
+ if attributes.key?(:'adm_group_message')
1141
+ self.adm_group_message = attributes[:'adm_group_message']
1142
+ end
1143
+
1144
+ if attributes.key?(:'thread_id')
1145
+ self.thread_id = attributes[:'thread_id']
1146
+ end
1147
+
1148
+ if attributes.key?(:'summary_arg')
1149
+ self.summary_arg = attributes[:'summary_arg']
1150
+ end
1151
+
1152
+ if attributes.key?(:'summary_arg_count')
1153
+ self.summary_arg_count = attributes[:'summary_arg_count']
1154
+ end
1155
+
1156
+ if attributes.key?(:'email_subject')
1157
+ self.email_subject = attributes[:'email_subject']
1158
+ end
1159
+
1160
+ if attributes.key?(:'email_body')
1161
+ self.email_body = attributes[:'email_body']
1162
+ end
1163
+
1164
+ if attributes.key?(:'email_from_name')
1165
+ self.email_from_name = attributes[:'email_from_name']
1166
+ end
1167
+
1168
+ if attributes.key?(:'email_from_address')
1169
+ self.email_from_address = attributes[:'email_from_address']
1170
+ end
1171
+
1172
+ if attributes.key?(:'email_preheader')
1173
+ self.email_preheader = attributes[:'email_preheader']
1174
+ end
1175
+
1176
+ if attributes.key?(:'include_unsubscribed')
1177
+ self.include_unsubscribed = attributes[:'include_unsubscribed']
1178
+ end
1179
+
1180
+ if attributes.key?(:'sms_from')
1181
+ self.sms_from = attributes[:'sms_from']
1182
+ end
1183
+
1184
+ if attributes.key?(:'sms_media_urls')
1185
+ if (value = attributes[:'sms_media_urls']).is_a?(Array)
1186
+ self.sms_media_urls = value
1187
+ end
1188
+ end
1189
+
1190
+ if attributes.key?(:'filters')
1191
+ if (value = attributes[:'filters']).is_a?(Array)
1192
+ self.filters = value
1193
+ end
1194
+ end
1195
+
1196
+ if attributes.key?(:'custom_data')
1197
+ self.custom_data = attributes[:'custom_data']
1198
+ end
1199
+
1200
+ if attributes.key?(:'successful')
1201
+ self.successful = attributes[:'successful']
1202
+ end
1203
+
1204
+ if attributes.key?(:'failed')
1205
+ self.failed = attributes[:'failed']
1206
+ end
1207
+
1208
+ if attributes.key?(:'errored')
1209
+ self.errored = attributes[:'errored']
1210
+ end
1211
+
1212
+ if attributes.key?(:'converted')
1213
+ self.converted = attributes[:'converted']
1214
+ end
1215
+
1216
+ if attributes.key?(:'received')
1217
+ self.received = attributes[:'received']
1218
+ end
1219
+
1220
+ if attributes.key?(:'outcomes')
1221
+ if (value = attributes[:'outcomes']).is_a?(Array)
1222
+ self.outcomes = value
1223
+ end
1224
+ end
1225
+
1226
+ if attributes.key?(:'remaining')
1227
+ self.remaining = attributes[:'remaining']
1228
+ end
1229
+
1230
+ if attributes.key?(:'queued_at')
1231
+ self.queued_at = attributes[:'queued_at']
1232
+ end
1233
+
1234
+ if attributes.key?(:'send_after')
1235
+ self.send_after = attributes[:'send_after']
1236
+ end
1237
+
1238
+ if attributes.key?(:'completed_at')
1239
+ self.completed_at = attributes[:'completed_at']
1240
+ end
1241
+
1242
+ if attributes.key?(:'platform_delivery_stats')
1243
+ self.platform_delivery_stats = attributes[:'platform_delivery_stats']
1244
+ end
1245
+ end
1246
+
1247
+ # Show invalid properties with the reasons. Usually used together with valid?
1248
+ # @return Array for valid properties with the reasons
1249
+ def list_invalid_properties
1250
+ invalid_properties = Array.new
1251
+ if @app_id.nil?
1252
+ invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
1253
+ end
1254
+
1255
+ invalid_properties
1256
+ end
1257
+
1258
+ # Check to see if the all the properties in the model are valid
1259
+ # @return true if the model is valid
1260
+ def valid?
1261
+ target_channel_validator = EnumAttributeValidator.new('String', ["push", "email", "sms"])
1262
+ return false unless target_channel_validator.valid?(@target_channel)
1263
+ aggregation_validator = EnumAttributeValidator.new('String', ["sum", "count"])
1264
+ return false unless aggregation_validator.valid?(@aggregation)
1265
+ return false if @app_id.nil?
1266
+ true
1267
+ end
1268
+
1269
+ # Custom attribute writer method checking allowed values (enum).
1270
+ # @param [Object] target_channel Object to be assigned
1271
+ def target_channel=(target_channel)
1272
+ validator = EnumAttributeValidator.new('String', ["push", "email", "sms"])
1273
+ unless validator.valid?(target_channel)
1274
+ fail ArgumentError, "invalid value for \"target_channel\", must be one of #{validator.allowable_values}."
1275
+ end
1276
+ @target_channel = target_channel
1277
+ end
1278
+
1279
+ # Custom attribute writer method checking allowed values (enum).
1280
+ # @param [Object] aggregation Object to be assigned
1281
+ def aggregation=(aggregation)
1282
+ validator = EnumAttributeValidator.new('String', ["sum", "count"])
1283
+ unless validator.valid?(aggregation)
1284
+ fail ArgumentError, "invalid value for \"aggregation\", must be one of #{validator.allowable_values}."
1285
+ end
1286
+ @aggregation = aggregation
1287
+ end
1288
+
1289
+ # Checks equality by comparing each attribute.
1290
+ # @param [Object] Object to be compared
1291
+ def ==(o)
1292
+ return true if self.equal?(o)
1293
+ self.class == o.class &&
1294
+ included_segments == o.included_segments &&
1295
+ excluded_segments == o.excluded_segments &&
1296
+ include_player_ids == o.include_player_ids &&
1297
+ include_external_user_ids == o.include_external_user_ids &&
1298
+ include_email_tokens == o.include_email_tokens &&
1299
+ include_phone_numbers == o.include_phone_numbers &&
1300
+ include_ios_tokens == o.include_ios_tokens &&
1301
+ include_wp_wns_uris == o.include_wp_wns_uris &&
1302
+ include_amazon_reg_ids == o.include_amazon_reg_ids &&
1303
+ include_chrome_reg_ids == o.include_chrome_reg_ids &&
1304
+ include_chrome_web_reg_ids == o.include_chrome_web_reg_ids &&
1305
+ include_android_reg_ids == o.include_android_reg_ids &&
1306
+ include_aliases == o.include_aliases &&
1307
+ target_channel == o.target_channel &&
1308
+ id == o.id &&
1309
+ value == o.value &&
1310
+ name == o.name &&
1311
+ aggregation == o.aggregation &&
1312
+ is_ios == o.is_ios &&
1313
+ is_android == o.is_android &&
1314
+ is_huawei == o.is_huawei &&
1315
+ is_any_web == o.is_any_web &&
1316
+ is_chrome_web == o.is_chrome_web &&
1317
+ is_firefox == o.is_firefox &&
1318
+ is_safari == o.is_safari &&
1319
+ is_wp_wns == o.is_wp_wns &&
1320
+ is_adm == o.is_adm &&
1321
+ is_chrome == o.is_chrome &&
1322
+ channel_for_external_user_ids == o.channel_for_external_user_ids &&
1323
+ app_id == o.app_id &&
1324
+ external_id == o.external_id &&
1325
+ contents == o.contents &&
1326
+ headings == o.headings &&
1327
+ subtitle == o.subtitle &&
1328
+ data == o.data &&
1329
+ huawei_msg_type == o.huawei_msg_type &&
1330
+ url == o.url &&
1331
+ web_url == o.web_url &&
1332
+ app_url == o.app_url &&
1333
+ ios_attachments == o.ios_attachments &&
1334
+ template_id == o.template_id &&
1335
+ content_available == o.content_available &&
1336
+ mutable_content == o.mutable_content &&
1337
+ target_content_identifier == o.target_content_identifier &&
1338
+ big_picture == o.big_picture &&
1339
+ huawei_big_picture == o.huawei_big_picture &&
1340
+ adm_big_picture == o.adm_big_picture &&
1341
+ chrome_big_picture == o.chrome_big_picture &&
1342
+ chrome_web_image == o.chrome_web_image &&
1343
+ buttons == o.buttons &&
1344
+ web_buttons == o.web_buttons &&
1345
+ ios_category == o.ios_category &&
1346
+ android_channel_id == o.android_channel_id &&
1347
+ huawei_channel_id == o.huawei_channel_id &&
1348
+ existing_android_channel_id == o.existing_android_channel_id &&
1349
+ huawei_existing_channel_id == o.huawei_existing_channel_id &&
1350
+ android_background_layout == o.android_background_layout &&
1351
+ small_icon == o.small_icon &&
1352
+ huawei_small_icon == o.huawei_small_icon &&
1353
+ large_icon == o.large_icon &&
1354
+ huawei_large_icon == o.huawei_large_icon &&
1355
+ adm_small_icon == o.adm_small_icon &&
1356
+ adm_large_icon == o.adm_large_icon &&
1357
+ chrome_web_icon == o.chrome_web_icon &&
1358
+ chrome_web_badge == o.chrome_web_badge &&
1359
+ firefox_icon == o.firefox_icon &&
1360
+ chrome_icon == o.chrome_icon &&
1361
+ ios_sound == o.ios_sound &&
1362
+ android_sound == o.android_sound &&
1363
+ huawei_sound == o.huawei_sound &&
1364
+ adm_sound == o.adm_sound &&
1365
+ wp_wns_sound == o.wp_wns_sound &&
1366
+ android_led_color == o.android_led_color &&
1367
+ huawei_led_color == o.huawei_led_color &&
1368
+ android_accent_color == o.android_accent_color &&
1369
+ huawei_accent_color == o.huawei_accent_color &&
1370
+ android_visibility == o.android_visibility &&
1371
+ huawei_visibility == o.huawei_visibility &&
1372
+ ios_badge_type == o.ios_badge_type &&
1373
+ ios_badge_count == o.ios_badge_count &&
1374
+ collapse_id == o.collapse_id &&
1375
+ web_push_topic == o.web_push_topic &&
1376
+ apns_alert == o.apns_alert &&
1377
+ delayed_option == o.delayed_option &&
1378
+ delivery_time_of_day == o.delivery_time_of_day &&
1379
+ ttl == o.ttl &&
1380
+ priority == o.priority &&
1381
+ apns_push_type_override == o.apns_push_type_override &&
1382
+ throttle_rate_per_minute == o.throttle_rate_per_minute &&
1383
+ android_group == o.android_group &&
1384
+ android_group_message == o.android_group_message &&
1385
+ adm_group == o.adm_group &&
1386
+ adm_group_message == o.adm_group_message &&
1387
+ thread_id == o.thread_id &&
1388
+ summary_arg == o.summary_arg &&
1389
+ summary_arg_count == o.summary_arg_count &&
1390
+ email_subject == o.email_subject &&
1391
+ email_body == o.email_body &&
1392
+ email_from_name == o.email_from_name &&
1393
+ email_from_address == o.email_from_address &&
1394
+ email_preheader == o.email_preheader &&
1395
+ include_unsubscribed == o.include_unsubscribed &&
1396
+ sms_from == o.sms_from &&
1397
+ sms_media_urls == o.sms_media_urls &&
1398
+ filters == o.filters &&
1399
+ custom_data == o.custom_data &&
1400
+ successful == o.successful &&
1401
+ failed == o.failed &&
1402
+ errored == o.errored &&
1403
+ converted == o.converted &&
1404
+ received == o.received &&
1405
+ outcomes == o.outcomes &&
1406
+ remaining == o.remaining &&
1407
+ queued_at == o.queued_at &&
1408
+ send_after == o.send_after &&
1409
+ completed_at == o.completed_at &&
1410
+ platform_delivery_stats == o.platform_delivery_stats
1411
+ end
1412
+
1413
+ # @see the `==` method
1414
+ # @param [Object] Object to be compared
1415
+ def eql?(o)
1416
+ self == o
1417
+ end
1418
+
1419
+ # Calculates hash code according to all attributes.
1420
+ # @return [Integer] Hash code
1421
+ def hash
1422
+ [included_segments, excluded_segments, include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, include_aliases, target_channel, id, value, name, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, channel_for_external_user_ids, app_id, external_id, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, email_subject, email_body, email_from_name, email_from_address, email_preheader, include_unsubscribed, sms_from, sms_media_urls, filters, custom_data, successful, failed, errored, converted, received, outcomes, remaining, queued_at, send_after, completed_at, platform_delivery_stats].hash
1423
+ end
1424
+
1425
+ # Builds the object from hash
1426
+ # @param [Hash] attributes Model attributes in the form of hash
1427
+ # @return [Object] Returns the model itself
1428
+ def self.build_from_hash(attributes)
1429
+ new.build_from_hash(attributes)
1430
+ end
1431
+
1432
+ # Builds the object from hash
1433
+ # @param [Hash] attributes Model attributes in the form of hash
1434
+ # @return [Object] Returns the model itself
1435
+ def build_from_hash(attributes)
1436
+ return nil unless attributes.is_a?(Hash)
1437
+ attributes = attributes.transform_keys(&:to_sym)
1438
+ self.class.openapi_types.each_pair do |key, type|
1439
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
1440
+ self.send("#{key}=", nil)
1441
+ elsif type =~ /\AArray<(.*)>/i
1442
+ # check to ensure the input is an array given that the attribute
1443
+ # is documented as an array but the input is not
1444
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
1445
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
1446
+ end
1447
+ elsif !attributes[self.class.attribute_map[key]].nil?
1448
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
1449
+ end
1450
+ end
1451
+
1452
+ self
1453
+ end
1454
+
1455
+ # Deserializes the data based on type
1456
+ # @param string type Data type
1457
+ # @param string value Value to be deserialized
1458
+ # @return [Object] Deserialized data
1459
+ def _deserialize(type, value)
1460
+ case type.to_sym
1461
+ when :Time
1462
+ Time.parse(value)
1463
+ when :Date
1464
+ Date.parse(value)
1465
+ when :String
1466
+ value.to_s
1467
+ when :Integer
1468
+ value.to_i
1469
+ when :Float
1470
+ value.to_f
1471
+ when :Boolean
1472
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
1473
+ true
1474
+ else
1475
+ false
1476
+ end
1477
+ when :Object
1478
+ # generic object (usually a Hash), return directly
1479
+ value
1480
+ when /\AArray<(?<inner_type>.+)>\z/
1481
+ inner_type = Regexp.last_match[:inner_type]
1482
+ value.map { |v| _deserialize(inner_type, v) }
1483
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
1484
+ k_type = Regexp.last_match[:k_type]
1485
+ v_type = Regexp.last_match[:v_type]
1486
+ {}.tap do |hash|
1487
+ value.each do |k, v|
1488
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
1489
+ end
1490
+ end
1491
+ else # model
1492
+ # models (e.g. Pet) or oneOf
1493
+ klass = OneSignal.const_get(type)
1494
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
1495
+ end
1496
+ end
1497
+
1498
+ # Returns the string representation of the object
1499
+ # @return [String] String presentation of the object
1500
+ def to_s
1501
+ to_hash.to_s
1502
+ end
1503
+
1504
+ # to_body is an alias to to_hash (backward compatibility)
1505
+ # @return [Hash] Returns the object in the form of hash
1506
+ def to_body
1507
+ to_hash
1508
+ end
1509
+
1510
+ # Returns the object in the form of hash
1511
+ # @return [Hash] Returns the object in the form of hash
1512
+ def to_hash
1513
+ hash = {}
1514
+ self.class.attribute_map.each_pair do |attr, param|
1515
+ value = self.send(attr)
1516
+ if value.nil?
1517
+ is_nullable = self.class.openapi_nullable.include?(attr)
1518
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
1519
+ end
1520
+
1521
+ hash[param] = _to_hash(value)
1522
+ end
1523
+ hash
1524
+ end
1525
+
1526
+ # Outputs non-array value in the form of hash
1527
+ # For object, use to_hash. Otherwise, just return the value
1528
+ # @param [Object] value Any valid value
1529
+ # @return [Hash] Returns the value in the form of hash
1530
+ def _to_hash(value)
1531
+ if value.is_a?(Array)
1532
+ value.compact.map { |v| _to_hash(v) }
1533
+ elsif value.is_a?(Hash)
1534
+ {}.tap do |hash|
1535
+ value.each { |k, v| hash[k] = _to_hash(v) }
1536
+ end
1537
+ elsif value.respond_to? :to_hash
1538
+ value.to_hash
1539
+ else
1540
+ value
1541
+ end
1542
+ end
1543
+
1544
+ end
1545
+
1546
+ end