onesignal 1.0.0.beta1 → 2.2.0

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 (230) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/Gemfile.lock +74 -0
  4. data/LICENSE +24 -0
  5. data/README.md +77 -23
  6. data/RELEASE_INSTRUCTIONS.md +11 -0
  7. data/docs/App.md +9 -1
  8. data/docs/BasicNotification.md +230 -0
  9. data/docs/BasicNotificationAllOf.md +202 -0
  10. data/docs/{NotificationAllOfAndroidBackgroundLayout.md → BasicNotificationAllOfAndroidBackgroundLayout.md} +2 -2
  11. data/docs/BeginLiveActivityRequest.md +20 -0
  12. data/docs/CancelNotificationSuccessResponse.md +18 -0
  13. data/docs/CreateNotificationSuccessResponse.md +24 -0
  14. data/docs/{InlineResponse2004.md → CreatePlayerSuccessResponse.md} +2 -2
  15. data/docs/{InlineResponse409.md → CreateSegmentConflictResponse.md} +2 -2
  16. data/docs/CreateSegmentSuccessResponse.md +20 -0
  17. data/docs/CreateSubscriptionRequestBody.md +20 -0
  18. data/docs/CreateUserConflictResponse.md +18 -0
  19. data/docs/CreateUserConflictResponseErrorsInner.md +22 -0
  20. data/docs/CreateUserConflictResponseErrorsItemsMeta.md +18 -0
  21. data/docs/DefaultApi.md +1629 -304
  22. data/docs/DeletePlayerNotFoundResponse.md +18 -0
  23. data/docs/{InlineResponse2001.md → DeletePlayerSuccessResponse.md} +3 -3
  24. data/docs/DeleteSegmentNotFoundResponse.md +18 -0
  25. data/docs/DeleteSegmentSuccessResponse.md +18 -0
  26. data/docs/DeliveryData.md +5 -5
  27. data/docs/{InlineResponse2005.md → ExportEventsSuccessResponse.md} +2 -2
  28. data/docs/ExportPlayersRequestBody.md +2 -2
  29. data/docs/ExportPlayersSuccessResponse.md +18 -0
  30. data/docs/Filter.md +1 -1
  31. data/docs/FilterExpressions.md +1 -1
  32. data/docs/GenericError.md +18 -0
  33. data/docs/GenericErrorErrorsInner.md +20 -0
  34. data/docs/InlineResponse200.md +2 -8
  35. data/docs/InlineResponse2003.md +2 -2
  36. data/docs/InlineResponse201.md +2 -4
  37. data/docs/InlineResponse202.md +18 -0
  38. data/docs/InvalidIdentifierError.md +20 -0
  39. data/docs/Notification.md +33 -41
  40. data/docs/Notification200Errors.md +49 -0
  41. data/docs/NotificationAllOf.md +2 -176
  42. data/docs/{InlineResponse2002.md → NotificationHistorySuccessResponse.md} +3 -3
  43. data/docs/NotificationSlice.md +1 -1
  44. data/docs/NotificationTarget.md +6 -26
  45. data/docs/NotificationWithMeta.md +252 -0
  46. data/docs/NotificationWithMetaAllOf.md +38 -0
  47. data/docs/OutcomesData.md +18 -0
  48. data/docs/PlatformDeliveryData.md +5 -1
  49. data/docs/PlatformDeliveryDataEmailAllOf.md +30 -0
  50. data/docs/PlatformDeliveryDataSmsAllOf.md +22 -0
  51. data/docs/Player.md +3 -3
  52. data/docs/PlayerNotificationTarget.md +6 -2
  53. data/docs/PlayerNotificationTargetIncludeAliases.md +18 -0
  54. data/docs/PropertiesDeltas.md +22 -0
  55. data/docs/PropertiesObject.md +38 -0
  56. data/docs/Purchase.md +4 -2
  57. data/docs/RateLimiterError.md +18 -0
  58. data/docs/StringMap.md +1 -1
  59. data/docs/SubscriptionObject.md +50 -0
  60. data/docs/TransferSubscriptionRequestBody.md +18 -0
  61. data/docs/UpdateLiveActivityRequest.md +24 -0
  62. data/docs/UpdateLiveActivitySuccessResponse.md +20 -0
  63. data/docs/UpdatePlayerSuccessResponse.md +18 -0
  64. data/docs/UpdatePlayerTagsSuccessResponse.md +18 -0
  65. data/docs/UpdateSubscriptionRequestBody.md +18 -0
  66. data/docs/UpdateUserRequest.md +22 -0
  67. data/docs/User.md +24 -0
  68. data/docs/UserIdentityRequestBody.md +18 -0
  69. data/docs/UserIdentityResponse.md +18 -0
  70. data/docs/UserSubscriptionOptions.md +18 -0
  71. data/lib/onesignal/api/default_api.rb +1657 -268
  72. data/lib/onesignal/api_client.rb +9 -7
  73. data/lib/onesignal/api_error.rb +2 -2
  74. data/lib/onesignal/configuration.rb +11 -8
  75. data/lib/onesignal/models/app.rb +59 -8
  76. data/lib/onesignal/models/basic_notification.rb +1442 -0
  77. data/lib/onesignal/models/basic_notification_all_of.rb +1252 -0
  78. data/lib/onesignal/models/{notification_all_of_android_background_layout.rb → basic_notification_all_of_android_background_layout.rb} +6 -5
  79. data/lib/onesignal/models/begin_live_activity_request.rb +238 -0
  80. data/lib/onesignal/models/button.rb +3 -2
  81. data/lib/onesignal/models/cancel_notification_success_response.rb +219 -0
  82. data/lib/onesignal/models/create_notification_success_response.rb +248 -0
  83. data/lib/onesignal/models/{inline_response2004.rb → create_player_success_response.rb} +6 -5
  84. data/lib/onesignal/models/{inline_response409.rb → create_segment_conflict_response.rb} +6 -5
  85. data/lib/onesignal/models/create_segment_success_response.rb +229 -0
  86. data/lib/onesignal/models/create_subscription_request_body.rb +228 -0
  87. data/lib/onesignal/models/{inline_response4001.rb → create_user_conflict_response.rb} +8 -16
  88. data/lib/onesignal/models/create_user_conflict_response_errors_inner.rb +237 -0
  89. data/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb +219 -0
  90. data/lib/onesignal/models/delete_player_not_found_response.rb +219 -0
  91. data/lib/onesignal/models/{inline_response2001.rb → delete_player_success_response.rb} +7 -6
  92. data/lib/onesignal/models/delete_segment_not_found_response.rb +219 -0
  93. data/lib/onesignal/models/delete_segment_success_response.rb +219 -0
  94. data/lib/onesignal/models/delivery_data.rb +13 -2
  95. data/lib/onesignal/models/{inline_response2005.rb → export_events_success_response.rb} +6 -5
  96. data/lib/onesignal/models/export_players_request_body.rb +5 -4
  97. data/lib/onesignal/models/export_players_success_response.rb +219 -0
  98. data/lib/onesignal/models/filter.rb +4 -3
  99. data/lib/onesignal/models/filter_expressions.rb +4 -3
  100. data/lib/onesignal/models/{inline_response400.rb → generic_error.rb} +7 -6
  101. data/lib/onesignal/models/generic_error_errors_inner.rb +228 -0
  102. data/lib/onesignal/models/get_notification_request_body.rb +3 -2
  103. data/lib/onesignal/models/inline_response200.rb +12 -47
  104. data/lib/onesignal/models/inline_response2003.rb +12 -9
  105. data/lib/onesignal/models/inline_response201.rb +10 -19
  106. data/lib/onesignal/models/{inline_response4002.rb → inline_response202.rb} +13 -14
  107. data/lib/onesignal/models/invalid_identifier_error.rb +234 -0
  108. data/lib/onesignal/models/notification.rb +209 -157
  109. data/lib/onesignal/models/notification200_errors.rb +105 -0
  110. data/lib/onesignal/models/notification_all_of.rb +8 -911
  111. data/lib/onesignal/models/{inline_response2002.rb → notification_history_success_response.rb} +7 -6
  112. data/lib/onesignal/models/notification_slice.rb +4 -3
  113. data/lib/onesignal/models/notification_target.rb +63 -128
  114. data/lib/onesignal/models/notification_with_meta.rb +1557 -0
  115. data/lib/onesignal/models/notification_with_meta_all_of.rb +323 -0
  116. data/lib/onesignal/models/operator.rb +3 -2
  117. data/lib/onesignal/models/outcome_data.rb +3 -2
  118. data/lib/onesignal/models/outcomes_data.rb +221 -0
  119. data/lib/onesignal/models/platform_delivery_data.rb +27 -6
  120. data/lib/onesignal/models/platform_delivery_data_email_all_of.rb +287 -0
  121. data/lib/onesignal/models/platform_delivery_data_sms_all_of.rb +243 -0
  122. data/lib/onesignal/models/player.rb +14 -13
  123. data/lib/onesignal/models/player_notification_target.rb +63 -7
  124. data/lib/onesignal/models/player_notification_target_include_aliases.rb +221 -0
  125. data/lib/onesignal/models/player_slice.rb +3 -2
  126. data/lib/onesignal/models/properties_deltas.rb +239 -0
  127. data/lib/onesignal/models/properties_object.rb +313 -0
  128. data/lib/onesignal/models/purchase.rb +17 -7
  129. data/lib/onesignal/models/rate_limiter_error.rb +221 -0
  130. data/lib/onesignal/models/segment.rb +3 -2
  131. data/lib/onesignal/models/segment_notification_target.rb +3 -2
  132. data/lib/onesignal/models/string_map.rb +3 -7
  133. data/lib/onesignal/models/{filter_notification_target.rb → subscription_object.rb} +147 -79
  134. data/lib/onesignal/models/transfer_subscription_request_body.rb +221 -0
  135. data/lib/onesignal/models/update_live_activity_request.rb +309 -0
  136. data/lib/onesignal/models/update_live_activity_success_response.rb +228 -0
  137. data/lib/onesignal/models/update_player_success_response.rb +219 -0
  138. data/lib/onesignal/models/update_player_tags_request_body.rb +3 -2
  139. data/lib/onesignal/models/update_player_tags_success_response.rb +219 -0
  140. data/lib/onesignal/models/update_subscription_request_body.rb +219 -0
  141. data/lib/onesignal/models/update_user_request.rb +239 -0
  142. data/lib/onesignal/models/user.rb +250 -0
  143. data/lib/onesignal/models/user_identity_request_body.rb +221 -0
  144. data/lib/onesignal/models/user_identity_response.rb +221 -0
  145. data/lib/onesignal/models/user_subscription_options.rb +219 -0
  146. data/lib/onesignal/version.rb +3 -3
  147. data/lib/onesignal.rb +111 -0
  148. data/onesignal.gemspec +5 -4
  149. data/spec/api/default_api_spec.rb +263 -26
  150. data/spec/api_client_spec.rb +4 -4
  151. data/spec/configuration_spec.rb +5 -5
  152. data/spec/models/app_spec.rb +26 -2
  153. data/spec/models/{notification_all_of_android_background_layout_spec.rb → basic_notification_all_of_android_background_layout_spec.rb} +8 -8
  154. data/spec/models/basic_notification_all_of_spec.rb +590 -0
  155. data/spec/models/basic_notification_spec.rb +678 -0
  156. data/spec/models/begin_live_activity_request_spec.rb +40 -0
  157. data/spec/models/button_spec.rb +2 -2
  158. data/spec/models/cancel_notification_success_response_spec.rb +34 -0
  159. data/spec/models/create_notification_success_response_spec.rb +52 -0
  160. data/spec/models/{inline_response2004_spec.rb → create_player_success_response_spec.rb} +8 -8
  161. data/spec/models/{inline_response4001_spec.rb → create_segment_conflict_response_spec.rb} +8 -8
  162. data/spec/models/{inline_response409_spec.rb → create_segment_success_response_spec.rb} +9 -9
  163. data/spec/models/create_subscription_request_body_spec.rb +40 -0
  164. data/spec/models/create_user_conflict_response_errors_inner_spec.rb +46 -0
  165. data/spec/models/create_user_conflict_response_errors_items_meta_spec.rb +34 -0
  166. data/spec/models/create_user_conflict_response_spec.rb +34 -0
  167. data/spec/models/delete_player_not_found_response_spec.rb +34 -0
  168. data/spec/models/{inline_response2001_spec.rb → delete_player_success_response_spec.rb} +8 -8
  169. data/spec/models/delete_segment_not_found_response_spec.rb +34 -0
  170. data/spec/models/delete_segment_success_response_spec.rb +34 -0
  171. data/spec/models/delivery_data_spec.rb +2 -2
  172. data/spec/models/{inline_response2005_spec.rb → export_events_success_response_spec.rb} +8 -8
  173. data/spec/models/export_players_request_body_spec.rb +2 -2
  174. data/spec/models/export_players_success_response_spec.rb +34 -0
  175. data/spec/models/filter_expressions_spec.rb +2 -2
  176. data/spec/models/filter_spec.rb +2 -2
  177. data/spec/models/generic_error_errors_inner_spec.rb +40 -0
  178. data/spec/models/{inline_response4002_spec.rb → generic_error_spec.rb} +9 -9
  179. data/spec/models/get_notification_request_body_spec.rb +2 -2
  180. data/spec/models/inline_response2003_spec.rb +3 -3
  181. data/spec/models/inline_response200_spec.rb +3 -21
  182. data/spec/models/inline_response201_spec.rb +3 -9
  183. data/spec/models/{inline_response400_spec.rb → inline_response202_spec.rb} +9 -9
  184. data/spec/models/invalid_identifier_error_spec.rb +40 -0
  185. data/spec/models/notification200_errors_spec.rb +31 -0
  186. data/spec/models/notification_all_of_spec.rb +2 -528
  187. data/spec/models/{inline_response2002_spec.rb → notification_history_success_response_spec.rb} +8 -8
  188. data/spec/models/notification_slice_spec.rb +2 -2
  189. data/spec/models/notification_spec.rb +58 -78
  190. data/spec/models/notification_target_spec.rb +18 -74
  191. data/spec/models/notification_with_meta_all_of_spec.rb +94 -0
  192. data/spec/models/notification_with_meta_spec.rb +744 -0
  193. data/spec/models/operator_spec.rb +2 -2
  194. data/spec/models/outcome_data_spec.rb +2 -2
  195. data/spec/models/outcomes_data_spec.rb +34 -0
  196. data/spec/models/platform_delivery_data_email_all_of_spec.rb +70 -0
  197. data/spec/models/platform_delivery_data_sms_all_of_spec.rb +46 -0
  198. data/spec/models/platform_delivery_data_spec.rb +14 -2
  199. data/spec/models/player_notification_target_include_aliases_spec.rb +34 -0
  200. data/spec/models/player_notification_target_spec.rb +18 -2
  201. data/spec/models/player_slice_spec.rb +2 -2
  202. data/spec/models/player_spec.rb +2 -2
  203. data/spec/models/properties_deltas_spec.rb +46 -0
  204. data/spec/models/{filter_notification_target_spec.rb → properties_object_spec.rb} +19 -25
  205. data/spec/models/purchase_spec.rb +8 -2
  206. data/spec/models/rate_limiter_error_spec.rb +34 -0
  207. data/spec/models/segment_notification_target_spec.rb +2 -2
  208. data/spec/models/segment_spec.rb +2 -2
  209. data/spec/models/string_map_spec.rb +2 -2
  210. data/spec/models/subscription_object_spec.rb +134 -0
  211. data/spec/models/transfer_subscription_request_body_spec.rb +34 -0
  212. data/spec/models/update_live_activity_request_spec.rb +60 -0
  213. data/spec/models/update_live_activity_success_response_spec.rb +40 -0
  214. data/spec/models/update_player_success_response_spec.rb +34 -0
  215. data/spec/models/update_player_tags_request_body_spec.rb +2 -2
  216. data/spec/models/update_player_tags_success_response_spec.rb +34 -0
  217. data/spec/models/update_subscription_request_body_spec.rb +34 -0
  218. data/spec/models/update_user_request_spec.rb +46 -0
  219. data/spec/models/user_identity_request_body_spec.rb +34 -0
  220. data/spec/models/user_identity_response_spec.rb +34 -0
  221. data/spec/models/user_spec.rb +52 -0
  222. data/spec/models/user_subscription_options_spec.rb +34 -0
  223. data/spec/spec_helper.rb +2 -2
  224. metadata +198 -51
  225. data/docs/FilterNotificationTarget.md +0 -40
  226. data/docs/InlineResponse400.md +0 -18
  227. data/docs/InlineResponse4001.md +0 -20
  228. data/docs/InlineResponse4002.md +0 -18
  229. data/git_push.sh +0 -58
  230. data/lib/OneSignal.rb +0 -75
