onesignal 2.2.1 → 5.1.0.pre.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +42 -67
  3. data/docs/BasicNotification.md +18 -18
  4. data/docs/BasicNotificationAllOf.md +9 -7
  5. data/docs/CreateNotificationSuccessResponse.md +1 -3
  6. data/docs/DefaultApi.md +364 -948
  7. data/docs/{ExportPlayersRequestBody.md → ExportSubscriptionsRequestBody.md} +2 -2
  8. data/docs/{ExportPlayersSuccessResponse.md → ExportSubscriptionsSuccessResponse.md} +2 -2
  9. data/docs/Filter.md +10 -2
  10. data/docs/{Notification200Errors.md → FilterExpression.md} +9 -9
  11. data/docs/GenericError.md +6 -2
  12. data/docs/{DeletePlayerSuccessResponse.md → GenericSuccessBoolResponse.md} +2 -2
  13. data/docs/{GetNotificationRequestBody.md → GetNotificationHistoryRequestBody.md} +2 -2
  14. data/docs/GetSegmentsSuccessResponse.md +24 -0
  15. data/docs/{StringMap.md → LanguageStringMap.md} +2 -2
  16. data/docs/Notification.md +18 -18
  17. data/docs/NotificationTarget.md +9 -11
  18. data/docs/NotificationWithMeta.md +18 -18
  19. data/docs/{InlineResponse202.md → PropertiesBody.md} +2 -2
  20. data/docs/PropertiesDeltas.md +2 -2
  21. data/docs/PropertiesObject.md +2 -2
  22. data/docs/Purchase.md +1 -1
  23. data/docs/RateLimitError.md +20 -0
  24. data/docs/Segment.md +1 -1
  25. data/docs/SegmentData.md +30 -0
  26. data/docs/{SubscriptionObject.md → Subscription.md} +6 -6
  27. data/docs/SubscriptionBody.md +18 -0
  28. data/docs/SubscriptionNotificationTarget.md +38 -0
  29. data/docs/TransferSubscriptionRequestBody.md +1 -1
  30. data/docs/UpdateLiveActivityRequest.md +14 -4
  31. data/docs/UpdateLiveActivitySuccessResponse.md +2 -4
  32. data/docs/User.md +3 -5
  33. data/docs/{InlineResponse200.md → UserIdentityBody.md} +3 -3
  34. data/docs/WebButton.md +24 -0
  35. data/lib/onesignal/api/default_api.rb +382 -890
  36. data/lib/onesignal/api_client.rb +2 -2
  37. data/lib/onesignal/api_error.rb +1 -1
  38. data/lib/onesignal/configuration.rb +5 -5
  39. data/lib/onesignal/models/app.rb +1 -1
  40. data/lib/onesignal/models/basic_notification.rb +49 -47
  41. data/lib/onesignal/models/basic_notification_all_of.rb +29 -17
  42. data/lib/onesignal/models/basic_notification_all_of_android_background_layout.rb +1 -1
  43. data/lib/onesignal/models/button.rb +1 -1
  44. data/lib/onesignal/models/create_notification_success_response.rb +5 -13
  45. data/lib/onesignal/models/create_segment_conflict_response.rb +1 -1
  46. data/lib/onesignal/models/create_segment_success_response.rb +1 -1
  47. data/lib/onesignal/models/create_user_conflict_response.rb +1 -1
  48. data/lib/onesignal/models/create_user_conflict_response_errors_inner.rb +1 -1
  49. data/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb +1 -1
  50. data/lib/onesignal/models/delivery_data.rb +1 -1
  51. data/lib/onesignal/models/export_events_success_response.rb +1 -1
  52. data/lib/onesignal/models/{export_players_request_body.rb → export_subscriptions_request_body.rb} +4 -4
  53. data/lib/onesignal/models/{export_players_success_response.rb → export_subscriptions_success_response.rb} +4 -4
  54. data/lib/onesignal/models/filter.rb +44 -14
  55. data/lib/onesignal/models/{notification200_errors.rb → filter_expression.rb} +4 -4
  56. data/lib/onesignal/models/generic_error.rb +26 -8
  57. data/lib/onesignal/models/{update_player_success_response.rb → generic_success_bool_response.rb} +4 -4
  58. data/lib/onesignal/models/{get_notification_request_body.rb → get_notification_history_request_body.rb} +4 -4
  59. data/lib/onesignal/models/{player_slice.rb → get_segments_success_response.rb} +16 -12
  60. data/lib/onesignal/models/{string_map.rb → language_string_map.rb} +4 -4
  61. data/lib/onesignal/models/notification.rb +49 -47
  62. data/lib/onesignal/models/notification_all_of.rb +1 -1
  63. data/lib/onesignal/models/notification_history_success_response.rb +1 -1
  64. data/lib/onesignal/models/notification_slice.rb +1 -1
  65. data/lib/onesignal/models/notification_target.rb +24 -34
  66. data/lib/onesignal/models/notification_with_meta.rb +49 -47
  67. data/lib/onesignal/models/notification_with_meta_all_of.rb +1 -1
  68. data/lib/onesignal/models/operator.rb +1 -1
  69. data/lib/onesignal/models/outcome_data.rb +1 -1
  70. data/lib/onesignal/models/outcomes_data.rb +1 -1
  71. data/lib/onesignal/models/platform_delivery_data.rb +1 -1
  72. data/lib/onesignal/models/platform_delivery_data_email_all_of.rb +1 -1
  73. data/lib/onesignal/models/platform_delivery_data_sms_all_of.rb +1 -1
  74. data/lib/onesignal/models/{inline_response202.rb → properties_body.rb} +4 -4
  75. data/lib/onesignal/models/properties_deltas.rb +3 -3
  76. data/lib/onesignal/models/properties_object.rb +3 -3
  77. data/lib/onesignal/models/purchase.rb +2 -2
  78. data/lib/onesignal/models/{rate_limiter_error.rb → rate_limit_error.rb} +17 -8
  79. data/lib/onesignal/models/segment.rb +2 -2
  80. data/lib/onesignal/models/{begin_live_activity_request.rb → segment_data.rb} +69 -27
  81. data/lib/onesignal/models/segment_notification_target.rb +1 -1
  82. data/lib/onesignal/models/{subscription_object.rb → subscription.rb} +8 -8
  83. data/lib/onesignal/models/{inline_response201.rb → subscription_body.rb} +5 -5
  84. data/lib/onesignal/models/{player_notification_target.rb → subscription_notification_target.rb} +25 -35
  85. data/lib/onesignal/models/transfer_subscription_request_body.rb +26 -2
  86. data/lib/onesignal/models/update_live_activity_request.rb +59 -22
  87. data/lib/onesignal/models/update_live_activity_success_response.rb +8 -17
  88. data/lib/onesignal/models/update_user_request.rb +1 -1
  89. data/lib/onesignal/models/user.rb +6 -15
  90. data/lib/onesignal/models/{inline_response200.rb → user_identity_body.rb} +5 -5
  91. data/lib/onesignal/models/{create_player_success_response.rb → web_button.rb} +40 -17
  92. data/lib/onesignal/version.rb +2 -2
  93. data/lib/onesignal.rb +16 -34
  94. data/onesignal.gemspec +1 -1
  95. data/spec/api/default_api_spec.rb +82 -174
  96. data/spec/api_client_spec.rb +1 -1
  97. data/spec/configuration_spec.rb +1 -1
  98. data/spec/models/app_spec.rb +1 -1
  99. data/spec/models/basic_notification_all_of_android_background_layout_spec.rb +1 -1
  100. data/spec/models/basic_notification_all_of_spec.rb +13 -7
  101. data/spec/models/basic_notification_spec.rb +14 -14
  102. data/spec/models/button_spec.rb +1 -1
  103. data/spec/models/create_notification_success_response_spec.rb +1 -7
  104. data/spec/models/create_segment_conflict_response_spec.rb +1 -1
  105. data/spec/models/create_segment_success_response_spec.rb +1 -1
  106. data/spec/models/create_user_conflict_response_errors_inner_spec.rb +1 -1
  107. data/spec/models/create_user_conflict_response_errors_items_meta_spec.rb +1 -1
  108. data/spec/models/create_user_conflict_response_spec.rb +1 -1
  109. data/spec/models/delivery_data_spec.rb +1 -1
  110. data/spec/models/export_events_success_response_spec.rb +1 -1
  111. data/spec/models/{export_players_request_body_spec.rb → export_subscriptions_request_body_spec.rb} +7 -7
  112. data/spec/models/{export_players_success_response_spec.rb → export_subscriptions_success_response_spec.rb} +7 -7
  113. data/spec/models/{notification200_errors_spec.rb → filter_expression_spec.rb} +3 -3
  114. data/spec/models/filter_spec.rb +25 -1
  115. data/spec/models/generic_error_spec.rb +13 -1
  116. data/spec/models/{delete_player_success_response_spec.rb → generic_success_bool_response_spec.rb} +7 -7
  117. data/spec/models/{get_notification_request_body_spec.rb → get_notification_history_request_body_spec.rb} +7 -7
  118. data/spec/models/{player_slice_spec.rb → get_segments_success_response_spec.rb} +8 -8
  119. data/spec/models/{string_map_spec.rb → language_string_map_spec.rb} +7 -7
  120. data/spec/models/notification_all_of_spec.rb +1 -1
  121. data/spec/models/notification_history_success_response_spec.rb +1 -1
  122. data/spec/models/notification_slice_spec.rb +1 -1
  123. data/spec/models/notification_spec.rb +14 -14
  124. data/spec/models/notification_target_spec.rb +2 -8
  125. data/spec/models/notification_with_meta_all_of_spec.rb +1 -1
  126. data/spec/models/notification_with_meta_spec.rb +14 -14
  127. data/spec/models/operator_spec.rb +1 -1
  128. data/spec/models/outcome_data_spec.rb +1 -1
  129. data/spec/models/outcomes_data_spec.rb +1 -1
  130. data/spec/models/platform_delivery_data_email_all_of_spec.rb +1 -1
  131. data/spec/models/platform_delivery_data_sms_all_of_spec.rb +1 -1
  132. data/spec/models/platform_delivery_data_spec.rb +1 -1
  133. data/spec/models/{inline_response202_spec.rb → properties_body_spec.rb} +7 -7
  134. data/spec/models/properties_deltas_spec.rb +1 -1
  135. data/spec/models/properties_object_spec.rb +1 -1
  136. data/spec/models/purchase_spec.rb +1 -1
  137. data/spec/models/{generic_error_errors_inner_spec.rb → rate_limit_error_spec.rb} +9 -9
  138. data/spec/models/{filter_expressions_spec.rb → segment_data_spec.rb} +24 -20
  139. data/spec/models/segment_notification_target_spec.rb +1 -1
  140. data/spec/models/segment_spec.rb +1 -1
  141. data/spec/models/{inline_response201_spec.rb → subscription_body_spec.rb} +7 -7
  142. data/spec/models/{player_notification_target_spec.rb → subscription_notification_target_spec.rb} +8 -14
  143. data/spec/models/{subscription_object_spec.rb → subscription_spec.rb} +7 -7
  144. data/spec/models/transfer_subscription_request_body_spec.rb +1 -1
  145. data/spec/models/update_live_activity_request_spec.rb +32 -6
  146. data/spec/models/update_live_activity_success_response_spec.rb +2 -8
  147. data/spec/models/update_user_request_spec.rb +1 -1
  148. data/spec/models/{user_identity_response_spec.rb → user_identity_body_spec.rb} +7 -7
  149. data/spec/models/user_spec.rb +1 -7
  150. data/spec/models/{create_player_success_response_spec.rb → web_button_spec.rb} +21 -9
  151. data/spec/spec_helper.rb +1 -1
  152. metadata +61 -131
  153. data/docs/BeginLiveActivityRequest.md +0 -20
  154. data/docs/CancelNotificationSuccessResponse.md +0 -18
  155. data/docs/CreatePlayerSuccessResponse.md +0 -20
  156. data/docs/CreateSubscriptionRequestBody.md +0 -20
  157. data/docs/DeletePlayerNotFoundResponse.md +0 -18
  158. data/docs/DeleteSegmentNotFoundResponse.md +0 -18
  159. data/docs/DeleteSegmentSuccessResponse.md +0 -18
  160. data/docs/FilterExpressions.md +0 -26
  161. data/docs/InlineResponse2003.md +0 -18
  162. data/docs/InlineResponse201.md +0 -18
  163. data/docs/InvalidIdentifierError.md +0 -20
  164. data/docs/Player.md +0 -70
  165. data/docs/PlayerNotificationTarget.md +0 -40
  166. data/docs/PlayerNotificationTargetIncludeAliases.md +0 -18
  167. data/docs/PlayerSlice.md +0 -24
  168. data/docs/UpdatePlayerSuccessResponse.md +0 -18
  169. data/docs/UpdatePlayerTagsRequestBody.md +0 -18
  170. data/docs/UpdatePlayerTagsSuccessResponse.md +0 -18
  171. data/docs/UpdateSubscriptionRequestBody.md +0 -18
  172. data/docs/UserIdentityRequestBody.md +0 -18
  173. data/docs/UserIdentityResponse.md +0 -18
  174. data/docs/UserSubscriptionOptions.md +0 -18
  175. data/lib/onesignal/models/cancel_notification_success_response.rb +0 -219
  176. data/lib/onesignal/models/create_subscription_request_body.rb +0 -228
  177. data/lib/onesignal/models/delete_player_not_found_response.rb +0 -219
  178. data/lib/onesignal/models/delete_player_success_response.rb +0 -219
  179. data/lib/onesignal/models/delete_segment_not_found_response.rb +0 -219
  180. data/lib/onesignal/models/delete_segment_success_response.rb +0 -219
  181. data/lib/onesignal/models/filter_expressions.rb +0 -336
  182. data/lib/onesignal/models/generic_error_errors_inner.rb +0 -228
  183. data/lib/onesignal/models/inline_response2003.rb +0 -221
  184. data/lib/onesignal/models/invalid_identifier_error.rb +0 -234
  185. data/lib/onesignal/models/player.rb +0 -494
  186. data/lib/onesignal/models/player_notification_target_include_aliases.rb +0 -221
  187. data/lib/onesignal/models/update_player_tags_request_body.rb +0 -220
  188. data/lib/onesignal/models/update_player_tags_success_response.rb +0 -219
  189. data/lib/onesignal/models/update_subscription_request_body.rb +0 -219
  190. data/lib/onesignal/models/user_identity_request_body.rb +0 -221
  191. data/lib/onesignal/models/user_identity_response.rb +0 -221
  192. data/lib/onesignal/models/user_subscription_options.rb +0 -219
  193. data/spec/models/begin_live_activity_request_spec.rb +0 -40
  194. data/spec/models/cancel_notification_success_response_spec.rb +0 -34
  195. data/spec/models/create_subscription_request_body_spec.rb +0 -40
  196. data/spec/models/delete_player_not_found_response_spec.rb +0 -34
  197. data/spec/models/delete_segment_not_found_response_spec.rb +0 -34
  198. data/spec/models/delete_segment_success_response_spec.rb +0 -34
  199. data/spec/models/inline_response2003_spec.rb +0 -34
  200. data/spec/models/inline_response200_spec.rb +0 -34
  201. data/spec/models/invalid_identifier_error_spec.rb +0 -40
  202. data/spec/models/player_notification_target_include_aliases_spec.rb +0 -34
  203. data/spec/models/player_spec.rb +0 -190
  204. data/spec/models/rate_limiter_error_spec.rb +0 -34
  205. data/spec/models/update_player_success_response_spec.rb +0 -34
  206. data/spec/models/update_player_tags_request_body_spec.rb +0 -34
  207. data/spec/models/update_player_tags_success_response_spec.rb +0 -34
  208. data/spec/models/update_subscription_request_body_spec.rb +0 -34
  209. data/spec/models/user_identity_request_body_spec.rb +0 -34
  210. data/spec/models/user_subscription_options_spec.rb +0 -34
