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,1442 @@
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 Notification
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
+ # Channel: All Apps with throttling enabled: - the parameter value will be used to override the default application throttling value set from the dashboard settings. - parameter value 0 indicates not to apply throttling to the notification. - if the parameter is not passed then the default app throttling value will be applied to the notification. Apps with throttling disabled: - this parameter can be used to throttle delivery for the notification even though throttling is not enabled at the application level. 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
+ # Channel: All Schedule notification for future delivery. API defaults to UTC -1100 Examples: All examples are the exact same date & time. \"Thu Sep 24 2015 14:00:00 GMT-0700 (PDT)\" \"September 24th 2015, 2:00:00 pm UTC-07:00\" \"2015-09-24 14:00:00 GMT-0700\" \"Sept 24 2015 14:00:00 GMT-0700\" \"Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)\" Note: SMS currently only supports send_after parameter.
327
+ attr_accessor :send_after
328
+
329
+ class EnumAttributeValidator
330
+ attr_reader :datatype
331
+ attr_reader :allowable_values
332
+
333
+ def initialize(datatype, allowable_values)
334
+ @allowable_values = allowable_values.map do |value|
335
+ case datatype.to_s
336
+ when /Integer/i
337
+ value.to_i
338
+ when /Float/i
339
+ value.to_f
340
+ else
341
+ value
342
+ end
343
+ end
344
+ end
345
+
346
+ def valid?(value)
347
+ !value || allowable_values.include?(value)
348
+ end
349
+ end
350
+
351
+ # Attribute mapping from ruby-style variable name to JSON key.
352
+ def self.attribute_map
353
+ {
354
+ :'included_segments' => :'included_segments',
355
+ :'excluded_segments' => :'excluded_segments',
356
+ :'include_player_ids' => :'include_player_ids',
357
+ :'include_external_user_ids' => :'include_external_user_ids',
358
+ :'include_email_tokens' => :'include_email_tokens',
359
+ :'include_phone_numbers' => :'include_phone_numbers',
360
+ :'include_ios_tokens' => :'include_ios_tokens',
361
+ :'include_wp_wns_uris' => :'include_wp_wns_uris',
362
+ :'include_amazon_reg_ids' => :'include_amazon_reg_ids',
363
+ :'include_chrome_reg_ids' => :'include_chrome_reg_ids',
364
+ :'include_chrome_web_reg_ids' => :'include_chrome_web_reg_ids',
365
+ :'include_android_reg_ids' => :'include_android_reg_ids',
366
+ :'include_aliases' => :'include_aliases',
367
+ :'target_channel' => :'target_channel',
368
+ :'id' => :'id',
369
+ :'value' => :'value',
370
+ :'name' => :'name',
371
+ :'aggregation' => :'aggregation',
372
+ :'is_ios' => :'isIos',
373
+ :'is_android' => :'isAndroid',
374
+ :'is_huawei' => :'isHuawei',
375
+ :'is_any_web' => :'isAnyWeb',
376
+ :'is_chrome_web' => :'isChromeWeb',
377
+ :'is_firefox' => :'isFirefox',
378
+ :'is_safari' => :'isSafari',
379
+ :'is_wp_wns' => :'isWP_WNS',
380
+ :'is_adm' => :'isAdm',
381
+ :'is_chrome' => :'isChrome',
382
+ :'channel_for_external_user_ids' => :'channel_for_external_user_ids',
383
+ :'app_id' => :'app_id',
384
+ :'external_id' => :'external_id',
385
+ :'contents' => :'contents',
386
+ :'headings' => :'headings',
387
+ :'subtitle' => :'subtitle',
388
+ :'data' => :'data',
389
+ :'huawei_msg_type' => :'huawei_msg_type',
390
+ :'url' => :'url',
391
+ :'web_url' => :'web_url',
392
+ :'app_url' => :'app_url',
393
+ :'ios_attachments' => :'ios_attachments',
394
+ :'template_id' => :'template_id',
395
+ :'content_available' => :'content_available',
396
+ :'mutable_content' => :'mutable_content',
397
+ :'target_content_identifier' => :'target_content_identifier',
398
+ :'big_picture' => :'big_picture',
399
+ :'huawei_big_picture' => :'huawei_big_picture',
400
+ :'adm_big_picture' => :'adm_big_picture',
401
+ :'chrome_big_picture' => :'chrome_big_picture',
402
+ :'chrome_web_image' => :'chrome_web_image',
403
+ :'buttons' => :'buttons',
404
+ :'web_buttons' => :'web_buttons',
405
+ :'ios_category' => :'ios_category',
406
+ :'android_channel_id' => :'android_channel_id',
407
+ :'huawei_channel_id' => :'huawei_channel_id',
408
+ :'existing_android_channel_id' => :'existing_android_channel_id',
409
+ :'huawei_existing_channel_id' => :'huawei_existing_channel_id',
410
+ :'android_background_layout' => :'android_background_layout',
411
+ :'small_icon' => :'small_icon',
412
+ :'huawei_small_icon' => :'huawei_small_icon',
413
+ :'large_icon' => :'large_icon',
414
+ :'huawei_large_icon' => :'huawei_large_icon',
415
+ :'adm_small_icon' => :'adm_small_icon',
416
+ :'adm_large_icon' => :'adm_large_icon',
417
+ :'chrome_web_icon' => :'chrome_web_icon',
418
+ :'chrome_web_badge' => :'chrome_web_badge',
419
+ :'firefox_icon' => :'firefox_icon',
420
+ :'chrome_icon' => :'chrome_icon',
421
+ :'ios_sound' => :'ios_sound',
422
+ :'android_sound' => :'android_sound',
423
+ :'huawei_sound' => :'huawei_sound',
424
+ :'adm_sound' => :'adm_sound',
425
+ :'wp_wns_sound' => :'wp_wns_sound',
426
+ :'android_led_color' => :'android_led_color',
427
+ :'huawei_led_color' => :'huawei_led_color',
428
+ :'android_accent_color' => :'android_accent_color',
429
+ :'huawei_accent_color' => :'huawei_accent_color',
430
+ :'android_visibility' => :'android_visibility',
431
+ :'huawei_visibility' => :'huawei_visibility',
432
+ :'ios_badge_type' => :'ios_badgeType',
433
+ :'ios_badge_count' => :'ios_badgeCount',
434
+ :'collapse_id' => :'collapse_id',
435
+ :'web_push_topic' => :'web_push_topic',
436
+ :'apns_alert' => :'apns_alert',
437
+ :'delayed_option' => :'delayed_option',
438
+ :'delivery_time_of_day' => :'delivery_time_of_day',
439
+ :'ttl' => :'ttl',
440
+ :'priority' => :'priority',
441
+ :'apns_push_type_override' => :'apns_push_type_override',
442
+ :'throttle_rate_per_minute' => :'throttle_rate_per_minute',
443
+ :'android_group' => :'android_group',
444
+ :'android_group_message' => :'android_group_message',
445
+ :'adm_group' => :'adm_group',
446
+ :'adm_group_message' => :'adm_group_message',
447
+ :'thread_id' => :'thread_id',
448
+ :'summary_arg' => :'summary_arg',
449
+ :'summary_arg_count' => :'summary_arg_count',
450
+ :'email_subject' => :'email_subject',
451
+ :'email_body' => :'email_body',
452
+ :'email_from_name' => :'email_from_name',
453
+ :'email_from_address' => :'email_from_address',
454
+ :'email_preheader' => :'email_preheader',
455
+ :'include_unsubscribed' => :'include_unsubscribed',
456
+ :'sms_from' => :'sms_from',
457
+ :'sms_media_urls' => :'sms_media_urls',
458
+ :'filters' => :'filters',
459
+ :'custom_data' => :'custom_data',
460
+ :'send_after' => :'send_after'
461
+ }
462
+ end
463
+
464
+ # Returns all the JSON keys this model knows about
465
+ def self.acceptable_attributes
466
+ attribute_map.values
467
+ end
468
+
469
+ # Attribute type mapping.
470
+ def self.openapi_types
471
+ {
472
+ :'included_segments' => :'Array<String>',
473
+ :'excluded_segments' => :'Array<String>',
474
+ :'include_player_ids' => :'Array<String>',
475
+ :'include_external_user_ids' => :'Array<String>',
476
+ :'include_email_tokens' => :'Array<String>',
477
+ :'include_phone_numbers' => :'Array<String>',
478
+ :'include_ios_tokens' => :'Array<String>',
479
+ :'include_wp_wns_uris' => :'Array<String>',
480
+ :'include_amazon_reg_ids' => :'Array<String>',
481
+ :'include_chrome_reg_ids' => :'Array<String>',
482
+ :'include_chrome_web_reg_ids' => :'Array<String>',
483
+ :'include_android_reg_ids' => :'Array<String>',
484
+ :'include_aliases' => :'PlayerNotificationTargetIncludeAliases',
485
+ :'target_channel' => :'String',
486
+ :'id' => :'String',
487
+ :'value' => :'Integer',
488
+ :'name' => :'String',
489
+ :'aggregation' => :'String',
490
+ :'is_ios' => :'Boolean',
491
+ :'is_android' => :'Boolean',
492
+ :'is_huawei' => :'Boolean',
493
+ :'is_any_web' => :'Boolean',
494
+ :'is_chrome_web' => :'Boolean',
495
+ :'is_firefox' => :'Boolean',
496
+ :'is_safari' => :'Boolean',
497
+ :'is_wp_wns' => :'Boolean',
498
+ :'is_adm' => :'Boolean',
499
+ :'is_chrome' => :'Boolean',
500
+ :'channel_for_external_user_ids' => :'String',
501
+ :'app_id' => :'String',
502
+ :'external_id' => :'String',
503
+ :'contents' => :'StringMap',
504
+ :'headings' => :'StringMap',
505
+ :'subtitle' => :'StringMap',
506
+ :'data' => :'Object',
507
+ :'huawei_msg_type' => :'String',
508
+ :'url' => :'String',
509
+ :'web_url' => :'String',
510
+ :'app_url' => :'String',
511
+ :'ios_attachments' => :'Object',
512
+ :'template_id' => :'String',
513
+ :'content_available' => :'Boolean',
514
+ :'mutable_content' => :'Boolean',
515
+ :'target_content_identifier' => :'String',
516
+ :'big_picture' => :'String',
517
+ :'huawei_big_picture' => :'String',
518
+ :'adm_big_picture' => :'String',
519
+ :'chrome_big_picture' => :'String',
520
+ :'chrome_web_image' => :'String',
521
+ :'buttons' => :'Array<Button>',
522
+ :'web_buttons' => :'Array<Button>',
523
+ :'ios_category' => :'String',
524
+ :'android_channel_id' => :'String',
525
+ :'huawei_channel_id' => :'String',
526
+ :'existing_android_channel_id' => :'String',
527
+ :'huawei_existing_channel_id' => :'String',
528
+ :'android_background_layout' => :'BasicNotificationAllOfAndroidBackgroundLayout',
529
+ :'small_icon' => :'String',
530
+ :'huawei_small_icon' => :'String',
531
+ :'large_icon' => :'String',
532
+ :'huawei_large_icon' => :'String',
533
+ :'adm_small_icon' => :'String',
534
+ :'adm_large_icon' => :'String',
535
+ :'chrome_web_icon' => :'String',
536
+ :'chrome_web_badge' => :'String',
537
+ :'firefox_icon' => :'String',
538
+ :'chrome_icon' => :'String',
539
+ :'ios_sound' => :'String',
540
+ :'android_sound' => :'String',
541
+ :'huawei_sound' => :'String',
542
+ :'adm_sound' => :'String',
543
+ :'wp_wns_sound' => :'String',
544
+ :'android_led_color' => :'String',
545
+ :'huawei_led_color' => :'String',
546
+ :'android_accent_color' => :'String',
547
+ :'huawei_accent_color' => :'String',
548
+ :'android_visibility' => :'Integer',
549
+ :'huawei_visibility' => :'Integer',
550
+ :'ios_badge_type' => :'String',
551
+ :'ios_badge_count' => :'Integer',
552
+ :'collapse_id' => :'String',
553
+ :'web_push_topic' => :'String',
554
+ :'apns_alert' => :'Object',
555
+ :'delayed_option' => :'String',
556
+ :'delivery_time_of_day' => :'String',
557
+ :'ttl' => :'Integer',
558
+ :'priority' => :'Integer',
559
+ :'apns_push_type_override' => :'String',
560
+ :'throttle_rate_per_minute' => :'String',
561
+ :'android_group' => :'String',
562
+ :'android_group_message' => :'String',
563
+ :'adm_group' => :'String',
564
+ :'adm_group_message' => :'Object',
565
+ :'thread_id' => :'String',
566
+ :'summary_arg' => :'String',
567
+ :'summary_arg_count' => :'Integer',
568
+ :'email_subject' => :'String',
569
+ :'email_body' => :'String',
570
+ :'email_from_name' => :'String',
571
+ :'email_from_address' => :'String',
572
+ :'email_preheader' => :'String',
573
+ :'include_unsubscribed' => :'Boolean',
574
+ :'sms_from' => :'String',
575
+ :'sms_media_urls' => :'Array<String>',
576
+ :'filters' => :'Array<Filter>',
577
+ :'custom_data' => :'Object',
578
+ :'send_after' => :'Time'
579
+ }
580
+ end
581
+
582
+ # List of attributes with nullable: true
583
+ def self.openapi_nullable
584
+ Set.new([
585
+ :'include_player_ids',
586
+ :'include_external_user_ids',
587
+ :'include_aliases',
588
+ :'name',
589
+ :'is_ios',
590
+ :'is_android',
591
+ :'is_huawei',
592
+ :'is_any_web',
593
+ :'is_chrome_web',
594
+ :'is_firefox',
595
+ :'is_safari',
596
+ :'is_wp_wns',
597
+ :'is_adm',
598
+ :'is_chrome',
599
+ :'external_id',
600
+ :'contents',
601
+ :'headings',
602
+ :'subtitle',
603
+ :'data',
604
+ :'huawei_msg_type',
605
+ :'url',
606
+ :'web_url',
607
+ :'app_url',
608
+ :'ios_attachments',
609
+ :'template_id',
610
+ :'content_available',
611
+ :'target_content_identifier',
612
+ :'big_picture',
613
+ :'huawei_big_picture',
614
+ :'adm_big_picture',
615
+ :'chrome_big_picture',
616
+ :'chrome_web_image',
617
+ :'buttons',
618
+ :'web_buttons',
619
+ :'ios_category',
620
+ :'huawei_channel_id',
621
+ :'huawei_existing_channel_id',
622
+ :'small_icon',
623
+ :'huawei_small_icon',
624
+ :'large_icon',
625
+ :'huawei_large_icon',
626
+ :'adm_small_icon',
627
+ :'adm_large_icon',
628
+ :'chrome_web_icon',
629
+ :'chrome_web_badge',
630
+ :'firefox_icon',
631
+ :'chrome_icon',
632
+ :'ios_sound',
633
+ :'android_sound',
634
+ :'huawei_sound',
635
+ :'adm_sound',
636
+ :'wp_wns_sound',
637
+ :'android_led_color',
638
+ :'huawei_led_color',
639
+ :'android_accent_color',
640
+ :'huawei_accent_color',
641
+ :'android_visibility',
642
+ :'huawei_visibility',
643
+ :'ios_badge_type',
644
+ :'ios_badge_count',
645
+ :'web_push_topic',
646
+ :'apns_alert',
647
+ :'delayed_option',
648
+ :'delivery_time_of_day',
649
+ :'ttl',
650
+ :'priority',
651
+ :'throttle_rate_per_minute',
652
+ :'android_group',
653
+ :'android_group_message',
654
+ :'adm_group',
655
+ :'adm_group_message',
656
+ :'thread_id',
657
+ :'email_subject',
658
+ :'email_from_name',
659
+ :'email_from_address',
660
+ :'email_preheader',
661
+ :'sms_from',
662
+ :'sms_media_urls',
663
+ :'filters',
664
+ :'custom_data',
665
+ :'send_after'
666
+ ])
667
+ end
668
+
669
+ # List of class defined in allOf (OpenAPI v3)
670
+ def self.openapi_all_of
671
+ [
672
+ :'BasicNotification',
673
+ :'NotificationAllOf'
674
+ ]
675
+ end
676
+
677
+ # Initializes the object
678
+ # @param [Hash] attributes Model attributes in the form of hash
679
+ def initialize(attributes = {})
680
+ if (!attributes.is_a?(Hash))
681
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::Notification` initialize method"
682
+ end
683
+
684
+ # check to see if the attribute exists and convert string to symbol for hash key
685
+ attributes = attributes.each_with_object({}) { |(k, v), h|
686
+ if (!self.class.attribute_map.key?(k.to_sym))
687
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::Notification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
688
+ end
689
+ h[k.to_sym] = v
690
+ }
691
+
692
+ if attributes.key?(:'included_segments')
693
+ if (value = attributes[:'included_segments']).is_a?(Array)
694
+ self.included_segments = value
695
+ end
696
+ end
697
+
698
+ if attributes.key?(:'excluded_segments')
699
+ if (value = attributes[:'excluded_segments']).is_a?(Array)
700
+ self.excluded_segments = value
701
+ end
702
+ end
703
+
704
+ if attributes.key?(:'include_player_ids')
705
+ if (value = attributes[:'include_player_ids']).is_a?(Array)
706
+ self.include_player_ids = value
707
+ end
708
+ end
709
+
710
+ if attributes.key?(:'include_external_user_ids')
711
+ if (value = attributes[:'include_external_user_ids']).is_a?(Array)
712
+ self.include_external_user_ids = value
713
+ end
714
+ end
715
+
716
+ if attributes.key?(:'include_email_tokens')
717
+ if (value = attributes[:'include_email_tokens']).is_a?(Array)
718
+ self.include_email_tokens = value
719
+ end
720
+ end
721
+
722
+ if attributes.key?(:'include_phone_numbers')
723
+ if (value = attributes[:'include_phone_numbers']).is_a?(Array)
724
+ self.include_phone_numbers = value
725
+ end
726
+ end
727
+
728
+ if attributes.key?(:'include_ios_tokens')
729
+ if (value = attributes[:'include_ios_tokens']).is_a?(Array)
730
+ self.include_ios_tokens = value
731
+ end
732
+ end
733
+
734
+ if attributes.key?(:'include_wp_wns_uris')
735
+ if (value = attributes[:'include_wp_wns_uris']).is_a?(Array)
736
+ self.include_wp_wns_uris = value
737
+ end
738
+ end
739
+
740
+ if attributes.key?(:'include_amazon_reg_ids')
741
+ if (value = attributes[:'include_amazon_reg_ids']).is_a?(Array)
742
+ self.include_amazon_reg_ids = value
743
+ end
744
+ end
745
+
746
+ if attributes.key?(:'include_chrome_reg_ids')
747
+ if (value = attributes[:'include_chrome_reg_ids']).is_a?(Array)
748
+ self.include_chrome_reg_ids = value
749
+ end
750
+ end
751
+
752
+ if attributes.key?(:'include_chrome_web_reg_ids')
753
+ if (value = attributes[:'include_chrome_web_reg_ids']).is_a?(Array)
754
+ self.include_chrome_web_reg_ids = value
755
+ end
756
+ end
757
+
758
+ if attributes.key?(:'include_android_reg_ids')
759
+ if (value = attributes[:'include_android_reg_ids']).is_a?(Array)
760
+ self.include_android_reg_ids = value
761
+ end
762
+ end
763
+
764
+ if attributes.key?(:'include_aliases')
765
+ self.include_aliases = attributes[:'include_aliases']
766
+ end
767
+
768
+ if attributes.key?(:'target_channel')
769
+ self.target_channel = attributes[:'target_channel']
770
+ end
771
+
772
+ if attributes.key?(:'id')
773
+ self.id = attributes[:'id']
774
+ end
775
+
776
+ if attributes.key?(:'value')
777
+ self.value = attributes[:'value']
778
+ end
779
+
780
+ if attributes.key?(:'name')
781
+ self.name = attributes[:'name']
782
+ end
783
+
784
+ if attributes.key?(:'aggregation')
785
+ self.aggregation = attributes[:'aggregation']
786
+ end
787
+
788
+ if attributes.key?(:'is_ios')
789
+ self.is_ios = attributes[:'is_ios']
790
+ end
791
+
792
+ if attributes.key?(:'is_android')
793
+ self.is_android = attributes[:'is_android']
794
+ end
795
+
796
+ if attributes.key?(:'is_huawei')
797
+ self.is_huawei = attributes[:'is_huawei']
798
+ end
799
+
800
+ if attributes.key?(:'is_any_web')
801
+ self.is_any_web = attributes[:'is_any_web']
802
+ end
803
+
804
+ if attributes.key?(:'is_chrome_web')
805
+ self.is_chrome_web = attributes[:'is_chrome_web']
806
+ end
807
+
808
+ if attributes.key?(:'is_firefox')
809
+ self.is_firefox = attributes[:'is_firefox']
810
+ end
811
+
812
+ if attributes.key?(:'is_safari')
813
+ self.is_safari = attributes[:'is_safari']
814
+ end
815
+
816
+ if attributes.key?(:'is_wp_wns')
817
+ self.is_wp_wns = attributes[:'is_wp_wns']
818
+ end
819
+
820
+ if attributes.key?(:'is_adm')
821
+ self.is_adm = attributes[:'is_adm']
822
+ end
823
+
824
+ if attributes.key?(:'is_chrome')
825
+ self.is_chrome = attributes[:'is_chrome']
826
+ end
827
+
828
+ if attributes.key?(:'channel_for_external_user_ids')
829
+ self.channel_for_external_user_ids = attributes[:'channel_for_external_user_ids']
830
+ end
831
+
832
+ if attributes.key?(:'app_id')
833
+ self.app_id = attributes[:'app_id']
834
+ end
835
+
836
+ if attributes.key?(:'external_id')
837
+ self.external_id = attributes[:'external_id']
838
+ end
839
+
840
+ if attributes.key?(:'contents')
841
+ self.contents = attributes[:'contents']
842
+ end
843
+
844
+ if attributes.key?(:'headings')
845
+ self.headings = attributes[:'headings']
846
+ end
847
+
848
+ if attributes.key?(:'subtitle')
849
+ self.subtitle = attributes[:'subtitle']
850
+ end
851
+
852
+ if attributes.key?(:'data')
853
+ self.data = attributes[:'data']
854
+ end
855
+
856
+ if attributes.key?(:'huawei_msg_type')
857
+ self.huawei_msg_type = attributes[:'huawei_msg_type']
858
+ end
859
+
860
+ if attributes.key?(:'url')
861
+ self.url = attributes[:'url']
862
+ end
863
+
864
+ if attributes.key?(:'web_url')
865
+ self.web_url = attributes[:'web_url']
866
+ end
867
+
868
+ if attributes.key?(:'app_url')
869
+ self.app_url = attributes[:'app_url']
870
+ end
871
+
872
+ if attributes.key?(:'ios_attachments')
873
+ self.ios_attachments = attributes[:'ios_attachments']
874
+ end
875
+
876
+ if attributes.key?(:'template_id')
877
+ self.template_id = attributes[:'template_id']
878
+ end
879
+
880
+ if attributes.key?(:'content_available')
881
+ self.content_available = attributes[:'content_available']
882
+ end
883
+
884
+ if attributes.key?(:'mutable_content')
885
+ self.mutable_content = attributes[:'mutable_content']
886
+ end
887
+
888
+ if attributes.key?(:'target_content_identifier')
889
+ self.target_content_identifier = attributes[:'target_content_identifier']
890
+ end
891
+
892
+ if attributes.key?(:'big_picture')
893
+ self.big_picture = attributes[:'big_picture']
894
+ end
895
+
896
+ if attributes.key?(:'huawei_big_picture')
897
+ self.huawei_big_picture = attributes[:'huawei_big_picture']
898
+ end
899
+
900
+ if attributes.key?(:'adm_big_picture')
901
+ self.adm_big_picture = attributes[:'adm_big_picture']
902
+ end
903
+
904
+ if attributes.key?(:'chrome_big_picture')
905
+ self.chrome_big_picture = attributes[:'chrome_big_picture']
906
+ end
907
+
908
+ if attributes.key?(:'chrome_web_image')
909
+ self.chrome_web_image = attributes[:'chrome_web_image']
910
+ end
911
+
912
+ if attributes.key?(:'buttons')
913
+ if (value = attributes[:'buttons']).is_a?(Array)
914
+ self.buttons = value
915
+ end
916
+ end
917
+
918
+ if attributes.key?(:'web_buttons')
919
+ if (value = attributes[:'web_buttons']).is_a?(Array)
920
+ self.web_buttons = value
921
+ end
922
+ end
923
+
924
+ if attributes.key?(:'ios_category')
925
+ self.ios_category = attributes[:'ios_category']
926
+ end
927
+
928
+ if attributes.key?(:'android_channel_id')
929
+ self.android_channel_id = attributes[:'android_channel_id']
930
+ end
931
+
932
+ if attributes.key?(:'huawei_channel_id')
933
+ self.huawei_channel_id = attributes[:'huawei_channel_id']
934
+ end
935
+
936
+ if attributes.key?(:'existing_android_channel_id')
937
+ self.existing_android_channel_id = attributes[:'existing_android_channel_id']
938
+ end
939
+
940
+ if attributes.key?(:'huawei_existing_channel_id')
941
+ self.huawei_existing_channel_id = attributes[:'huawei_existing_channel_id']
942
+ end
943
+
944
+ if attributes.key?(:'android_background_layout')
945
+ self.android_background_layout = attributes[:'android_background_layout']
946
+ end
947
+
948
+ if attributes.key?(:'small_icon')
949
+ self.small_icon = attributes[:'small_icon']
950
+ end
951
+
952
+ if attributes.key?(:'huawei_small_icon')
953
+ self.huawei_small_icon = attributes[:'huawei_small_icon']
954
+ end
955
+
956
+ if attributes.key?(:'large_icon')
957
+ self.large_icon = attributes[:'large_icon']
958
+ end
959
+
960
+ if attributes.key?(:'huawei_large_icon')
961
+ self.huawei_large_icon = attributes[:'huawei_large_icon']
962
+ end
963
+
964
+ if attributes.key?(:'adm_small_icon')
965
+ self.adm_small_icon = attributes[:'adm_small_icon']
966
+ end
967
+
968
+ if attributes.key?(:'adm_large_icon')
969
+ self.adm_large_icon = attributes[:'adm_large_icon']
970
+ end
971
+
972
+ if attributes.key?(:'chrome_web_icon')
973
+ self.chrome_web_icon = attributes[:'chrome_web_icon']
974
+ end
975
+
976
+ if attributes.key?(:'chrome_web_badge')
977
+ self.chrome_web_badge = attributes[:'chrome_web_badge']
978
+ end
979
+
980
+ if attributes.key?(:'firefox_icon')
981
+ self.firefox_icon = attributes[:'firefox_icon']
982
+ end
983
+
984
+ if attributes.key?(:'chrome_icon')
985
+ self.chrome_icon = attributes[:'chrome_icon']
986
+ end
987
+
988
+ if attributes.key?(:'ios_sound')
989
+ self.ios_sound = attributes[:'ios_sound']
990
+ end
991
+
992
+ if attributes.key?(:'android_sound')
993
+ self.android_sound = attributes[:'android_sound']
994
+ end
995
+
996
+ if attributes.key?(:'huawei_sound')
997
+ self.huawei_sound = attributes[:'huawei_sound']
998
+ end
999
+
1000
+ if attributes.key?(:'adm_sound')
1001
+ self.adm_sound = attributes[:'adm_sound']
1002
+ end
1003
+
1004
+ if attributes.key?(:'wp_wns_sound')
1005
+ self.wp_wns_sound = attributes[:'wp_wns_sound']
1006
+ end
1007
+
1008
+ if attributes.key?(:'android_led_color')
1009
+ self.android_led_color = attributes[:'android_led_color']
1010
+ end
1011
+
1012
+ if attributes.key?(:'huawei_led_color')
1013
+ self.huawei_led_color = attributes[:'huawei_led_color']
1014
+ end
1015
+
1016
+ if attributes.key?(:'android_accent_color')
1017
+ self.android_accent_color = attributes[:'android_accent_color']
1018
+ end
1019
+
1020
+ if attributes.key?(:'huawei_accent_color')
1021
+ self.huawei_accent_color = attributes[:'huawei_accent_color']
1022
+ end
1023
+
1024
+ if attributes.key?(:'android_visibility')
1025
+ self.android_visibility = attributes[:'android_visibility']
1026
+ end
1027
+
1028
+ if attributes.key?(:'huawei_visibility')
1029
+ self.huawei_visibility = attributes[:'huawei_visibility']
1030
+ end
1031
+
1032
+ if attributes.key?(:'ios_badge_type')
1033
+ self.ios_badge_type = attributes[:'ios_badge_type']
1034
+ end
1035
+
1036
+ if attributes.key?(:'ios_badge_count')
1037
+ self.ios_badge_count = attributes[:'ios_badge_count']
1038
+ end
1039
+
1040
+ if attributes.key?(:'collapse_id')
1041
+ self.collapse_id = attributes[:'collapse_id']
1042
+ end
1043
+
1044
+ if attributes.key?(:'web_push_topic')
1045
+ self.web_push_topic = attributes[:'web_push_topic']
1046
+ end
1047
+
1048
+ if attributes.key?(:'apns_alert')
1049
+ self.apns_alert = attributes[:'apns_alert']
1050
+ end
1051
+
1052
+ if attributes.key?(:'delayed_option')
1053
+ self.delayed_option = attributes[:'delayed_option']
1054
+ end
1055
+
1056
+ if attributes.key?(:'delivery_time_of_day')
1057
+ self.delivery_time_of_day = attributes[:'delivery_time_of_day']
1058
+ end
1059
+
1060
+ if attributes.key?(:'ttl')
1061
+ self.ttl = attributes[:'ttl']
1062
+ end
1063
+
1064
+ if attributes.key?(:'priority')
1065
+ self.priority = attributes[:'priority']
1066
+ end
1067
+
1068
+ if attributes.key?(:'apns_push_type_override')
1069
+ self.apns_push_type_override = attributes[:'apns_push_type_override']
1070
+ end
1071
+
1072
+ if attributes.key?(:'throttle_rate_per_minute')
1073
+ self.throttle_rate_per_minute = attributes[:'throttle_rate_per_minute']
1074
+ end
1075
+
1076
+ if attributes.key?(:'android_group')
1077
+ self.android_group = attributes[:'android_group']
1078
+ end
1079
+
1080
+ if attributes.key?(:'android_group_message')
1081
+ self.android_group_message = attributes[:'android_group_message']
1082
+ end
1083
+
1084
+ if attributes.key?(:'adm_group')
1085
+ self.adm_group = attributes[:'adm_group']
1086
+ end
1087
+
1088
+ if attributes.key?(:'adm_group_message')
1089
+ self.adm_group_message = attributes[:'adm_group_message']
1090
+ end
1091
+
1092
+ if attributes.key?(:'thread_id')
1093
+ self.thread_id = attributes[:'thread_id']
1094
+ end
1095
+
1096
+ if attributes.key?(:'summary_arg')
1097
+ self.summary_arg = attributes[:'summary_arg']
1098
+ end
1099
+
1100
+ if attributes.key?(:'summary_arg_count')
1101
+ self.summary_arg_count = attributes[:'summary_arg_count']
1102
+ end
1103
+
1104
+ if attributes.key?(:'email_subject')
1105
+ self.email_subject = attributes[:'email_subject']
1106
+ end
1107
+
1108
+ if attributes.key?(:'email_body')
1109
+ self.email_body = attributes[:'email_body']
1110
+ end
1111
+
1112
+ if attributes.key?(:'email_from_name')
1113
+ self.email_from_name = attributes[:'email_from_name']
1114
+ end
1115
+
1116
+ if attributes.key?(:'email_from_address')
1117
+ self.email_from_address = attributes[:'email_from_address']
1118
+ end
1119
+
1120
+ if attributes.key?(:'email_preheader')
1121
+ self.email_preheader = attributes[:'email_preheader']
1122
+ end
1123
+
1124
+ if attributes.key?(:'include_unsubscribed')
1125
+ self.include_unsubscribed = attributes[:'include_unsubscribed']
1126
+ end
1127
+
1128
+ if attributes.key?(:'sms_from')
1129
+ self.sms_from = attributes[:'sms_from']
1130
+ end
1131
+
1132
+ if attributes.key?(:'sms_media_urls')
1133
+ if (value = attributes[:'sms_media_urls']).is_a?(Array)
1134
+ self.sms_media_urls = value
1135
+ end
1136
+ end
1137
+
1138
+ if attributes.key?(:'filters')
1139
+ if (value = attributes[:'filters']).is_a?(Array)
1140
+ self.filters = value
1141
+ end
1142
+ end
1143
+
1144
+ if attributes.key?(:'custom_data')
1145
+ self.custom_data = attributes[:'custom_data']
1146
+ end
1147
+
1148
+ if attributes.key?(:'send_after')
1149
+ self.send_after = attributes[:'send_after']
1150
+ end
1151
+ end
1152
+
1153
+ # Show invalid properties with the reasons. Usually used together with valid?
1154
+ # @return Array for valid properties with the reasons
1155
+ def list_invalid_properties
1156
+ invalid_properties = Array.new
1157
+ if @app_id.nil?
1158
+ invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
1159
+ end
1160
+
1161
+ invalid_properties
1162
+ end
1163
+
1164
+ # Check to see if the all the properties in the model are valid
1165
+ # @return true if the model is valid
1166
+ def valid?
1167
+ target_channel_validator = EnumAttributeValidator.new('String', ["push", "email", "sms"])
1168
+ return false unless target_channel_validator.valid?(@target_channel)
1169
+ aggregation_validator = EnumAttributeValidator.new('String', ["sum", "count"])
1170
+ return false unless aggregation_validator.valid?(@aggregation)
1171
+ return false if @app_id.nil?
1172
+ true
1173
+ end
1174
+
1175
+ # Custom attribute writer method checking allowed values (enum).
1176
+ # @param [Object] target_channel Object to be assigned
1177
+ def target_channel=(target_channel)
1178
+ validator = EnumAttributeValidator.new('String', ["push", "email", "sms"])
1179
+ unless validator.valid?(target_channel)
1180
+ fail ArgumentError, "invalid value for \"target_channel\", must be one of #{validator.allowable_values}."
1181
+ end
1182
+ @target_channel = target_channel
1183
+ end
1184
+
1185
+ # Custom attribute writer method checking allowed values (enum).
1186
+ # @param [Object] aggregation Object to be assigned
1187
+ def aggregation=(aggregation)
1188
+ validator = EnumAttributeValidator.new('String', ["sum", "count"])
1189
+ unless validator.valid?(aggregation)
1190
+ fail ArgumentError, "invalid value for \"aggregation\", must be one of #{validator.allowable_values}."
1191
+ end
1192
+ @aggregation = aggregation
1193
+ end
1194
+
1195
+ # Checks equality by comparing each attribute.
1196
+ # @param [Object] Object to be compared
1197
+ def ==(o)
1198
+ return true if self.equal?(o)
1199
+ self.class == o.class &&
1200
+ included_segments == o.included_segments &&
1201
+ excluded_segments == o.excluded_segments &&
1202
+ include_player_ids == o.include_player_ids &&
1203
+ include_external_user_ids == o.include_external_user_ids &&
1204
+ include_email_tokens == o.include_email_tokens &&
1205
+ include_phone_numbers == o.include_phone_numbers &&
1206
+ include_ios_tokens == o.include_ios_tokens &&
1207
+ include_wp_wns_uris == o.include_wp_wns_uris &&
1208
+ include_amazon_reg_ids == o.include_amazon_reg_ids &&
1209
+ include_chrome_reg_ids == o.include_chrome_reg_ids &&
1210
+ include_chrome_web_reg_ids == o.include_chrome_web_reg_ids &&
1211
+ include_android_reg_ids == o.include_android_reg_ids &&
1212
+ include_aliases == o.include_aliases &&
1213
+ target_channel == o.target_channel &&
1214
+ id == o.id &&
1215
+ value == o.value &&
1216
+ name == o.name &&
1217
+ aggregation == o.aggregation &&
1218
+ is_ios == o.is_ios &&
1219
+ is_android == o.is_android &&
1220
+ is_huawei == o.is_huawei &&
1221
+ is_any_web == o.is_any_web &&
1222
+ is_chrome_web == o.is_chrome_web &&
1223
+ is_firefox == o.is_firefox &&
1224
+ is_safari == o.is_safari &&
1225
+ is_wp_wns == o.is_wp_wns &&
1226
+ is_adm == o.is_adm &&
1227
+ is_chrome == o.is_chrome &&
1228
+ channel_for_external_user_ids == o.channel_for_external_user_ids &&
1229
+ app_id == o.app_id &&
1230
+ external_id == o.external_id &&
1231
+ contents == o.contents &&
1232
+ headings == o.headings &&
1233
+ subtitle == o.subtitle &&
1234
+ data == o.data &&
1235
+ huawei_msg_type == o.huawei_msg_type &&
1236
+ url == o.url &&
1237
+ web_url == o.web_url &&
1238
+ app_url == o.app_url &&
1239
+ ios_attachments == o.ios_attachments &&
1240
+ template_id == o.template_id &&
1241
+ content_available == o.content_available &&
1242
+ mutable_content == o.mutable_content &&
1243
+ target_content_identifier == o.target_content_identifier &&
1244
+ big_picture == o.big_picture &&
1245
+ huawei_big_picture == o.huawei_big_picture &&
1246
+ adm_big_picture == o.adm_big_picture &&
1247
+ chrome_big_picture == o.chrome_big_picture &&
1248
+ chrome_web_image == o.chrome_web_image &&
1249
+ buttons == o.buttons &&
1250
+ web_buttons == o.web_buttons &&
1251
+ ios_category == o.ios_category &&
1252
+ android_channel_id == o.android_channel_id &&
1253
+ huawei_channel_id == o.huawei_channel_id &&
1254
+ existing_android_channel_id == o.existing_android_channel_id &&
1255
+ huawei_existing_channel_id == o.huawei_existing_channel_id &&
1256
+ android_background_layout == o.android_background_layout &&
1257
+ small_icon == o.small_icon &&
1258
+ huawei_small_icon == o.huawei_small_icon &&
1259
+ large_icon == o.large_icon &&
1260
+ huawei_large_icon == o.huawei_large_icon &&
1261
+ adm_small_icon == o.adm_small_icon &&
1262
+ adm_large_icon == o.adm_large_icon &&
1263
+ chrome_web_icon == o.chrome_web_icon &&
1264
+ chrome_web_badge == o.chrome_web_badge &&
1265
+ firefox_icon == o.firefox_icon &&
1266
+ chrome_icon == o.chrome_icon &&
1267
+ ios_sound == o.ios_sound &&
1268
+ android_sound == o.android_sound &&
1269
+ huawei_sound == o.huawei_sound &&
1270
+ adm_sound == o.adm_sound &&
1271
+ wp_wns_sound == o.wp_wns_sound &&
1272
+ android_led_color == o.android_led_color &&
1273
+ huawei_led_color == o.huawei_led_color &&
1274
+ android_accent_color == o.android_accent_color &&
1275
+ huawei_accent_color == o.huawei_accent_color &&
1276
+ android_visibility == o.android_visibility &&
1277
+ huawei_visibility == o.huawei_visibility &&
1278
+ ios_badge_type == o.ios_badge_type &&
1279
+ ios_badge_count == o.ios_badge_count &&
1280
+ collapse_id == o.collapse_id &&
1281
+ web_push_topic == o.web_push_topic &&
1282
+ apns_alert == o.apns_alert &&
1283
+ delayed_option == o.delayed_option &&
1284
+ delivery_time_of_day == o.delivery_time_of_day &&
1285
+ ttl == o.ttl &&
1286
+ priority == o.priority &&
1287
+ apns_push_type_override == o.apns_push_type_override &&
1288
+ throttle_rate_per_minute == o.throttle_rate_per_minute &&
1289
+ android_group == o.android_group &&
1290
+ android_group_message == o.android_group_message &&
1291
+ adm_group == o.adm_group &&
1292
+ adm_group_message == o.adm_group_message &&
1293
+ thread_id == o.thread_id &&
1294
+ summary_arg == o.summary_arg &&
1295
+ summary_arg_count == o.summary_arg_count &&
1296
+ email_subject == o.email_subject &&
1297
+ email_body == o.email_body &&
1298
+ email_from_name == o.email_from_name &&
1299
+ email_from_address == o.email_from_address &&
1300
+ email_preheader == o.email_preheader &&
1301
+ include_unsubscribed == o.include_unsubscribed &&
1302
+ sms_from == o.sms_from &&
1303
+ sms_media_urls == o.sms_media_urls &&
1304
+ filters == o.filters &&
1305
+ custom_data == o.custom_data &&
1306
+ send_after == o.send_after
1307
+ end
1308
+
1309
+ # @see the `==` method
1310
+ # @param [Object] Object to be compared
1311
+ def eql?(o)
1312
+ self == o
1313
+ end
1314
+
1315
+ # Calculates hash code according to all attributes.
1316
+ # @return [Integer] Hash code
1317
+ def hash
1318
+ [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, send_after].hash
1319
+ end
1320
+
1321
+ # Builds the object from hash
1322
+ # @param [Hash] attributes Model attributes in the form of hash
1323
+ # @return [Object] Returns the model itself
1324
+ def self.build_from_hash(attributes)
1325
+ new.build_from_hash(attributes)
1326
+ end
1327
+
1328
+ # Builds the object from hash
1329
+ # @param [Hash] attributes Model attributes in the form of hash
1330
+ # @return [Object] Returns the model itself
1331
+ def build_from_hash(attributes)
1332
+ return nil unless attributes.is_a?(Hash)
1333
+ attributes = attributes.transform_keys(&:to_sym)
1334
+ self.class.openapi_types.each_pair do |key, type|
1335
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
1336
+ self.send("#{key}=", nil)
1337
+ elsif type =~ /\AArray<(.*)>/i
1338
+ # check to ensure the input is an array given that the attribute
1339
+ # is documented as an array but the input is not
1340
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
1341
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
1342
+ end
1343
+ elsif !attributes[self.class.attribute_map[key]].nil?
1344
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
1345
+ end
1346
+ end
1347
+
1348
+ self
1349
+ end
1350
+
1351
+ # Deserializes the data based on type
1352
+ # @param string type Data type
1353
+ # @param string value Value to be deserialized
1354
+ # @return [Object] Deserialized data
1355
+ def _deserialize(type, value)
1356
+ case type.to_sym
1357
+ when :Time
1358
+ Time.parse(value)
1359
+ when :Date
1360
+ Date.parse(value)
1361
+ when :String
1362
+ value.to_s
1363
+ when :Integer
1364
+ value.to_i
1365
+ when :Float
1366
+ value.to_f
1367
+ when :Boolean
1368
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
1369
+ true
1370
+ else
1371
+ false
1372
+ end
1373
+ when :Object
1374
+ # generic object (usually a Hash), return directly
1375
+ value
1376
+ when /\AArray<(?<inner_type>.+)>\z/
1377
+ inner_type = Regexp.last_match[:inner_type]
1378
+ value.map { |v| _deserialize(inner_type, v) }
1379
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
1380
+ k_type = Regexp.last_match[:k_type]
1381
+ v_type = Regexp.last_match[:v_type]
1382
+ {}.tap do |hash|
1383
+ value.each do |k, v|
1384
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
1385
+ end
1386
+ end
1387
+ else # model
1388
+ # models (e.g. Pet) or oneOf
1389
+ klass = OneSignal.const_get(type)
1390
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
1391
+ end
1392
+ end
1393
+
1394
+ # Returns the string representation of the object
1395
+ # @return [String] String presentation of the object
1396
+ def to_s
1397
+ to_hash.to_s
1398
+ end
1399
+
1400
+ # to_body is an alias to to_hash (backward compatibility)
1401
+ # @return [Hash] Returns the object in the form of hash
1402
+ def to_body
1403
+ to_hash
1404
+ end
1405
+
1406
+ # Returns the object in the form of hash
1407
+ # @return [Hash] Returns the object in the form of hash
1408
+ def to_hash
1409
+ hash = {}
1410
+ self.class.attribute_map.each_pair do |attr, param|
1411
+ value = self.send(attr)
1412
+ if value.nil?
1413
+ is_nullable = self.class.openapi_nullable.include?(attr)
1414
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
1415
+ end
1416
+
1417
+ hash[param] = _to_hash(value)
1418
+ end
1419
+ hash
1420
+ end
1421
+
1422
+ # Outputs non-array value in the form of hash
1423
+ # For object, use to_hash. Otherwise, just return the value
1424
+ # @param [Object] value Any valid value
1425
+ # @return [Hash] Returns the value in the form of hash
1426
+ def _to_hash(value)
1427
+ if value.is_a?(Array)
1428
+ value.compact.map { |v| _to_hash(v) }
1429
+ elsif value.is_a?(Hash)
1430
+ {}.tap do |hash|
1431
+ value.each { |k, v| hash[k] = _to_hash(v) }
1432
+ end
1433
+ elsif value.respond_to? :to_hash
1434
+ value.to_hash
1435
+ else
1436
+ value
1437
+ end
1438
+ end
1439
+
1440
+ end
1441
+
1442
+ end