onesignal 1.0.0.beta1 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/LICENSE +24 -0
  4. data/README.md +75 -45
  5. data/RELEASE_INSTRUCTIONS.md +11 -0
  6. data/docs/DefaultApi.md +86 -86
  7. data/docs/InlineResponse200.md +1 -1
  8. data/docs/InlineResponse2001.md +1 -1
  9. data/docs/InlineResponse2002.md +1 -1
  10. data/docs/InlineResponse2005.md +4 -2
  11. data/docs/{InlineResponse2003.md → InlineResponse2007.md} +3 -3
  12. data/docs/InlineResponse2008.md +18 -0
  13. data/docs/InlineResponse4002.md +4 -2
  14. data/docs/InlineResponse4003.md +18 -0
  15. data/docs/InvalidIdentifierError.md +20 -0
  16. data/docs/Notification.md +12 -12
  17. data/docs/Notification200Errors.md +49 -0
  18. data/docs/NotificationAllOf.md +11 -11
  19. data/docs/NotificationSlice.md +1 -1
  20. data/docs/NotificationTarget.md +1 -1
  21. data/docs/NotificationWithMeta.md +260 -0
  22. data/docs/NotificationWithMetaAllOf.md +38 -0
  23. data/docs/OutcomesData.md +18 -0
  24. data/docs/Player.md +2 -2
  25. data/docs/PlayerNotificationTarget.md +1 -1
  26. data/docs/StringMap.md +1 -1
  27. data/lib/onesignal/api/default_api.rb +82 -55
  28. data/lib/onesignal/api_client.rb +9 -7
  29. data/lib/onesignal/api_error.rb +2 -2
  30. data/lib/onesignal/configuration.rb +6 -3
  31. data/lib/onesignal/models/app.rb +3 -2
  32. data/lib/onesignal/models/button.rb +3 -2
  33. data/lib/onesignal/models/delivery_data.rb +8 -2
  34. data/lib/onesignal/models/export_players_request_body.rb +3 -2
  35. data/lib/onesignal/models/filter.rb +3 -2
  36. data/lib/onesignal/models/filter_expressions.rb +3 -2
  37. data/lib/onesignal/models/filter_notification_target.rb +3 -2
  38. data/lib/onesignal/models/get_notification_request_body.rb +3 -2
  39. data/lib/onesignal/models/inline_response200.rb +4 -3
  40. data/lib/onesignal/models/inline_response2001.rb +4 -3
  41. data/lib/onesignal/models/inline_response2002.rb +4 -3
  42. data/lib/onesignal/models/inline_response2005.rb +19 -9
  43. data/lib/onesignal/models/{inline_response2003.rb → inline_response2007.rb} +7 -6
  44. data/lib/onesignal/models/{inline_response2004.rb → inline_response2008.rb} +13 -21
  45. data/lib/onesignal/models/inline_response201.rb +3 -2
  46. data/lib/onesignal/models/inline_response400.rb +3 -2
  47. data/lib/onesignal/models/inline_response4001.rb +3 -2
  48. data/lib/onesignal/models/inline_response4002.rb +20 -10
  49. data/lib/onesignal/models/{inline_response409.rb → inline_response4003.rb} +14 -22
  50. data/lib/onesignal/models/invalid_identifier_error.rb +234 -0
  51. data/lib/onesignal/models/notification.rb +39 -19
  52. data/lib/onesignal/models/notification200_errors.rb +105 -0
  53. data/lib/onesignal/models/notification_all_of.rb +38 -18
  54. data/lib/onesignal/models/notification_all_of_android_background_layout.rb +3 -2
  55. data/lib/onesignal/models/notification_slice.rb +4 -3
  56. data/lib/onesignal/models/notification_target.rb +4 -3
  57. data/lib/onesignal/models/notification_with_meta.rb +1526 -0
  58. data/lib/onesignal/models/notification_with_meta_all_of.rb +322 -0
  59. data/lib/onesignal/models/operator.rb +3 -2
  60. data/lib/onesignal/models/outcome_data.rb +3 -2
  61. data/lib/onesignal/models/outcomes_data.rb +221 -0
  62. data/lib/onesignal/models/platform_delivery_data.rb +3 -2
  63. data/lib/onesignal/models/player.rb +6 -8
  64. data/lib/onesignal/models/player_notification_target.rb +4 -3
  65. data/lib/onesignal/models/player_slice.rb +3 -2
  66. data/lib/onesignal/models/purchase.rb +3 -2
  67. data/lib/onesignal/models/segment.rb +3 -2
  68. data/lib/onesignal/models/segment_notification_target.rb +3 -2
  69. data/lib/onesignal/models/string_map.rb +3 -7
  70. data/lib/onesignal/models/update_player_tags_request_body.rb +3 -2
  71. data/lib/onesignal/version.rb +3 -3
  72. data/lib/{OneSignal.rb → onesignal.rb} +10 -5
  73. data/onesignal.gemspec +5 -4
  74. data/spec/api/default_api_spec.rb +20 -20
  75. data/spec/api_client_spec.rb +4 -4
  76. data/spec/configuration_spec.rb +2 -2
  77. data/spec/models/app_spec.rb +2 -2
  78. data/spec/models/button_spec.rb +2 -2
  79. data/spec/models/delivery_data_spec.rb +2 -2
  80. data/spec/models/export_players_request_body_spec.rb +2 -2
  81. data/spec/models/filter_expressions_spec.rb +2 -2
  82. data/spec/models/filter_notification_target_spec.rb +2 -2
  83. data/spec/models/filter_spec.rb +2 -2
  84. data/spec/models/get_notification_request_body_spec.rb +2 -2
  85. data/spec/models/inline_response2001_spec.rb +2 -2
  86. data/spec/models/inline_response2002_spec.rb +2 -2
  87. data/spec/models/inline_response2005_spec.rb +9 -3
  88. data/spec/models/{inline_response2003_spec.rb → inline_response2007_spec.rb} +8 -8
  89. data/spec/models/{inline_response409_spec.rb → inline_response2008_spec.rb} +9 -15
  90. data/spec/models/inline_response200_spec.rb +2 -2
  91. data/spec/models/inline_response201_spec.rb +2 -2
  92. data/spec/models/inline_response4001_spec.rb +2 -2
  93. data/spec/models/inline_response4002_spec.rb +9 -3
  94. data/spec/models/inline_response4003_spec.rb +34 -0
  95. data/spec/models/inline_response400_spec.rb +2 -2
  96. data/spec/models/{inline_response2004_spec.rb → invalid_identifier_error_spec.rb} +10 -10
  97. data/spec/models/notification200_errors_spec.rb +31 -0
  98. data/spec/models/notification_all_of_android_background_layout_spec.rb +2 -2
  99. data/spec/models/notification_all_of_spec.rb +3 -3
  100. data/spec/models/notification_slice_spec.rb +2 -2
  101. data/spec/models/notification_spec.rb +3 -3
  102. data/spec/models/notification_target_spec.rb +2 -2
  103. data/spec/models/notification_with_meta_all_of_spec.rb +94 -0
  104. data/spec/models/notification_with_meta_spec.rb +764 -0
  105. data/spec/models/operator_spec.rb +2 -2
  106. data/spec/models/outcome_data_spec.rb +2 -2
  107. data/spec/models/outcomes_data_spec.rb +34 -0
  108. data/spec/models/platform_delivery_data_spec.rb +2 -2
  109. data/spec/models/player_notification_target_spec.rb +2 -2
  110. data/spec/models/player_slice_spec.rb +2 -2
  111. data/spec/models/player_spec.rb +2 -2
  112. data/spec/models/purchase_spec.rb +2 -2
  113. data/spec/models/segment_notification_target_spec.rb +2 -2
  114. data/spec/models/segment_spec.rb +2 -2
  115. data/spec/models/string_map_spec.rb +2 -2
  116. data/spec/models/update_player_tags_request_body_spec.rb +2 -2
  117. data/spec/spec_helper.rb +2 -2
  118. metadata +51 -29
  119. data/docs/InlineResponse2004.md +0 -20
  120. data/docs/InlineResponse409.md +0 -20
  121. data/git_push.sh +0 -58
