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,1241 @@
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 BasicNotificationAllOf
18
+ attr_accessor :id
19
+
20
+ attr_accessor :value
21
+
22
+ # Required for SMS Messages. An identifier for tracking message within the OneSignal dashboard or export analytics. Not shown to end user.
23
+ attr_accessor :name
24
+
25
+ attr_accessor :aggregation
26
+
27
+ # Indicates whether to send to all devices registered under your app's Apple iOS platform.
28
+ attr_accessor :is_ios
29
+
30
+ # Indicates whether to send to all devices registered under your app's Google Android platform.
31
+ attr_accessor :is_android
32
+
33
+ # Indicates whether to send to all devices registered under your app's Huawei Android platform.
34
+ attr_accessor :is_huawei
35
+
36
+ # 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.
37
+ attr_accessor :is_any_web
38
+
39
+ # Indicates whether to send to all Google Chrome, Chrome on Android, and Mozilla Firefox users registered under your Chrome & Firefox web push platform.
40
+ attr_accessor :is_chrome_web
41
+
42
+ # Indicates whether to send to all Mozilla Firefox desktop users registered under your Firefox web push platform.
43
+ attr_accessor :is_firefox
44
+
45
+ # 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
46
+ attr_accessor :is_safari
47
+
48
+ # Indicates whether to send to all devices registered under your app's Windows platform.
49
+ attr_accessor :is_wp_wns
50
+
51
+ # Indicates whether to send to all devices registered under your app's Amazon Fire platform.
52
+ attr_accessor :is_adm
53
+
54
+ # 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.
55
+ attr_accessor :is_chrome
56
+
57
+ # 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.
58
+ attr_accessor :channel_for_external_user_ids
59
+
60
+ # 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.
61
+ attr_accessor :app_id
62
+
63
+ # 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
64
+ attr_accessor :external_id
65
+
66
+ attr_accessor :contents
67
+
68
+ attr_accessor :headings
69
+
70
+ attr_accessor :subtitle
71
+
72
+ # 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}
73
+ attr_accessor :data
74
+
75
+ # Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications.
76
+ attr_accessor :huawei_msg_type
77
+
78
+ # 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
79
+ attr_accessor :url
80
+
81
+ # 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
82
+ attr_accessor :web_url
83
+
84
+ # 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
85
+ attr_accessor :app_url
86
+
87
+ # 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\"}
88
+ attr_accessor :ios_attachments
89
+
90
+ # 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
91
+ attr_accessor :template_id
92
+
93
+ # 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.
94
+ attr_accessor :content_available
95
+
96
+ # 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.
97
+ attr_accessor :mutable_content
98
+
99
+ # 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.
100
+ attr_accessor :target_content_identifier
101
+
102
+ # Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL.
103
+ attr_accessor :big_picture
104
+
105
+ # Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL.
106
+ attr_accessor :huawei_big_picture
107
+
108
+ # Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL.
109
+ attr_accessor :adm_big_picture
110
+
111
+ # Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL.
112
+ attr_accessor :chrome_big_picture
113
+
114
+ # 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.
115
+ attr_accessor :chrome_web_image
116
+
117
+ # 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\"}]
118
+ attr_accessor :buttons
119
+
120
+ # 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\"}]
121
+ attr_accessor :web_buttons
122
+
123
+ # 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.
124
+ attr_accessor :ios_category
125
+
126
+ # 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.
127
+ attr_accessor :android_channel_id
128
+
129
+ # 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.
130
+ attr_accessor :huawei_channel_id
131
+
132
+ # Channel: Push Notifications Platform: Android Use this if you have client side Android Oreo Channels you have already defined in your app with code.
133
+ attr_accessor :existing_android_channel_id
134
+
135
+ # Channel: Push Notifications Platform: Huawei Use this if you have client side Android Oreo Channels you have already defined in your app with code.
136
+ attr_accessor :huawei_existing_channel_id
137
+
138
+ attr_accessor :android_background_layout
139
+
140
+ # 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
141
+ attr_accessor :small_icon
142
+
143
+ # 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.
144
+ attr_accessor :huawei_small_icon
145
+
146
+ # Channel: Push Notifications Platform: Android Can be a drawable resource name or a URL. See: How to create large icons
147
+ attr_accessor :large_icon
148
+
149
+ # Channel: Push Notifications Platform: Huawei Can be a drawable resource name or a URL. See: How to create large icons
150
+ attr_accessor :huawei_large_icon
151
+
152
+ # 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
153
+ attr_accessor :adm_small_icon
154
+
155
+ # 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
156
+ attr_accessor :adm_large_icon
157
+
158
+ # 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.
159
+ attr_accessor :chrome_web_icon
160
+
161
+ # Channel: Push Notifications Platform: Chrome Sets the web push notification icon for Android devices in the notification shade. Please see Web Push Notification Badge.
162
+ attr_accessor :chrome_web_badge
163
+
164
+ # 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.
165
+ attr_accessor :firefox_icon
166
+
167
+ # 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.
168
+ attr_accessor :chrome_icon
169
+
170
+ # 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\"
171
+ attr_accessor :ios_sound
172
+
173
+ # 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\"
174
+ attr_accessor :android_sound
175
+
176
+ # 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\"
177
+ attr_accessor :huawei_sound
178
+
179
+ # 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\"
180
+ attr_accessor :adm_sound
181
+
182
+ # 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\"
183
+ attr_accessor :wp_wns_sound
184
+
185
+ # 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\"
186
+ attr_accessor :android_led_color
187
+
188
+ # 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\"
189
+ attr_accessor :huawei_led_color
190
+
191
+ # 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\"
192
+ attr_accessor :android_accent_color
193
+
194
+ # 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.
195
+ attr_accessor :huawei_accent_color
196
+
197
+ # 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)
198
+ attr_accessor :android_visibility
199
+
200
+ # 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)
201
+ attr_accessor :huawei_visibility
202
+
203
+ # 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.
204
+ attr_accessor :ios_badge_type
205
+
206
+ # 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.
207
+ attr_accessor :ios_badge_count
208
+
209
+ # 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.
210
+ attr_accessor :collapse_id
211
+
212
+ # Channel: Push Notifications Platform: All Browsers Display multiple notifications at once with different topics.
213
+ attr_accessor :web_push_topic
214
+
215
+ # 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.
216
+ attr_accessor :apns_alert
217
+
218
+ # 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.
219
+ attr_accessor :delayed_option
220
+
221
+ # Channel: All Use with delayed_option=timezone. Examples: \"9:00AM\" \"21:45\" \"9:45:30\"
222
+ attr_accessor :delivery_time_of_day
223
+
224
+ # 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).
225
+ attr_accessor :ttl
226
+
227
+ # 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.
228
+ attr_accessor :priority
229
+
230
+ # 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
231
+ attr_accessor :apns_push_type_override
232
+
233
+ # 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.
234
+ attr_accessor :throttle_rate_per_minute
235
+
236
+ # Channel: Push Notifications Platform: Android Notifications with the same group will be stacked together using Android's Notification Grouping feature.
237
+ attr_accessor :android_group
238
+
239
+ # 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\"}
240
+ attr_accessor :android_group_message
241
+
242
+ # Channel: Push Notifications Platform: Amazon Notifications with the same group will be stacked together using Android's Notification Grouping feature.
243
+ attr_accessor :adm_group
244
+
245
+ # 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\"}
246
+ attr_accessor :adm_group_message
247
+
248
+ # 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.
249
+ attr_accessor :thread_id
250
+
251
+ # 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\"
252
+ attr_accessor :summary_arg
253
+
254
+ # 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\"
255
+ attr_accessor :summary_arg_count
256
+
257
+ # Channel: Email Required. The subject of the email.
258
+ attr_accessor :email_subject
259
+
260
+ # 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.
261
+ attr_accessor :email_body
262
+
263
+ # Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings.
264
+ attr_accessor :email_from_name
265
+
266
+ # Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings.
267
+ attr_accessor :email_from_address
268
+
269
+ # 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.
270
+ attr_accessor :email_preheader
271
+
272
+ # 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.
273
+ attr_accessor :include_unsubscribed
274
+
275
+ # Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format.
276
+ attr_accessor :sms_from
277
+
278
+ # 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.
279
+ attr_accessor :sms_media_urls
280
+
281
+ attr_accessor :filters
282
+
283
+ # 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}
284
+ attr_accessor :custom_data
285
+
286
+ class EnumAttributeValidator
287
+ attr_reader :datatype
288
+ attr_reader :allowable_values
289
+
290
+ def initialize(datatype, allowable_values)
291
+ @allowable_values = allowable_values.map do |value|
292
+ case datatype.to_s
293
+ when /Integer/i
294
+ value.to_i
295
+ when /Float/i
296
+ value.to_f
297
+ else
298
+ value
299
+ end
300
+ end
301
+ end
302
+
303
+ def valid?(value)
304
+ !value || allowable_values.include?(value)
305
+ end
306
+ end
307
+
308
+ # Attribute mapping from ruby-style variable name to JSON key.
309
+ def self.attribute_map
310
+ {
311
+ :'id' => :'id',
312
+ :'value' => :'value',
313
+ :'name' => :'name',
314
+ :'aggregation' => :'aggregation',
315
+ :'is_ios' => :'isIos',
316
+ :'is_android' => :'isAndroid',
317
+ :'is_huawei' => :'isHuawei',
318
+ :'is_any_web' => :'isAnyWeb',
319
+ :'is_chrome_web' => :'isChromeWeb',
320
+ :'is_firefox' => :'isFirefox',
321
+ :'is_safari' => :'isSafari',
322
+ :'is_wp_wns' => :'isWP_WNS',
323
+ :'is_adm' => :'isAdm',
324
+ :'is_chrome' => :'isChrome',
325
+ :'channel_for_external_user_ids' => :'channel_for_external_user_ids',
326
+ :'app_id' => :'app_id',
327
+ :'external_id' => :'external_id',
328
+ :'contents' => :'contents',
329
+ :'headings' => :'headings',
330
+ :'subtitle' => :'subtitle',
331
+ :'data' => :'data',
332
+ :'huawei_msg_type' => :'huawei_msg_type',
333
+ :'url' => :'url',
334
+ :'web_url' => :'web_url',
335
+ :'app_url' => :'app_url',
336
+ :'ios_attachments' => :'ios_attachments',
337
+ :'template_id' => :'template_id',
338
+ :'content_available' => :'content_available',
339
+ :'mutable_content' => :'mutable_content',
340
+ :'target_content_identifier' => :'target_content_identifier',
341
+ :'big_picture' => :'big_picture',
342
+ :'huawei_big_picture' => :'huawei_big_picture',
343
+ :'adm_big_picture' => :'adm_big_picture',
344
+ :'chrome_big_picture' => :'chrome_big_picture',
345
+ :'chrome_web_image' => :'chrome_web_image',
346
+ :'buttons' => :'buttons',
347
+ :'web_buttons' => :'web_buttons',
348
+ :'ios_category' => :'ios_category',
349
+ :'android_channel_id' => :'android_channel_id',
350
+ :'huawei_channel_id' => :'huawei_channel_id',
351
+ :'existing_android_channel_id' => :'existing_android_channel_id',
352
+ :'huawei_existing_channel_id' => :'huawei_existing_channel_id',
353
+ :'android_background_layout' => :'android_background_layout',
354
+ :'small_icon' => :'small_icon',
355
+ :'huawei_small_icon' => :'huawei_small_icon',
356
+ :'large_icon' => :'large_icon',
357
+ :'huawei_large_icon' => :'huawei_large_icon',
358
+ :'adm_small_icon' => :'adm_small_icon',
359
+ :'adm_large_icon' => :'adm_large_icon',
360
+ :'chrome_web_icon' => :'chrome_web_icon',
361
+ :'chrome_web_badge' => :'chrome_web_badge',
362
+ :'firefox_icon' => :'firefox_icon',
363
+ :'chrome_icon' => :'chrome_icon',
364
+ :'ios_sound' => :'ios_sound',
365
+ :'android_sound' => :'android_sound',
366
+ :'huawei_sound' => :'huawei_sound',
367
+ :'adm_sound' => :'adm_sound',
368
+ :'wp_wns_sound' => :'wp_wns_sound',
369
+ :'android_led_color' => :'android_led_color',
370
+ :'huawei_led_color' => :'huawei_led_color',
371
+ :'android_accent_color' => :'android_accent_color',
372
+ :'huawei_accent_color' => :'huawei_accent_color',
373
+ :'android_visibility' => :'android_visibility',
374
+ :'huawei_visibility' => :'huawei_visibility',
375
+ :'ios_badge_type' => :'ios_badgeType',
376
+ :'ios_badge_count' => :'ios_badgeCount',
377
+ :'collapse_id' => :'collapse_id',
378
+ :'web_push_topic' => :'web_push_topic',
379
+ :'apns_alert' => :'apns_alert',
380
+ :'delayed_option' => :'delayed_option',
381
+ :'delivery_time_of_day' => :'delivery_time_of_day',
382
+ :'ttl' => :'ttl',
383
+ :'priority' => :'priority',
384
+ :'apns_push_type_override' => :'apns_push_type_override',
385
+ :'throttle_rate_per_minute' => :'throttle_rate_per_minute',
386
+ :'android_group' => :'android_group',
387
+ :'android_group_message' => :'android_group_message',
388
+ :'adm_group' => :'adm_group',
389
+ :'adm_group_message' => :'adm_group_message',
390
+ :'thread_id' => :'thread_id',
391
+ :'summary_arg' => :'summary_arg',
392
+ :'summary_arg_count' => :'summary_arg_count',
393
+ :'email_subject' => :'email_subject',
394
+ :'email_body' => :'email_body',
395
+ :'email_from_name' => :'email_from_name',
396
+ :'email_from_address' => :'email_from_address',
397
+ :'email_preheader' => :'email_preheader',
398
+ :'include_unsubscribed' => :'include_unsubscribed',
399
+ :'sms_from' => :'sms_from',
400
+ :'sms_media_urls' => :'sms_media_urls',
401
+ :'filters' => :'filters',
402
+ :'custom_data' => :'custom_data'
403
+ }
404
+ end
405
+
406
+ # Returns all the JSON keys this model knows about
407
+ def self.acceptable_attributes
408
+ attribute_map.values
409
+ end
410
+
411
+ # Attribute type mapping.
412
+ def self.openapi_types
413
+ {
414
+ :'id' => :'String',
415
+ :'value' => :'Integer',
416
+ :'name' => :'String',
417
+ :'aggregation' => :'String',
418
+ :'is_ios' => :'Boolean',
419
+ :'is_android' => :'Boolean',
420
+ :'is_huawei' => :'Boolean',
421
+ :'is_any_web' => :'Boolean',
422
+ :'is_chrome_web' => :'Boolean',
423
+ :'is_firefox' => :'Boolean',
424
+ :'is_safari' => :'Boolean',
425
+ :'is_wp_wns' => :'Boolean',
426
+ :'is_adm' => :'Boolean',
427
+ :'is_chrome' => :'Boolean',
428
+ :'channel_for_external_user_ids' => :'String',
429
+ :'app_id' => :'String',
430
+ :'external_id' => :'String',
431
+ :'contents' => :'StringMap',
432
+ :'headings' => :'StringMap',
433
+ :'subtitle' => :'StringMap',
434
+ :'data' => :'Object',
435
+ :'huawei_msg_type' => :'String',
436
+ :'url' => :'String',
437
+ :'web_url' => :'String',
438
+ :'app_url' => :'String',
439
+ :'ios_attachments' => :'Object',
440
+ :'template_id' => :'String',
441
+ :'content_available' => :'Boolean',
442
+ :'mutable_content' => :'Boolean',
443
+ :'target_content_identifier' => :'String',
444
+ :'big_picture' => :'String',
445
+ :'huawei_big_picture' => :'String',
446
+ :'adm_big_picture' => :'String',
447
+ :'chrome_big_picture' => :'String',
448
+ :'chrome_web_image' => :'String',
449
+ :'buttons' => :'Array<Button>',
450
+ :'web_buttons' => :'Array<Button>',
451
+ :'ios_category' => :'String',
452
+ :'android_channel_id' => :'String',
453
+ :'huawei_channel_id' => :'String',
454
+ :'existing_android_channel_id' => :'String',
455
+ :'huawei_existing_channel_id' => :'String',
456
+ :'android_background_layout' => :'BasicNotificationAllOfAndroidBackgroundLayout',
457
+ :'small_icon' => :'String',
458
+ :'huawei_small_icon' => :'String',
459
+ :'large_icon' => :'String',
460
+ :'huawei_large_icon' => :'String',
461
+ :'adm_small_icon' => :'String',
462
+ :'adm_large_icon' => :'String',
463
+ :'chrome_web_icon' => :'String',
464
+ :'chrome_web_badge' => :'String',
465
+ :'firefox_icon' => :'String',
466
+ :'chrome_icon' => :'String',
467
+ :'ios_sound' => :'String',
468
+ :'android_sound' => :'String',
469
+ :'huawei_sound' => :'String',
470
+ :'adm_sound' => :'String',
471
+ :'wp_wns_sound' => :'String',
472
+ :'android_led_color' => :'String',
473
+ :'huawei_led_color' => :'String',
474
+ :'android_accent_color' => :'String',
475
+ :'huawei_accent_color' => :'String',
476
+ :'android_visibility' => :'Integer',
477
+ :'huawei_visibility' => :'Integer',
478
+ :'ios_badge_type' => :'String',
479
+ :'ios_badge_count' => :'Integer',
480
+ :'collapse_id' => :'String',
481
+ :'web_push_topic' => :'String',
482
+ :'apns_alert' => :'Object',
483
+ :'delayed_option' => :'String',
484
+ :'delivery_time_of_day' => :'String',
485
+ :'ttl' => :'Integer',
486
+ :'priority' => :'Integer',
487
+ :'apns_push_type_override' => :'String',
488
+ :'throttle_rate_per_minute' => :'String',
489
+ :'android_group' => :'String',
490
+ :'android_group_message' => :'String',
491
+ :'adm_group' => :'String',
492
+ :'adm_group_message' => :'Object',
493
+ :'thread_id' => :'String',
494
+ :'summary_arg' => :'String',
495
+ :'summary_arg_count' => :'Integer',
496
+ :'email_subject' => :'String',
497
+ :'email_body' => :'String',
498
+ :'email_from_name' => :'String',
499
+ :'email_from_address' => :'String',
500
+ :'email_preheader' => :'String',
501
+ :'include_unsubscribed' => :'Boolean',
502
+ :'sms_from' => :'String',
503
+ :'sms_media_urls' => :'Array<String>',
504
+ :'filters' => :'Array<Filter>',
505
+ :'custom_data' => :'Object'
506
+ }
507
+ end
508
+
509
+ # List of attributes with nullable: true
510
+ def self.openapi_nullable
511
+ Set.new([
512
+ :'name',
513
+ :'is_ios',
514
+ :'is_android',
515
+ :'is_huawei',
516
+ :'is_any_web',
517
+ :'is_chrome_web',
518
+ :'is_firefox',
519
+ :'is_safari',
520
+ :'is_wp_wns',
521
+ :'is_adm',
522
+ :'is_chrome',
523
+ :'external_id',
524
+ :'contents',
525
+ :'headings',
526
+ :'subtitle',
527
+ :'data',
528
+ :'huawei_msg_type',
529
+ :'url',
530
+ :'web_url',
531
+ :'app_url',
532
+ :'ios_attachments',
533
+ :'template_id',
534
+ :'content_available',
535
+ :'target_content_identifier',
536
+ :'big_picture',
537
+ :'huawei_big_picture',
538
+ :'adm_big_picture',
539
+ :'chrome_big_picture',
540
+ :'chrome_web_image',
541
+ :'buttons',
542
+ :'web_buttons',
543
+ :'ios_category',
544
+ :'huawei_channel_id',
545
+ :'huawei_existing_channel_id',
546
+ :'small_icon',
547
+ :'huawei_small_icon',
548
+ :'large_icon',
549
+ :'huawei_large_icon',
550
+ :'adm_small_icon',
551
+ :'adm_large_icon',
552
+ :'chrome_web_icon',
553
+ :'chrome_web_badge',
554
+ :'firefox_icon',
555
+ :'chrome_icon',
556
+ :'ios_sound',
557
+ :'android_sound',
558
+ :'huawei_sound',
559
+ :'adm_sound',
560
+ :'wp_wns_sound',
561
+ :'android_led_color',
562
+ :'huawei_led_color',
563
+ :'android_accent_color',
564
+ :'huawei_accent_color',
565
+ :'android_visibility',
566
+ :'huawei_visibility',
567
+ :'ios_badge_type',
568
+ :'ios_badge_count',
569
+ :'web_push_topic',
570
+ :'apns_alert',
571
+ :'delayed_option',
572
+ :'delivery_time_of_day',
573
+ :'ttl',
574
+ :'priority',
575
+ :'throttle_rate_per_minute',
576
+ :'android_group',
577
+ :'android_group_message',
578
+ :'adm_group',
579
+ :'adm_group_message',
580
+ :'thread_id',
581
+ :'email_subject',
582
+ :'email_from_name',
583
+ :'email_from_address',
584
+ :'email_preheader',
585
+ :'sms_from',
586
+ :'sms_media_urls',
587
+ :'filters',
588
+ :'custom_data'
589
+ ])
590
+ end
591
+
592
+ # Initializes the object
593
+ # @param [Hash] attributes Model attributes in the form of hash
594
+ def initialize(attributes = {})
595
+ if (!attributes.is_a?(Hash))
596
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::BasicNotificationAllOf` initialize method"
597
+ end
598
+
599
+ # check to see if the attribute exists and convert string to symbol for hash key
600
+ attributes = attributes.each_with_object({}) { |(k, v), h|
601
+ if (!self.class.attribute_map.key?(k.to_sym))
602
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::BasicNotificationAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
603
+ end
604
+ h[k.to_sym] = v
605
+ }
606
+
607
+ if attributes.key?(:'id')
608
+ self.id = attributes[:'id']
609
+ end
610
+
611
+ if attributes.key?(:'value')
612
+ self.value = attributes[:'value']
613
+ end
614
+
615
+ if attributes.key?(:'name')
616
+ self.name = attributes[:'name']
617
+ end
618
+
619
+ if attributes.key?(:'aggregation')
620
+ self.aggregation = attributes[:'aggregation']
621
+ end
622
+
623
+ if attributes.key?(:'is_ios')
624
+ self.is_ios = attributes[:'is_ios']
625
+ end
626
+
627
+ if attributes.key?(:'is_android')
628
+ self.is_android = attributes[:'is_android']
629
+ end
630
+
631
+ if attributes.key?(:'is_huawei')
632
+ self.is_huawei = attributes[:'is_huawei']
633
+ end
634
+
635
+ if attributes.key?(:'is_any_web')
636
+ self.is_any_web = attributes[:'is_any_web']
637
+ end
638
+
639
+ if attributes.key?(:'is_chrome_web')
640
+ self.is_chrome_web = attributes[:'is_chrome_web']
641
+ end
642
+
643
+ if attributes.key?(:'is_firefox')
644
+ self.is_firefox = attributes[:'is_firefox']
645
+ end
646
+
647
+ if attributes.key?(:'is_safari')
648
+ self.is_safari = attributes[:'is_safari']
649
+ end
650
+
651
+ if attributes.key?(:'is_wp_wns')
652
+ self.is_wp_wns = attributes[:'is_wp_wns']
653
+ end
654
+
655
+ if attributes.key?(:'is_adm')
656
+ self.is_adm = attributes[:'is_adm']
657
+ end
658
+
659
+ if attributes.key?(:'is_chrome')
660
+ self.is_chrome = attributes[:'is_chrome']
661
+ end
662
+
663
+ if attributes.key?(:'channel_for_external_user_ids')
664
+ self.channel_for_external_user_ids = attributes[:'channel_for_external_user_ids']
665
+ end
666
+
667
+ if attributes.key?(:'app_id')
668
+ self.app_id = attributes[:'app_id']
669
+ end
670
+
671
+ if attributes.key?(:'external_id')
672
+ self.external_id = attributes[:'external_id']
673
+ end
674
+
675
+ if attributes.key?(:'contents')
676
+ self.contents = attributes[:'contents']
677
+ end
678
+
679
+ if attributes.key?(:'headings')
680
+ self.headings = attributes[:'headings']
681
+ end
682
+
683
+ if attributes.key?(:'subtitle')
684
+ self.subtitle = attributes[:'subtitle']
685
+ end
686
+
687
+ if attributes.key?(:'data')
688
+ self.data = attributes[:'data']
689
+ end
690
+
691
+ if attributes.key?(:'huawei_msg_type')
692
+ self.huawei_msg_type = attributes[:'huawei_msg_type']
693
+ end
694
+
695
+ if attributes.key?(:'url')
696
+ self.url = attributes[:'url']
697
+ end
698
+
699
+ if attributes.key?(:'web_url')
700
+ self.web_url = attributes[:'web_url']
701
+ end
702
+
703
+ if attributes.key?(:'app_url')
704
+ self.app_url = attributes[:'app_url']
705
+ end
706
+
707
+ if attributes.key?(:'ios_attachments')
708
+ self.ios_attachments = attributes[:'ios_attachments']
709
+ end
710
+
711
+ if attributes.key?(:'template_id')
712
+ self.template_id = attributes[:'template_id']
713
+ end
714
+
715
+ if attributes.key?(:'content_available')
716
+ self.content_available = attributes[:'content_available']
717
+ end
718
+
719
+ if attributes.key?(:'mutable_content')
720
+ self.mutable_content = attributes[:'mutable_content']
721
+ end
722
+
723
+ if attributes.key?(:'target_content_identifier')
724
+ self.target_content_identifier = attributes[:'target_content_identifier']
725
+ end
726
+
727
+ if attributes.key?(:'big_picture')
728
+ self.big_picture = attributes[:'big_picture']
729
+ end
730
+
731
+ if attributes.key?(:'huawei_big_picture')
732
+ self.huawei_big_picture = attributes[:'huawei_big_picture']
733
+ end
734
+
735
+ if attributes.key?(:'adm_big_picture')
736
+ self.adm_big_picture = attributes[:'adm_big_picture']
737
+ end
738
+
739
+ if attributes.key?(:'chrome_big_picture')
740
+ self.chrome_big_picture = attributes[:'chrome_big_picture']
741
+ end
742
+
743
+ if attributes.key?(:'chrome_web_image')
744
+ self.chrome_web_image = attributes[:'chrome_web_image']
745
+ end
746
+
747
+ if attributes.key?(:'buttons')
748
+ if (value = attributes[:'buttons']).is_a?(Array)
749
+ self.buttons = value
750
+ end
751
+ end
752
+
753
+ if attributes.key?(:'web_buttons')
754
+ if (value = attributes[:'web_buttons']).is_a?(Array)
755
+ self.web_buttons = value
756
+ end
757
+ end
758
+
759
+ if attributes.key?(:'ios_category')
760
+ self.ios_category = attributes[:'ios_category']
761
+ end
762
+
763
+ if attributes.key?(:'android_channel_id')
764
+ self.android_channel_id = attributes[:'android_channel_id']
765
+ end
766
+
767
+ if attributes.key?(:'huawei_channel_id')
768
+ self.huawei_channel_id = attributes[:'huawei_channel_id']
769
+ end
770
+
771
+ if attributes.key?(:'existing_android_channel_id')
772
+ self.existing_android_channel_id = attributes[:'existing_android_channel_id']
773
+ end
774
+
775
+ if attributes.key?(:'huawei_existing_channel_id')
776
+ self.huawei_existing_channel_id = attributes[:'huawei_existing_channel_id']
777
+ end
778
+
779
+ if attributes.key?(:'android_background_layout')
780
+ self.android_background_layout = attributes[:'android_background_layout']
781
+ end
782
+
783
+ if attributes.key?(:'small_icon')
784
+ self.small_icon = attributes[:'small_icon']
785
+ end
786
+
787
+ if attributes.key?(:'huawei_small_icon')
788
+ self.huawei_small_icon = attributes[:'huawei_small_icon']
789
+ end
790
+
791
+ if attributes.key?(:'large_icon')
792
+ self.large_icon = attributes[:'large_icon']
793
+ end
794
+
795
+ if attributes.key?(:'huawei_large_icon')
796
+ self.huawei_large_icon = attributes[:'huawei_large_icon']
797
+ end
798
+
799
+ if attributes.key?(:'adm_small_icon')
800
+ self.adm_small_icon = attributes[:'adm_small_icon']
801
+ end
802
+
803
+ if attributes.key?(:'adm_large_icon')
804
+ self.adm_large_icon = attributes[:'adm_large_icon']
805
+ end
806
+
807
+ if attributes.key?(:'chrome_web_icon')
808
+ self.chrome_web_icon = attributes[:'chrome_web_icon']
809
+ end
810
+
811
+ if attributes.key?(:'chrome_web_badge')
812
+ self.chrome_web_badge = attributes[:'chrome_web_badge']
813
+ end
814
+
815
+ if attributes.key?(:'firefox_icon')
816
+ self.firefox_icon = attributes[:'firefox_icon']
817
+ end
818
+
819
+ if attributes.key?(:'chrome_icon')
820
+ self.chrome_icon = attributes[:'chrome_icon']
821
+ end
822
+
823
+ if attributes.key?(:'ios_sound')
824
+ self.ios_sound = attributes[:'ios_sound']
825
+ end
826
+
827
+ if attributes.key?(:'android_sound')
828
+ self.android_sound = attributes[:'android_sound']
829
+ end
830
+
831
+ if attributes.key?(:'huawei_sound')
832
+ self.huawei_sound = attributes[:'huawei_sound']
833
+ end
834
+
835
+ if attributes.key?(:'adm_sound')
836
+ self.adm_sound = attributes[:'adm_sound']
837
+ end
838
+
839
+ if attributes.key?(:'wp_wns_sound')
840
+ self.wp_wns_sound = attributes[:'wp_wns_sound']
841
+ end
842
+
843
+ if attributes.key?(:'android_led_color')
844
+ self.android_led_color = attributes[:'android_led_color']
845
+ end
846
+
847
+ if attributes.key?(:'huawei_led_color')
848
+ self.huawei_led_color = attributes[:'huawei_led_color']
849
+ end
850
+
851
+ if attributes.key?(:'android_accent_color')
852
+ self.android_accent_color = attributes[:'android_accent_color']
853
+ end
854
+
855
+ if attributes.key?(:'huawei_accent_color')
856
+ self.huawei_accent_color = attributes[:'huawei_accent_color']
857
+ end
858
+
859
+ if attributes.key?(:'android_visibility')
860
+ self.android_visibility = attributes[:'android_visibility']
861
+ end
862
+
863
+ if attributes.key?(:'huawei_visibility')
864
+ self.huawei_visibility = attributes[:'huawei_visibility']
865
+ end
866
+
867
+ if attributes.key?(:'ios_badge_type')
868
+ self.ios_badge_type = attributes[:'ios_badge_type']
869
+ end
870
+
871
+ if attributes.key?(:'ios_badge_count')
872
+ self.ios_badge_count = attributes[:'ios_badge_count']
873
+ end
874
+
875
+ if attributes.key?(:'collapse_id')
876
+ self.collapse_id = attributes[:'collapse_id']
877
+ end
878
+
879
+ if attributes.key?(:'web_push_topic')
880
+ self.web_push_topic = attributes[:'web_push_topic']
881
+ end
882
+
883
+ if attributes.key?(:'apns_alert')
884
+ self.apns_alert = attributes[:'apns_alert']
885
+ end
886
+
887
+ if attributes.key?(:'delayed_option')
888
+ self.delayed_option = attributes[:'delayed_option']
889
+ end
890
+
891
+ if attributes.key?(:'delivery_time_of_day')
892
+ self.delivery_time_of_day = attributes[:'delivery_time_of_day']
893
+ end
894
+
895
+ if attributes.key?(:'ttl')
896
+ self.ttl = attributes[:'ttl']
897
+ end
898
+
899
+ if attributes.key?(:'priority')
900
+ self.priority = attributes[:'priority']
901
+ end
902
+
903
+ if attributes.key?(:'apns_push_type_override')
904
+ self.apns_push_type_override = attributes[:'apns_push_type_override']
905
+ end
906
+
907
+ if attributes.key?(:'throttle_rate_per_minute')
908
+ self.throttle_rate_per_minute = attributes[:'throttle_rate_per_minute']
909
+ end
910
+
911
+ if attributes.key?(:'android_group')
912
+ self.android_group = attributes[:'android_group']
913
+ end
914
+
915
+ if attributes.key?(:'android_group_message')
916
+ self.android_group_message = attributes[:'android_group_message']
917
+ end
918
+
919
+ if attributes.key?(:'adm_group')
920
+ self.adm_group = attributes[:'adm_group']
921
+ end
922
+
923
+ if attributes.key?(:'adm_group_message')
924
+ self.adm_group_message = attributes[:'adm_group_message']
925
+ end
926
+
927
+ if attributes.key?(:'thread_id')
928
+ self.thread_id = attributes[:'thread_id']
929
+ end
930
+
931
+ if attributes.key?(:'summary_arg')
932
+ self.summary_arg = attributes[:'summary_arg']
933
+ end
934
+
935
+ if attributes.key?(:'summary_arg_count')
936
+ self.summary_arg_count = attributes[:'summary_arg_count']
937
+ end
938
+
939
+ if attributes.key?(:'email_subject')
940
+ self.email_subject = attributes[:'email_subject']
941
+ end
942
+
943
+ if attributes.key?(:'email_body')
944
+ self.email_body = attributes[:'email_body']
945
+ end
946
+
947
+ if attributes.key?(:'email_from_name')
948
+ self.email_from_name = attributes[:'email_from_name']
949
+ end
950
+
951
+ if attributes.key?(:'email_from_address')
952
+ self.email_from_address = attributes[:'email_from_address']
953
+ end
954
+
955
+ if attributes.key?(:'email_preheader')
956
+ self.email_preheader = attributes[:'email_preheader']
957
+ end
958
+
959
+ if attributes.key?(:'include_unsubscribed')
960
+ self.include_unsubscribed = attributes[:'include_unsubscribed']
961
+ end
962
+
963
+ if attributes.key?(:'sms_from')
964
+ self.sms_from = attributes[:'sms_from']
965
+ end
966
+
967
+ if attributes.key?(:'sms_media_urls')
968
+ if (value = attributes[:'sms_media_urls']).is_a?(Array)
969
+ self.sms_media_urls = value
970
+ end
971
+ end
972
+
973
+ if attributes.key?(:'filters')
974
+ if (value = attributes[:'filters']).is_a?(Array)
975
+ self.filters = value
976
+ end
977
+ end
978
+
979
+ if attributes.key?(:'custom_data')
980
+ self.custom_data = attributes[:'custom_data']
981
+ end
982
+ end
983
+
984
+ # Show invalid properties with the reasons. Usually used together with valid?
985
+ # @return Array for valid properties with the reasons
986
+ def list_invalid_properties
987
+ invalid_properties = Array.new
988
+ invalid_properties
989
+ end
990
+
991
+ # Check to see if the all the properties in the model are valid
992
+ # @return true if the model is valid
993
+ def valid?
994
+ aggregation_validator = EnumAttributeValidator.new('String', ["sum", "count"])
995
+ return false unless aggregation_validator.valid?(@aggregation)
996
+ true
997
+ end
998
+
999
+ # Custom attribute writer method checking allowed values (enum).
1000
+ # @param [Object] aggregation Object to be assigned
1001
+ def aggregation=(aggregation)
1002
+ validator = EnumAttributeValidator.new('String', ["sum", "count"])
1003
+ unless validator.valid?(aggregation)
1004
+ fail ArgumentError, "invalid value for \"aggregation\", must be one of #{validator.allowable_values}."
1005
+ end
1006
+ @aggregation = aggregation
1007
+ end
1008
+
1009
+ # Checks equality by comparing each attribute.
1010
+ # @param [Object] Object to be compared
1011
+ def ==(o)
1012
+ return true if self.equal?(o)
1013
+ self.class == o.class &&
1014
+ id == o.id &&
1015
+ value == o.value &&
1016
+ name == o.name &&
1017
+ aggregation == o.aggregation &&
1018
+ is_ios == o.is_ios &&
1019
+ is_android == o.is_android &&
1020
+ is_huawei == o.is_huawei &&
1021
+ is_any_web == o.is_any_web &&
1022
+ is_chrome_web == o.is_chrome_web &&
1023
+ is_firefox == o.is_firefox &&
1024
+ is_safari == o.is_safari &&
1025
+ is_wp_wns == o.is_wp_wns &&
1026
+ is_adm == o.is_adm &&
1027
+ is_chrome == o.is_chrome &&
1028
+ channel_for_external_user_ids == o.channel_for_external_user_ids &&
1029
+ app_id == o.app_id &&
1030
+ external_id == o.external_id &&
1031
+ contents == o.contents &&
1032
+ headings == o.headings &&
1033
+ subtitle == o.subtitle &&
1034
+ data == o.data &&
1035
+ huawei_msg_type == o.huawei_msg_type &&
1036
+ url == o.url &&
1037
+ web_url == o.web_url &&
1038
+ app_url == o.app_url &&
1039
+ ios_attachments == o.ios_attachments &&
1040
+ template_id == o.template_id &&
1041
+ content_available == o.content_available &&
1042
+ mutable_content == o.mutable_content &&
1043
+ target_content_identifier == o.target_content_identifier &&
1044
+ big_picture == o.big_picture &&
1045
+ huawei_big_picture == o.huawei_big_picture &&
1046
+ adm_big_picture == o.adm_big_picture &&
1047
+ chrome_big_picture == o.chrome_big_picture &&
1048
+ chrome_web_image == o.chrome_web_image &&
1049
+ buttons == o.buttons &&
1050
+ web_buttons == o.web_buttons &&
1051
+ ios_category == o.ios_category &&
1052
+ android_channel_id == o.android_channel_id &&
1053
+ huawei_channel_id == o.huawei_channel_id &&
1054
+ existing_android_channel_id == o.existing_android_channel_id &&
1055
+ huawei_existing_channel_id == o.huawei_existing_channel_id &&
1056
+ android_background_layout == o.android_background_layout &&
1057
+ small_icon == o.small_icon &&
1058
+ huawei_small_icon == o.huawei_small_icon &&
1059
+ large_icon == o.large_icon &&
1060
+ huawei_large_icon == o.huawei_large_icon &&
1061
+ adm_small_icon == o.adm_small_icon &&
1062
+ adm_large_icon == o.adm_large_icon &&
1063
+ chrome_web_icon == o.chrome_web_icon &&
1064
+ chrome_web_badge == o.chrome_web_badge &&
1065
+ firefox_icon == o.firefox_icon &&
1066
+ chrome_icon == o.chrome_icon &&
1067
+ ios_sound == o.ios_sound &&
1068
+ android_sound == o.android_sound &&
1069
+ huawei_sound == o.huawei_sound &&
1070
+ adm_sound == o.adm_sound &&
1071
+ wp_wns_sound == o.wp_wns_sound &&
1072
+ android_led_color == o.android_led_color &&
1073
+ huawei_led_color == o.huawei_led_color &&
1074
+ android_accent_color == o.android_accent_color &&
1075
+ huawei_accent_color == o.huawei_accent_color &&
1076
+ android_visibility == o.android_visibility &&
1077
+ huawei_visibility == o.huawei_visibility &&
1078
+ ios_badge_type == o.ios_badge_type &&
1079
+ ios_badge_count == o.ios_badge_count &&
1080
+ collapse_id == o.collapse_id &&
1081
+ web_push_topic == o.web_push_topic &&
1082
+ apns_alert == o.apns_alert &&
1083
+ delayed_option == o.delayed_option &&
1084
+ delivery_time_of_day == o.delivery_time_of_day &&
1085
+ ttl == o.ttl &&
1086
+ priority == o.priority &&
1087
+ apns_push_type_override == o.apns_push_type_override &&
1088
+ throttle_rate_per_minute == o.throttle_rate_per_minute &&
1089
+ android_group == o.android_group &&
1090
+ android_group_message == o.android_group_message &&
1091
+ adm_group == o.adm_group &&
1092
+ adm_group_message == o.adm_group_message &&
1093
+ thread_id == o.thread_id &&
1094
+ summary_arg == o.summary_arg &&
1095
+ summary_arg_count == o.summary_arg_count &&
1096
+ email_subject == o.email_subject &&
1097
+ email_body == o.email_body &&
1098
+ email_from_name == o.email_from_name &&
1099
+ email_from_address == o.email_from_address &&
1100
+ email_preheader == o.email_preheader &&
1101
+ include_unsubscribed == o.include_unsubscribed &&
1102
+ sms_from == o.sms_from &&
1103
+ sms_media_urls == o.sms_media_urls &&
1104
+ filters == o.filters &&
1105
+ custom_data == o.custom_data
1106
+ end
1107
+
1108
+ # @see the `==` method
1109
+ # @param [Object] Object to be compared
1110
+ def eql?(o)
1111
+ self == o
1112
+ end
1113
+
1114
+ # Calculates hash code according to all attributes.
1115
+ # @return [Integer] Hash code
1116
+ def hash
1117
+ [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].hash
1118
+ end
1119
+
1120
+ # Builds the object from hash
1121
+ # @param [Hash] attributes Model attributes in the form of hash
1122
+ # @return [Object] Returns the model itself
1123
+ def self.build_from_hash(attributes)
1124
+ new.build_from_hash(attributes)
1125
+ end
1126
+
1127
+ # Builds the object from hash
1128
+ # @param [Hash] attributes Model attributes in the form of hash
1129
+ # @return [Object] Returns the model itself
1130
+ def build_from_hash(attributes)
1131
+ return nil unless attributes.is_a?(Hash)
1132
+ attributes = attributes.transform_keys(&:to_sym)
1133
+ self.class.openapi_types.each_pair do |key, type|
1134
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
1135
+ self.send("#{key}=", nil)
1136
+ elsif type =~ /\AArray<(.*)>/i
1137
+ # check to ensure the input is an array given that the attribute
1138
+ # is documented as an array but the input is not
1139
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
1140
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
1141
+ end
1142
+ elsif !attributes[self.class.attribute_map[key]].nil?
1143
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
1144
+ end
1145
+ end
1146
+
1147
+ self
1148
+ end
1149
+
1150
+ # Deserializes the data based on type
1151
+ # @param string type Data type
1152
+ # @param string value Value to be deserialized
1153
+ # @return [Object] Deserialized data
1154
+ def _deserialize(type, value)
1155
+ case type.to_sym
1156
+ when :Time
1157
+ Time.parse(value)
1158
+ when :Date
1159
+ Date.parse(value)
1160
+ when :String
1161
+ value.to_s
1162
+ when :Integer
1163
+ value.to_i
1164
+ when :Float
1165
+ value.to_f
1166
+ when :Boolean
1167
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
1168
+ true
1169
+ else
1170
+ false
1171
+ end
1172
+ when :Object
1173
+ # generic object (usually a Hash), return directly
1174
+ value
1175
+ when /\AArray<(?<inner_type>.+)>\z/
1176
+ inner_type = Regexp.last_match[:inner_type]
1177
+ value.map { |v| _deserialize(inner_type, v) }
1178
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
1179
+ k_type = Regexp.last_match[:k_type]
1180
+ v_type = Regexp.last_match[:v_type]
1181
+ {}.tap do |hash|
1182
+ value.each do |k, v|
1183
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
1184
+ end
1185
+ end
1186
+ else # model
1187
+ # models (e.g. Pet) or oneOf
1188
+ klass = OneSignal.const_get(type)
1189
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
1190
+ end
1191
+ end
1192
+
1193
+ # Returns the string representation of the object
1194
+ # @return [String] String presentation of the object
1195
+ def to_s
1196
+ to_hash.to_s
1197
+ end
1198
+
1199
+ # to_body is an alias to to_hash (backward compatibility)
1200
+ # @return [Hash] Returns the object in the form of hash
1201
+ def to_body
1202
+ to_hash
1203
+ end
1204
+
1205
+ # Returns the object in the form of hash
1206
+ # @return [Hash] Returns the object in the form of hash
1207
+ def to_hash
1208
+ hash = {}
1209
+ self.class.attribute_map.each_pair do |attr, param|
1210
+ value = self.send(attr)
1211
+ if value.nil?
1212
+ is_nullable = self.class.openapi_nullable.include?(attr)
1213
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
1214
+ end
1215
+
1216
+ hash[param] = _to_hash(value)
1217
+ end
1218
+ hash
1219
+ end
1220
+
1221
+ # Outputs non-array value in the form of hash
1222
+ # For object, use to_hash. Otherwise, just return the value
1223
+ # @param [Object] value Any valid value
1224
+ # @return [Hash] Returns the value in the form of hash
1225
+ def _to_hash(value)
1226
+ if value.is_a?(Array)
1227
+ value.compact.map { |v| _to_hash(v) }
1228
+ elsif value.is_a?(Hash)
1229
+ {}.tap do |hash|
1230
+ value.each { |k, v| hash[k] = _to_hash(v) }
1231
+ end
1232
+ elsif value.respond_to? :to_hash
1233
+ value.to_hash
1234
+ else
1235
+ value
1236
+ end
1237
+ end
1238
+
1239
+ end
1240
+
1241
+ end