@@ -1,494 +0,0 @@
1
- =begin
2
- #OneSignal
3
-
4
- #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5
-
6
- The version of the OpenAPI document: 1.4.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 Player
18
- # The device's OneSignal ID
19
- attr_accessor :id
20
-
21
- # If true, this is the equivalent of a user being Unsubscribed
22
- attr_accessor :invalid_identifier
23
-
24
- attr_accessor :app_id
25
-
26
- # Required The device's platform: 0 = iOS 1 = Android 2 = Amazon 3 = WindowsPhone (MPNS) 4 = Chrome Apps / Extensions 5 = Chrome Web Push 6 = Windows (WNS) 7 = Safari 8 = Firefox 9 = MacOS 10 = Alexa 11 = Email 13 = For Huawei App Gallery Builds SDK Setup. Not for Huawei Devices using FCM 14 = SMS
27
- attr_accessor :device_type
28
-
29
- # a custom user ID
30
- attr_accessor :external_user_id
31
-
32
- # Only required if you have enabled Identity Verification and device_type is NOT 11 email.
33
- attr_accessor :external_user_id_auth_hash
34
-
35
- # Email - Only required if you have enabled Identity Verification and device_type is email (11).
36
- attr_accessor :email_auth_hash
37
-
38
- # Recommended: For Push Notifications, this is the Push Token Identifier from Google or Apple. For Apple Push identifiers, you must strip all non alphanumeric characters. Examples: iOS: 7abcd558f29d0b1f048083e2834ad8ea4b3d87d8ad9c088b33c132706ff445f0 Android: APA91bHbYHk7aq-Uam_2pyJ2qbZvqllyyh2wjfPRaw5gLEX2SUlQBRvOc6sck1sa7H7nGeLNlDco8lXj83HWWwzV... For Email Addresses, set the full email address email@email.com and make sure to set device_type to 11.
39
- attr_accessor :identifier
40
-
41
- # Language code. Typically lower case two letters, except for Chinese where it must be one of zh-Hans or zh-Hant. Example: en
42
- attr_accessor :language
43
-
44
- # Number of seconds away from UTC. Example: -28800
45
- attr_accessor :timezone
46
-
47
- # Version of your app. Example: 1.1
48
- attr_accessor :game_version
49
-
50
- # Device make and model. Example: iPhone5,1
51
- attr_accessor :device_model
52
-
53
- # Device operating system version. Example: 7.0.4
54
- attr_accessor :device_os
55
-
56
- # The ad id for the device's platform: Android = Advertising Id iOS = identifierForVendor WP8.0 = DeviceUniqueId WP8.1 = AdvertisingId
57
- attr_accessor :ad_id
58
-
59
- # Name and version of the sdk/plugin that's calling this API method (if any)
60
- attr_accessor :sdk
61
-
62
- # Number of times the user has played the game, defaults to 1
63
- attr_accessor :session_count
64
-
65
- # Custom tags for the player. Only support string and integer key value pairs. Does not support arrays or other nested objects. Setting a tag value to null or an empty string will remove the tag. Example: {\"foo\":\"bar\",\"this\":\"that\"} Limitations: - 100 tags per call - Android SDK users: tags cannot be removed or changed via API if set through SDK sendTag methods. Recommended to only tag devices with 1 kilobyte of data Please consider using your own Database to save more than 1 kilobyte of data. See: Internal Database & CRM
66
- attr_accessor :tags
67
-
68
- # Amount the user has spent in USD, up to two decimal places
69
- attr_accessor :amount_spent
70
-
71
- # Unixtime when the player joined the game
72
- attr_accessor :created_at
73
-
74
- # Seconds player was running your app.
75
- attr_accessor :playtime
76
-
77
- # Current iOS badge count displayed on the app icon NOTE: Not supported for apps created after June 2018, since badge count for apps created after this date are handled on the client.
78
- attr_accessor :badge_count
79
-
80
- # Unixtime when the player was last active
81
- attr_accessor :last_active
82
-
83
- # 1 = subscribed -2 = unsubscribed iOS - These values are set each time the user opens the app from the SDK. Use the SDK function set Subscription instead. Android - You may set this but you can no longer use the SDK method setSubscription later in your app as it will create synchronization issues.
84
- attr_accessor :notification_types
85
-
86
- # This is used in deciding whether to use your iOS Sandbox or Production push certificate when sending a push when both have been uploaded. Set to the iOS provisioning profile that was used to build your app. 1 = Development 2 = Ad-Hoc Omit this field for App Store builds.
87
- attr_accessor :test_type
88
-
89
- # Longitude of the device, used for geotagging to segment on.
90
- attr_accessor :long
91
-
92
- # Latitude of the device, used for geotagging to segment on.
93
- attr_accessor :lat
94
-
95
- # Country code in the ISO 3166-1 Alpha 2 format
96
- attr_accessor :country
97
-
98
- # Attribute mapping from ruby-style variable name to JSON key.
99
- def self.attribute_map
100
- {
101
- :'id' => :'id',
102
- :'invalid_identifier' => :'invalid_identifier',
103
- :'app_id' => :'app_id',
104
- :'device_type' => :'device_type',
105
- :'external_user_id' => :'external_user_id',
106
- :'external_user_id_auth_hash' => :'external_user_id_auth_hash',
107
- :'email_auth_hash' => :'email_auth_hash',
108
- :'identifier' => :'identifier',
109
- :'language' => :'language',
110
- :'timezone' => :'timezone',
111
- :'game_version' => :'game_version',
112
- :'device_model' => :'device_model',
113
- :'device_os' => :'device_os',
114
- :'ad_id' => :'ad_id',
115
- :'sdk' => :'sdk',
116
- :'session_count' => :'session_count',
117
- :'tags' => :'tags',
118
- :'amount_spent' => :'amount_spent',
119
- :'created_at' => :'created_at',
120
- :'playtime' => :'playtime',
121
- :'badge_count' => :'badge_count',
122
- :'last_active' => :'last_active',
123
- :'notification_types' => :'notification_types',
124
- :'test_type' => :'test_type',
125
- :'long' => :'long',
126
- :'lat' => :'lat',
127
- :'country' => :'country'
128
- }
129
- end
130
-
131
- # Returns all the JSON keys this model knows about
132
- def self.acceptable_attributes
133
- attribute_map.values
134
- end
135
-
136
- # Attribute type mapping.
137
- def self.openapi_types
138
- {
139
- :'id' => :'String',
140
- :'invalid_identifier' => :'Boolean',
141
- :'app_id' => :'String',
142
- :'device_type' => :'Integer',
143
- :'external_user_id' => :'String',
144
- :'external_user_id_auth_hash' => :'String',
145
- :'email_auth_hash' => :'String',
146
- :'identifier' => :'String',
147
- :'language' => :'String',
148
- :'timezone' => :'Integer',
149
- :'game_version' => :'String',
150
- :'device_model' => :'String',
151
- :'device_os' => :'String',
152
- :'ad_id' => :'String',
153
- :'sdk' => :'String',
154
- :'session_count' => :'Integer',
155
- :'tags' => :'Object',
156
- :'amount_spent' => :'Float',
157
- :'created_at' => :'Integer',
158
- :'playtime' => :'Integer',
159
- :'badge_count' => :'Integer',
160
- :'last_active' => :'Integer',
161
- :'notification_types' => :'Integer',
162
- :'test_type' => :'Integer',
163
- :'long' => :'Float',
164
- :'lat' => :'Float',
165
- :'country' => :'String'
166
- }
167
- end
168
-
169
- # List of attributes with nullable: true
170
- def self.openapi_nullable
171
- Set.new([
172
- :'external_user_id',
173
- :'identifier',
174
- :'timezone',
175
- :'game_version',
176
- :'device_model',
177
- :'device_os',
178
- :'ad_id',
179
- :'sdk',
180
- :'tags',
181
- :'test_type',
182
- ])
183
- end
184
-
185
- # Initializes the object
186
- # @param [Hash] attributes Model attributes in the form of hash
187
- def initialize(attributes = {})
188
- if (!attributes.is_a?(Hash))
189
- fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::Player` initialize method"
190
- end
191
-
192
- # check to see if the attribute exists and convert string to symbol for hash key
193
- attributes = attributes.each_with_object({}) { |(k, v), h|
194
- if (!self.class.attribute_map.key?(k.to_sym))
195
- fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::Player`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
196
- end
197
- h[k.to_sym] = v
198
- }
199
-
200
- if attributes.key?(:'id')
201
- self.id = attributes[:'id']
202
- end
203
-
204
- if attributes.key?(:'invalid_identifier')
205
- self.invalid_identifier = attributes[:'invalid_identifier']
206
- end
207
-
208
- if attributes.key?(:'app_id')
209
- self.app_id = attributes[:'app_id']
210
- end
211
-
212
- if attributes.key?(:'device_type')
213
- self.device_type = attributes[:'device_type']
214
- end
215
-
216
- if attributes.key?(:'external_user_id')
217
- self.external_user_id = attributes[:'external_user_id']
218
- end
219
-
220
- if attributes.key?(:'external_user_id_auth_hash')
221
- self.external_user_id_auth_hash = attributes[:'external_user_id_auth_hash']
222
- end
223
-
224
- if attributes.key?(:'email_auth_hash')
225
- self.email_auth_hash = attributes[:'email_auth_hash']
226
- end
227
-
228
- if attributes.key?(:'identifier')
229
- self.identifier = attributes[:'identifier']
230
- end
231
-
232
- if attributes.key?(:'language')
233
- self.language = attributes[:'language']
234
- end
235
-
236
- if attributes.key?(:'timezone')
237
- self.timezone = attributes[:'timezone']
238
- end
239
-
240
- if attributes.key?(:'game_version')
241
- self.game_version = attributes[:'game_version']
242
- end
243
-
244
- if attributes.key?(:'device_model')
245
- self.device_model = attributes[:'device_model']
246
- end
247
-
248
- if attributes.key?(:'device_os')
249
- self.device_os = attributes[:'device_os']
250
- end
251
-
252
- if attributes.key?(:'ad_id')
253
- self.ad_id = attributes[:'ad_id']
254
- end
255
-
256
- if attributes.key?(:'sdk')
257
- self.sdk = attributes[:'sdk']
258
- end
259
-
260
- if attributes.key?(:'session_count')
261
- self.session_count = attributes[:'session_count']
262
- end
263
-
264
- if attributes.key?(:'tags')
265
- self.tags = attributes[:'tags']
266
- end
267
-
268
- if attributes.key?(:'amount_spent')
269
- self.amount_spent = attributes[:'amount_spent']
270
- end
271
-
272
- if attributes.key?(:'created_at')
273
- self.created_at = attributes[:'created_at']
274
- end
275
-
276
- if attributes.key?(:'playtime')
277
- self.playtime = attributes[:'playtime']
278
- end
279
-
280
- if attributes.key?(:'badge_count')
281
- self.badge_count = attributes[:'badge_count']
282
- end
283
-
284
- if attributes.key?(:'last_active')
285
- self.last_active = attributes[:'last_active']
286
- end
287
-
288
- if attributes.key?(:'notification_types')
289
- self.notification_types = attributes[:'notification_types']
290
- end
291
-
292
- if attributes.key?(:'test_type')
293
- self.test_type = attributes[:'test_type']
294
- end
295
-
296
- if attributes.key?(:'long')
297
- self.long = attributes[:'long']
298
- end
299
-
300
- if attributes.key?(:'lat')
301
- self.lat = attributes[:'lat']
302
- end
303
-
304
- if attributes.key?(:'country')
305
- self.country = attributes[:'country']
306
- end
307
- end
308
-
309
- # Show invalid properties with the reasons. Usually used together with valid?
310
- # @return Array for valid properties with the reasons
311
- def list_invalid_properties
312
- invalid_properties = Array.new
313
- if @device_type.nil?
314
- invalid_properties.push('invalid value for "device_type", device_type cannot be nil.')
315
- end
316
-
317
- invalid_properties
318
- end
319
-
320
- # Check to see if the all the properties in the model are valid
321
- # @return true if the model is valid
322
- def valid?
323
- return false if @device_type.nil?
324
- true
325
- end
326
-
327
- # Checks equality by comparing each attribute.
328
- # @param [Object] Object to be compared
329
- def ==(o)
330
- return true if self.equal?(o)
331
- self.class == o.class &&
332
- id == o.id &&
333
- invalid_identifier == o.invalid_identifier &&
334
- app_id == o.app_id &&
335
- device_type == o.device_type &&
336
- external_user_id == o.external_user_id &&
337
- external_user_id_auth_hash == o.external_user_id_auth_hash &&
338
- email_auth_hash == o.email_auth_hash &&
339
- identifier == o.identifier &&
340
- language == o.language &&
341
- timezone == o.timezone &&
342
- game_version == o.game_version &&
343
- device_model == o.device_model &&
344
- device_os == o.device_os &&
345
- ad_id == o.ad_id &&
346
- sdk == o.sdk &&
347
- session_count == o.session_count &&
348
- tags == o.tags &&
349
- amount_spent == o.amount_spent &&
350
- created_at == o.created_at &&
351
- playtime == o.playtime &&
352
- badge_count == o.badge_count &&
353
- last_active == o.last_active &&
354
- notification_types == o.notification_types &&
355
- test_type == o.test_type &&
356
- long == o.long &&
357
- lat == o.lat &&
358
- country == o.country
359
- end
360
-
361
- # @see the `==` method
362
- # @param [Object] Object to be compared
363
- def eql?(o)
364
- self == o
365
- end
366
-
367
- # Calculates hash code according to all attributes.
368
- # @return [Integer] Hash code
369
- def hash
370
- [id, invalid_identifier, app_id, device_type, external_user_id, external_user_id_auth_hash, email_auth_hash, identifier, language, timezone, game_version, device_model, device_os, ad_id, sdk, session_count, tags, amount_spent, created_at, playtime, badge_count, last_active, notification_types, test_type, long, lat, country].hash
371
- end
372
-
373
- # Builds the object from hash
374
- # @param [Hash] attributes Model attributes in the form of hash
375
- # @return [Object] Returns the model itself
376
- def self.build_from_hash(attributes)
377
- new.build_from_hash(attributes)
378
- end
379
-
380
- # Builds the object from hash
381
- # @param [Hash] attributes Model attributes in the form of hash
382
- # @return [Object] Returns the model itself
383
- def build_from_hash(attributes)
384
- return nil unless attributes.is_a?(Hash)
385
- attributes = attributes.transform_keys(&:to_sym)
386
- self.class.openapi_types.each_pair do |key, type|
387
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
388
- self.send("#{key}=", nil)
389
- elsif type =~ /\AArray<(.*)>/i
390
- # check to ensure the input is an array given that the attribute
391
- # is documented as an array but the input is not
392
- if attributes[self.class.attribute_map[key]].is_a?(Array)
393
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
394
- end
395
- elsif !attributes[self.class.attribute_map[key]].nil?
396
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
397
- end
398
- end
399
-
400
- self
401
- end
402
-
403
- # Deserializes the data based on type
404
- # @param string type Data type
405
- # @param string value Value to be deserialized
406
- # @return [Object] Deserialized data
407
- def _deserialize(type, value)
408
- case type.to_sym
409
- when :Time
410
- Time.parse(value)
411
- when :Date
412
- Date.parse(value)
413
- when :String
414
- value.to_s
415
- when :Integer
416
- value.to_i
417
- when :Float
418
- value.to_f
419
- when :Boolean
420
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
421
- true
422
- else
423
- false
424
- end
425
- when :Object
426
- # generic object (usually a Hash), return directly
427
- value
428
- when /\AArray<(?<inner_type>.+)>\z/
429
- inner_type = Regexp.last_match[:inner_type]
430
- value.map { |v| _deserialize(inner_type, v) }
431
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
432
- k_type = Regexp.last_match[:k_type]
433
- v_type = Regexp.last_match[:v_type]
434
- {}.tap do |hash|
435
- value.each do |k, v|
436
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
437
- end
438
- end
439
- else # model
440
- # models (e.g. Pet) or oneOf
441
- klass = OneSignal.const_get(type)
442
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
443
- end
444
- end
445
-
446
- # Returns the string representation of the object
447
- # @return [String] String presentation of the object
448
- def to_s
449
- to_hash.to_s
450
- end
451
-
452
- # to_body is an alias to to_hash (backward compatibility)
453
- # @return [Hash] Returns the object in the form of hash
454
- def to_body
455
- to_hash
456
- end
457
-
458
- # Returns the object in the form of hash
459
- # @return [Hash] Returns the object in the form of hash
460
- def to_hash
461
- hash = {}
462
- self.class.attribute_map.each_pair do |attr, param|
463
- value = self.send(attr)
464
- if value.nil?
465
- is_nullable = self.class.openapi_nullable.include?(attr)
466
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
467
- end
468
-
469
- hash[param] = _to_hash(value)
470
- end
471
- hash
472
- end
473
-
474
- # Outputs non-array value in the form of hash
475
- # For object, use to_hash. Otherwise, just return the value
476
- # @param [Object] value Any valid value
477
- # @return [Hash] Returns the value in the form of hash
478
- def _to_hash(value)
479
- if value.is_a?(Array)
480
- value.compact.map { |v| _to_hash(v) }
481
- elsif value.is_a?(Hash)
482
- {}.tap do |hash|
483
- value.each { |k, v| hash[k] = _to_hash(v) }
484
- end
485
- elsif value.respond_to? :to_hash
486
- value.to_hash
487
- else
488
- value
489
- end
490
- end
491
-
492
- end
493
-
494
- end