aylien_news_api 4.3.1 → 4.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/aylien_news_api.gemspec +1 -1
  3. data/docs/Category.md +3 -3
  4. data/docs/CategoryLinks.md +2 -0
  5. data/docs/DefaultApi.md +200 -176
  6. data/docs/DeprecatedEntities.md +19 -0
  7. data/docs/DeprecatedEntity.md +33 -0
  8. data/docs/DeprecatedEntitySurfaceForm.md +21 -0
  9. data/docs/DeprecatedRelatedStories.md +27 -0
  10. data/docs/DeprecatedStories.md +25 -0
  11. data/docs/DeprecatedStory.md +65 -0
  12. data/docs/Entity.md +12 -10
  13. data/docs/EntityInText.md +19 -0
  14. data/docs/EntityMention.md +19 -0
  15. data/docs/EntityMentionIndex.md +19 -0
  16. data/docs/EntitySurfaceForm.md +4 -2
  17. data/docs/Story.md +1 -1
  18. data/lib/aylien_news_api/api/default_api.rb +225 -189
  19. data/lib/aylien_news_api/api_client.rb +1 -1
  20. data/lib/aylien_news_api/api_error.rb +1 -1
  21. data/lib/aylien_news_api/configuration.rb +1 -1
  22. data/lib/aylien_news_api/models/aggregated_sentiment.rb +1 -1
  23. data/lib/aylien_news_api/models/author.rb +1 -1
  24. data/lib/aylien_news_api/models/autocomplete.rb +1 -1
  25. data/lib/aylien_news_api/models/autocompletes.rb +1 -1
  26. data/lib/aylien_news_api/models/category.rb +17 -14
  27. data/lib/aylien_news_api/models/category_links.rb +16 -2
  28. data/lib/aylien_news_api/models/category_taxonomy.rb +2 -1
  29. data/lib/aylien_news_api/models/cluster.rb +1 -1
  30. data/lib/aylien_news_api/models/clusters.rb +1 -1
  31. data/lib/aylien_news_api/models/deprecated_entities.rb +221 -0
  32. data/lib/aylien_news_api/models/deprecated_entity.rb +314 -0
  33. data/lib/aylien_news_api/models/deprecated_entity_surface_form.rb +244 -0
  34. data/lib/aylien_news_api/models/deprecated_related_stories.rb +260 -0
  35. data/lib/aylien_news_api/models/deprecated_stories.rb +252 -0
  36. data/lib/aylien_news_api/models/deprecated_story.rb +451 -0
  37. data/lib/aylien_news_api/models/entity.rb +91 -45
  38. data/lib/aylien_news_api/models/entity_in_text.rb +217 -0
  39. data/lib/aylien_news_api/models/entity_links.rb +1 -1
  40. data/lib/aylien_news_api/models/entity_mention.rb +215 -0
  41. data/lib/aylien_news_api/models/entity_mention_index.rb +265 -0
  42. data/lib/aylien_news_api/models/entity_sentiment.rb +1 -1
  43. data/lib/aylien_news_api/models/entity_surface_form.rb +35 -10
  44. data/lib/aylien_news_api/models/error.rb +1 -1
  45. data/lib/aylien_news_api/models/error_links.rb +1 -1
  46. data/lib/aylien_news_api/models/errors.rb +1 -1
  47. data/lib/aylien_news_api/models/histogram_interval.rb +1 -1
  48. data/lib/aylien_news_api/models/histograms.rb +1 -1
  49. data/lib/aylien_news_api/models/location.rb +1 -1
  50. data/lib/aylien_news_api/models/logicals.rb +1 -1
  51. data/lib/aylien_news_api/models/media.rb +1 -1
  52. data/lib/aylien_news_api/models/media_format.rb +1 -1
  53. data/lib/aylien_news_api/models/media_type.rb +1 -1
  54. data/lib/aylien_news_api/models/nested_entity.rb +1 -1
  55. data/lib/aylien_news_api/models/parameter.rb +1 -1
  56. data/lib/aylien_news_api/models/query.rb +1 -1
  57. data/lib/aylien_news_api/models/rank.rb +1 -1
  58. data/lib/aylien_news_api/models/rankings.rb +1 -1
  59. data/lib/aylien_news_api/models/related_stories.rb +2 -1
  60. data/lib/aylien_news_api/models/representative_story.rb +1 -1
  61. data/lib/aylien_news_api/models/scope.rb +1 -1
  62. data/lib/aylien_news_api/models/scope_level.rb +1 -1
  63. data/lib/aylien_news_api/models/sentiment.rb +1 -1
  64. data/lib/aylien_news_api/models/sentiment_polarity.rb +1 -1
  65. data/lib/aylien_news_api/models/sentiments.rb +1 -1
  66. data/lib/aylien_news_api/models/share_count.rb +1 -1
  67. data/lib/aylien_news_api/models/share_counts.rb +1 -1
  68. data/lib/aylien_news_api/models/source.rb +1 -1
  69. data/lib/aylien_news_api/models/stories.rb +2 -1
  70. data/lib/aylien_news_api/models/story.rb +6 -3
  71. data/lib/aylien_news_api/models/story_cluster.rb +1 -1
  72. data/lib/aylien_news_api/models/story_links.rb +1 -1
  73. data/lib/aylien_news_api/models/story_translation.rb +1 -1
  74. data/lib/aylien_news_api/models/story_translations.rb +1 -1
  75. data/lib/aylien_news_api/models/summary.rb +1 -1
  76. data/lib/aylien_news_api/models/time_series.rb +1 -1
  77. data/lib/aylien_news_api/models/time_series_list.rb +1 -1
  78. data/lib/aylien_news_api/models/trend.rb +1 -1
  79. data/lib/aylien_news_api/models/trends.rb +1 -1
  80. data/lib/aylien_news_api/models/warning.rb +1 -1
  81. data/lib/aylien_news_api/version.rb +2 -2
  82. data/lib/aylien_news_api.rb +10 -5
  83. data/spec/api/default_api_spec.rb +143 -5
  84. data/spec/api_client_spec.rb +1 -1
  85. data/spec/configuration_spec.rb +1 -1
  86. data/spec/models/aggregated_sentiment_spec.rb +1 -1
  87. data/spec/models/author_spec.rb +1 -1
  88. data/spec/models/autocomplete_spec.rb +1 -1
  89. data/spec/models/autocompletes_spec.rb +1 -1
  90. data/spec/models/category_links_spec.rb +7 -1
  91. data/spec/models/category_spec.rb +4 -4
  92. data/spec/models/category_taxonomy_spec.rb +1 -1
  93. data/spec/models/cluster_spec.rb +1 -1
  94. data/spec/models/clusters_spec.rb +1 -1
  95. data/spec/models/deprecated_entities_spec.rb +47 -0
  96. data/spec/models/deprecated_entity_spec.rb +89 -0
  97. data/spec/models/deprecated_entity_surface_form_spec.rb +53 -0
  98. data/spec/models/deprecated_related_stories_spec.rb +71 -0
  99. data/spec/models/deprecated_stories_spec.rb +65 -0
  100. data/spec/models/deprecated_story_spec.rb +185 -0
  101. data/spec/models/entity_in_text_spec.rb +47 -0
  102. data/spec/models/entity_links_spec.rb +7 -1
  103. data/spec/models/entity_mention_index_spec.rb +47 -0
  104. data/spec/models/entity_mention_spec.rb +47 -0
  105. data/spec/models/entity_sentiment_spec.rb +1 -1
  106. data/spec/models/entity_spec.rb +24 -6
  107. data/spec/models/entity_surface_form_spec.rb +8 -2
  108. data/spec/models/error_links_spec.rb +1 -1
  109. data/spec/models/error_spec.rb +1 -1
  110. data/spec/models/errors_spec.rb +1 -1
  111. data/spec/models/histogram_interval_spec.rb +1 -1
  112. data/spec/models/histograms_spec.rb +1 -1
  113. data/spec/models/location_spec.rb +1 -1
  114. data/spec/models/logicals_spec.rb +1 -1
  115. data/spec/models/media_format_spec.rb +1 -1
  116. data/spec/models/media_spec.rb +1 -1
  117. data/spec/models/media_type_spec.rb +1 -1
  118. data/spec/models/nested_entity_spec.rb +20 -2
  119. data/spec/models/parameter_spec.rb +1 -1
  120. data/spec/models/query_spec.rb +1 -1
  121. data/spec/models/rank_spec.rb +1 -1
  122. data/spec/models/rankings_spec.rb +1 -1
  123. data/spec/models/related_stories_spec.rb +1 -1
  124. data/spec/models/representative_story_spec.rb +1 -1
  125. data/spec/models/scope_level_spec.rb +1 -1
  126. data/spec/models/scope_spec.rb +1 -1
  127. data/spec/models/sentiment_polarity_spec.rb +1 -1
  128. data/spec/models/sentiment_spec.rb +1 -1
  129. data/spec/models/sentiments_spec.rb +1 -1
  130. data/spec/models/share_count_spec.rb +1 -1
  131. data/spec/models/share_counts_spec.rb +1 -1
  132. data/spec/models/source_spec.rb +1 -1
  133. data/spec/models/stories_spec.rb +1 -1
  134. data/spec/models/story_cluster_spec.rb +1 -1
  135. data/spec/models/story_links_spec.rb +1 -1
  136. data/spec/models/story_spec.rb +7 -1
  137. data/spec/models/story_translation_spec.rb +1 -1
  138. data/spec/models/story_translations_spec.rb +1 -1
  139. data/spec/models/summary_spec.rb +1 -1
  140. data/spec/models/time_series_list_spec.rb +1 -1
  141. data/spec/models/time_series_spec.rb +7 -1
  142. data/spec/models/trend_spec.rb +7 -1
  143. data/spec/models/trends_spec.rb +1 -1
  144. data/spec/models/warning_spec.rb +1 -1
  145. data/spec/spec_helper.rb +1 -1
  146. metadata +38 -3
  147. data/aylien_news_api-4.3.0.gem +0 -0
