onesignal 0.2.0 → 1.0.1

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