aylien_news_api 4.1.1 → 4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/AggregatedSentiment.md +21 -0
- data/docs/DefaultApi.md +316 -0
- data/docs/Entity.md +11 -5
- data/docs/EntityLinks.md +6 -2
- data/docs/EntitySentiment.md +19 -0
- data/docs/EntitySurfaceForm.md +19 -0
- data/docs/Logicals.md +21 -0
- data/docs/NestedEntity.md +33 -0
- data/docs/Parameter.md +127 -0
- data/docs/Query.md +31 -0
- data/docs/Story.md +3 -1
- data/docs/TimeSeries.md +3 -1
- data/docs/Trend.md +3 -1
- data/lib/aylien_news_api.rb +7 -0
- data/lib/aylien_news_api/api/default_api.rb +466 -1
- data/lib/aylien_news_api/models/aggregated_sentiment.rb +228 -0
- data/lib/aylien_news_api/models/entity.rb +45 -39
- data/lib/aylien_news_api/models/entity_links.rb +25 -5
- data/lib/aylien_news_api/models/entity_sentiment.rb +240 -0
- data/lib/aylien_news_api/models/entity_surface_form.rb +219 -0
- data/lib/aylien_news_api/models/logicals.rb +230 -0
- data/lib/aylien_news_api/models/nested_entity.rb +278 -0
- data/lib/aylien_news_api/models/parameter.rb +701 -0
- data/lib/aylien_news_api/models/query.rb +271 -0
- data/lib/aylien_news_api/models/story.rb +14 -4
- data/lib/aylien_news_api/models/time_series.rb +13 -4
- data/lib/aylien_news_api/models/trend.rb +13 -4
- data/lib/aylien_news_api/version.rb +1 -1
- data/spec/api/default_api_spec.rb +19 -0
- data/spec/models/aggregated_sentiment_spec.rb +53 -0
- data/spec/models/entity_links_spec.rb +6 -0
- data/spec/models/entity_sentiment_spec.rb +47 -0
- data/spec/models/entity_spec.rb +8 -2
- data/spec/models/entity_surface_form_spec.rb +47 -0
- data/spec/models/logicals_spec.rb +53 -0
- data/spec/models/nested_entity_spec.rb +71 -0
- data/spec/models/parameter_spec.rb +371 -0
- data/spec/models/query_spec.rb +83 -0
- metadata +30 -2
@@ -0,0 +1,701 @@
|
|
1
|
+
=begin
|
2
|
+
#AYLIEN News API
|
3
|
+
|
4
|
+
#The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 3.0
|
7
|
+
Contact: support@aylien.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module AylienNewsApi
|
16
|
+
class Parameter
|
17
|
+
attr_accessor :author_id
|
18
|
+
|
19
|
+
attr_accessor :author_name
|
20
|
+
|
21
|
+
attr_accessor :body
|
22
|
+
|
23
|
+
attr_accessor :categories_confident
|
24
|
+
|
25
|
+
attr_accessor :categories_id
|
26
|
+
|
27
|
+
attr_accessor :categories_level
|
28
|
+
|
29
|
+
attr_accessor :categories_taxonomy
|
30
|
+
|
31
|
+
attr_accessor :clusters
|
32
|
+
|
33
|
+
attr_accessor :links_permalink
|
34
|
+
|
35
|
+
attr_accessor :entities_body_links_dbpedia
|
36
|
+
|
37
|
+
attr_accessor :entities_body_text
|
38
|
+
|
39
|
+
attr_accessor :entities_body_type
|
40
|
+
|
41
|
+
attr_accessor :entities_title_links_dbpedia
|
42
|
+
|
43
|
+
attr_accessor :entities_title_text
|
44
|
+
|
45
|
+
attr_accessor :entities_title_type
|
46
|
+
|
47
|
+
attr_accessor :id
|
48
|
+
|
49
|
+
attr_accessor :language
|
50
|
+
|
51
|
+
attr_accessor :media_images_content_length_max
|
52
|
+
|
53
|
+
attr_accessor :media_images_content_length_min
|
54
|
+
|
55
|
+
attr_accessor :media_images_count_max
|
56
|
+
|
57
|
+
attr_accessor :media_images_count_min
|
58
|
+
|
59
|
+
attr_accessor :media_images_format
|
60
|
+
|
61
|
+
attr_accessor :media_images_height_max
|
62
|
+
|
63
|
+
attr_accessor :media_images_height_min
|
64
|
+
|
65
|
+
attr_accessor :media_images_width_max
|
66
|
+
|
67
|
+
attr_accessor :media_images_width_min
|
68
|
+
|
69
|
+
attr_accessor :media_videos_count_max
|
70
|
+
|
71
|
+
attr_accessor :media_videos_count_min
|
72
|
+
|
73
|
+
attr_accessor :sentiment_body_polarity
|
74
|
+
|
75
|
+
attr_accessor :sentiment_title_polarity
|
76
|
+
|
77
|
+
attr_accessor :social_shares_count_facebook_max
|
78
|
+
|
79
|
+
attr_accessor :social_shares_count_facebook_min
|
80
|
+
|
81
|
+
attr_accessor :social_shares_count_reddit_max
|
82
|
+
|
83
|
+
attr_accessor :social_shares_count_reddit_min
|
84
|
+
|
85
|
+
attr_accessor :source_domain
|
86
|
+
|
87
|
+
attr_accessor :source_id
|
88
|
+
|
89
|
+
attr_accessor :source_links_in_count_max
|
90
|
+
|
91
|
+
attr_accessor :source_links_in_count_min
|
92
|
+
|
93
|
+
attr_accessor :source_locations_city
|
94
|
+
|
95
|
+
attr_accessor :source_locations_country
|
96
|
+
|
97
|
+
attr_accessor :source_locations_state
|
98
|
+
|
99
|
+
attr_accessor :source_rankings_alexa_country
|
100
|
+
|
101
|
+
attr_accessor :source_rankings_alexa_rank_max
|
102
|
+
|
103
|
+
attr_accessor :source_rankings_alexa_rank_min
|
104
|
+
|
105
|
+
attr_accessor :source_scopes_city
|
106
|
+
|
107
|
+
attr_accessor :source_scopes_country
|
108
|
+
|
109
|
+
attr_accessor :source_scopes_level
|
110
|
+
|
111
|
+
attr_accessor :source_scopes_state
|
112
|
+
|
113
|
+
attr_accessor :story_url
|
114
|
+
|
115
|
+
attr_accessor :story_language
|
116
|
+
|
117
|
+
attr_accessor :text
|
118
|
+
|
119
|
+
attr_accessor :title
|
120
|
+
|
121
|
+
attr_accessor :translations_en_body
|
122
|
+
|
123
|
+
attr_accessor :translations_en_text
|
124
|
+
|
125
|
+
attr_accessor :translations_en_title
|
126
|
+
|
127
|
+
attr_accessor :entity
|
128
|
+
|
129
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
130
|
+
def self.attribute_map
|
131
|
+
{
|
132
|
+
:'author_id' => :'author.id',
|
133
|
+
:'author_name' => :'author.name',
|
134
|
+
:'body' => :'body',
|
135
|
+
:'categories_confident' => :'categories.confident',
|
136
|
+
:'categories_id' => :'categories.id',
|
137
|
+
:'categories_level' => :'categories.level',
|
138
|
+
:'categories_taxonomy' => :'categories.taxonomy',
|
139
|
+
:'clusters' => :'clusters',
|
140
|
+
:'links_permalink' => :'links.permalink',
|
141
|
+
:'entities_body_links_dbpedia' => :'entities.body.links.dbpedia',
|
142
|
+
:'entities_body_text' => :'entities.body.text',
|
143
|
+
:'entities_body_type' => :'entities.body.type',
|
144
|
+
:'entities_title_links_dbpedia' => :'entities.title.links.dbpedia',
|
145
|
+
:'entities_title_text' => :'entities.title.text',
|
146
|
+
:'entities_title_type' => :'entities.title.type',
|
147
|
+
:'id' => :'id',
|
148
|
+
:'language' => :'language',
|
149
|
+
:'media_images_content_length_max' => :'media.images.content.length.max',
|
150
|
+
:'media_images_content_length_min' => :'media.images.content.length.min',
|
151
|
+
:'media_images_count_max' => :'media.images.count.max',
|
152
|
+
:'media_images_count_min' => :'media.images.count.min',
|
153
|
+
:'media_images_format' => :'media.images.format',
|
154
|
+
:'media_images_height_max' => :'media.images.height.max',
|
155
|
+
:'media_images_height_min' => :'media.images.height.min',
|
156
|
+
:'media_images_width_max' => :'media.images.width.max',
|
157
|
+
:'media_images_width_min' => :'media.images.width.min',
|
158
|
+
:'media_videos_count_max' => :'media.videos.count.max',
|
159
|
+
:'media_videos_count_min' => :'media.videos.count.min',
|
160
|
+
:'sentiment_body_polarity' => :'sentiment.body.polarity',
|
161
|
+
:'sentiment_title_polarity' => :'sentiment.title.polarity',
|
162
|
+
:'social_shares_count_facebook_max' => :'social.shares.count.facebook.max',
|
163
|
+
:'social_shares_count_facebook_min' => :'social.shares.count.facebook.min',
|
164
|
+
:'social_shares_count_reddit_max' => :'social.shares.count.reddit.max',
|
165
|
+
:'social_shares_count_reddit_min' => :'social.shares.count.reddit.min',
|
166
|
+
:'source_domain' => :'source.domain',
|
167
|
+
:'source_id' => :'source.id',
|
168
|
+
:'source_links_in_count_max' => :'source.links.in.count.max',
|
169
|
+
:'source_links_in_count_min' => :'source.links.in.count.min',
|
170
|
+
:'source_locations_city' => :'source.locations.city',
|
171
|
+
:'source_locations_country' => :'source.locations.country',
|
172
|
+
:'source_locations_state' => :'source.locations.state',
|
173
|
+
:'source_rankings_alexa_country' => :'source.rankings.alexa.country',
|
174
|
+
:'source_rankings_alexa_rank_max' => :'source.rankings.alexa.rank.max',
|
175
|
+
:'source_rankings_alexa_rank_min' => :'source.rankings.alexa.rank.min',
|
176
|
+
:'source_scopes_city' => :'source.scopes.city',
|
177
|
+
:'source_scopes_country' => :'source.scopes.country',
|
178
|
+
:'source_scopes_level' => :'source.scopes.level',
|
179
|
+
:'source_scopes_state' => :'source.scopes.state',
|
180
|
+
:'story_url' => :'story_url',
|
181
|
+
:'story_language' => :'story_language',
|
182
|
+
:'text' => :'text',
|
183
|
+
:'title' => :'title',
|
184
|
+
:'translations_en_body' => :'translations.en.body',
|
185
|
+
:'translations_en_text' => :'translations.en.text',
|
186
|
+
:'translations_en_title' => :'translations.en.title',
|
187
|
+
:'entity' => :'entity'
|
188
|
+
}
|
189
|
+
end
|
190
|
+
|
191
|
+
# Attribute type mapping.
|
192
|
+
def self.openapi_types
|
193
|
+
{
|
194
|
+
:'author_id' => :'Query',
|
195
|
+
:'author_name' => :'Query',
|
196
|
+
:'body' => :'Query',
|
197
|
+
:'categories_confident' => :'Query',
|
198
|
+
:'categories_id' => :'Query',
|
199
|
+
:'categories_level' => :'Query',
|
200
|
+
:'categories_taxonomy' => :'Query',
|
201
|
+
:'clusters' => :'Query',
|
202
|
+
:'links_permalink' => :'Query',
|
203
|
+
:'entities_body_links_dbpedia' => :'Query',
|
204
|
+
:'entities_body_text' => :'Query',
|
205
|
+
:'entities_body_type' => :'Query',
|
206
|
+
:'entities_title_links_dbpedia' => :'Query',
|
207
|
+
:'entities_title_text' => :'Query',
|
208
|
+
:'entities_title_type' => :'Query',
|
209
|
+
:'id' => :'Query',
|
210
|
+
:'language' => :'Query',
|
211
|
+
:'media_images_content_length_max' => :'Query',
|
212
|
+
:'media_images_content_length_min' => :'Query',
|
213
|
+
:'media_images_count_max' => :'Query',
|
214
|
+
:'media_images_count_min' => :'Query',
|
215
|
+
:'media_images_format' => :'Query',
|
216
|
+
:'media_images_height_max' => :'Query',
|
217
|
+
:'media_images_height_min' => :'Query',
|
218
|
+
:'media_images_width_max' => :'Query',
|
219
|
+
:'media_images_width_min' => :'Query',
|
220
|
+
:'media_videos_count_max' => :'Query',
|
221
|
+
:'media_videos_count_min' => :'Query',
|
222
|
+
:'sentiment_body_polarity' => :'Query',
|
223
|
+
:'sentiment_title_polarity' => :'Query',
|
224
|
+
:'social_shares_count_facebook_max' => :'Query',
|
225
|
+
:'social_shares_count_facebook_min' => :'Query',
|
226
|
+
:'social_shares_count_reddit_max' => :'Query',
|
227
|
+
:'social_shares_count_reddit_min' => :'Query',
|
228
|
+
:'source_domain' => :'Query',
|
229
|
+
:'source_id' => :'Query',
|
230
|
+
:'source_links_in_count_max' => :'Query',
|
231
|
+
:'source_links_in_count_min' => :'Query',
|
232
|
+
:'source_locations_city' => :'Query',
|
233
|
+
:'source_locations_country' => :'Query',
|
234
|
+
:'source_locations_state' => :'Query',
|
235
|
+
:'source_rankings_alexa_country' => :'Query',
|
236
|
+
:'source_rankings_alexa_rank_max' => :'Query',
|
237
|
+
:'source_rankings_alexa_rank_min' => :'Query',
|
238
|
+
:'source_scopes_city' => :'Query',
|
239
|
+
:'source_scopes_country' => :'Query',
|
240
|
+
:'source_scopes_level' => :'Query',
|
241
|
+
:'source_scopes_state' => :'Query',
|
242
|
+
:'story_url' => :'Query',
|
243
|
+
:'story_language' => :'Query',
|
244
|
+
:'text' => :'Query',
|
245
|
+
:'title' => :'Query',
|
246
|
+
:'translations_en_body' => :'Query',
|
247
|
+
:'translations_en_text' => :'Query',
|
248
|
+
:'translations_en_title' => :'Query',
|
249
|
+
:'entity' => :'OneOfNestedEntityLogicals'
|
250
|
+
}
|
251
|
+
end
|
252
|
+
|
253
|
+
# List of attributes with nullable: true
|
254
|
+
def self.openapi_nullable
|
255
|
+
Set.new([
|
256
|
+
])
|
257
|
+
end
|
258
|
+
|
259
|
+
# Initializes the object
|
260
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
261
|
+
def initialize(attributes = {})
|
262
|
+
if (!attributes.is_a?(Hash))
|
263
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AylienNewsApi::Parameter` initialize method"
|
264
|
+
end
|
265
|
+
|
266
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
267
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
268
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
269
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `AylienNewsApi::Parameter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
270
|
+
end
|
271
|
+
h[k.to_sym] = v
|
272
|
+
}
|
273
|
+
|
274
|
+
if attributes.key?(:'author_id')
|
275
|
+
self.author_id = attributes[:'author_id']
|
276
|
+
end
|
277
|
+
|
278
|
+
if attributes.key?(:'author_name')
|
279
|
+
self.author_name = attributes[:'author_name']
|
280
|
+
end
|
281
|
+
|
282
|
+
if attributes.key?(:'body')
|
283
|
+
self.body = attributes[:'body']
|
284
|
+
end
|
285
|
+
|
286
|
+
if attributes.key?(:'categories_confident')
|
287
|
+
self.categories_confident = attributes[:'categories_confident']
|
288
|
+
end
|
289
|
+
|
290
|
+
if attributes.key?(:'categories_id')
|
291
|
+
self.categories_id = attributes[:'categories_id']
|
292
|
+
end
|
293
|
+
|
294
|
+
if attributes.key?(:'categories_level')
|
295
|
+
self.categories_level = attributes[:'categories_level']
|
296
|
+
end
|
297
|
+
|
298
|
+
if attributes.key?(:'categories_taxonomy')
|
299
|
+
self.categories_taxonomy = attributes[:'categories_taxonomy']
|
300
|
+
end
|
301
|
+
|
302
|
+
if attributes.key?(:'clusters')
|
303
|
+
self.clusters = attributes[:'clusters']
|
304
|
+
end
|
305
|
+
|
306
|
+
if attributes.key?(:'links_permalink')
|
307
|
+
self.links_permalink = attributes[:'links_permalink']
|
308
|
+
end
|
309
|
+
|
310
|
+
if attributes.key?(:'entities_body_links_dbpedia')
|
311
|
+
self.entities_body_links_dbpedia = attributes[:'entities_body_links_dbpedia']
|
312
|
+
end
|
313
|
+
|
314
|
+
if attributes.key?(:'entities_body_text')
|
315
|
+
self.entities_body_text = attributes[:'entities_body_text']
|
316
|
+
end
|
317
|
+
|
318
|
+
if attributes.key?(:'entities_body_type')
|
319
|
+
self.entities_body_type = attributes[:'entities_body_type']
|
320
|
+
end
|
321
|
+
|
322
|
+
if attributes.key?(:'entities_title_links_dbpedia')
|
323
|
+
self.entities_title_links_dbpedia = attributes[:'entities_title_links_dbpedia']
|
324
|
+
end
|
325
|
+
|
326
|
+
if attributes.key?(:'entities_title_text')
|
327
|
+
self.entities_title_text = attributes[:'entities_title_text']
|
328
|
+
end
|
329
|
+
|
330
|
+
if attributes.key?(:'entities_title_type')
|
331
|
+
self.entities_title_type = attributes[:'entities_title_type']
|
332
|
+
end
|
333
|
+
|
334
|
+
if attributes.key?(:'id')
|
335
|
+
self.id = attributes[:'id']
|
336
|
+
end
|
337
|
+
|
338
|
+
if attributes.key?(:'language')
|
339
|
+
self.language = attributes[:'language']
|
340
|
+
end
|
341
|
+
|
342
|
+
if attributes.key?(:'media_images_content_length_max')
|
343
|
+
self.media_images_content_length_max = attributes[:'media_images_content_length_max']
|
344
|
+
end
|
345
|
+
|
346
|
+
if attributes.key?(:'media_images_content_length_min')
|
347
|
+
self.media_images_content_length_min = attributes[:'media_images_content_length_min']
|
348
|
+
end
|
349
|
+
|
350
|
+
if attributes.key?(:'media_images_count_max')
|
351
|
+
self.media_images_count_max = attributes[:'media_images_count_max']
|
352
|
+
end
|
353
|
+
|
354
|
+
if attributes.key?(:'media_images_count_min')
|
355
|
+
self.media_images_count_min = attributes[:'media_images_count_min']
|
356
|
+
end
|
357
|
+
|
358
|
+
if attributes.key?(:'media_images_format')
|
359
|
+
self.media_images_format = attributes[:'media_images_format']
|
360
|
+
end
|
361
|
+
|
362
|
+
if attributes.key?(:'media_images_height_max')
|
363
|
+
self.media_images_height_max = attributes[:'media_images_height_max']
|
364
|
+
end
|
365
|
+
|
366
|
+
if attributes.key?(:'media_images_height_min')
|
367
|
+
self.media_images_height_min = attributes[:'media_images_height_min']
|
368
|
+
end
|
369
|
+
|
370
|
+
if attributes.key?(:'media_images_width_max')
|
371
|
+
self.media_images_width_max = attributes[:'media_images_width_max']
|
372
|
+
end
|
373
|
+
|
374
|
+
if attributes.key?(:'media_images_width_min')
|
375
|
+
self.media_images_width_min = attributes[:'media_images_width_min']
|
376
|
+
end
|
377
|
+
|
378
|
+
if attributes.key?(:'media_videos_count_max')
|
379
|
+
self.media_videos_count_max = attributes[:'media_videos_count_max']
|
380
|
+
end
|
381
|
+
|
382
|
+
if attributes.key?(:'media_videos_count_min')
|
383
|
+
self.media_videos_count_min = attributes[:'media_videos_count_min']
|
384
|
+
end
|
385
|
+
|
386
|
+
if attributes.key?(:'sentiment_body_polarity')
|
387
|
+
self.sentiment_body_polarity = attributes[:'sentiment_body_polarity']
|
388
|
+
end
|
389
|
+
|
390
|
+
if attributes.key?(:'sentiment_title_polarity')
|
391
|
+
self.sentiment_title_polarity = attributes[:'sentiment_title_polarity']
|
392
|
+
end
|
393
|
+
|
394
|
+
if attributes.key?(:'social_shares_count_facebook_max')
|
395
|
+
self.social_shares_count_facebook_max = attributes[:'social_shares_count_facebook_max']
|
396
|
+
end
|
397
|
+
|
398
|
+
if attributes.key?(:'social_shares_count_facebook_min')
|
399
|
+
self.social_shares_count_facebook_min = attributes[:'social_shares_count_facebook_min']
|
400
|
+
end
|
401
|
+
|
402
|
+
if attributes.key?(:'social_shares_count_reddit_max')
|
403
|
+
self.social_shares_count_reddit_max = attributes[:'social_shares_count_reddit_max']
|
404
|
+
end
|
405
|
+
|
406
|
+
if attributes.key?(:'social_shares_count_reddit_min')
|
407
|
+
self.social_shares_count_reddit_min = attributes[:'social_shares_count_reddit_min']
|
408
|
+
end
|
409
|
+
|
410
|
+
if attributes.key?(:'source_domain')
|
411
|
+
self.source_domain = attributes[:'source_domain']
|
412
|
+
end
|
413
|
+
|
414
|
+
if attributes.key?(:'source_id')
|
415
|
+
self.source_id = attributes[:'source_id']
|
416
|
+
end
|
417
|
+
|
418
|
+
if attributes.key?(:'source_links_in_count_max')
|
419
|
+
self.source_links_in_count_max = attributes[:'source_links_in_count_max']
|
420
|
+
end
|
421
|
+
|
422
|
+
if attributes.key?(:'source_links_in_count_min')
|
423
|
+
self.source_links_in_count_min = attributes[:'source_links_in_count_min']
|
424
|
+
end
|
425
|
+
|
426
|
+
if attributes.key?(:'source_locations_city')
|
427
|
+
self.source_locations_city = attributes[:'source_locations_city']
|
428
|
+
end
|
429
|
+
|
430
|
+
if attributes.key?(:'source_locations_country')
|
431
|
+
self.source_locations_country = attributes[:'source_locations_country']
|
432
|
+
end
|
433
|
+
|
434
|
+
if attributes.key?(:'source_locations_state')
|
435
|
+
self.source_locations_state = attributes[:'source_locations_state']
|
436
|
+
end
|
437
|
+
|
438
|
+
if attributes.key?(:'source_rankings_alexa_country')
|
439
|
+
self.source_rankings_alexa_country = attributes[:'source_rankings_alexa_country']
|
440
|
+
end
|
441
|
+
|
442
|
+
if attributes.key?(:'source_rankings_alexa_rank_max')
|
443
|
+
self.source_rankings_alexa_rank_max = attributes[:'source_rankings_alexa_rank_max']
|
444
|
+
end
|
445
|
+
|
446
|
+
if attributes.key?(:'source_rankings_alexa_rank_min')
|
447
|
+
self.source_rankings_alexa_rank_min = attributes[:'source_rankings_alexa_rank_min']
|
448
|
+
end
|
449
|
+
|
450
|
+
if attributes.key?(:'source_scopes_city')
|
451
|
+
self.source_scopes_city = attributes[:'source_scopes_city']
|
452
|
+
end
|
453
|
+
|
454
|
+
if attributes.key?(:'source_scopes_country')
|
455
|
+
self.source_scopes_country = attributes[:'source_scopes_country']
|
456
|
+
end
|
457
|
+
|
458
|
+
if attributes.key?(:'source_scopes_level')
|
459
|
+
self.source_scopes_level = attributes[:'source_scopes_level']
|
460
|
+
end
|
461
|
+
|
462
|
+
if attributes.key?(:'source_scopes_state')
|
463
|
+
self.source_scopes_state = attributes[:'source_scopes_state']
|
464
|
+
end
|
465
|
+
|
466
|
+
if attributes.key?(:'story_url')
|
467
|
+
self.story_url = attributes[:'story_url']
|
468
|
+
end
|
469
|
+
|
470
|
+
if attributes.key?(:'story_language')
|
471
|
+
self.story_language = attributes[:'story_language']
|
472
|
+
end
|
473
|
+
|
474
|
+
if attributes.key?(:'text')
|
475
|
+
self.text = attributes[:'text']
|
476
|
+
end
|
477
|
+
|
478
|
+
if attributes.key?(:'title')
|
479
|
+
self.title = attributes[:'title']
|
480
|
+
end
|
481
|
+
|
482
|
+
if attributes.key?(:'translations_en_body')
|
483
|
+
self.translations_en_body = attributes[:'translations_en_body']
|
484
|
+
end
|
485
|
+
|
486
|
+
if attributes.key?(:'translations_en_text')
|
487
|
+
self.translations_en_text = attributes[:'translations_en_text']
|
488
|
+
end
|
489
|
+
|
490
|
+
if attributes.key?(:'translations_en_title')
|
491
|
+
self.translations_en_title = attributes[:'translations_en_title']
|
492
|
+
end
|
493
|
+
|
494
|
+
if attributes.key?(:'entity')
|
495
|
+
self.entity = attributes[:'entity']
|
496
|
+
end
|
497
|
+
end
|
498
|
+
|
499
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
500
|
+
# @return Array for valid properties with the reasons
|
501
|
+
def list_invalid_properties
|
502
|
+
invalid_properties = Array.new
|
503
|
+
invalid_properties
|
504
|
+
end
|
505
|
+
|
506
|
+
# Check to see if the all the properties in the model are valid
|
507
|
+
# @return true if the model is valid
|
508
|
+
def valid?
|
509
|
+
true
|
510
|
+
end
|
511
|
+
|
512
|
+
# Checks equality by comparing each attribute.
|
513
|
+
# @param [Object] Object to be compared
|
514
|
+
def ==(o)
|
515
|
+
return true if self.equal?(o)
|
516
|
+
self.class == o.class &&
|
517
|
+
author_id == o.author_id &&
|
518
|
+
author_name == o.author_name &&
|
519
|
+
body == o.body &&
|
520
|
+
categories_confident == o.categories_confident &&
|
521
|
+
categories_id == o.categories_id &&
|
522
|
+
categories_level == o.categories_level &&
|
523
|
+
categories_taxonomy == o.categories_taxonomy &&
|
524
|
+
clusters == o.clusters &&
|
525
|
+
links_permalink == o.links_permalink &&
|
526
|
+
entities_body_links_dbpedia == o.entities_body_links_dbpedia &&
|
527
|
+
entities_body_text == o.entities_body_text &&
|
528
|
+
entities_body_type == o.entities_body_type &&
|
529
|
+
entities_title_links_dbpedia == o.entities_title_links_dbpedia &&
|
530
|
+
entities_title_text == o.entities_title_text &&
|
531
|
+
entities_title_type == o.entities_title_type &&
|
532
|
+
id == o.id &&
|
533
|
+
language == o.language &&
|
534
|
+
media_images_content_length_max == o.media_images_content_length_max &&
|
535
|
+
media_images_content_length_min == o.media_images_content_length_min &&
|
536
|
+
media_images_count_max == o.media_images_count_max &&
|
537
|
+
media_images_count_min == o.media_images_count_min &&
|
538
|
+
media_images_format == o.media_images_format &&
|
539
|
+
media_images_height_max == o.media_images_height_max &&
|
540
|
+
media_images_height_min == o.media_images_height_min &&
|
541
|
+
media_images_width_max == o.media_images_width_max &&
|
542
|
+
media_images_width_min == o.media_images_width_min &&
|
543
|
+
media_videos_count_max == o.media_videos_count_max &&
|
544
|
+
media_videos_count_min == o.media_videos_count_min &&
|
545
|
+
sentiment_body_polarity == o.sentiment_body_polarity &&
|
546
|
+
sentiment_title_polarity == o.sentiment_title_polarity &&
|
547
|
+
social_shares_count_facebook_max == o.social_shares_count_facebook_max &&
|
548
|
+
social_shares_count_facebook_min == o.social_shares_count_facebook_min &&
|
549
|
+
social_shares_count_reddit_max == o.social_shares_count_reddit_max &&
|
550
|
+
social_shares_count_reddit_min == o.social_shares_count_reddit_min &&
|
551
|
+
source_domain == o.source_domain &&
|
552
|
+
source_id == o.source_id &&
|
553
|
+
source_links_in_count_max == o.source_links_in_count_max &&
|
554
|
+
source_links_in_count_min == o.source_links_in_count_min &&
|
555
|
+
source_locations_city == o.source_locations_city &&
|
556
|
+
source_locations_country == o.source_locations_country &&
|
557
|
+
source_locations_state == o.source_locations_state &&
|
558
|
+
source_rankings_alexa_country == o.source_rankings_alexa_country &&
|
559
|
+
source_rankings_alexa_rank_max == o.source_rankings_alexa_rank_max &&
|
560
|
+
source_rankings_alexa_rank_min == o.source_rankings_alexa_rank_min &&
|
561
|
+
source_scopes_city == o.source_scopes_city &&
|
562
|
+
source_scopes_country == o.source_scopes_country &&
|
563
|
+
source_scopes_level == o.source_scopes_level &&
|
564
|
+
source_scopes_state == o.source_scopes_state &&
|
565
|
+
story_url == o.story_url &&
|
566
|
+
story_language == o.story_language &&
|
567
|
+
text == o.text &&
|
568
|
+
title == o.title &&
|
569
|
+
translations_en_body == o.translations_en_body &&
|
570
|
+
translations_en_text == o.translations_en_text &&
|
571
|
+
translations_en_title == o.translations_en_title &&
|
572
|
+
entity == o.entity
|
573
|
+
end
|
574
|
+
|
575
|
+
# @see the `==` method
|
576
|
+
# @param [Object] Object to be compared
|
577
|
+
def eql?(o)
|
578
|
+
self == o
|
579
|
+
end
|
580
|
+
|
581
|
+
# Calculates hash code according to all attributes.
|
582
|
+
# @return [Integer] Hash code
|
583
|
+
def hash
|
584
|
+
[author_id, author_name, body, categories_confident, categories_id, categories_level, categories_taxonomy, clusters, links_permalink, entities_body_links_dbpedia, entities_body_text, entities_body_type, entities_title_links_dbpedia, entities_title_text, entities_title_type, id, language, media_images_content_length_max, media_images_content_length_min, media_images_count_max, media_images_count_min, media_images_format, media_images_height_max, media_images_height_min, media_images_width_max, media_images_width_min, media_videos_count_max, media_videos_count_min, sentiment_body_polarity, sentiment_title_polarity, social_shares_count_facebook_max, social_shares_count_facebook_min, social_shares_count_reddit_max, social_shares_count_reddit_min, source_domain, source_id, source_links_in_count_max, source_links_in_count_min, source_locations_city, source_locations_country, source_locations_state, source_rankings_alexa_country, source_rankings_alexa_rank_max, source_rankings_alexa_rank_min, source_scopes_city, source_scopes_country, source_scopes_level, source_scopes_state, story_url, story_language, text, title, translations_en_body, translations_en_text, translations_en_title, entity].hash
|
585
|
+
end
|
586
|
+
|
587
|
+
# Builds the object from hash
|
588
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
589
|
+
# @return [Object] Returns the model itself
|
590
|
+
def self.build_from_hash(attributes)
|
591
|
+
new.build_from_hash(attributes)
|
592
|
+
end
|
593
|
+
|
594
|
+
# Builds the object from hash
|
595
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
596
|
+
# @return [Object] Returns the model itself
|
597
|
+
def build_from_hash(attributes)
|
598
|
+
return nil unless attributes.is_a?(Hash)
|
599
|
+
self.class.openapi_types.each_pair do |key, type|
|
600
|
+
if type =~ /\AArray<(.*)>/i
|
601
|
+
# check to ensure the input is an array given that the attribute
|
602
|
+
# is documented as an array but the input is not
|
603
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
604
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
605
|
+
end
|
606
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
607
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
608
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
609
|
+
end
|
610
|
+
|
611
|
+
self
|
612
|
+
end
|
613
|
+
|
614
|
+
# Deserializes the data based on type
|
615
|
+
# @param string type Data type
|
616
|
+
# @param string value Value to be deserialized
|
617
|
+
# @return [Object] Deserialized data
|
618
|
+
def _deserialize(type, value)
|
619
|
+
case type.to_sym
|
620
|
+
when :DateTime
|
621
|
+
DateTime.parse(value)
|
622
|
+
when :Date
|
623
|
+
Date.parse(value)
|
624
|
+
when :String
|
625
|
+
value.to_s
|
626
|
+
when :Integer
|
627
|
+
value.to_i
|
628
|
+
when :Float
|
629
|
+
value.to_f
|
630
|
+
when :Boolean
|
631
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
632
|
+
true
|
633
|
+
else
|
634
|
+
false
|
635
|
+
end
|
636
|
+
when :Object
|
637
|
+
# generic object (usually a Hash), return directly
|
638
|
+
value
|
639
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
640
|
+
inner_type = Regexp.last_match[:inner_type]
|
641
|
+
value.map { |v| _deserialize(inner_type, v) }
|
642
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
643
|
+
k_type = Regexp.last_match[:k_type]
|
644
|
+
v_type = Regexp.last_match[:v_type]
|
645
|
+
{}.tap do |hash|
|
646
|
+
value.each do |k, v|
|
647
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
648
|
+
end
|
649
|
+
end
|
650
|
+
else # model
|
651
|
+
AylienNewsApi.const_get(type).build_from_hash(value)
|
652
|
+
end
|
653
|
+
end
|
654
|
+
|
655
|
+
# Returns the string representation of the object
|
656
|
+
# @return [String] String presentation of the object
|
657
|
+
def to_s
|
658
|
+
to_hash.to_s
|
659
|
+
end
|
660
|
+
|
661
|
+
# to_body is an alias to to_hash (backward compatibility)
|
662
|
+
# @return [Hash] Returns the object in the form of hash
|
663
|
+
def to_body
|
664
|
+
to_hash
|
665
|
+
end
|
666
|
+
|
667
|
+
# Returns the object in the form of hash
|
668
|
+
# @return [Hash] Returns the object in the form of hash
|
669
|
+
def to_hash
|
670
|
+
hash = {}
|
671
|
+
self.class.attribute_map.each_pair do |attr, param|
|
672
|
+
value = self.send(attr)
|
673
|
+
if value.nil?
|
674
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
675
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
676
|
+
end
|
677
|
+
|
678
|
+
hash[param] = _to_hash(value)
|
679
|
+
end
|
680
|
+
hash
|
681
|
+
end
|
682
|
+
|
683
|
+
# Outputs non-array value in the form of hash
|
684
|
+
# For object, use to_hash. Otherwise, just return the value
|
685
|
+
# @param [Object] value Any valid value
|
686
|
+
# @return [Hash] Returns the value in the form of hash
|
687
|
+
def _to_hash(value)
|
688
|
+
if value.is_a?(Array)
|
689
|
+
value.compact.map { |v| _to_hash(v) }
|
690
|
+
elsif value.is_a?(Hash)
|
691
|
+
{}.tap do |hash|
|
692
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
693
|
+
end
|
694
|
+
elsif value.respond_to? :to_hash
|
695
|
+
value.to_hash
|
696
|
+
else
|
697
|
+
value
|
698
|
+
end
|
699
|
+
end
|
700
|
+
end
|
701
|
+
end
|