aylien_news_api 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -4
  3. data/README.md +8 -7
  4. data/aylien_news_api.gemspec +15 -2
  5. data/docs/CategoryLinks.md +2 -2
  6. data/docs/Coverages.md +1 -0
  7. data/docs/DefaultApi.md +315 -252
  8. data/docs/Media.md +1 -1
  9. data/docs/RelatedStories.md +1 -0
  10. data/docs/Scope.md +4 -4
  11. data/docs/Story.md +5 -5
  12. data/lib/aylien_news_api/api/default_api.rb +615 -549
  13. data/lib/aylien_news_api/api_client.rb +2 -2
  14. data/lib/aylien_news_api/configuration.rb +8 -0
  15. data/lib/aylien_news_api/models/author.rb +25 -6
  16. data/lib/aylien_news_api/models/autocomplete.rb +23 -5
  17. data/lib/aylien_news_api/models/autocompletes.rb +21 -4
  18. data/lib/aylien_news_api/models/category.rb +57 -12
  19. data/lib/aylien_news_api/models/category_links.rb +25 -7
  20. data/lib/aylien_news_api/models/coverages.rb +45 -12
  21. data/lib/aylien_news_api/models/entities.rb +23 -5
  22. data/lib/aylien_news_api/models/entity.rb +49 -8
  23. data/lib/aylien_news_api/models/entity_links.rb +21 -4
  24. data/lib/aylien_news_api/models/error.rb +31 -9
  25. data/lib/aylien_news_api/models/error_links.rb +21 -4
  26. data/lib/aylien_news_api/models/errors.rb +21 -4
  27. data/lib/aylien_news_api/models/histogram_interval.rb +23 -5
  28. data/lib/aylien_news_api/models/histograms.rb +29 -8
  29. data/lib/aylien_news_api/models/location.rb +25 -6
  30. data/lib/aylien_news_api/models/media.rb +50 -9
  31. data/lib/aylien_news_api/models/related_stories.rb +43 -11
  32. data/lib/aylien_news_api/models/scope.rb +57 -14
  33. data/lib/aylien_news_api/models/sentiment.rb +69 -8
  34. data/lib/aylien_news_api/models/sentiments.rb +23 -5
  35. data/lib/aylien_news_api/models/share_count.rb +23 -5
  36. data/lib/aylien_news_api/models/share_counts.rb +27 -7
  37. data/lib/aylien_news_api/models/source.rb +31 -9
  38. data/lib/aylien_news_api/models/stories.rb +25 -6
  39. data/lib/aylien_news_api/models/story.rb +64 -28
  40. data/lib/aylien_news_api/models/story_cluster.rb +29 -8
  41. data/lib/aylien_news_api/models/story_links.rb +25 -6
  42. data/lib/aylien_news_api/models/summary.rb +21 -4
  43. data/lib/aylien_news_api/models/time_series.rb +23 -5
  44. data/lib/aylien_news_api/models/time_series_list.rb +27 -7
  45. data/lib/aylien_news_api/models/trend.rb +23 -5
  46. data/lib/aylien_news_api/models/trends.rb +23 -5
  47. data/lib/aylien_news_api/version.rb +1 -1
  48. data/spec/api_client_spec.rb +306 -0
  49. data/spec/configuration_spec.rb +39 -0
  50. data/spec/spec_helper.rb +113 -0
  51. metadata +34 -49
  52. data/Rakefile +0 -8
  53. data/aylien_news_api-0.0.1.gem +0 -0
@@ -15,6 +15,7 @@
15
15
  require 'date'
16
16
 
17
17
  module AylienNewsApi
18
+
18
19
  class ShareCount
19
20
  # The number of shares
20
21
  attr_accessor :count
@@ -22,6 +23,7 @@ module AylienNewsApi
22
23
  # The fetched date of the shares
23
24
  attr_accessor :fetched_at
24
25
 
26
+
25
27
  # Attribute mapping from ruby-style variable name to JSON key.
26
28
  def self.attribute_map