@@ -0,0 +1,322 @@
1
+ =begin
2
+ #OneSignal
3
+
4
+ #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: devrel@onesignal.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OneSignal
17
+ class NotificationWithMetaAllOf
18
+ # Number of notifications that have not been sent out yet. This can mean either our system is still processing the notification or you have delayed options set.
19
+ attr_accessor :remaining
20
+
21
+ # Number of notifications that were successfully delivered.
22
+ attr_accessor :successful
23
+
24
+ # Number of notifications that could not be delivered due to those devices being unsubscribed.
25
+ attr_accessor :failed
26
+
27
+ # Number of notifications that could not be delivered due to an error. You can find more information by viewing the notification in the dashboard.
28
+ attr_accessor :errored
29
+
30
+ # Number of users who have clicked / tapped on your notification.
31
+ attr_accessor :converted
32
+
33
+ # Unix timestamp indicating when the notification was created.
34
+ attr_accessor :queued_at
35
+
36
+ # Unix timestamp indicating when notification delivery should begin.
37
+ attr_accessor :send_after
38
+
39
+ # Unix timestamp indicating when notification delivery completed. The delivery duration from start to finish can be calculated with completed_at - send_after.
40
+ attr_accessor :completed_at
41
+
42
+ attr_accessor :platform_delivery_stats
43
+
44
+ # Confirmed Deliveries number of devices that received the push notification. Paid Feature Only. Free accounts will see 0.
45
+ attr_accessor :received
46
+
47
+ # number of push notifications sent per minute. Paid Feature Only. If throttling is not enabled for the app or the notification, and for free accounts, null is returned. Refer to Throttling for more details.
48
+ attr_accessor :throttle_rate_per_minute
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'remaining' => :'remaining',
54
+ :'successful' => :'successful',
55
+ :'failed' => :'failed',
56
+ :'errored' => :'errored',
57
+ :'converted' => :'converted',
58
+ :'queued_at' => :'queued_at',
59
+ :'send_after' => :'send_after',
60
+ :'completed_at' => :'completed_at',
61
+ :'platform_delivery_stats' => :'platform_delivery_stats',
62
+ :'received' => :'received',
63
+ :'throttle_rate_per_minute' => :'throttle_rate_per_minute'
64
+ }
65
+ end
66
+
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ attribute_map.values
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'remaining' => :'Integer',
76
+ :'successful' => :'Integer',
77
+ :'failed' => :'Integer',
78
+ :'errored' => :'Integer',
79
+ :'converted' => :'Integer',
80
+ :'queued_at' => :'Integer',
81
+ :'send_after' => :'Integer',
82
+ :'completed_at' => :'Integer',
83
+ :'platform_delivery_stats' => :'PlatformDeliveryData',
84
+ :'received' => :'Integer',
85
+ :'throttle_rate_per_minute' => :'Integer'
86
+ }
87
+ end
88
+
89
+ # List of attributes with nullable: true
90
+ def self.openapi_nullable
91
+ Set.new([
92
+ :'completed_at',
93
+ :'received',
94
+ :'throttle_rate_per_minute'
95
+ ])
96
+ end
97
+
98
+ # Initializes the object
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ def initialize(attributes = {})
101
+ if (!attributes.is_a?(Hash))
102
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::NotificationWithMetaAllOf` initialize method"
103
+ end
104
+
105
+ # check to see if the attribute exists and convert string to symbol for hash key
106
+ attributes = attributes.each_with_object({}) { |(k, v), h|
107
+ if (!self.class.attribute_map.key?(k.to_sym))
108
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::NotificationWithMetaAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
109
+ end
110
+ h[k.to_sym] = v
111
+ }
112
+
113
+ if attributes.key?(:'remaining')
114
+ self.remaining = attributes[:'remaining']
115
+ end
116
+
117
+ if attributes.key?(:'successful')
118
+ self.successful = attributes[:'successful']
119
+ end
120
+
121
+ if attributes.key?(:'failed')
122
+ self.failed = attributes[:'failed']
123
+ end
124
+
125
+ if attributes.key?(:'errored')
126
+ self.errored = attributes[:'errored']
127
+ end
128
+
129
+ if attributes.key?(:'converted')
130
+ self.converted = attributes[:'converted']
131
+ end
132
+
133
+ if attributes.key?(:'queued_at')
134
+ self.queued_at = attributes[:'queued_at']
135
+ end
136
+
137
+ if attributes.key?(:'send_after')
138
+ self.send_after = attributes[:'send_after']
139
+ end
140
+
141
+ if attributes.key?(:'completed_at')
142
+ self.completed_at = attributes[:'completed_at']
143
+ end
144
+
145
+ if attributes.key?(:'platform_delivery_stats')
146
+ self.platform_delivery_stats = attributes[:'platform_delivery_stats']
147
+ end
148
+
149
+ if attributes.key?(:'received')
150
+ self.received = attributes[:'received']
151
+ end
152
+
153
+ if attributes.key?(:'throttle_rate_per_minute')
154
+ self.throttle_rate_per_minute = attributes[:'throttle_rate_per_minute']
155
+ end
156
+ end
157
+
158
+ # Show invalid properties with the reasons. Usually used together with valid?
159
+ # @return Array for valid properties with the reasons
160
+ def list_invalid_properties
161
+ invalid_properties = Array.new
162
+ invalid_properties
163
+ end
164
+
165
+ # Check to see if the all the properties in the model are valid
166
+ # @return true if the model is valid
167
+ def valid?
168
+ true
169
+ end
170
+
171
+ # Checks equality by comparing each attribute.
172
+ # @param [Object] Object to be compared
173
+ def ==(o)
174
+ return true if self.equal?(o)
175
+ self.class == o.class &&
176
+ remaining == o.remaining &&
177
+ successful == o.successful &&
178
+ failed == o.failed &&
179
+ errored == o.errored &&
180
+ converted == o.converted &&
181
+ queued_at == o.queued_at &&
182
+ send_after == o.send_after &&
183
+ completed_at == o.completed_at &&
184
+ platform_delivery_stats == o.platform_delivery_stats &&
185
+ received == o.received &&
186
+ throttle_rate_per_minute == o.throttle_rate_per_minute
187
+ end
188
+
189
+ # @see the `==` method
190
+ # @param [Object] Object to be compared
191
+ def eql?(o)
192
+ self == o
193
+ end
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Integer] Hash code
197
+ def hash
198
+ [remaining, successful, failed, errored, converted, queued_at, send_after, completed_at, platform_delivery_stats, received, throttle_rate_per_minute].hash
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def self.build_from_hash(attributes)
205
+ new.build_from_hash(attributes)
206
+ end
207
+
208
+ # Builds the object from hash
209
+ # @param [Hash] attributes Model attributes in the form of hash
210
+ # @return [Object] Returns the model itself
211
+ def build_from_hash(attributes)
212
+ return nil unless attributes.is_a?(Hash)
213
+ attributes = attributes.transform_keys(&:to_sym)
214
+ self.class.openapi_types.each_pair do |key, type|
215
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
216
+ self.send("#{key}=", nil)
217
+ elsif type =~ /\AArray<(.*)>/i
218
+ # check to ensure the input is an array given that the attribute
219
+ # is documented as an array but the input is not
220
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
221
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
222
+ end
223
+ elsif !attributes[self.class.attribute_map[key]].nil?
224
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
225
+ end
226
+ end
227
+
228
+ self
229
+ end
230
+
231
+ # Deserializes the data based on type
232
+ # @param string type Data type
233
+ # @param string value Value to be deserialized
234
+ # @return [Object] Deserialized data
235
+ def _deserialize(type, value)
236
+ case type.to_sym
237
+ when :Time
238
+ Time.parse(value)
239
+ when :Date
240
+ Date.parse(value)
241
+ when :String
242
+ value.to_s
243
+ when :Integer
244
+ value.to_i
245
+ when :Float
246
+ value.to_f
247
+ when :Boolean
248
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
249
+ true
250
+ else
251
+ false
252
+ end
253
+ when :Object
254
+ # generic object (usually a Hash), return directly
255
+ value
256
+ when /\AArray<(?<inner_type>.+)>\z/
257
+ inner_type = Regexp.last_match[:inner_type]
258
+ value.map { |v| _deserialize(inner_type, v) }
259
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
260
+ k_type = Regexp.last_match[:k_type]
261
+ v_type = Regexp.last_match[:v_type]
262
+ {}.tap do |hash|
263
+ value.each do |k, v|
264
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
265
+ end
266
+ end
267
+ else # model
268
+ # models (e.g. Pet) or oneOf
269
+ klass = OneSignal.const_get(type)
270
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
271
+ end
272
+ end
273
+
274
+ # Returns the string representation of the object
275
+ # @return [String] String presentation of the object
276
+ def to_s
277
+ to_hash.to_s
278
+ end
279
+
280
+ # to_body is an alias to to_hash (backward compatibility)
281
+ # @return [Hash] Returns the object in the form of hash
282
+ def to_body
283
+ to_hash
284
+ end
285
+
286
+ # Returns the object in the form of hash
287
+ # @return [Hash] Returns the object in the form of hash
288
+ def to_hash
289
+ hash = {}
290
+ self.class.attribute_map.each_pair do |attr, param|
291
+ value = self.send(attr)
292
+ if value.nil?
293
+ is_nullable = self.class.openapi_nullable.include?(attr)
294
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
295
+ end
296
+
297
+ hash[param] = _to_hash(value)
298
+ end
299
+ hash
300
+ end
301
+
302
+ # Outputs non-array value in the form of hash
303
+ # For object, use to_hash. Otherwise, just return the value
304
+ # @param [Object] value Any valid value
305
+ # @return [Hash] Returns the value in the form of hash
306
+ def _to_hash(value)
307
+ if value.is_a?(Array)
308
+ value.compact.map { |v| _to_hash(v) }
309
+ elsif value.is_a?(Hash)
310
+ {}.tap do |hash|
311
+ value.each { |k, v| hash[k] = _to_hash(v) }
312
+ end
313
+ elsif value.respond_to? :to_hash
314
+ value.to_hash
315
+ else
316
+ value
317
+ end
318
+ end
319
+
320
+ end
321
+
322
+ 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.0.1
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
 
@@ -142,6 +142,7 @@ module OneSignal
142
142
  # @return [Object] Returns the model itself
143
143
  def build_from_hash(attributes)
144
144
  return nil unless attributes.is_a?(Hash)
145
+ attributes = attributes.transform_keys(&:to_sym)
145
146
  self.class.openapi_types.each_pair do |key, type|
146
147
  if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
147
148
  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.0.1
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
 
@@ -174,6 +174,7 @@ module OneSignal
174
174
  # @return [Object] Returns the model itself
175
175
  def build_from_hash(attributes)
176
176
  return nil unless attributes.is_a?(Hash)
177
+ attributes = attributes.transform_keys(&:to_sym)
177
178
  self.class.openapi_types.each_pair do |key, type|
178
179
  if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
179
180
  self.send("#{key}=", nil)
@@ -0,0 +1,221 @@
1
+ =begin
2
+ #OneSignal
3
+
4
+ #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: devrel@onesignal.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OneSignal
17
+ class OutcomesData
18
+ attr_accessor :outcomes
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'outcomes' => :'outcomes'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'outcomes' => :'Array<OutcomeData>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::OutcomesData` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::OutcomesData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'outcomes')
61
+ if (value = attributes[:'outcomes']).is_a?(Array)
62
+ self.outcomes = value
63
+ end
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ outcomes == o.outcomes
86
+ end
87
+
88
+ # @see the `==` method
89
+ # @param [Object] Object to be compared
90
+ def eql?(o)
91
+ self == o
92
+ end
93
+
94
+ # Calculates hash code according to all attributes.
95
+ # @return [Integer] Hash code
96
+ def hash
97
+ [outcomes].hash
98
+ end
99
+
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def self.build_from_hash(attributes)
104
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ self.class.openapi_types.each_pair do |key, type|
114
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
115
+ self.send("#{key}=", nil)
116
+ elsif type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ end
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :Time
137
+ Time.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ # models (e.g. Pet) or oneOf
168
+ klass = OneSignal.const_get(type)
169
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ 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.0.1
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
 