@@ -0,0 +1,228 @@
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.0
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 GenericErrorErrorsInner
18
+ attr_accessor :code
19
+
20
+ attr_accessor :title
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'code' => :'code',
26
+ :'title' => :'title'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'code' => :'String',
39
+ :'title' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::GenericErrorErrorsInner` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::GenericErrorErrorsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'code')
65
+ self.code = attributes[:'code']
66
+ end
67
+
68
+ if attributes.key?(:'title')
69
+ self.title = attributes[:'title']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ code == o.code &&
92
+ title == o.title
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [code, title].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ attributes = attributes.transform_keys(&:to_sym)
120
+ self.class.openapi_types.each_pair do |key, type|
121
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
122
+ self.send("#{key}=", nil)
123
+ elsif type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :Time
144
+ Time.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ # models (e.g. Pet) or oneOf
175
+ klass = OneSignal.const_get(type)
176
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+
226
+ end
227
+
228
+ end
@@ -3,10 +3,10 @@
3
3
 
4
4
  #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.4.0
7
7
  Contact: devrel@onesignal.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.2.0-SNAPSHOT
9
+ OpenAPI Generator version: 6.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -161,6 +161,7 @@ module OneSignal
161
161
  # @return [Object] Returns the model itself
162
162
  def build_from_hash(attributes)
163
163
  return nil unless attributes.is_a?(Hash)
164
+ attributes = attributes.transform_keys(&:to_sym)
164
165
  self.class.openapi_types.each_pair do |key, type|
165
166
  if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
166
167
  self.send("#{key}=", nil)
@@ -3,10 +3,10 @@
3
3
 
4
4
  #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.4.0
7
7
  Contact: devrel@onesignal.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.2.0-SNAPSHOT
9
+ OpenAPI Generator version: 6.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -15,22 +15,12 @@ require 'time'
15
15
 
16
16
  module OneSignal
17
17
  class InlineResponse200
18
- attr_accessor :id
19
-
20
- # Estimated number of subscribers targetted by notification.
21
- attr_accessor :recipients
22
-
23
- attr_accessor :external_id
24
-
25
- attr_accessor :errors
18
+ attr_accessor :identity
26
19
 
27
20
  # Attribute mapping from ruby-style variable name to JSON key.
28
21
  def self.attribute_map
29
22
  {
30
- :'id' => :'id',
31
- :'recipients' => :'recipients',
32
- :'external_id' => :'external_id',
33
- :'errors' => :'errors'
23
+ :'identity' => :'identity'
34
24
  }
35
25
  end
36
26
 
@@ -42,10 +32,7 @@ module OneSignal
42
32
  # Attribute type mapping.
43
33
  def self.openapi_types
44
34
  {
45
- :'id' => :'String',
46
- :'recipients' => :'Integer',
47
- :'external_id' => :'String',
48
- :'errors' => :'OneOfobjectarray'
35
+ :'identity' => :'Hash<String, Object>'
49
36
  }
50
37
  end
51
38
 
@@ -70,20 +57,10 @@ module OneSignal
70
57
  h[k.to_sym] = v
71
58
  }
72
59
 
73
- if attributes.key?(:'id')
74
- self.id = attributes[:'id']
75
- end
76
-
77
- if attributes.key?(:'recipients')
78
- self.recipients = attributes[:'recipients']
79
- end
80
-
81
- if attributes.key?(:'external_id')
82
- self.external_id = attributes[:'external_id']
83
- end
84
-
85
- if attributes.key?(:'errors')
86
- self.errors = attributes[:'errors']
60
+ if attributes.key?(:'identity')
61
+ if (value = attributes[:'identity']).is_a?(Hash)
62
+ self.identity = value
63
+ end
87
64
  end
88
65
  end
89
66
 
@@ -91,22 +68,12 @@ module OneSignal
91
68
  # @return Array for valid properties with the reasons
92
69
  def list_invalid_properties
93
70
  invalid_properties = Array.new
94
- if @id.nil?
95
- invalid_properties.push('invalid value for "id", id cannot be nil.')
96
- end
97
-
98
- if @recipients.nil?
99
- invalid_properties.push('invalid value for "recipients", recipients cannot be nil.')
100
- end
101
-
102
71
  invalid_properties
103
72
  end
104
73
 
105
74
  # Check to see if the all the properties in the model are valid
106
75
  # @return true if the model is valid
107
76
  def valid?
108
- return false if @id.nil?
109
- return false if @recipients.nil?
110
77
  true
111
78
  end
112
79
 
@@ -115,10 +82,7 @@ module OneSignal
115
82
  def ==(o)
116
83
  return true if self.equal?(o)
117
84
  self.class == o.class &&
118
- id == o.id &&
119
- recipients == o.recipients &&
120
- external_id == o.external_id &&
121
- errors == o.errors
85
+ identity == o.identity
122
86
  end
123
87
 
124
88
  # @see the `==` method
@@ -130,7 +94,7 @@ module OneSignal
130
94
  # Calculates hash code according to all attributes.
131
95
  # @return [Integer] Hash code
132
96
  def hash
133
- [id, recipients, external_id, errors].hash
97
+ [identity].hash
134
98
  end
135
99
 
136
100
  # Builds the object from hash
@@ -145,6 +109,7 @@ module OneSignal
145
109
  # @return [Object] Returns the model itself
146
110
  def build_from_hash(attributes)
147
111
  return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
148
113
  self.class.openapi_types.each_pair do |key, type|
149
114
  if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
150
115
  self.send("#{key}=", nil)
@@ -3,10 +3,10 @@
3
3
 
4
4
  #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.4.0
7
7
  Contact: devrel@onesignal.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.2.0-SNAPSHOT
9
+ OpenAPI Generator version: 6.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -15,12 +15,12 @@ require 'time'
15
15
 
16
16
  module OneSignal
17
17
  class InlineResponse2003
18
- attr_accessor :success
18
+ attr_accessor :in_app_messages
19
19
 
20
20
  # Attribute mapping from ruby-style variable name to JSON key.
21
21
  def self.attribute_map
22
22
  {
23
- :'success' => :'success'
23
+ :'in_app_messages' => :'in_app_messages'
24
24
  }
25
25
  end
26
26
 
@@ -32,7 +32,7 @@ module OneSignal
32
32
  # Attribute type mapping.
33
33
  def self.openapi_types
34
34
  {
35
- :'success' => :'Boolean'
35
+ :'in_app_messages' => :'Array<Object>'
36
36
  }
37
37
  end
38
38
 
@@ -57,8 +57,10 @@ module OneSignal
57
57
  h[k.to_sym] = v
58
58
  }
59
59
 
60
- if attributes.key?(:'success')
61
- self.success = attributes[:'success']
60
+ if attributes.key?(:'in_app_messages')
61
+ if (value = attributes[:'in_app_messages']).is_a?(Array)
62
+ self.in_app_messages = value
63
+ end
62
64
  end
63
65
  end
64
66
 
@@ -80,7 +82,7 @@ module OneSignal
80
82
  def ==(o)
81
83
  return true if self.equal?(o)
82
84
  self.class == o.class &&
83
- success == o.success
85
+ in_app_messages == o.in_app_messages
84
86
  end
85
87
 
86
88
  # @see the `==` method
@@ -92,7 +94,7 @@ module OneSignal
92
94
  # Calculates hash code according to all attributes.
93
95
  # @return [Integer] Hash code
94
96
  def hash
95
- [success].hash
97
+ [in_app_messages].hash
96
98
  end
97
99
 
98
100
  # Builds the object from hash
@@ -107,6 +109,7 @@ module OneSignal
107
109
  # @return [Object] Returns the model itself
108
110
  def build_from_hash(attributes)
109
111
  return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
110
113
  self.class.openapi_types.each_pair do |key, type|
111
114
  if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
112
115
  self.send("#{key}=", nil)
@@ -3,10 +3,10 @@
3
3
 
4
4
  #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.4.0
7
7
  Contact: devrel@onesignal.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.2.0-SNAPSHOT
9
+ OpenAPI Generator version: 6.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -15,16 +15,12 @@ require 'time'
15
15
 
16
16
  module OneSignal
17
17
  class InlineResponse201
18
- attr_accessor :success
19
-
20
- # UUID of created segment
21
- attr_accessor :id
18
+ attr_accessor :subscription
22
19
 
23
20
  # Attribute mapping from ruby-style variable name to JSON key.
24
21
  def self.attribute_map
25
22
  {
26
- :'success' => :'success',
27
- :'id' => :'id'
23
+ :'subscription' => :'subscription'
28
24
  }
29
25
  end
30
26
 
@@ -36,8 +32,7 @@ module OneSignal
36
32
  # Attribute type mapping.
37
33
  def self.openapi_types
38
34
  {
39
- :'success' => :'Boolean',
40
- :'id' => :'String'
35
+ :'subscription' => :'SubscriptionObject'
41
36
  }
42
37
  end
43
38
 
@@ -62,12 +57,8 @@ module OneSignal
62
57
  h[k.to_sym] = v
63
58
  }
64
59
 
65
- if attributes.key?(:'success')
66
- self.success = attributes[:'success']
67
- end
68
-
69
- if attributes.key?(:'id')
70
- self.id = attributes[:'id']
60
+ if attributes.key?(:'subscription')
61
+ self.subscription = attributes[:'subscription']
71
62
  end
72
63
  end
73
64
 
@@ -89,8 +80,7 @@ module OneSignal
89
80
  def ==(o)
90
81
  return true if self.equal?(o)
91
82
  self.class == o.class &&
92
- success == o.success &&
93
- id == o.id
83
+ subscription == o.subscription
94
84
  end
95
85
 
96
86
  # @see the `==` method
@@ -102,7 +92,7 @@ module OneSignal
102
92
  # Calculates hash code according to all attributes.
103
93
  # @return [Integer] Hash code
104
94
  def hash
105
- [success, id].hash
95
+ [subscription].hash
106
96
  end
107
97
 
108
98
  # Builds the object from hash
@@ -117,6 +107,7 @@ module OneSignal
117
107
  # @return [Object] Returns the model itself
118
108
  def build_from_hash(attributes)
119
109
  return nil unless attributes.is_a?(Hash)
110
+ attributes = attributes.transform_keys(&:to_sym)
120
111
  self.class.openapi_types.each_pair do |key, type|
121
112
  if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
122
113
  self.send("#{key}=", nil)
@@ -3,10 +3,10 @@
3
3
 
4
4
  #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.4.0
7
7
  Contact: devrel@onesignal.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.2.0-SNAPSHOT
9
+ OpenAPI Generator version: 6.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -14,13 +14,13 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OneSignal
17
- class InlineResponse4002
18
- attr_accessor :erorrs
17
+ class InlineResponse202
18
+ attr_accessor :properties
19
19
 
20
20
  # Attribute mapping from ruby-style variable name to JSON key.
21
21
  def self.attribute_map
22
22
  {
23
- :'erorrs' => :'erorrs'
23
+ :'properties' => :'properties'
24
24
  }
25
25
  end
26
26
 
@@ -32,7 +32,7 @@ module OneSignal
32
32
  # Attribute type mapping.
33
33
  def self.openapi_types
34
34
  {
35
- :'erorrs' => :'Array<String>'
35
+ :'properties' => :'PropertiesObject'
36
36
  }
37
37
  end
38
38
 
@@ -46,21 +46,19 @@ module OneSignal
46
46
  # @param [Hash] attributes Model attributes in the form of hash
47
47
  def initialize(attributes = {})
48
48
  if (!attributes.is_a?(Hash))
49
- fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::InlineResponse4002` initialize method"
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::InlineResponse202` initialize method"
50
50
  end
51
51
 
52
52
  # check to see if the attribute exists and convert string to symbol for hash key
53
53
  attributes = attributes.each_with_object({}) { |(k, v), h|
54
54
  if (!self.class.attribute_map.key?(k.to_sym))
55
- fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::InlineResponse4002`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::InlineResponse202`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
56
  end
57
57
  h[k.to_sym] = v
58
58
  }
59
59
 
60
- if attributes.key?(:'erorrs')
61
- if (value = attributes[:'erorrs']).is_a?(Array)
62
- self.erorrs = value
63
- end
60
+ if attributes.key?(:'properties')
61
+ self.properties = attributes[:'properties']
64
62
  end
65
63
  end
66
64
 
@@ -82,7 +80,7 @@ module OneSignal
82
80
  def ==(o)
83
81
  return true if self.equal?(o)
84
82
  self.class == o.class &&
85
- erorrs == o.erorrs
83
+ properties == o.properties
86
84
  end
87
85
 
88
86
  # @see the `==` method
@@ -94,7 +92,7 @@ module OneSignal
94
92
  # Calculates hash code according to all attributes.
95
93
  # @return [Integer] Hash code
96
94
  def hash
97
- [erorrs].hash
95
+ [properties].hash
98
96
  end
99
97
 
100
98
  # Builds the object from hash
@@ -109,6 +107,7 @@ module OneSignal
109
107
  # @return [Object] Returns the model itself
110
108
  def build_from_hash(attributes)
111
109
  return nil unless attributes.is_a?(Hash)
110
+ attributes = attributes.transform_keys(&:to_sym)
112
111
  self.class.openapi_types.each_pair do |key, type|
113
112
  if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
113
  self.send("#{key}=", nil)