27
29
  {
@@ -46,16 +48,31 @@ module AylienNewsApi
46
48
  # convert string to symbol for hash key
47
49
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
50
 
49
- if attributes[:'count']
51
+ if attributes.has_key?(:'count')
50
52
  self.count = attributes[:'count']
51
53
  end
52
- if attributes[:'fetched_at']
54
+
55
+ if attributes.has_key?(:'fetched_at')
53
56
  self.fetched_at = attributes[:'fetched_at']
54
57
  end
58
+
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properies with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ return invalid_properties
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ def valid?
71
+ return true
55
72
  end
56
73
 
57
74
  # Checks equality by comparing each attribute.
58
- # @param [Object] Object to be compared
75
+ # @param [Object] Object to be compared
59
76
  def ==(o)
60
77
  return true if self.equal?(o)
61
78
  self.class == o.class &&
@@ -64,7 +81,7 @@ module AylienNewsApi
64
81
  end
65
82
 
66
83
  # @see the `==` method
67
- # @param [Object] Object to be compared
84
+ # @param [Object] Object to be compared
68
85
  def eql?(o)
69
86
  self == o
70
87
  end
@@ -163,7 +180,7 @@ module AylienNewsApi
163
180
 
164
181
  # Outputs non-array value in the form of hash
165
182
  # For object, use to_hash. Otherwise, just return the value
166
- # @param [Object] value Any valid value
183
+ # @param [Object] value Any valid value
167
184
  # @return [Hash] Returns the value in the form of hash
168
185
  def _to_hash(value)
169
186
  if value.is_a?(Array)
@@ -180,4 +197,5 @@ module AylienNewsApi
180
197
  end
181
198
 
182
199
  end
200
+
183
201
  end
@@ -15,6 +15,7 @@
15
15
  require 'date'
16
16
 
17
17
  module AylienNewsApi
18
+
18
19
  class ShareCounts
19
20
  # Facebook shares count
20
21
  attr_accessor :facebook
@@ -28,6 +29,7 @@ module AylienNewsApi
28
29
  # Reddit shares count
29
30
  attr_accessor :reddit
30
31
 
32
+
31
33
  # Attribute mapping from ruby-style variable name to JSON key.
32
34
  def self.attribute_map
33
35
  {
@@ -56,30 +58,47 @@ module AylienNewsApi
56
58
  # convert string to symbol for hash key
57
59
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
58
60
 
59
- if attributes[:'facebook']
61
+ if attributes.has_key?(:'facebook')
60
62
  if (value = attributes[:'facebook']).is_a?(Array)
61
63
  self.facebook = value
62
64
  end
63
65
  end
64
- if attributes[:'google_plus']
66
+
67
+ if attributes.has_key?(:'google_plus')
65
68
  if (value = attributes[:'google_plus']).is_a?(Array)
66
69
  self.google_plus = value
67
70
  end
68
71
  end
69
- if attributes[:'linkedin']
72
+
73
+ if attributes.has_key?(:'linkedin')
70
74
  if (value = attributes[:'linkedin']).is_a?(Array)
71
75
  self.linkedin = value
72
76
  end
73
77
  end
74
- if attributes[:'reddit']
78
+
79
+ if attributes.has_key?(:'reddit')
75
80
  if (value = attributes[:'reddit']).is_a?(Array)
76
81
  self.reddit = value
77
82
  end
78
83
  end
84
+
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properies with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = Array.new
91
+ return invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ return true
79
98
  end
80
99
 
81
100
  # Checks equality by comparing each attribute.
82
- # @param [Object] Object to be compared
101
+ # @param [Object] Object to be compared
83
102
  def ==(o)
84
103
  return true if self.equal?(o)
85
104
  self.class == o.class &&
@@ -90,7 +109,7 @@ module AylienNewsApi
90
109
  end
91
110
 
92
111
  # @see the `==` method
93
- # @param [Object] Object to be compared
112
+ # @param [Object] Object to be compared
94
113
  def eql?(o)
95
114
  self == o
96
115
  end
@@ -189,7 +208,7 @@ module AylienNewsApi
189
208
 
190
209
  # Outputs non-array value in the form of hash
191
210
  # For object, use to_hash. Otherwise, just return the value
192
- # @param [Object] value Any valid value
211
+ # @param [Object] value Any valid value
193
212
  # @return [Hash] Returns the value in the form of hash
194
213
  def _to_hash(value)
195
214
  if value.is_a?(Array)
@@ -206,4 +225,5 @@ module AylienNewsApi
206
225
  end
207
226
 
208
227
  end
228
+
209
229
  end
@@ -15,6 +15,7 @@
15
15
  require 'date'
16
16
 
17
17
  module AylienNewsApi
18
+
18
19
  class Source
19
20
  # The source id which is a unique value
20
21
  attr_accessor :id
@@ -34,6 +35,7 @@ module AylienNewsApi
34
35
  # The source scopes which is tend to be scope locations of the source, e.g. BBC scopes is international.
35
36
  attr_accessor :scopes
36
37
 
38
+
37
39
  # Attribute mapping from ruby-style variable name to JSON key.
38
40
  def self.attribute_map
39
41
  {
@@ -66,32 +68,51 @@ module AylienNewsApi
66
68
  # convert string to symbol for hash key
67
69
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
68
70
 
69
- if attributes[:'id']
71
+ if attributes.has_key?(:'id')
70
72
  self.id = attributes[:'id']
71
73
  end
72
- if attributes[:'name']
74
+
75
+ if attributes.has_key?(:'name')
73
76
  self.name = attributes[:'name']
74
77
  end
75
- if attributes[:'domain']
78
+
79
+ if attributes.has_key?(:'domain')
76
80
  self.domain = attributes[:'domain']
77
81
  end
78
- if attributes[:'logo_url']
82
+
83
+ if attributes.has_key?(:'logo_url')
79
84
  self.logo_url = attributes[:'logo_url']
80
85
  end
81
- if attributes[:'locations']
86
+
87
+ if attributes.has_key?(:'locations')
82
88
  if (value = attributes[:'locations']).is_a?(Array)
83
89
  self.locations = value
84
90
  end
85
91
  end
86
- if attributes[:'scopes']
92
+
93
+ if attributes.has_key?(:'scopes')
87
94
  if (value = attributes[:'scopes']).is_a?(Array)
88
95
  self.scopes = value
89
96
  end
90
97
  end
98
+
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properies with the reasons
103
+ def list_invalid_properties
104
+ invalid_properties = Array.new
105
+ return invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ return true
91
112
  end
92
113
 
93
114
  # Checks equality by comparing each attribute.
94
- # @param [Object] Object to be compared
115
+ # @param [Object] Object to be compared
95
116
  def ==(o)
96
117
  return true if self.equal?(o)
97
118
  self.class == o.class &&
@@ -104,7 +125,7 @@ module AylienNewsApi
104
125
  end
105
126
 
106
127
  # @see the `==` method
107
- # @param [Object] Object to be compared
128
+ # @param [Object] Object to be compared
108
129
  def eql?(o)
109
130
  self == o
110
131
  end
@@ -203,7 +224,7 @@ module AylienNewsApi
203
224
 
204
225
  # Outputs non-array value in the form of hash
205
226
  # For object, use to_hash. Otherwise, just return the value
206
- # @param [Object] value Any valid value
227
+ # @param [Object] value Any valid value
207
228
  # @return [Hash] Returns the value in the form of hash
208
229
  def _to_hash(value)
209
230
  if value.is_a?(Array)
@@ -220,4 +241,5 @@ module AylienNewsApi
220
241
  end
221
242
 
222
243
  end
244
+
223
245
  end
@@ -15,6 +15,7 @@
15
15
  require 'date'
16
16
 
17
17
  module AylienNewsApi
18
+
18
19
  class Stories
19
20
  # An array of stories
20
21
  attr_accessor :stories
@@ -25,6 +26,7 @@ module AylienNewsApi
25
26
  # The next page cursor
26
27
  attr_accessor :next_page_cursor
27
28
 
29
+
28
30
  # Attribute mapping from ruby-style variable name to JSON key.
29
31
  def self.attribute_map
30
32
  {
@@ -51,23 +53,39 @@ module AylienNewsApi
51
53
  # convert string to symbol for hash key
52
54
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
53
55
 
54
- if attributes[:'stories']
56
+ if attributes.has_key?(:'stories')
55
57
  if (value = attributes[:'stories']).is_a?(Array)
56
58
  self.stories = value
57
59
  end
58
60
  end
59
- if attributes[:'clusters']
61
+
62
+ if attributes.has_key?(:'clusters')
60
63
  if (value = attributes[:'clusters']).is_a?(Array)
61
64
  self.clusters = value
62
65
  end
63
66
  end
64
- if attributes[:'next_page_cursor']
67
+
68
+ if attributes.has_key?(:'next_page_cursor')
65
69
  self.next_page_cursor = attributes[:'next_page_cursor']
66
70
  end
71
+
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properies with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ return invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ return true
67
85
  end
68
86
 
69
87
  # Checks equality by comparing each attribute.
70
- # @param [Object] Object to be compared
88
+ # @param [Object] Object to be compared
71
89
  def ==(o)
72
90
  return true if self.equal?(o)
73
91
  self.class == o.class &&
@@ -77,7 +95,7 @@ module AylienNewsApi
77
95
  end
78
96
 
79
97
  # @see the `==` method
80
- # @param [Object] Object to be compared
98
+ # @param [Object] Object to be compared
81
99
  def eql?(o)
82
100
  self == o
83
101
  end
@@ -176,7 +194,7 @@ module AylienNewsApi
176
194
 
177
195
  # Outputs non-array value in the form of hash
178
196
  # For object, use to_hash. Otherwise, just return the value
179
- # @param [Object] value Any valid value
197
+ # @param [Object] value Any valid value
180
198
  # @return [Hash] Returns the value in the form of hash
181
199
  def _to_hash(value)
182
200
  if value.is_a?(Array)
@@ -193,4 +211,5 @@ module AylienNewsApi
193
211
  end
194
212
 
195
213
  end
214
+
196
215
  end
@@ -15,8 +15,9 @@
15
15
  require 'date'
16
16
 
17
17
  module AylienNewsApi
18
+
18
19
  class Story
19
- # ID of the story which is unique identification
20
+ # ID of the story which is a unique identification
20
21
  attr_accessor :id
21
22
 
22
23
  # Title of the story
@@ -43,16 +44,16 @@ module AylienNewsApi
43
44
  # An array of suggested Story hashtags
44
45
  attr_accessor :hashtags
45
46
 
46
- # Characters count of the story body
47
+ # Character count of the story body
47
48
  attr_accessor :characters_count
48
49
 
49
- # Words count of the story body
50
+ # Word count of the story body
50
51
  attr_accessor :words_count
51
52
 
52
- # Sentences count of the story body
53
+ # Sentence count of the story body
53
54
  attr_accessor :sentences_count
54
55
 
55
- # Paragraphs count of the story body
56
+ # Paragraph count of the story body
56
57
  attr_accessor :paragraphs_count
57
58
 
58
59
  # Suggested categories for the story
@@ -76,6 +77,7 @@ module AylienNewsApi
76
77
  # Links which is related to the story
77
78
  attr_accessor :links
78
79
 
80
+
79
81
  # Attribute mapping from ruby-style variable name to JSON key.
80
82
  def self.attribute_map
81
83
  {
@@ -136,78 +138,111 @@ module AylienNewsApi
136
138
  # convert string to symbol for hash key
137
139
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
138
140
 
139
- if attributes[:'id']
141
+ if attributes.has_key?(:'id')
140
142
  self.id = attributes[:'id']
141
143
  end
142
- if attributes[:'title']
144
+
145
+ if attributes.has_key?(:'title')
143
146
  self.title = attributes[:'title']
144
147
  end
145
- if attributes[:'body']
148
+
149
+ if attributes.has_key?(:'body')
146
150
  self.body = attributes[:'body']
147
151
  end
148
- if attributes[:'summary']
152
+
153
+ if attributes.has_key?(:'summary')
149
154
  self.summary = attributes[:'summary']
150
155
  end
151
- if attributes[:'source']
156
+
157
+ if attributes.has_key?(:'source')
152
158
  self.source = attributes[:'source']
153
159
  end
154
- if attributes[:'author']
160
+
161
+ if attributes.has_key?(:'author')
155
162
  self.author = attributes[:'author']
156
163
  end
157
- if attributes[:'entities']
164
+
165
+ if attributes.has_key?(:'entities')
158
166
  self.entities = attributes[:'entities']
159
167
  end
160
- if attributes[:'keywords']
168
+
169
+ if attributes.has_key?(:'keywords')
161
170
  if (value = attributes[:'keywords']).is_a?(Array)
162
171
  self.keywords = value
163
172
  end
164
173
  end
165
- if attributes[:'hashtags']
174
+
175
+ if attributes.has_key?(:'hashtags')
166
176
  if (value = attributes[:'hashtags']).is_a?(Array)
167
177
  self.hashtags = value
168
178
  end
169
179
  end
170
- if attributes[:'characters_count']
180
+
181
+ if attributes.has_key?(:'characters_count')
171
182
  self.characters_count = attributes[:'characters_count']
172
183
  end
173
- if attributes[:'words_count']
184
+
185
+ if attributes.has_key?(:'words_count')
174
186
  self.words_count = attributes[:'words_count']
175
187
  end
176
- if attributes[:'sentences_count']
188
+
189
+ if attributes.has_key?(:'sentences_count')
177
190
  self.sentences_count = attributes[:'sentences_count']
178
191
  end
179
- if attributes[:'paragraphs_count']
192
+
193
+ if attributes.has_key?(:'paragraphs_count')
180
194
  self.paragraphs_count = attributes[:'paragraphs_count']
181
195
  end
182
- if attributes[:'categories']
196
+
197
+ if attributes.has_key?(:'categories')
183
198
  if (value = attributes[:'categories']).is_a?(Array)
184
199
  self.categories = value
185
200
  end
186
201
  end
187
- if attributes[:'social_shares_count']
202
+
203
+ if attributes.has_key?(:'social_shares_count')
188
204
  self.social_shares_count = attributes[:'social_shares_count']
189
205
  end
190
- if attributes[:'media']
206
+
207
+ if attributes.has_key?(:'media')
191
208
  if (value = attributes[:'media']).is_a?(Array)
192
209
  self.media = value
193
210
  end
194
211
  end
195
- if attributes[:'sentiment']
212
+
213
+ if attributes.has_key?(:'sentiment')
196
214
  self.sentiment = attributes[:'sentiment']
197
215
  end
198
- if attributes[:'language']
216
+
217
+ if attributes.has_key?(:'language')
199
218
  self.language = attributes[:'language']
200
219
  end
201
- if attributes[:'published_at']
220
+
221
+ if attributes.has_key?(:'published_at')
202
222
  self.published_at = attributes[:'published_at']
203
223
  end
204
- if attributes[:'links']
224
+
225
+ if attributes.has_key?(:'links')
205
226
  self.links = attributes[:'links']
206
227
  end
228
+
229
+ end
230
+
231
+ # Show invalid properties with the reasons. Usually used together with valid?
232
+ # @return Array for valid properies with the reasons
233
+ def list_invalid_properties
234
+ invalid_properties = Array.new
235
+ return invalid_properties
236
+ end
237
+
238
+ # Check to see if the all the properties in the model are valid
239
+ # @return true if the model is valid
240
+ def valid?
241
+ return true
207
242
  end
208
243
 
209
244
  # Checks equality by comparing each attribute.
210
- # @param [Object] Object to be compared
245
+ # @param [Object] Object to be compared
211
246
  def ==(o)
212
247
  return true if self.equal?(o)
213
248
  self.class == o.class &&
@@ -234,7 +269,7 @@ module AylienNewsApi
234
269
  end
235
270
 
236
271
  # @see the `==` method
237
- # @param [Object] Object to be compared
272
+ # @param [Object] Object to be compared
238
273
  def eql?(o)
239
274
  self == o
240
275
  end
@@ -333,7 +368,7 @@ module AylienNewsApi
333
368
 
334
369
  # Outputs non-array value in the form of hash
335
370
  # For object, use to_hash. Otherwise, just return the value
336
- # @param [Object] value Any valid value
371
+ # @param [Object] value Any valid value
337
372
  # @return [Hash] Returns the value in the form of hash
338
373
  def _to_hash(value)
339
374
  if value.is_a?(Array)
@@ -350,4 +385,5 @@ module AylienNewsApi
350
385
  end
351
386
 
352
387
  end
388
+
353
389
  end