@@ -153,6 +153,7 @@ module OneSignal
153
153
  # @return [Object] Returns the model itself
154
154
  def build_from_hash(attributes)
155
155
  return nil unless attributes.is_a?(Hash)
156
+ attributes = attributes.transform_keys(&:to_sym)
156
157
  self.class.openapi_types.each_pair do |key, type|
157
158
  if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
158
159
  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.0.1
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
 
@@ -153,7 +153,7 @@ module OneSignal
153
153
  :'sdk' => :'String',
154
154
  :'session_count' => :'Integer',
155
155
  :'tags' => :'Object',
156
- :'amount_spent' => :'String',
156
+ :'amount_spent' => :'Float',
157
157
  :'created_at' => :'Integer',
158
158
  :'playtime' => :'Integer',
159
159
  :'badge_count' => :'Integer',
@@ -169,6 +169,8 @@ module OneSignal
169
169
  # List of attributes with nullable: true
170
170
  def self.openapi_nullable
171
171
  Set.new([
172
+ :'timezone',
173
+ :'test_type',
172
174
  ])
173
175
  end
174
176
 
@@ -304,10 +306,6 @@ module OneSignal
304
306
  invalid_properties.push('invalid value for "id", id cannot be nil.')
305
307
  end
306
308
 
307
- if @app_id.nil?
308
- invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
309
- end
310
-
311
309
  if @device_type.nil?
