onesignal 0.2.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +14 -0
- data/Gemfile +6 -1
- data/LICENSE +6 -3
- data/README.md +144 -99
- data/RELEASE_INSTRUCTIONS.md +11 -0
- data/Rakefile +8 -8
- data/docs/App.md +76 -0
- data/docs/Button.md +22 -0
- data/docs/DefaultApi.md +1394 -0
- data/docs/DeliveryData.md +26 -0
- data/docs/ExportPlayersRequestBody.md +22 -0
- data/docs/Filter.md +24 -0
- data/docs/FilterExpressions.md +26 -0
- data/docs/FilterNotificationTarget.md +40 -0
- data/docs/GetNotificationRequestBody.md +22 -0
- data/docs/InlineResponse200.md +24 -0
- data/docs/InlineResponse2001.md +18 -0
- data/docs/InlineResponse2002.md +20 -0
- data/docs/InlineResponse2005.md +20 -0
- data/docs/InlineResponse2007.md +18 -0
- data/docs/InlineResponse2008.md +18 -0
- data/docs/InlineResponse201.md +20 -0
- data/docs/InlineResponse400.md +18 -0
- data/docs/InlineResponse4001.md +20 -0
- data/docs/InlineResponse4002.md +20 -0
- data/docs/InlineResponse4003.md +18 -0
- data/docs/InvalidIdentifierError.md +20 -0
- data/docs/Notification.md +240 -0
- data/docs/Notification200Errors.md +49 -0
- data/docs/NotificationAllOf.md +192 -0
- data/docs/NotificationAllOfAndroidBackgroundLayout.md +22 -0
- data/docs/NotificationSlice.md +24 -0
- data/docs/NotificationTarget.md +64 -0
- data/docs/NotificationWithMeta.md +260 -0
- data/docs/NotificationWithMetaAllOf.md +38 -0
- data/docs/Operator.md +18 -0
- data/docs/OutcomeData.md +22 -0
- data/docs/OutcomesData.md +18 -0
- data/docs/PlatformDeliveryData.md +28 -0
- data/docs/Player.md +70 -0
- data/docs/PlayerNotificationTarget.md +36 -0
- data/docs/PlayerSlice.md +24 -0
- data/docs/Purchase.md +22 -0
- data/docs/Segment.md +22 -0
- data/docs/SegmentNotificationTarget.md +20 -0
- data/docs/StringMap.md +102 -0
- data/docs/UpdatePlayerTagsRequestBody.md +18 -0
- data/lib/onesignal/api/default_api.rb +1365 -0
- data/lib/onesignal/api_client.rb +393 -0
- data/lib/onesignal/api_error.rb +57 -0
- data/lib/onesignal/configuration.rb +245 -0
- data/lib/onesignal/models/app.rb +519 -20
- data/lib/onesignal/models/button.rb +242 -0
- data/lib/onesignal/models/delivery_data.rb +260 -0
- data/lib/onesignal/models/export_players_request_body.rb +242 -0
- data/lib/onesignal/models/filter.rb +294 -0
- data/lib/onesignal/models/filter_expressions.rb +336 -0
- data/lib/onesignal/models/filter_notification_target.rb +330 -0
- data/lib/onesignal/models/get_notification_request_body.rb +273 -0
- data/lib/onesignal/models/inline_response200.rb +257 -0
- data/lib/onesignal/models/inline_response2001.rb +219 -0
- data/lib/onesignal/models/inline_response2002.rb +228 -0
- data/lib/onesignal/models/inline_response2005.rb +228 -0
- data/lib/onesignal/models/inline_response2007.rb +219 -0
- data/lib/onesignal/models/inline_response2008.rb +219 -0
- data/lib/onesignal/models/inline_response201.rb +229 -0
- data/lib/onesignal/models/inline_response400.rb +221 -0
- data/lib/onesignal/models/inline_response4001.rb +230 -0
- data/lib/onesignal/models/inline_response4002.rb +230 -0
- data/lib/onesignal/models/inline_response4003.rb +221 -0
- data/lib/onesignal/models/invalid_identifier_error.rb +234 -0
- data/lib/onesignal/models/notification.rb +1414 -9
- data/lib/onesignal/models/notification200_errors.rb +105 -0
- data/lib/onesignal/models/notification_all_of.rb +1144 -0
- data/lib/onesignal/models/notification_all_of_android_background_layout.rb +241 -0
- data/lib/onesignal/models/notification_slice.rb +248 -0
- data/lib/onesignal/models/notification_target.rb +495 -0
- data/lib/onesignal/models/notification_with_meta.rb +1526 -0
- data/lib/onesignal/models/notification_with_meta_all_of.rb +322 -0
- data/lib/onesignal/models/operator.rb +254 -0
- data/lib/onesignal/models/outcome_data.rb +286 -0
- data/lib/onesignal/models/outcomes_data.rb +221 -0
- data/lib/onesignal/models/platform_delivery_data.rb +265 -0
- data/lib/onesignal/models/player.rb +480 -13
- data/lib/onesignal/models/player_notification_target.rb +330 -0
- data/lib/onesignal/models/player_slice.rb +248 -0
- data/lib/onesignal/models/purchase.rb +255 -0
- data/lib/onesignal/models/segment.rb +252 -0
- data/lib/onesignal/models/segment_notification_target.rb +234 -0
- data/lib/onesignal/models/string_map.rb +640 -0
- data/lib/onesignal/models/update_player_tags_request_body.rb +220 -0
- data/lib/onesignal/version.rb +13 -1
- data/lib/onesignal.rb +73 -16
- data/onesignal.gemspec +37 -27
- data/spec/api/default_api_spec.rb +285 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/app_spec.rb +212 -0
- data/spec/models/button_spec.rb +46 -0
- data/spec/models/delivery_data_spec.rb +58 -0
- data/spec/models/export_players_request_body_spec.rb +46 -0
- data/spec/models/filter_expressions_spec.rb +66 -0
- data/spec/models/filter_notification_target_spec.rb +100 -0
- data/spec/models/filter_spec.rb +56 -0
- data/spec/models/get_notification_request_body_spec.rb +50 -0
- data/spec/models/inline_response2001_spec.rb +34 -0
- data/spec/models/inline_response2002_spec.rb +40 -0
- data/spec/models/inline_response2005_spec.rb +40 -0
- data/spec/models/inline_response2007_spec.rb +34 -0
- data/spec/models/inline_response2008_spec.rb +34 -0
- data/spec/models/inline_response200_spec.rb +52 -0
- data/spec/models/inline_response201_spec.rb +40 -0
- data/spec/models/inline_response4001_spec.rb +40 -0
- data/spec/models/inline_response4002_spec.rb +40 -0
- data/spec/models/inline_response4003_spec.rb +34 -0
- data/spec/models/inline_response400_spec.rb +34 -0
- data/spec/models/invalid_identifier_error_spec.rb +40 -0
- data/spec/models/notification200_errors_spec.rb +31 -0
- data/spec/models/notification_all_of_android_background_layout_spec.rb +46 -0
- data/spec/models/notification_all_of_spec.rb +560 -0
- data/spec/models/notification_slice_spec.rb +52 -0
- data/spec/models/notification_spec.rb +704 -0
- data/spec/models/notification_target_spec.rb +172 -0
- data/spec/models/notification_with_meta_all_of_spec.rb +94 -0
- data/spec/models/notification_with_meta_spec.rb +764 -0
- data/spec/models/operator_spec.rb +38 -0
- data/spec/models/outcome_data_spec.rb +50 -0
- data/spec/models/outcomes_data_spec.rb +34 -0
- data/spec/models/platform_delivery_data_spec.rb +64 -0
- data/spec/models/player_notification_target_spec.rb +88 -0
- data/spec/models/player_slice_spec.rb +52 -0
- data/spec/models/player_spec.rb +190 -0
- data/spec/models/purchase_spec.rb +46 -0
- data/spec/models/segment_notification_target_spec.rb +40 -0
- data/spec/models/segment_spec.rb +46 -0
- data/spec/models/string_map_spec.rb +286 -0
- data/spec/models/update_player_tags_request_body_spec.rb +34 -0
- data/spec/spec_helper.rb +111 -0
- metadata +203 -64
- data/.gitignore +0 -10
- data/.rubocop.yml +0 -17
- data/.travis.yml +0 -16
- data/CODE_OF_CONDUCT.md +0 -49
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/lib/onesignal/app_id_missing_error.rb +0 -7
- data/lib/onesignal/client.rb +0 -44
- data/lib/onesignal/models/base_model.rb +0 -19
- data/lib/onesignal/request.rb +0 -94
- data/lib/onesignal/request_error.rb +0 -21
- data/lib/onesignal/resources/app_resource.rb +0 -27
- data/lib/onesignal/resources/base_resource.rb +0 -35
- data/lib/onesignal/resources/notification_resource.rb +0 -33
- data/lib/onesignal/resources/player_resource.rb +0 -53
@@ -0,0 +1,640 @@
|
|
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 StringMap
|
18
|
+
# Text in English. Will be used as a fallback
|
19
|
+
attr_accessor :en
|
20
|
+
|
21
|
+
# Text in Arabic.
|
22
|
+
attr_accessor :ar
|
23
|
+
|
24
|
+
# Text in Bosnian.
|
25
|
+
attr_accessor :bs
|
26
|
+
|
27
|
+
# Text in Bulgarian.
|
28
|
+
attr_accessor :bg
|
29
|
+
|
30
|
+
# Text in Catalan.
|
31
|
+
attr_accessor :ca
|
32
|
+
|
33
|
+
# Text in Chinese (Simplified).
|
34
|
+
attr_accessor :zh_hans
|
35
|
+
|
36
|
+
# Text in Chinese (Traditional).
|
37
|
+
attr_accessor :zh_hant
|
38
|
+
|
39
|
+
# Alias for zh-Hans.
|
40
|
+
attr_accessor :zh
|
41
|
+
|
42
|
+
# Text in Croatian.
|
43
|
+
attr_accessor :hr
|
44
|
+
|
45
|
+
# Text in Czech.
|
46
|
+
attr_accessor :cs
|
47
|
+
|
48
|
+
# Text in Danish.
|
49
|
+
attr_accessor :da
|
50
|
+
|
51
|
+
# Text in Dutch.
|
52
|
+
attr_accessor :nl
|
53
|
+
|
54
|
+
# Text in Estonian.
|
55
|
+
attr_accessor :et
|
56
|
+
|
57
|
+
# Text in Finnish.
|
58
|
+
attr_accessor :fi
|
59
|
+
|
60
|
+
# Text in French.
|
61
|
+
attr_accessor :fr
|
62
|
+
|
63
|
+
# Text in Georgian.
|
64
|
+
attr_accessor :ka
|
65
|
+
|
66
|
+
# Text in German.
|
67
|
+
attr_accessor :de
|
68
|
+
|
69
|
+
# Text in Greek.
|
70
|
+
attr_accessor :el
|
71
|
+
|
72
|
+
# Text in Hindi.
|
73
|
+
attr_accessor :hi
|
74
|
+
|
75
|
+
# Text in Hebrew.
|
76
|
+
attr_accessor :he
|
77
|
+
|
78
|
+
# Text in Hungarian.
|
79
|
+
attr_accessor :hu
|
80
|
+
|
81
|
+
# Text in Indonesian.
|
82
|
+
attr_accessor :id
|
83
|
+
|
84
|
+
# Text in Italian.
|
85
|
+
attr_accessor :it
|
86
|
+
|
87
|
+
# Text in Japanese.
|
88
|
+
attr_accessor :ja
|
89
|
+
|
90
|
+
# Text in Korean.
|
91
|
+
attr_accessor :ko
|
92
|
+
|
93
|
+
# Text in Latvian.
|
94
|
+
attr_accessor :lv
|
95
|
+
|
96
|
+
# Text in Lithuanian.
|
97
|
+
attr_accessor :lt
|
98
|
+
|
99
|
+
# Text in Malay.
|
100
|
+
attr_accessor :ms
|
101
|
+
|
102
|
+
# Text in Norwegian.
|
103
|
+
attr_accessor :nb
|
104
|
+
|
105
|
+
# Text in Polish.
|
106
|
+
attr_accessor :pl
|
107
|
+
|
108
|
+
# Text in Persian.
|
109
|
+
attr_accessor :fa
|
110
|
+
|
111
|
+
# Text in Portugese.
|
112
|
+
attr_accessor :pt
|
113
|
+
|
114
|
+
# Text in Punjabi.
|
115
|
+
attr_accessor :pa
|
116
|
+
|
117
|
+
# Text in Romanian.
|
118
|
+
attr_accessor :ro
|
119
|
+
|
120
|
+
# Text in Russian.
|
121
|
+
attr_accessor :ru
|
122
|
+
|
123
|
+
# Text in Serbian.
|
124
|
+
attr_accessor :sr
|
125
|
+
|
126
|
+
# Text in Slovak.
|
127
|
+
attr_accessor :sk
|
128
|
+
|
129
|
+
# Text in Spanish.
|
130
|
+
attr_accessor :es
|
131
|
+
|
132
|
+
# Text in Swedish.
|
133
|
+
attr_accessor :sv
|
134
|
+
|
135
|
+
# Text in Thai.
|
136
|
+
attr_accessor :th
|
137
|
+
|
138
|
+
# Text in Turkish.
|
139
|
+
attr_accessor :tr
|
140
|
+
|
141
|
+
# Text in Ukrainian.
|
142
|
+
attr_accessor :uk
|
143
|
+
|
144
|
+
# Text in Vietnamese.
|
145
|
+
attr_accessor :vi
|
146
|
+
|
147
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
148
|
+
def self.attribute_map
|
149
|
+
{
|
150
|
+
:'en' => :'en',
|
151
|
+
:'ar' => :'ar',
|
152
|
+
:'bs' => :'bs',
|
153
|
+
:'bg' => :'bg',
|
154
|
+
:'ca' => :'ca',
|
155
|
+
:'zh_hans' => :'zh-Hans',
|
156
|
+
:'zh_hant' => :'zh-Hant',
|
157
|
+
:'zh' => :'zh',
|
158
|
+
:'hr' => :'hr',
|
159
|
+
:'cs' => :'cs',
|
160
|
+
:'da' => :'da',
|
161
|
+
:'nl' => :'nl',
|
162
|
+
:'et' => :'et',
|
163
|
+
:'fi' => :'fi',
|
164
|
+
:'fr' => :'fr',
|
165
|
+
:'ka' => :'ka',
|
166
|
+
:'de' => :'de',
|
167
|
+
:'el' => :'el',
|
168
|
+
:'hi' => :'hi',
|
169
|
+
:'he' => :'he',
|
170
|
+
:'hu' => :'hu',
|
171
|
+
:'id' => :'id',
|
172
|
+
:'it' => :'it',
|
173
|
+
:'ja' => :'ja',
|
174
|
+
:'ko' => :'ko',
|
175
|
+
:'lv' => :'lv',
|
176
|
+
:'lt' => :'lt',
|
177
|
+
:'ms' => :'ms',
|
178
|
+
:'nb' => :'nb',
|
179
|
+
:'pl' => :'pl',
|
180
|
+
:'fa' => :'fa',
|
181
|
+
:'pt' => :'pt',
|
182
|
+
:'pa' => :'pa',
|
183
|
+
:'ro' => :'ro',
|
184
|
+
:'ru' => :'ru',
|
185
|
+
:'sr' => :'sr',
|
186
|
+
:'sk' => :'sk',
|
187
|
+
:'es' => :'es',
|
188
|
+
:'sv' => :'sv',
|
189
|
+
:'th' => :'th',
|
190
|
+
:'tr' => :'tr',
|
191
|
+
:'uk' => :'uk',
|
192
|
+
:'vi' => :'vi'
|
193
|
+
}
|
194
|
+
end
|
195
|
+
|
196
|
+
# Returns all the JSON keys this model knows about
|
197
|
+
def self.acceptable_attributes
|
198
|
+
attribute_map.values
|
199
|
+
end
|
200
|
+
|
201
|
+
# Attribute type mapping.
|
202
|
+
def self.openapi_types
|
203
|
+
{
|
204
|
+
:'en' => :'String',
|
205
|
+
:'ar' => :'String',
|
206
|
+
:'bs' => :'String',
|
207
|
+
:'bg' => :'String',
|
208
|
+
:'ca' => :'String',
|
209
|
+
:'zh_hans' => :'String',
|
210
|
+
:'zh_hant' => :'String',
|
211
|
+
:'zh' => :'String',
|
212
|
+
:'hr' => :'String',
|
213
|
+
:'cs' => :'String',
|
214
|
+
:'da' => :'String',
|
215
|
+
:'nl' => :'String',
|
216
|
+
:'et' => :'String',
|
217
|
+
:'fi' => :'String',
|
218
|
+
:'fr' => :'String',
|
219
|
+
:'ka' => :'String',
|
220
|
+
:'de' => :'String',
|
221
|
+
:'el' => :'String',
|
222
|
+
:'hi' => :'String',
|
223
|
+
:'he' => :'String',
|
224
|
+
:'hu' => :'String',
|
225
|
+
:'id' => :'String',
|
226
|
+
:'it' => :'String',
|
227
|
+
:'ja' => :'String',
|
228
|
+
:'ko' => :'String',
|
229
|
+
:'lv' => :'String',
|
230
|
+
:'lt' => :'String',
|
231
|
+
:'ms' => :'String',
|
232
|
+
:'nb' => :'String',
|
233
|
+
:'pl' => :'String',
|
234
|
+
:'fa' => :'String',
|
235
|
+
:'pt' => :'String',
|
236
|
+
:'pa' => :'String',
|
237
|
+
:'ro' => :'String',
|
238
|
+
:'ru' => :'String',
|
239
|
+
:'sr' => :'String',
|
240
|
+
:'sk' => :'String',
|
241
|
+
:'es' => :'String',
|
242
|
+
:'sv' => :'String',
|
243
|
+
:'th' => :'String',
|
244
|
+
:'tr' => :'String',
|
245
|
+
:'uk' => :'String',
|
246
|
+
:'vi' => :'String'
|
247
|
+
}
|
248
|
+
end
|
249
|
+
|
250
|
+
# List of attributes with nullable: true
|
251
|
+
def self.openapi_nullable
|
252
|
+
Set.new([
|
253
|
+
])
|
254
|
+
end
|
255
|
+
|
256
|
+
# Initializes the object
|
257
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
258
|
+
def initialize(attributes = {})
|
259
|
+
if (!attributes.is_a?(Hash))
|
260
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::StringMap` initialize method"
|
261
|
+
end
|
262
|
+
|
263
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
264
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
265
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
266
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::StringMap`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
267
|
+
end
|
268
|
+
h[k.to_sym] = v
|
269
|
+
}
|
270
|
+
|
271
|
+
if attributes.key?(:'en')
|
272
|
+
self.en = attributes[:'en']
|
273
|
+
end
|
274
|
+
|
275
|
+
if attributes.key?(:'ar')
|
276
|
+
self.ar = attributes[:'ar']
|
277
|
+
end
|
278
|
+
|
279
|
+
if attributes.key?(:'bs')
|
280
|
+
self.bs = attributes[:'bs']
|
281
|
+
end
|
282
|
+
|
283
|
+
if attributes.key?(:'bg')
|
284
|
+
self.bg = attributes[:'bg']
|
285
|
+
end
|
286
|
+
|
287
|
+
if attributes.key?(:'ca')
|
288
|
+
self.ca = attributes[:'ca']
|
289
|
+
end
|
290
|
+
|
291
|
+
if attributes.key?(:'zh_hans')
|
292
|
+
self.zh_hans = attributes[:'zh_hans']
|
293
|
+
end
|
294
|
+
|
295
|
+
if attributes.key?(:'zh_hant')
|
296
|
+
self.zh_hant = attributes[:'zh_hant']
|
297
|
+
end
|
298
|
+
|
299
|
+
if attributes.key?(:'zh')
|
300
|
+
self.zh = attributes[:'zh']
|
301
|
+
end
|
302
|
+
|
303
|
+
if attributes.key?(:'hr')
|
304
|
+
self.hr = attributes[:'hr']
|
305
|
+
end
|
306
|
+
|
307
|
+
if attributes.key?(:'cs')
|
308
|
+
self.cs = attributes[:'cs']
|
309
|
+
end
|
310
|
+
|
311
|
+
if attributes.key?(:'da')
|
312
|
+
self.da = attributes[:'da']
|
313
|
+
end
|
314
|
+
|
315
|
+
if attributes.key?(:'nl')
|
316
|
+
self.nl = attributes[:'nl']
|
317
|
+
end
|
318
|
+
|
319
|
+
if attributes.key?(:'et')
|
320
|
+
self.et = attributes[:'et']
|
321
|
+
end
|
322
|
+
|
323
|
+
if attributes.key?(:'fi')
|
324
|
+
self.fi = attributes[:'fi']
|
325
|
+
end
|
326
|
+
|
327
|
+
if attributes.key?(:'fr')
|
328
|
+
self.fr = attributes[:'fr']
|
329
|
+
end
|
330
|
+
|
331
|
+
if attributes.key?(:'ka')
|
332
|
+
self.ka = attributes[:'ka']
|
333
|
+
end
|
334
|
+
|
335
|
+
if attributes.key?(:'de')
|
336
|
+
self.de = attributes[:'de']
|
337
|
+
end
|
338
|
+
|
339
|
+
if attributes.key?(:'el')
|
340
|
+
self.el = attributes[:'el']
|
341
|
+
end
|
342
|
+
|
343
|
+
if attributes.key?(:'hi')
|
344
|
+
self.hi = attributes[:'hi']
|
345
|
+
end
|
346
|
+
|
347
|
+
if attributes.key?(:'he')
|
348
|
+
self.he = attributes[:'he']
|
349
|
+
end
|
350
|
+
|
351
|
+
if attributes.key?(:'hu')
|
352
|
+
self.hu = attributes[:'hu']
|
353
|
+
end
|
354
|
+
|
355
|
+
if attributes.key?(:'id')
|
356
|
+
self.id = attributes[:'id']
|
357
|
+
end
|
358
|
+
|
359
|
+
if attributes.key?(:'it')
|
360
|
+
self.it = attributes[:'it']
|
361
|
+
end
|
362
|
+
|
363
|
+
if attributes.key?(:'ja')
|
364
|
+
self.ja = attributes[:'ja']
|
365
|
+
end
|
366
|
+
|
367
|
+
if attributes.key?(:'ko')
|
368
|
+
self.ko = attributes[:'ko']
|
369
|
+
end
|
370
|
+
|
371
|
+
if attributes.key?(:'lv')
|
372
|
+
self.lv = attributes[:'lv']
|
373
|
+
end
|
374
|
+
|
375
|
+
if attributes.key?(:'lt')
|
376
|
+
self.lt = attributes[:'lt']
|
377
|
+
end
|
378
|
+
|
379
|
+
if attributes.key?(:'ms')
|
380
|
+
self.ms = attributes[:'ms']
|
381
|
+
end
|
382
|
+
|
383
|
+
if attributes.key?(:'nb')
|
384
|
+
self.nb = attributes[:'nb']
|
385
|
+
end
|
386
|
+
|
387
|
+
if attributes.key?(:'pl')
|
388
|
+
self.pl = attributes[:'pl']
|
389
|
+
end
|
390
|
+
|
391
|
+
if attributes.key?(:'fa')
|
392
|
+
self.fa = attributes[:'fa']
|
393
|
+
end
|
394
|
+
|
395
|
+
if attributes.key?(:'pt')
|
396
|
+
self.pt = attributes[:'pt']
|
397
|
+
end
|
398
|
+
|
399
|
+
if attributes.key?(:'pa')
|
400
|
+
self.pa = attributes[:'pa']
|
401
|
+
end
|
402
|
+
|
403
|
+
if attributes.key?(:'ro')
|
404
|
+
self.ro = attributes[:'ro']
|
405
|
+
end
|
406
|
+
|
407
|
+
if attributes.key?(:'ru')
|
408
|
+
self.ru = attributes[:'ru']
|
409
|
+
end
|
410
|
+
|
411
|
+
if attributes.key?(:'sr')
|
412
|
+
self.sr = attributes[:'sr']
|
413
|
+
end
|
414
|
+
|
415
|
+
if attributes.key?(:'sk')
|
416
|
+
self.sk = attributes[:'sk']
|
417
|
+
end
|
418
|
+
|
419
|
+
if attributes.key?(:'es')
|
420
|
+
self.es = attributes[:'es']
|
421
|
+
end
|
422
|
+
|
423
|
+
if attributes.key?(:'sv')
|
424
|
+
self.sv = attributes[:'sv']
|
425
|
+
end
|
426
|
+
|
427
|
+
if attributes.key?(:'th')
|
428
|
+
self.th = attributes[:'th']
|
429
|
+
end
|
430
|
+
|
431
|
+
if attributes.key?(:'tr')
|
432
|
+
self.tr = attributes[:'tr']
|
433
|
+
end
|
434
|
+
|
435
|
+
if attributes.key?(:'uk')
|
436
|
+
self.uk = attributes[:'uk']
|
437
|
+
end
|
438
|
+
|
439
|
+
if attributes.key?(:'vi')
|
440
|
+
self.vi = attributes[:'vi']
|
441
|
+
end
|
442
|
+
end
|
443
|
+
|
444
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
445
|
+
# @return Array for valid properties with the reasons
|
446
|
+
def list_invalid_properties
|
447
|
+
invalid_properties = Array.new
|
448
|
+
invalid_properties
|
449
|
+
end
|
450
|
+
|
451
|
+
# Check to see if the all the properties in the model are valid
|
452
|
+
# @return true if the model is valid
|
453
|
+
def valid?
|
454
|
+
true
|
455
|
+
end
|
456
|
+
|
457
|
+
# Checks equality by comparing each attribute.
|
458
|
+
# @param [Object] Object to be compared
|
459
|
+
def ==(o)
|
460
|
+
return true if self.equal?(o)
|
461
|
+
self.class == o.class &&
|
462
|
+
en == o.en &&
|
463
|
+
ar == o.ar &&
|
464
|
+
bs == o.bs &&
|
465
|
+
bg == o.bg &&
|
466
|
+
ca == o.ca &&
|
467
|
+
zh_hans == o.zh_hans &&
|
468
|
+
zh_hant == o.zh_hant &&
|
469
|
+
zh == o.zh &&
|
470
|
+
hr == o.hr &&
|
471
|
+
cs == o.cs &&
|
472
|
+
da == o.da &&
|
473
|
+
nl == o.nl &&
|
474
|
+
et == o.et &&
|
475
|
+
fi == o.fi &&
|
476
|
+
fr == o.fr &&
|
477
|
+
ka == o.ka &&
|
478
|
+
de == o.de &&
|
479
|
+
el == o.el &&
|
480
|
+
hi == o.hi &&
|
481
|
+
he == o.he &&
|
482
|
+
hu == o.hu &&
|
483
|
+
id == o.id &&
|
484
|
+
it == o.it &&
|
485
|
+
ja == o.ja &&
|
486
|
+
ko == o.ko &&
|
487
|
+
lv == o.lv &&
|
488
|
+
lt == o.lt &&
|
489
|
+
ms == o.ms &&
|
490
|
+
nb == o.nb &&
|
491
|
+
pl == o.pl &&
|
492
|
+
fa == o.fa &&
|
493
|
+
pt == o.pt &&
|
494
|
+
pa == o.pa &&
|
495
|
+
ro == o.ro &&
|
496
|
+
ru == o.ru &&
|
497
|
+
sr == o.sr &&
|
498
|
+
sk == o.sk &&
|
499
|
+
es == o.es &&
|
500
|
+
sv == o.sv &&
|
501
|
+
th == o.th &&
|
502
|
+
tr == o.tr &&
|
503
|
+
uk == o.uk &&
|
504
|
+
vi == o.vi
|
505
|
+
end
|
506
|
+
|
507
|
+
# @see the `==` method
|
508
|
+
# @param [Object] Object to be compared
|
509
|
+
def eql?(o)
|
510
|
+
self == o
|
511
|
+
end
|
512
|
+
|
513
|
+
# Calculates hash code according to all attributes.
|
514
|
+
# @return [Integer] Hash code
|
515
|
+
def hash
|
516
|
+
[en, ar, bs, bg, ca, zh_hans, zh_hant, zh, hr, cs, da, nl, et, fi, fr, ka, de, el, hi, he, hu, id, it, ja, ko, lv, lt, ms, nb, pl, fa, pt, pa, ro, ru, sr, sk, es, sv, th, tr, uk, vi].hash
|
517
|
+
end
|
518
|
+
|
519
|
+
# Builds the object from hash
|
520
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
521
|
+
# @return [Object] Returns the model itself
|
522
|
+
def self.build_from_hash(attributes)
|
523
|
+
new.build_from_hash(attributes)
|
524
|
+
end
|
525
|
+
|
526
|
+
# Builds the object from hash
|
527
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
528
|
+
# @return [Object] Returns the model itself
|
529
|
+
def build_from_hash(attributes)
|
530
|
+
return nil unless attributes.is_a?(Hash)
|
531
|
+
attributes = attributes.transform_keys(&:to_sym)
|
532
|
+
self.class.openapi_types.each_pair do |key, type|
|
533
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
534
|
+
self.send("#{key}=", nil)
|
535
|
+
elsif type =~ /\AArray<(.*)>/i
|
536
|
+
# check to ensure the input is an array given that the attribute
|
537
|
+
# is documented as an array but the input is not
|
538
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
539
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
540
|
+
end
|
541
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
542
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
543
|
+
end
|
544
|
+
end
|
545
|
+
|
546
|
+
self
|
547
|
+
end
|
548
|
+
|
549
|
+
# Deserializes the data based on type
|
550
|
+
# @param string type Data type
|
551
|
+
# @param string value Value to be deserialized
|
552
|
+
# @return [Object] Deserialized data
|
553
|
+
def _deserialize(type, value)
|
554
|
+
case type.to_sym
|
555
|
+
when :Time
|
556
|
+
Time.parse(value)
|
557
|
+
when :Date
|
558
|
+
Date.parse(value)
|
559
|
+
when :String
|
560
|
+
value.to_s
|
561
|
+
when :Integer
|
562
|
+
value.to_i
|
563
|
+
when :Float
|
564
|
+
value.to_f
|
565
|
+
when :Boolean
|
566
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
567
|
+
true
|
568
|
+
else
|
569
|
+
false
|
570
|
+
end
|
571
|
+
when :Object
|
572
|
+
# generic object (usually a Hash), return directly
|
573
|
+
value
|
574
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
575
|
+
inner_type = Regexp.last_match[:inner_type]
|
576
|
+
value.map { |v| _deserialize(inner_type, v) }
|
577
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
578
|
+
k_type = Regexp.last_match[:k_type]
|
579
|
+
v_type = Regexp.last_match[:v_type]
|
580
|
+
{}.tap do |hash|
|
581
|
+
value.each do |k, v|
|
582
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
583
|
+
end
|
584
|
+
end
|
585
|
+
else # model
|
586
|
+
# models (e.g. Pet) or oneOf
|
587
|
+
klass = OneSignal.const_get(type)
|
588
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
589
|
+
end
|
590
|
+
end
|
591
|
+
|
592
|
+
# Returns the string representation of the object
|
593
|
+
# @return [String] String presentation of the object
|
594
|
+
def to_s
|
595
|
+
to_hash.to_s
|
596
|
+
end
|
597
|
+
|
598
|
+
# to_body is an alias to to_hash (backward compatibility)
|
599
|
+
# @return [Hash] Returns the object in the form of hash
|
600
|
+
def to_body
|
601
|
+
to_hash
|
602
|
+
end
|
603
|
+
|
604
|
+
# Returns the object in the form of hash
|
605
|
+
# @return [Hash] Returns the object in the form of hash
|
606
|
+
def to_hash
|
607
|
+
hash = {}
|
608
|
+
self.class.attribute_map.each_pair do |attr, param|
|
609
|
+
value = self.send(attr)
|
610
|
+
if value.nil?
|
611
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
612
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
613
|
+
end
|
614
|
+
|
615
|
+
hash[param] = _to_hash(value)
|
616
|
+
end
|
617
|
+
hash
|
618
|
+
end
|
619
|
+
|
620
|
+
# Outputs non-array value in the form of hash
|
621
|
+
# For object, use to_hash. Otherwise, just return the value
|
622
|
+
# @param [Object] value Any valid value
|
623
|
+
# @return [Hash] Returns the value in the form of hash
|
624
|
+
def _to_hash(value)
|
625
|
+
if value.is_a?(Array)
|
626
|
+
value.compact.map { |v| _to_hash(v) }
|
627
|
+
elsif value.is_a?(Hash)
|
628
|
+
{}.tap do |hash|
|
629
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
630
|
+
end
|
631
|
+
elsif value.respond_to? :to_hash
|
632
|
+
value.to_hash
|
633
|
+
else
|
634
|
+
value
|
635
|
+
end
|
636
|
+
end
|
637
|
+
|
638
|
+
end
|
639
|
+
|
640
|
+
end
|