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,586 @@
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 App
18
+ attr_accessor :id
19
+
20
+ # The name of your app, as displayed on your apps list on the dashboard. This can be renamed.
21
+ attr_accessor :name
22
+
23
+ attr_accessor :players
24
+
25
+ attr_accessor :messageable_players
26
+
27
+ attr_accessor :updated_at
28
+
29
+ attr_accessor :created_at
30
+
31
+ # Android: Your Google Project number. Also known as Sender ID.
32
+ attr_accessor :android_gcm_sender_id
33
+
34
+ # Android: Your Google Push Messaging Auth Key
35
+ attr_accessor :gcm_key
36
+
37
+ # Chrome (All Browsers except Safari) (Recommended): The URL to your website. This field is required if you wish to enable web push and specify other web push parameters.
38
+ attr_accessor :chrome_web_origin
39
+
40
+ # Not for web push. Your Google Push Messaging Auth Key if you use Chrome Apps / Extensions.
41
+ attr_accessor :chrome_key
42
+
43
+ # Chrome (All Browsers except Safari): Your default notification icon. Should be 256x256 pixels, min 80x80.
44
+ attr_accessor :chrome_web_default_notification_icon
45
+
46
+ # Chrome (All Browsers except Safari): A subdomain of your choice in order to support Web Push on non-HTTPS websites. This field must be set in order for the chrome_web_gcm_sender_id property to be processed.
47
+ attr_accessor :chrome_web_sub_domain
48
+
49
+ # iOS: Either sandbox or production
50
+ attr_accessor :apns_env
51
+
52
+ # iOS: Your apple push notification p12 certificate file, converted to a string and Base64 encoded.
53
+ attr_accessor :apns_p12
54
+
55
+ # iOS: Required if using p12 certificate. Password for the apns_p12 file.
56
+ attr_accessor :apns_p12_password
57
+
58
+ attr_accessor :apns_certificates
59
+
60
+ attr_accessor :safari_apns_certificates
61
+
62
+ # Safari: Your apple push notification p12 certificate file for Safari Push Notifications, converted to a string and Base64 encoded.
63
+ attr_accessor :safari_apns_p12
64
+
65
+ # Safari: Password for safari_apns_p12 file
66
+ attr_accessor :safari_apns_p12_password
67
+
68
+ # iOS: Required if using p8. Unique identifier for the p8 authentication key.
69
+ attr_accessor :apns_key_id
70
+
71
+ # iOS: Required if using p8. Team ID generated by Apple for your developer account.
72
+ attr_accessor :apns_team_id
73
+
74
+ # iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem.
75
+ attr_accessor :apns_bundle_id
76
+
77
+ # iOS: Required if using p8. Base64 encoded p8 key
78
+ attr_accessor :apns_p8
79
+
80
+ # Safari (Recommended): The hostname to your website including http(s)://
81
+ attr_accessor :safari_site_origin
82
+
83
+ attr_accessor :safari_push_id
84
+
85
+ attr_accessor :safari_icon_16_16
86
+
87
+ attr_accessor :safari_icon_32_32
88
+
89
+ attr_accessor :safari_icon_64_64
90
+
91
+ attr_accessor :safari_icon_128_128
92
+
93
+ # Safari: A url for a 256x256 png notification icon. This is the only Safari icon URL you need to provide.
94
+ attr_accessor :safari_icon_256_256
95
+
96
+ # All Browsers (Recommended): The Site Name. Requires both chrome_web_origin and safari_site_origin to be set to add or update it.
97
+ attr_accessor :site_name
98
+
99
+ attr_accessor :basic_auth_key
100
+
101
+ # The Id of the Organization you would like to add this app to.
102
+ attr_accessor :organization_id
103
+
104
+ # iOS: Notification data (additional data) values will be added to the root of the apns payload when sent to the device. Ignore if you're not using any other plugins, or not using OneSignal SDK methods to read the payload.
105
+ attr_accessor :additional_data_is_root_payload
106
+
107
+ class EnumAttributeValidator
108
+ attr_reader :datatype
109
+ attr_reader :allowable_values
110
+
111
+ def initialize(datatype, allowable_values)
112
+ @allowable_values = allowable_values.map do |value|
113
+ case datatype.to_s
114
+ when /Integer/i
115
+ value.to_i
116
+ when /Float/i
117
+ value.to_f
118
+ else
119
+ value
120
+ end
121
+ end
122
+ end
123
+
124
+ def valid?(value)
125
+ !value || allowable_values.include?(value)
126
+ end
127
+ end
128
+
129
+ # Attribute mapping from ruby-style variable name to JSON key.
130
+ def self.attribute_map
131
+ {
132
+ :'id' => :'id',
133
+ :'name' => :'name',
134
+ :'players' => :'players',
135
+ :'messageable_players' => :'messageable_players',
136
+ :'updated_at' => :'updated_at',
137
+ :'created_at' => :'created_at',
138
+ :'android_gcm_sender_id' => :'android_gcm_sender_id',
139
+ :'gcm_key' => :'gcm_key',
140
+ :'chrome_web_origin' => :'chrome_web_origin',
141
+ :'chrome_key' => :'chrome_key',
142
+ :'chrome_web_default_notification_icon' => :'chrome_web_default_notification_icon',
143
+ :'chrome_web_sub_domain' => :'chrome_web_sub_domain',
144
+ :'apns_env' => :'apns_env',
145
+ :'apns_p12' => :'apns_p12',
146
+ :'apns_p12_password' => :'apns_p12_password',
147
+ :'apns_certificates' => :'apns_certificates',
148
+ :'safari_apns_certificates' => :'safari_apns_certificates',
149
+ :'safari_apns_p12' => :'safari_apns_p12',
150
+ :'safari_apns_p12_password' => :'safari_apns_p12_password',
151
+ :'apns_key_id' => :'apns_key_id',
152
+ :'apns_team_id' => :'apns_team_id',
153
+ :'apns_bundle_id' => :'apns_bundle_id',
154
+ :'apns_p8' => :'apns_p8',
155
+ :'safari_site_origin' => :'safari_site_origin',
156
+ :'safari_push_id' => :'safari_push_id',
157
+ :'safari_icon_16_16' => :'safari_icon_16_16',
158
+ :'safari_icon_32_32' => :'safari_icon_32_32',
159
+ :'safari_icon_64_64' => :'safari_icon_64_64',
160
+ :'safari_icon_128_128' => :'safari_icon_128_128',
161
+ :'safari_icon_256_256' => :'safari_icon_256_256',
162
+ :'site_name' => :'site_name',
163
+ :'basic_auth_key' => :'basic_auth_key',
164
+ :'organization_id' => :'organization_id',
165
+ :'additional_data_is_root_payload' => :'additional_data_is_root_payload'
166
+ }
167
+ end
168
+
169
+ # Returns all the JSON keys this model knows about
170
+ def self.acceptable_attributes
171
+ attribute_map.values
172
+ end
173
+
174
+ # Attribute type mapping.
175
+ def self.openapi_types
176
+ {
177
+ :'id' => :'String',
178
+ :'name' => :'String',
179
+ :'players' => :'Integer',
180
+ :'messageable_players' => :'Integer',
181
+ :'updated_at' => :'Time',
182
+ :'created_at' => :'Time',
183
+ :'android_gcm_sender_id' => :'String',
184
+ :'gcm_key' => :'String',
185
+ :'chrome_web_origin' => :'String',
186
+ :'chrome_key' => :'String',
187
+ :'chrome_web_default_notification_icon' => :'String',
188
+ :'chrome_web_sub_domain' => :'String',
189
+ :'apns_env' => :'String',
190
+ :'apns_p12' => :'String',
191
+ :'apns_p12_password' => :'String',
192
+ :'apns_certificates' => :'String',
193
+ :'safari_apns_certificates' => :'String',
194
+ :'safari_apns_p12' => :'String',
195
+ :'safari_apns_p12_password' => :'String',
196
+ :'apns_key_id' => :'String',
197
+ :'apns_team_id' => :'String',
198
+ :'apns_bundle_id' => :'String',
199
+ :'apns_p8' => :'String',
200
+ :'safari_site_origin' => :'String',
201
+ :'safari_push_id' => :'String',
202
+ :'safari_icon_16_16' => :'String',
203
+ :'safari_icon_32_32' => :'String',
204
+ :'safari_icon_64_64' => :'String',
205
+ :'safari_icon_128_128' => :'String',
206
+ :'safari_icon_256_256' => :'String',
207
+ :'site_name' => :'String',
208
+ :'basic_auth_key' => :'String',
209
+ :'organization_id' => :'String',
210
+ :'additional_data_is_root_payload' => :'Boolean'
211
+ }
212
+ end
213
+
214
+ # List of attributes with nullable: true
215
+ def self.openapi_nullable
216
+ Set.new([
217
+ :'gcm_key',
218
+ :'chrome_web_origin',
219
+ :'chrome_key',
220
+ :'chrome_web_default_notification_icon',
221
+ :'chrome_web_sub_domain',
222
+ :'apns_env',
223
+ :'apns_certificates',
224
+ :'apns_key_id',
225
+ :'apns_team_id',
226
+ :'apns_bundle_id',
227
+ :'apns_p8',
228
+ :'safari_site_origin',
229
+ :'safari_push_id',
230
+ :'site_name',
231
+ :'basic_auth_key',
232
+ ])
233
+ end
234
+
235
+ # Initializes the object
236
+ # @param [Hash] attributes Model attributes in the form of hash
237
+ def initialize(attributes = {})
238
+ if (!attributes.is_a?(Hash))
239
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::App` initialize method"
240
+ end
241
+
242
+ # check to see if the attribute exists and convert string to symbol for hash key
243
+ attributes = attributes.each_with_object({}) { |(k, v), h|
244
+ if (!self.class.attribute_map.key?(k.to_sym))
245
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::App`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
246
+ end
247
+ h[k.to_sym] = v
248
+ }
249
+
250
+ if attributes.key?(:'id')
251
+ self.id = attributes[:'id']
252
+ end
253
+
254
+ if attributes.key?(:'name')
255
+ self.name = attributes[:'name']
256
+ end
257
+
258
+ if attributes.key?(:'players')
259
+ self.players = attributes[:'players']
260
+ end
261
+
262
+ if attributes.key?(:'messageable_players')
263
+ self.messageable_players = attributes[:'messageable_players']
264
+ end
265
+
266
+ if attributes.key?(:'updated_at')
267
+ self.updated_at = attributes[:'updated_at']
268
+ end
269
+
270
+ if attributes.key?(:'created_at')
271
+ self.created_at = attributes[:'created_at']
272
+ end
273
+
274
+ if attributes.key?(:'android_gcm_sender_id')
275
+ self.android_gcm_sender_id = attributes[:'android_gcm_sender_id']
276
+ end
277
+
278
+ if attributes.key?(:'gcm_key')
279
+ self.gcm_key = attributes[:'gcm_key']
280
+ end
281
+
282
+ if attributes.key?(:'chrome_web_origin')
283
+ self.chrome_web_origin = attributes[:'chrome_web_origin']
284
+ end
285
+
286
+ if attributes.key?(:'chrome_key')
287
+ self.chrome_key = attributes[:'chrome_key']
288
+ end
289
+
290
+ if attributes.key?(:'chrome_web_default_notification_icon')
291
+ self.chrome_web_default_notification_icon = attributes[:'chrome_web_default_notification_icon']
292
+ end
293
+
294
+ if attributes.key?(:'chrome_web_sub_domain')
295
+ self.chrome_web_sub_domain = attributes[:'chrome_web_sub_domain']
296
+ end
297
+
298
+ if attributes.key?(:'apns_env')
299
+ self.apns_env = attributes[:'apns_env']
300
+ end
301
+
302
+ if attributes.key?(:'apns_p12')
303
+ self.apns_p12 = attributes[:'apns_p12']
304
+ end
305
+
306
+ if attributes.key?(:'apns_p12_password')
307
+ self.apns_p12_password = attributes[:'apns_p12_password']
308
+ end
309
+
310
+ if attributes.key?(:'apns_certificates')
311
+ self.apns_certificates = attributes[:'apns_certificates']
312
+ end
313
+
314
+ if attributes.key?(:'safari_apns_certificates')
315
+ self.safari_apns_certificates = attributes[:'safari_apns_certificates']
316
+ end
317
+
318
+ if attributes.key?(:'safari_apns_p12')
319
+ self.safari_apns_p12 = attributes[:'safari_apns_p12']
320
+ end
321
+
322
+ if attributes.key?(:'safari_apns_p12_password')
323
+ self.safari_apns_p12_password = attributes[:'safari_apns_p12_password']
324
+ end
325
+
326
+ if attributes.key?(:'apns_key_id')
327
+ self.apns_key_id = attributes[:'apns_key_id']
328
+ end
329
+
330
+ if attributes.key?(:'apns_team_id')
331
+ self.apns_team_id = attributes[:'apns_team_id']
332
+ end
333
+
334
+ if attributes.key?(:'apns_bundle_id')
335
+ self.apns_bundle_id = attributes[:'apns_bundle_id']
336
+ end
337
+
338
+ if attributes.key?(:'apns_p8')
339
+ self.apns_p8 = attributes[:'apns_p8']
340
+ end
341
+
342
+ if attributes.key?(:'safari_site_origin')
343
+ self.safari_site_origin = attributes[:'safari_site_origin']
344
+ end
345
+
346
+ if attributes.key?(:'safari_push_id')
347
+ self.safari_push_id = attributes[:'safari_push_id']
348
+ end
349
+
350
+ if attributes.key?(:'safari_icon_16_16')
351
+ self.safari_icon_16_16 = attributes[:'safari_icon_16_16']
352
+ end
353
+
354
+ if attributes.key?(:'safari_icon_32_32')
355
+ self.safari_icon_32_32 = attributes[:'safari_icon_32_32']
356
+ end
357
+
358
+ if attributes.key?(:'safari_icon_64_64')
359
+ self.safari_icon_64_64 = attributes[:'safari_icon_64_64']
360
+ end
361
+
362
+ if attributes.key?(:'safari_icon_128_128')
363
+ self.safari_icon_128_128 = attributes[:'safari_icon_128_128']
364
+ end
365
+
366
+ if attributes.key?(:'safari_icon_256_256')
367
+ self.safari_icon_256_256 = attributes[:'safari_icon_256_256']
368
+ end
369
+
370
+ if attributes.key?(:'site_name')
371
+ self.site_name = attributes[:'site_name']
372
+ end
373
+
374
+ if attributes.key?(:'basic_auth_key')
375
+ self.basic_auth_key = attributes[:'basic_auth_key']
376
+ end
377
+
378
+ if attributes.key?(:'organization_id')
379
+ self.organization_id = attributes[:'organization_id']
380
+ end
381
+
382
+ if attributes.key?(:'additional_data_is_root_payload')
383
+ self.additional_data_is_root_payload = attributes[:'additional_data_is_root_payload']
384
+ end
385
+ end
386
+
387
+ # Show invalid properties with the reasons. Usually used together with valid?
388
+ # @return Array for valid properties with the reasons
389
+ def list_invalid_properties
390
+ invalid_properties = Array.new
391
+ invalid_properties
392
+ end
393
+
394
+ # Check to see if the all the properties in the model are valid
395
+ # @return true if the model is valid
396
+ def valid?
397
+ apns_env_validator = EnumAttributeValidator.new('String', ["sandbox", "production"])
398
+ return false unless apns_env_validator.valid?(@apns_env)
399
+ true
400
+ end
401
+
402
+ # Custom attribute writer method checking allowed values (enum).
403
+ # @param [Object] apns_env Object to be assigned
404
+ def apns_env=(apns_env)
405
+ validator = EnumAttributeValidator.new('String', ["sandbox", "production"])
406
+ unless validator.valid?(apns_env)
407
+ fail ArgumentError, "invalid value for \"apns_env\", must be one of #{validator.allowable_values}."
408
+ end
409
+ @apns_env = apns_env
410
+ end
411
+
412
+ # Checks equality by comparing each attribute.
413
+ # @param [Object] Object to be compared
414
+ def ==(o)
415
+ return true if self.equal?(o)
416
+ self.class == o.class &&
417
+ id == o.id &&
418
+ name == o.name &&
419
+ players == o.players &&
420
+ messageable_players == o.messageable_players &&
421
+ updated_at == o.updated_at &&
422
+ created_at == o.created_at &&
423
+ android_gcm_sender_id == o.android_gcm_sender_id &&
424
+ gcm_key == o.gcm_key &&
425
+ chrome_web_origin == o.chrome_web_origin &&
426
+ chrome_key == o.chrome_key &&
427
+ chrome_web_default_notification_icon == o.chrome_web_default_notification_icon &&
428
+ chrome_web_sub_domain == o.chrome_web_sub_domain &&
429
+ apns_env == o.apns_env &&
430
+ apns_p12 == o.apns_p12 &&
431
+ apns_p12_password == o.apns_p12_password &&
432
+ apns_certificates == o.apns_certificates &&
433
+ safari_apns_certificates == o.safari_apns_certificates &&
434
+ safari_apns_p12 == o.safari_apns_p12 &&
435
+ safari_apns_p12_password == o.safari_apns_p12_password &&
436
+ apns_key_id == o.apns_key_id &&
437
+ apns_team_id == o.apns_team_id &&
438
+ apns_bundle_id == o.apns_bundle_id &&
439
+ apns_p8 == o.apns_p8 &&
440
+ safari_site_origin == o.safari_site_origin &&
441
+ safari_push_id == o.safari_push_id &&
442
+ safari_icon_16_16 == o.safari_icon_16_16 &&
443
+ safari_icon_32_32 == o.safari_icon_32_32 &&
444
+ safari_icon_64_64 == o.safari_icon_64_64 &&
445
+ safari_icon_128_128 == o.safari_icon_128_128 &&
446
+ safari_icon_256_256 == o.safari_icon_256_256 &&
447
+ site_name == o.site_name &&
448
+ basic_auth_key == o.basic_auth_key &&
449
+ organization_id == o.organization_id &&
450
+ additional_data_is_root_payload == o.additional_data_is_root_payload
451
+ end
452
+
453
+ # @see the `==` method
454
+ # @param [Object] Object to be compared
455
+ def eql?(o)
456
+ self == o
457
+ end
458
+
459
+ # Calculates hash code according to all attributes.
460
+ # @return [Integer] Hash code
461
+ def hash
462
+ [id, name, players, messageable_players, updated_at, created_at, android_gcm_sender_id, gcm_key, chrome_web_origin, chrome_key, chrome_web_default_notification_icon, chrome_web_sub_domain, apns_env, apns_p12, apns_p12_password, apns_certificates, safari_apns_certificates, safari_apns_p12, safari_apns_p12_password, apns_key_id, apns_team_id, apns_bundle_id, apns_p8, safari_site_origin, safari_push_id, safari_icon_16_16, safari_icon_32_32, safari_icon_64_64, safari_icon_128_128, safari_icon_256_256, site_name, basic_auth_key, organization_id, additional_data_is_root_payload].hash
463
+ end
464
+
465
+ # Builds the object from hash
466
+ # @param [Hash] attributes Model attributes in the form of hash
467
+ # @return [Object] Returns the model itself
468
+ def self.build_from_hash(attributes)
469
+ new.build_from_hash(attributes)
470
+ end
471
+
472
+ # Builds the object from hash
473
+ # @param [Hash] attributes Model attributes in the form of hash
474
+ # @return [Object] Returns the model itself
475
+ def build_from_hash(attributes)
476
+ return nil unless attributes.is_a?(Hash)
477
+ attributes = attributes.transform_keys(&:to_sym)
478
+ self.class.openapi_types.each_pair do |key, type|
479
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
480
+ self.send("#{key}=", nil)
481
+ elsif type =~ /\AArray<(.*)>/i
482
+ # check to ensure the input is an array given that the attribute
483
+ # is documented as an array but the input is not
484
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
485
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
486
+ end
487
+ elsif !attributes[self.class.attribute_map[key]].nil?
488
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
489
+ end
490
+ end
491
+
492
+ self
493
+ end
494
+
495
+ # Deserializes the data based on type
496
+ # @param string type Data type
497
+ # @param string value Value to be deserialized
498
+ # @return [Object] Deserialized data
499
+ def _deserialize(type, value)
500
+ case type.to_sym
501
+ when :Time
502
+ Time.parse(value)
503
+ when :Date
504
+ Date.parse(value)
505
+ when :String
506
+ value.to_s
507
+ when :Integer
508
+ value.to_i
509
+ when :Float
510
+ value.to_f
511
+ when :Boolean
512
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
513
+ true
514
+ else
515
+ false
516
+ end
517
+ when :Object
518
+ # generic object (usually a Hash), return directly
519
+ value
520
+ when /\AArray<(?<inner_type>.+)>\z/
521
+ inner_type = Regexp.last_match[:inner_type]
522
+ value.map { |v| _deserialize(inner_type, v) }
523
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
524
+ k_type = Regexp.last_match[:k_type]
525
+ v_type = Regexp.last_match[:v_type]
526
+ {}.tap do |hash|
527
+ value.each do |k, v|
528
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
529
+ end
530
+ end
531
+ else # model
532
+ # models (e.g. Pet) or oneOf
533
+ klass = OneSignal.const_get(type)
534
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
535
+ end
536
+ end
537
+
538
+ # Returns the string representation of the object
539
+ # @return [String] String presentation of the object
540
+ def to_s
541
+ to_hash.to_s
542
+ end
543
+
544
+ # to_body is an alias to to_hash (backward compatibility)
545
+ # @return [Hash] Returns the object in the form of hash
546
+ def to_body
547
+ to_hash
548
+ end
549
+
550
+ # Returns the object in the form of hash
551
+ # @return [Hash] Returns the object in the form of hash
552
+ def to_hash
553
+ hash = {}
554
+ self.class.attribute_map.each_pair do |attr, param|
555
+ value = self.send(attr)
556
+ if value.nil?
557
+ is_nullable = self.class.openapi_nullable.include?(attr)
558
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
559
+ end
560
+
561
+ hash[param] = _to_hash(value)
562
+ end
563
+ hash
564
+ end
565
+
566
+ # Outputs non-array value in the form of hash
567
+ # For object, use to_hash. Otherwise, just return the value
568
+ # @param [Object] value Any valid value
569
+ # @return [Hash] Returns the value in the form of hash
570
+ def _to_hash(value)
571
+ if value.is_a?(Array)
572
+ value.compact.map { |v| _to_hash(v) }
573
+ elsif value.is_a?(Hash)
574
+ {}.tap do |hash|
575
+ value.each { |k, v| hash[k] = _to_hash(v) }
576
+ end
577
+ elsif value.respond_to? :to_hash
578
+ value.to_hash
579
+ else
580
+ value
581
+ end
582
+ end
583
+
584
+ end
585
+
586
+ end