312
310
  invalid_properties.push('invalid value for "device_type", device_type cannot be nil.')
313
311
  end
@@ -319,7 +317,6 @@ module OneSignal
319
317
  # @return true if the model is valid
320
318
  def valid?
321
319
  return false if @id.nil?
322
- return false if @app_id.nil?
323
320
  return false if @device_type.nil?
324
321
  true
325
322
  end
@@ -382,6 +379,7 @@ module OneSignal
382
379
  # @return [Object] Returns the model itself
383
380
  def build_from_hash(attributes)
384
381
  return nil unless attributes.is_a?(Hash)
382
+ attributes = attributes.transform_keys(&:to_sym)
385
383
  self.class.openapi_types.each_pair do |key, type|
386
384
  if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
387
385
  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.0.1
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
 
@@ -18,7 +18,7 @@ module OneSignal
18
18
  # Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call
19
19
  attr_accessor :include_player_ids
20
20
 
21
- # Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [custom-id-assigned-by-api] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms.
21
+ # Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms.
22
22
  attr_accessor :include_external_user_ids
23
23
 
24
24
  # Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call
@@ -218,6 +218,7 @@ module OneSignal
218
218
  # @return [Object] Returns the model itself
219
219
  def build_from_hash(attributes)
220
220
  return nil unless attributes.is_a?(Hash)
221
+ attributes = attributes.transform_keys(&:to_sym)
221
222
  self.class.openapi_types.each_pair do |key, type|
222
223
  if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
223
224
  self.send("#{key}=", nil)