@@ -0,0 +1,451 @@
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: 4.7
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 DeprecatedStory
17
+ attr_accessor :author
18
+
19
+ # Body of the story
20
+ attr_accessor :body
21
+
22
+ # Suggested categories for the story
23
+ attr_accessor :categories
24
+
25
+ # Character count of the story body
26
+ attr_accessor :characters_count
27
+
28
+ # An array of clusters the story is associated with
29
+ attr_accessor :clusters
30
+
31
+ attr_accessor :entities
32
+
33
+ # An array of suggested Story hashtags
34
+ attr_accessor :hashtags
35
+
36
+ # ID of the story which is a unique identification
37
+ attr_accessor :id
38
+
39
+ # Extracted keywords mentioned in the story title or body
40
+ attr_accessor :keywords
41
+
42
+ # Language of the story
43
+ attr_accessor :language
44
+
45
+ attr_accessor :links
46
+
47
+ # An array of extracted media such as images and videos
48
+ attr_accessor :media
49
+
50
+ # Paragraph count of the story body
51
+ attr_accessor :paragraphs_count
52
+
53
+ # Publication time of the story, if available, otherwise time of acquisition
54
+ attr_accessor :published_datetime
55
+
56
+ # Acquisition time of the story
57
+ attr_accessor :published_at
58
+
59
+ # Sentence count of the story body
60
+ attr_accessor :sentences_count
61
+
62
+ attr_accessor :sentiment
63
+
64
+ attr_accessor :social_shares_count
65
+
66
+ attr_accessor :source
67
+
68
+ attr_accessor :summary
69
+
70
+ # Title of the story
71
+ attr_accessor :title
72
+
73
+ attr_accessor :translations
74
+
75
+ # Word count of the story body
76
+ attr_accessor :words_count
77
+
78
+ # License type of the story
79
+ attr_accessor :license_type
80
+
81
+ # An array of industries categories
82
+ attr_accessor :industries
83
+
84
+ # Attribute mapping from ruby-style variable name to JSON key.
85
+ def self.attribute_map
86
+ {
87
+ :'author' => :'author',
88
+ :'body' => :'body',
89
+ :'categories' => :'categories',
90
+ :'characters_count' => :'characters_count',
91
+ :'clusters' => :'clusters',
92
+ :'entities' => :'entities',
93
+ :'hashtags' => :'hashtags',
94
+ :'id' => :'id',
95
+ :'keywords' => :'keywords',
96
+ :'language' => :'language',
97
+ :'links' => :'links',
98
+ :'media' => :'media',
99
+ :'paragraphs_count' => :'paragraphs_count',
100
+ :'published_datetime' => :'published_datetime',
101
+ :'published_at' => :'published_at',
102
+ :'sentences_count' => :'sentences_count',
103
+ :'sentiment' => :'sentiment',
104
+ :'social_shares_count' => :'social_shares_count',
105
+ :'source' => :'source',
106
+ :'summary' => :'summary',
107
+ :'title' => :'title',
108
+ :'translations' => :'translations',
109
+ :'words_count' => :'words_count',
110
+ :'license_type' => :'license_type',
111
+ :'industries' => :'industries'
112
+ }
113
+ end
114
+
115
+ # Attribute type mapping.
116
+ def self.openapi_types
117
+ {
118
+ :'author' => :'Author',
119
+ :'body' => :'String',
120
+ :'categories' => :'Array<Category>',
121
+ :'characters_count' => :'Integer',
122
+ :'clusters' => :'Array<Integer>',
123
+ :'entities' => :'DeprecatedEntities',
124
+ :'hashtags' => :'Array<String>',
125
+ :'id' => :'Integer',
126
+ :'keywords' => :'Array<String>',
127
+ :'language' => :'String',
128
+ :'links' => :'StoryLinks',
129
+ :'media' => :'Array<Media>',
130
+ :'paragraphs_count' => :'Integer',
131
+ :'published_datetime' => :'DateTime',
132
+ :'published_at' => :'DateTime',
133
+ :'sentences_count' => :'Integer',
134
+ :'sentiment' => :'Sentiments',
135
+ :'social_shares_count' => :'ShareCounts',
136
+ :'source' => :'Source',
137
+ :'summary' => :'Summary',
138
+ :'title' => :'String',
139
+ :'translations' => :'StoryTranslations',
140
+ :'words_count' => :'Integer',
141
+ :'license_type' => :'Integer',
142
+ :'industries' => :'Array<Category>'
143
+ }
144
+ end
145
+
146
+ # List of attributes with nullable: true
147
+ def self.openapi_nullable
148
+ Set.new([
149
+ ])
150
+ end
151
+
152
+ # Initializes the object
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ def initialize(attributes = {})
155
+ if (!attributes.is_a?(Hash))
156
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AylienNewsApi::DeprecatedStory` initialize method"
157
+ end
158
+
159
+ # check to see if the attribute exists and convert string to symbol for hash key
160
+ attributes = attributes.each_with_object({}) { |(k, v), h|
161
+ if (!self.class.attribute_map.key?(k.to_sym))
162
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AylienNewsApi::DeprecatedStory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
163
+ end
164
+ h[k.to_sym] = v
165
+ }
166
+
167
+ if attributes.key?(:'author')
168
+ self.author = attributes[:'author']
169
+ end
170
+
171
+ if attributes.key?(:'body')
172
+ self.body = attributes[:'body']
173
+ end
174
+
175
+ if attributes.key?(:'categories')
176
+ if (value = attributes[:'categories']).is_a?(Array)
177
+ self.categories = value
178
+ end
179
+ end
180
+
181
+ if attributes.key?(:'characters_count')
182
+ self.characters_count = attributes[:'characters_count']
183
+ end
184
+
185
+ if attributes.key?(:'clusters')
186
+ if (value = attributes[:'clusters']).is_a?(Array)
187
+ self.clusters = value
188
+ end
189
+ end
190
+
191
+ if attributes.key?(:'entities')
192
+ self.entities = attributes[:'entities']
193
+ end
194
+
195
+ if attributes.key?(:'hashtags')
196
+ if (value = attributes[:'hashtags']).is_a?(Array)
197
+ self.hashtags = value
198
+ end
199
+ end
200
+
201
+ if attributes.key?(:'id')
202
+ self.id = attributes[:'id']
203
+ end
204
+
205
+ if attributes.key?(:'keywords')
206
+ if (value = attributes[:'keywords']).is_a?(Array)
207
+ self.keywords = value
208
+ end
209
+ end
210
+
211
+ if attributes.key?(:'language')
212
+ self.language = attributes[:'language']
213
+ end
214
+
215
+ if attributes.key?(:'links')
216
+ self.links = attributes[:'links']
217
+ end
218
+
219
+ if attributes.key?(:'media')
220
+ if (value = attributes[:'media']).is_a?(Array)
221
+ self.media = value
222
+ end
223
+ end
224
+
225
+ if attributes.key?(:'paragraphs_count')
226
+ self.paragraphs_count = attributes[:'paragraphs_count']
227
+ end
228
+
229
+ if attributes.key?(:'published_datetime')
230
+ self.published_datetime = attributes[:'published_datetime']
231
+ end
232
+
233
+ if attributes.key?(:'published_at')
234
+ self.published_at = attributes[:'published_at']
235
+ end
236
+
237
+ if attributes.key?(:'sentences_count')
238
+ self.sentences_count = attributes[:'sentences_count']
239
+ end
240
+
241
+ if attributes.key?(:'sentiment')
242
+ self.sentiment = attributes[:'sentiment']
243
+ end
244
+
245
+ if attributes.key?(:'social_shares_count')
246
+ self.social_shares_count = attributes[:'social_shares_count']
247
+ end
248
+
249
+ if attributes.key?(:'source')
250
+ self.source = attributes[:'source']
251
+ end
252
+
253
+ if attributes.key?(:'summary')
254
+ self.summary = attributes[:'summary']
255
+ end
256
+
257
+ if attributes.key?(:'title')
258
+ self.title = attributes[:'title']
259
+ end
260
+
261
+ if attributes.key?(:'translations')
262
+ self.translations = attributes[:'translations']
263
+ end
264
+
265
+ if attributes.key?(:'words_count')
266
+ self.words_count = attributes[:'words_count']
267
+ end
268
+
269
+ if attributes.key?(:'license_type')
270
+ self.license_type = attributes[:'license_type']
271
+ end
272
+
273
+ if attributes.key?(:'industries')
274
+ if (value = attributes[:'industries']).is_a?(Array)
275
+ self.industries = value
276
+ end
277
+ end
278
+ end
279
+
280
+ # Show invalid properties with the reasons. Usually used together with valid?
281
+ # @return Array for valid properties with the reasons
282
+ def list_invalid_properties
283
+ invalid_properties = Array.new
284
+ invalid_properties
285
+ end
286
+
287
+ # Check to see if the all the properties in the model are valid
288
+ # @return true if the model is valid
289
+ def valid?
290
+ true
291
+ end
292
+
293
+ # Checks equality by comparing each attribute.
294
+ # @param [Object] Object to be compared
295
+ def ==(o)
296
+ return true if self.equal?(o)
297
+ self.class == o.class &&
298
+ author == o.author &&
299
+ body == o.body &&
300
+ categories == o.categories &&
301
+ characters_count == o.characters_count &&
302
+ clusters == o.clusters &&
303
+ entities == o.entities &&
304
+ hashtags == o.hashtags &&
305
+ id == o.id &&
306
+ keywords == o.keywords &&
307
+ language == o.language &&
308
+ links == o.links &&
309
+ media == o.media &&
310
+ paragraphs_count == o.paragraphs_count &&
311
+ published_datetime == o.published_datetime &&
312
+ published_at == o.published_at &&
313
+ sentences_count == o.sentences_count &&
314
+ sentiment == o.sentiment &&
315
+ social_shares_count == o.social_shares_count &&
316
+ source == o.source &&
317
+ summary == o.summary &&
318
+ title == o.title &&
319
+ translations == o.translations &&
320
+ words_count == o.words_count &&
321
+ license_type == o.license_type &&
322
+ industries == o.industries
323
+ end
324
+
325
+ # @see the `==` method
326
+ # @param [Object] Object to be compared
327
+ def eql?(o)
328
+ self == o
329
+ end
330
+
331
+ # Calculates hash code according to all attributes.
332
+ # @return [Integer] Hash code
333
+ def hash
334
+ [author, body, categories, characters_count, clusters, entities, hashtags, id, keywords, language, links, media, paragraphs_count, published_datetime, published_at, sentences_count, sentiment, social_shares_count, source, summary, title, translations, words_count, license_type, industries].hash
335
+ end
336
+
337
+ # Builds the object from hash
338
+ # @param [Hash] attributes Model attributes in the form of hash
339
+ # @return [Object] Returns the model itself
340
+ def self.build_from_hash(attributes)
341
+ new.build_from_hash(attributes)
342
+ end
343
+
344
+ # Builds the object from hash
345
+ # @param [Hash] attributes Model attributes in the form of hash
346
+ # @return [Object] Returns the model itself
347
+ def build_from_hash(attributes)
348
+ return nil unless attributes.is_a?(Hash)
349
+ self.class.openapi_types.each_pair do |key, type|
350
+ if type =~ /\AArray<(.*)>/i
351
+ # check to ensure the input is an array given that the attribute
352
+ # is documented as an array but the input is not
353
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
354
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
355
+ end
356
+ elsif !attributes[self.class.attribute_map[key]].nil?
357
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
358
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
359
+ end
360
+
361
+ self
362
+ end
363
+
364
+ # Deserializes the data based on type
365
+ # @param string type Data type
366
+ # @param string value Value to be deserialized
367
+ # @return [Object] Deserialized data
368
+ def _deserialize(type, value)
369
+ case type.to_sym
370
+ when :DateTime
371
+ DateTime.parse(value)
372
+ when :Date
373
+ Date.parse(value)
374
+ when :String
375
+ value.to_s
376
+ when :Integer
377
+ value.to_i
378
+ when :Float
379
+ value.to_f
380
+ when :Boolean
381
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
382
+ true
383
+ else
384
+ false
385
+ end
386
+ when :Object
387
+ # generic object (usually a Hash), return directly
388
+ value
389
+ when /\AArray<(?<inner_type>.+)>\z/
390
+ inner_type = Regexp.last_match[:inner_type]
391
+ value.map { |v| _deserialize(inner_type, v) }
392
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
393
+ k_type = Regexp.last_match[:k_type]
394
+ v_type = Regexp.last_match[:v_type]
395
+ {}.tap do |hash|
396
+ value.each do |k, v|
397
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
398
+ end
399
+ end
400
+ else # model
401
+ AylienNewsApi.const_get(type).build_from_hash(value)
402
+ end
403
+ end
404
+
405
+ # Returns the string representation of the object
406
+ # @return [String] String presentation of the object
407
+ def to_s
408
+ to_hash.to_s
409
+ end
410
+
411
+ # to_body is an alias to to_hash (backward compatibility)
412
+ # @return [Hash] Returns the object in the form of hash
413
+ def to_body
414
+ to_hash
415
+ end
416
+
417
+ # Returns the object in the form of hash
418
+ # @return [Hash] Returns the object in the form of hash
419
+ def to_hash
420
+ hash = {}
421
+ self.class.attribute_map.each_pair do |attr, param|
422
+ value = self.send(attr)
423
+ if value.nil?
424
+ is_nullable = self.class.openapi_nullable.include?(attr)
425
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
426
+ end
427
+
428
+ hash[param] = _to_hash(value)
429
+ end
430
+ hash
431
+ end
432
+
433
+ # Outputs non-array value in the form of hash
434
+ # For object, use to_hash. Otherwise, just return the value
435
+ # @param [Object] value Any valid value
436
+ # @return [Hash] Returns the value in the form of hash
437
+ def _to_hash(value)
438
+ if value.is_a?(Array)
439
+ value.compact.map { |v| _to_hash(v) }
440
+ elsif value.is_a?(Hash)
441
+ {}.tap do |hash|
442
+ value.each { |k, v| hash[k] = _to_hash(v) }
443
+ end
444
+ elsif value.respond_to? :to_hash
445
+ value.to_hash
446
+ else
447
+ value
448
+ end
449
+ end
450
+ end
451
+ end
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- The version of the OpenAPI document: 3.0
6
+ The version of the OpenAPI document: 4.7
7
7
  Contact: support@aylien.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.0.0-SNAPSHOT
@@ -17,35 +17,38 @@ module AylienNewsApi
17
17
  # The unique ID of the entity
18
18
  attr_accessor :id
19
19
 
20
- # The indices of the entity text
21
- attr_accessor :indices
22
-
23
20
  attr_accessor :links
24
21
 
25
- # The entity text
26
- attr_accessor :text
27
-
28
- # The stock_ticker of the entity (might be null)
29
- attr_accessor :stock_ticker
22
+ # The stock tickers of the entity (might be empty)
23
+ attr_accessor :stock_tickers
30
24
 
31
25
  # An array of the entity types
32
26
  attr_accessor :types
33
27
 
34
- attr_accessor :sentiment
28
+ attr_accessor :overall_sentiment
29
+
30
+ # Describes how relevant an entity is to the article
31
+ attr_accessor :overall_prominence
32
+
33
+ # Amount of entity surface form mentions in the article
34
+ attr_accessor :overall_frequency
35
+
36
+ attr_accessor :body
35
37
 
36
- attr_accessor :surface_forms
38
+ attr_accessor :title
37
39
 
38
40
  # Attribute mapping from ruby-style variable name to JSON key.
39
41
  def self.attribute_map
40
42
  {
41
43
  :'id' => :'id',
42
- :'indices' => :'indices',
43
44
  :'links' => :'links',
44
- :'text' => :'text',
45
- :'stock_ticker' => :'stock_ticker',
45
+ :'stock_tickers' => :'stock_tickers',
46
46
  :'types' => :'types',
47
- :'sentiment' => :'sentiment',
48
- :'surface_forms' => :'surface_forms'
47
+ :'overall_sentiment' => :'overall_sentiment',
48
+ :'overall_prominence' => :'overall_prominence',
49
+ :'overall_frequency' => :'overall_frequency',
50
+ :'body' => :'body',
51
+ :'title' => :'title'
49
52
  }
50
53
  end
51
54
 
@@ -53,13 +56,14 @@ module AylienNewsApi
53
56
  def self.openapi_types
54
57
  {
55
58
  :'id' => :'String',
56
- :'indices' => :'Array<Array<Integer>>',
57
59
  :'links' => :'EntityLinks',
58
- :'text' => :'String',
59
- :'stock_ticker' => :'String',
60
+ :'stock_tickers' => :'Array<String>',
60
61
  :'types' => :'Array<String>',
61
- :'sentiment' => :'EntitySentiment',
62
- :'surface_forms' => :'Array<EntitySurfaceForm>'
62
+ :'overall_sentiment' => :'EntitySentiment',
63
+ :'overall_prominence' => :'Float',
64
+ :'overall_frequency' => :'Integer',
65
+ :'body' => :'EntityInText',
66
+ :'title' => :'EntityInText'
63
67
  }
64
68
  end
65
69
 
@@ -88,22 +92,14 @@ module AylienNewsApi
88
92
  self.id = attributes[:'id']
89
93
  end
90
94
 
91
- if attributes.key?(:'indices')
92
- if (value = attributes[:'indices']).is_a?(Array)
93
- self.indices = value
94
- end
95
- end
96
-
97
95
  if attributes.key?(:'links')
98
96
  self.links = attributes[:'links']
99
97
  end
100
98
 
101
- if attributes.key?(:'text')
102
- self.text = attributes[:'text']
103
- end
104
-
105
- if attributes.key?(:'stock_ticker')
106
- self.stock_ticker = attributes[:'stock_ticker']
99
+ if attributes.key?(:'stock_tickers')
100
+ if (value = attributes[:'stock_tickers']).is_a?(Array)
101
+ self.stock_tickers = value
102
+ end
107
103
  end
108
104
 
109
105
  if attributes.key?(:'types')
@@ -112,14 +108,24 @@ module AylienNewsApi
112
108
  end
113
109
  end
114
110
 
115
- if attributes.key?(:'sentiment')
116
- self.sentiment = attributes[:'sentiment']
111
+ if attributes.key?(:'overall_sentiment')
112
+ self.overall_sentiment = attributes[:'overall_sentiment']
117
113
  end
118
114
 
119
- if attributes.key?(:'surface_forms')
120
- if (value = attributes[:'surface_forms']).is_a?(Array)
121
- self.surface_forms = value
122
- end
115
+ if attributes.key?(:'overall_prominence')
116
+ self.overall_prominence = attributes[:'overall_prominence']
117
+ end
118
+
119
+ if attributes.key?(:'overall_frequency')
120
+ self.overall_frequency = attributes[:'overall_frequency']
121
+ end
122
+
123
+ if attributes.key?(:'body')
124
+ self.body = attributes[:'body']
125
+ end
126
+
127
+ if attributes.key?(:'title')
128
+ self.title = attributes[:'title']
123
129
  end
124
130
  end
125
131
 
@@ -127,28 +133,68 @@ module AylienNewsApi
127
133
  # @return Array for valid properties with the reasons
128
134
  def list_invalid_properties
129
135
  invalid_properties = Array.new
136
+ if !@overall_prominence.nil? && @overall_prominence > 1
137
+ invalid_properties.push('invalid value for "overall_prominence", must be smaller than or equal to 1.')
138
+ end
139
+
140
+ if !@overall_prominence.nil? && @overall_prominence < 0
141
+ invalid_properties.push('invalid value for "overall_prominence", must be greater than or equal to 0.')
142
+ end
143
+
144
+ if !@overall_frequency.nil? && @overall_frequency < 0
145
+ invalid_properties.push('invalid value for "overall_frequency", must be greater than or equal to 0.')
146
+ end
147
+
130
148
  invalid_properties
131
149
  end
132
150
 
133
151
  # Check to see if the all the properties in the model are valid
134
152
  # @return true if the model is valid
135
153
  def valid?
154
+ return false if !@overall_prominence.nil? && @overall_prominence > 1
155
+ return false if !@overall_prominence.nil? && @overall_prominence < 0
156
+ return false if !@overall_frequency.nil? && @overall_frequency < 0
136
157
  true
137
158
  end
138
159
 
160
+ # Custom attribute writer method with validation
161
+ # @param [Object] overall_prominence Value to be assigned
162
+ def overall_prominence=(overall_prominence)
163
+ if !overall_prominence.nil? && overall_prominence > 1
164
+ fail ArgumentError, 'invalid value for "overall_prominence", must be smaller than or equal to 1.'
165
+ end
166
+
167
+ if !overall_prominence.nil? && overall_prominence < 0
168
+ fail ArgumentError, 'invalid value for "overall_prominence", must be greater than or equal to 0.'
169
+ end
170
+
171
+ @overall_prominence = overall_prominence
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] overall_frequency Value to be assigned
176
+ def overall_frequency=(overall_frequency)
177
+ if !overall_frequency.nil? && overall_frequency < 0
178
+ fail ArgumentError, 'invalid value for "overall_frequency", must be greater than or equal to 0.'
179
+ end
180
+
181
+ @overall_frequency = overall_frequency
182
+ end
183
+
139
184
  # Checks equality by comparing each attribute.
140
185
  # @param [Object] Object to be compared
141
186
  def ==(o)
142
187
  return true if self.equal?(o)
143
188
  self.class == o.class &&
144
189
  id == o.id &&
145
- indices == o.indices &&
146
190
  links == o.links &&
147
- text == o.text &&
148
- stock_ticker == o.stock_ticker &&
191
+ stock_tickers == o.stock_tickers &&
149
192
  types == o.types &&
150
- sentiment == o.sentiment &&
151
- surface_forms == o.surface_forms
193
+ overall_sentiment == o.overall_sentiment &&
194
+ overall_prominence == o.overall_prominence &&
195
+ overall_frequency == o.overall_frequency &&
196
+ body == o.body &&
197
+ title == o.title
152
198
  end
153
199
 
154
200
  # @see the `==` method
@@ -160,7 +206,7 @@ module AylienNewsApi
160
206
  # Calculates hash code according to all attributes.
161
207
  # @return [Integer] Hash code
162
208
  def hash
163
- [id, indices, links, text, stock_ticker, types, sentiment, surface_forms].hash
209
+ [id, links, stock_tickers, types, overall_sentiment, overall_prominence, overall_frequency, body, title].hash
164
210
  end
165
211
 
166
212
  # Builds the object from hash