onesignal 1.0.0.beta1 → 2.2.0

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