aylien_news_api 0.4.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +1 -1
- data/Rakefile +8 -0
- data/aylien_news_api.gemspec +17 -13
- data/docs/DefaultApi.md +897 -611
- data/docs/StoryLinks.md +1 -0
- data/lib/aylien_news_api.rb +15 -13
- data/lib/aylien_news_api/api/default_api.rb +861 -344
- data/lib/aylien_news_api/api_client.rb +18 -15
- data/lib/aylien_news_api/api_error.rb +22 -18
- data/lib/aylien_news_api/configuration.rb +15 -13
- data/lib/aylien_news_api/models/author.rb +15 -13
- data/lib/aylien_news_api/models/autocomplete.rb +15 -13
- data/lib/aylien_news_api/models/autocompletes.rb +15 -13
- data/lib/aylien_news_api/models/category.rb +15 -13
- data/lib/aylien_news_api/models/category_links.rb +15 -13
- data/lib/aylien_news_api/models/coverages.rb +15 -13
- data/lib/aylien_news_api/models/entities.rb +15 -13
- data/lib/aylien_news_api/models/entity.rb +25 -23
- data/lib/aylien_news_api/models/entity_links.rb +15 -13
- data/lib/aylien_news_api/models/error.rb +15 -13
- data/lib/aylien_news_api/models/error_links.rb +15 -13
- data/lib/aylien_news_api/models/errors.rb +15 -13
- data/lib/aylien_news_api/models/histogram_interval.rb +15 -13
- data/lib/aylien_news_api/models/histograms.rb +15 -13
- data/lib/aylien_news_api/models/location.rb +15 -13
- data/lib/aylien_news_api/models/media.rb +15 -13
- data/lib/aylien_news_api/models/rank.rb +15 -13
- data/lib/aylien_news_api/models/rankings.rb +15 -13
- data/lib/aylien_news_api/models/related_stories.rb +15 -13
- data/lib/aylien_news_api/models/scope.rb +15 -13
- data/lib/aylien_news_api/models/sentiment.rb +25 -23
- data/lib/aylien_news_api/models/sentiments.rb +15 -13
- data/lib/aylien_news_api/models/share_count.rb +15 -13
- data/lib/aylien_news_api/models/share_counts.rb +15 -13
- data/lib/aylien_news_api/models/source.rb +15 -13
- data/lib/aylien_news_api/models/stories.rb +15 -13
- data/lib/aylien_news_api/models/story.rb +15 -13
- data/lib/aylien_news_api/models/story_cluster.rb +15 -13
- data/lib/aylien_news_api/models/story_links.rb +29 -17
- data/lib/aylien_news_api/models/summary.rb +15 -13
- data/lib/aylien_news_api/models/time_series.rb +15 -13
- data/lib/aylien_news_api/models/time_series_list.rb +15 -13
- data/lib/aylien_news_api/models/trend.rb +15 -13
- data/lib/aylien_news_api/models/trends.rb +15 -13
- data/lib/aylien_news_api/version.rb +16 -14
- data/spec/api/default_api_spec.rb +463 -189
- data/spec/api_client_spec.rb +25 -101
- data/spec/configuration_spec.rb +26 -19
- data/spec/models/author_spec.rb +19 -29
- data/spec/models/autocomplete_spec.rb +18 -24
- data/spec/models/autocompletes_spec.rb +17 -19
- data/spec/models/category_links_spec.rb +18 -24
- data/spec/models/category_spec.rb +26 -44
- data/spec/models/coverages_spec.rb +27 -39
- data/spec/models/entities_spec.rb +18 -24
- data/spec/models/entity_links_spec.rb +17 -19
- data/spec/models/entity_spec.rb +21 -39
- data/spec/models/error_links_spec.rb +17 -19
- data/spec/models/error_spec.rb +22 -44
- data/spec/models/errors_spec.rb +17 -19
- data/spec/models/histogram_interval_spec.rb +18 -24
- data/spec/models/histograms_spec.rb +21 -39
- data/spec/models/location_spec.rb +19 -29
- data/spec/models/media_spec.rb +50 -24
- data/spec/models/rank_spec.rb +15 -13
- data/spec/models/rankings_spec.rb +15 -13
- data/spec/models/related_stories_spec.rb +26 -34
- data/spec/models/scope_spec.rb +24 -34
- data/spec/models/sentiment_spec.rb +22 -24
- data/spec/models/sentiments_spec.rb +18 -24
- data/spec/models/share_count_spec.rb +18 -24
- data/spec/models/share_counts_spec.rb +20 -34
- data/spec/models/source_spec.rb +52 -44
- data/spec/models/stories_spec.rb +19 -29
- data/spec/models/story_cluster_spec.rb +21 -39
- data/spec/models/story_links_spec.rb +25 -29
- data/spec/models/story_spec.rb +36 -114
- data/spec/models/summary_spec.rb +17 -19
- data/spec/models/time_series_list_spec.rb +20 -34
- data/spec/models/time_series_spec.rb +18 -24
- data/spec/models/trend_spec.rb +18 -24
- data/spec/models/trends_spec.rb +18 -24
- data/spec/spec_helper.rb +15 -13
- metadata +25 -8
- data/Gemfile.lock +0 -65
- data/LICENSE +0 -13
- data/aylien_news_api-0.2.0.gem +0 -0
- data/aylien_news_api-0.3.0.gem +0 -0
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
=begin
|
2
|
+
Copyright 2017 Aylien, Inc. All Rights Reserved.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
=end
|
14
16
|
|
15
17
|
require 'date'
|
16
18
|
require 'json'
|
@@ -133,10 +135,11 @@ module AylienNewsApi
|
|
133
135
|
# application/json
|
134
136
|
# application/json; charset=UTF8
|
135
137
|
# APPLICATION/JSON
|
138
|
+
# */*
|
136
139
|
# @param [String] mime MIME
|
137
140
|
# @return [Boolean] True if the MIME is application/json
|
138
141
|
def json_mime?(mime)
|
139
|
-
!(mime =~ /\Aapplication\/json(;.*)?\z/i).nil?
|
142
|
+
(mime == "*/*") || !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil?
|
140
143
|
end
|
141
144
|
|
142
145
|
# Deserialize the response to the given return type.
|
@@ -303,7 +306,7 @@ module AylienNewsApi
|
|
303
306
|
|
304
307
|
# Sets user agent in HTTP header
|
305
308
|
#
|
306
|
-
# @param [String] user_agent User agent
|
309
|
+
# @param [String] user_agent User agent (e.g. aylien-news-api/ruby/1.0.0)
|
307
310
|
def user_agent=(user_agent)
|
308
311
|
@user_agent = user_agent
|
309
312
|
@default_headers['User-Agent'] = @user_agent
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
=begin
|
2
|
+
Copyright 2017 Aylien, Inc. All Rights Reserved.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
=end
|
14
16
|
|
15
17
|
module AylienNewsApi
|
16
18
|
class ApiError < StandardError
|
@@ -23,12 +25,14 @@ module AylienNewsApi
|
|
23
25
|
# ApiError.new(:code => 404, :message => "Not Found")
|
24
26
|
def initialize(arg = nil)
|
25
27
|
if arg.is_a? Hash
|
28
|
+
if arg.key?(:message) || arg.key?('message')
|
29
|
+
super(arg[:message] || arg['message'])
|
30
|
+
else
|
31
|
+
super arg
|
32
|
+
end
|
33
|
+
|
26
34
|
arg.each do |k, v|
|
27
|
-
|
28
|
-
super v
|
29
|
-
else
|
30
|
-
instance_variable_set "@#{k}", v
|
31
|
-
end
|
35
|
+
instance_variable_set "@#{k}", v
|
32
36
|
end
|
33
37
|
else
|
34
38
|
super arg
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
=begin
|
2
|
+
Copyright 2017 Aylien, Inc. All Rights Reserved.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
=end
|
14
16
|
|
15
17
|
require 'uri'
|
16
18
|
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
=begin
|
2
|
+
Copyright 2017 Aylien, Inc. All Rights Reserved.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
=end
|
14
16
|
|
15
17
|
require 'date'
|
16
18
|
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
=begin
|
2
|
+
Copyright 2017 Aylien, Inc. All Rights Reserved.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
=end
|
14
16
|
|
15
17
|
require 'date'
|
16
18
|
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
=begin
|
2
|
+
Copyright 2017 Aylien, Inc. All Rights Reserved.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
=end
|
14
16
|
|
15
17
|
require 'date'
|
16
18
|
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
=begin
|
2
|
+
Copyright 2017 Aylien, Inc. All Rights Reserved.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
=end
|
14
16
|
|
15
17
|
require 'date'
|
16
18
|
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
=begin
|
2
|
+
Copyright 2017 Aylien, Inc. All Rights Reserved.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
=end
|
14
16
|
|
15
17
|
require 'date'
|
16
18
|
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
=begin
|
2
|
+
Copyright 2017 Aylien, Inc. All Rights Reserved.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
=end
|
14
16
|
|
15
17
|
require 'date'
|
16
18
|
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
=begin
|
2
|
+
Copyright 2017 Aylien, Inc. All Rights Reserved.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
=end
|
14
16
|
|
15
17
|
require 'date'
|
16
18
|
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
=begin
|
2
|
+
Copyright 2017 Aylien, Inc. All Rights Reserved.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
=end
|
14
16
|
|
15
17
|
require 'date'
|
16
18
|
|
@@ -93,12 +95,12 @@ module AylienNewsApi
|
|
93
95
|
# @return Array for valid properies with the reasons
|
94
96
|
def list_invalid_properties
|
95
97
|
invalid_properties = Array.new
|
96
|
-
if !@score.nil? && @score > 1
|
97
|
-
invalid_properties.push("invalid value for 'score', must be smaller than or equal to 1.
|
98
|
+
if !@score.nil? && @score > 1
|
99
|
+
invalid_properties.push("invalid value for 'score', must be smaller than or equal to 1.")
|
98
100
|
end
|
99
101
|
|
100
|
-
if !@score.nil? && @score < 0
|
101
|
-
invalid_properties.push("invalid value for 'score', must be greater than or equal to 0.
|
102
|
+
if !@score.nil? && @score < 0
|
103
|
+
invalid_properties.push("invalid value for 'score', must be greater than or equal to 0.")
|
102
104
|
end
|
103
105
|
|
104
106
|
return invalid_properties
|
@@ -107,8 +109,8 @@ module AylienNewsApi
|
|
107
109
|
# Check to see if the all the properties in the model are valid
|
108
110
|
# @return true if the model is valid
|
109
111
|
def valid?
|
110
|
-
return false if !@score.nil? && @score > 1
|
111
|
-
return false if !@score.nil? && @score < 0
|
112
|
+
return false if !@score.nil? && @score > 1
|
113
|
+
return false if !@score.nil? && @score < 0
|
112
114
|
return true
|
113
115
|
end
|
114
116
|
|
@@ -116,12 +118,12 @@ module AylienNewsApi
|
|
116
118
|
# @param [Object] score Value to be assigned
|
117
119
|
def score=(score)
|
118
120
|
|
119
|
-
if !score.nil? && score > 1
|
120
|
-
fail ArgumentError, "invalid value for 'score', must be smaller than or equal to 1.
|
121
|
+
if !score.nil? && score > 1
|
122
|
+
fail ArgumentError, "invalid value for 'score', must be smaller than or equal to 1."
|
121
123
|
end
|
122
124
|
|
123
|
-
if !score.nil? && score < 0
|
124
|
-
fail ArgumentError, "invalid value for 'score', must be greater than or equal to 0.
|
125
|
+
if !score.nil? && score < 0
|
126
|
+
fail ArgumentError, "invalid value for 'score', must be greater than or equal to 0."
|
125
127
|
end
|
126
128
|
|
127
129
|
@score = score
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
=begin
|
2
|
+
Copyright 2017 Aylien, Inc. All Rights Reserved.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
=end
|
14
16
|
|
15
17
|
require 'date'
|
16
18
|
|