aylien_news_api 1.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/Gemfile +6 -0
- data/README.md +117 -4
- data/Rakefile +2 -0
- data/aylien_news_api.gemspec +16 -27
- data/docs/Author.md +12 -1
- data/docs/Autocomplete.md +10 -0
- data/docs/Autocompletes.md +9 -0
- data/docs/Category.md +17 -3
- data/docs/CategoryLinks.md +11 -1
- data/docs/Cluster.md +29 -0
- data/docs/Clusters.md +21 -0
- data/docs/Coverages.md +16 -4
- data/docs/DefaultApi.md +1250 -1117
- data/docs/Entities.md +11 -1
- data/docs/Entity.md +16 -3
- data/docs/EntityLinks.md +9 -0
- data/docs/Error.md +16 -2
- data/docs/ErrorLinks.md +9 -0
- data/docs/Errors.md +9 -0
- data/docs/HistogramInterval.md +10 -0
- data/docs/Histograms.md +16 -3
- data/docs/Location.md +13 -2
- data/docs/Media.md +17 -3
- data/docs/Rank.md +12 -1
- data/docs/Rankings.md +9 -0
- data/docs/RelatedStories.md +14 -3
- data/docs/RepresentativeStory.md +23 -0
- data/docs/Scope.md +14 -2
- data/docs/Sentiment.md +10 -0
- data/docs/Sentiments.md +12 -2
- data/docs/ShareCount.md +10 -0
- data/docs/ShareCounts.md +12 -0
- data/docs/Source.md +27 -8
- data/docs/Stories.md +11 -2
- data/docs/Story.md +48 -16
- data/docs/StoryCluster.md +14 -1
- data/docs/StoryLinks.md +14 -2
- data/docs/StoryTranslations.md +17 -0
- data/docs/StoryTranslationsEn.md +21 -0
- data/docs/Summary.md +9 -0
- data/docs/TimeSeries.md +11 -1
- data/docs/TimeSeriesList.md +15 -3
- data/docs/Trend.md +11 -1
- data/docs/Trends.md +11 -1
- data/git_push.sh +58 -0
- data/lib/aylien_news_api.rb +11 -10
- data/lib/aylien_news_api/api/default_api.rb +2065 -1801
- data/lib/aylien_news_api/api_client.rb +129 -108
- data/lib/aylien_news_api/api_error.rb +25 -10
- data/lib/aylien_news_api/configuration.rb +69 -33
- data/lib/aylien_news_api/models/author.rb +50 -46
- data/lib/aylien_news_api/models/autocomplete.rb +36 -32
- data/lib/aylien_news_api/models/autocompletes.rb +35 -31
- data/lib/aylien_news_api/models/category.rb +63 -59
- data/lib/aylien_news_api/models/category_links.rb +47 -43
- data/lib/aylien_news_api/models/cluster.rb +255 -0
- data/lib/aylien_news_api/models/clusters.rb +219 -0
- data/lib/aylien_news_api/models/coverages.rb +60 -68
- data/lib/aylien_news_api/models/entities.rb +48 -44
- data/lib/aylien_news_api/models/entity.rb +71 -69
- data/lib/aylien_news_api/models/entity_links.rb +35 -31
- data/lib/aylien_news_api/models/error.rb +60 -56
- data/lib/aylien_news_api/models/error_links.rb +35 -31
- data/lib/aylien_news_api/models/errors.rb +35 -31
- data/lib/aylien_news_api/models/histogram_interval.rb +36 -32
- data/lib/aylien_news_api/models/histograms.rb +62 -58
- data/lib/aylien_news_api/models/location.rb +51 -47
- data/lib/aylien_news_api/models/media.rb +81 -76
- data/lib/aylien_news_api/models/rank.rb +48 -44
- data/lib/aylien_news_api/models/rankings.rb +35 -31
- data/lib/aylien_news_api/models/related_stories.rb +53 -61
- data/lib/aylien_news_api/models/representative_story.rb +227 -0
- data/lib/aylien_news_api/models/scope.rb +59 -54
- data/lib/aylien_news_api/models/sentiment.rb +41 -37
- data/lib/aylien_news_api/models/sentiments.rb +46 -44
- data/lib/aylien_news_api/models/share_count.rb +36 -32
- data/lib/aylien_news_api/models/share_counts.rb +38 -34
- data/lib/aylien_news_api/models/source.rb +95 -92
- data/lib/aylien_news_api/models/stories.rb +47 -55
- data/lib/aylien_news_api/models/story.rb +172 -154
- data/lib/aylien_news_api/models/story_cluster.rb +52 -48
- data/lib/aylien_news_api/models/story_links.rb +58 -54
- data/lib/aylien_news_api/models/story_translations.rb +197 -0
- data/lib/aylien_news_api/models/story_translations_en.rb +217 -0
- data/lib/aylien_news_api/models/summary.rb +35 -31
- data/lib/aylien_news_api/models/time_series.rb +47 -43
- data/lib/aylien_news_api/models/time_series_list.rb +56 -52
- data/lib/aylien_news_api/models/trend.rb +47 -43
- data/lib/aylien_news_api/models/trends.rb +48 -44
- data/lib/aylien_news_api/version.rb +7 -11
- data/spec/api/default_api_spec.rb +569 -533
- data/spec/api_client_spec.rb +34 -76
- data/spec/configuration_spec.rb +14 -18
- data/spec/models/author_spec.rb +15 -18
- data/spec/models/autocomplete_spec.rb +11 -14
- data/spec/models/autocompletes_spec.rb +10 -13
- data/spec/models/category_links_spec.rb +13 -16
- data/spec/models/category_spec.rb +24 -27
- data/spec/models/cluster_spec.rb +77 -0
- data/spec/models/clusters_spec.rb +53 -0
- data/spec/models/coverages_spec.rb +17 -26
- data/spec/models/entities_spec.rb +13 -16
- data/spec/models/entity_links_spec.rb +10 -13
- data/spec/models/entity_spec.rb +19 -22
- data/spec/models/error_links_spec.rb +10 -13
- data/spec/models/error_spec.rb +21 -24
- data/spec/models/errors_spec.rb +10 -13
- data/spec/models/histogram_interval_spec.rb +11 -14
- data/spec/models/histograms_spec.rb +18 -21
- data/spec/models/location_spec.rb +15 -18
- data/spec/models/media_spec.rb +29 -32
- data/spec/models/rank_spec.rb +15 -18
- data/spec/models/rankings_spec.rb +10 -13
- data/spec/models/related_stories_spec.rb +15 -24
- data/spec/models/representative_story_spec.rb +59 -0
- data/spec/models/scope_spec.rb +21 -24
- data/spec/models/sentiment_spec.rb +15 -18
- data/spec/models/sentiments_spec.rb +13 -16
- data/spec/models/share_count_spec.rb +11 -14
- data/spec/models/share_counts_spec.rb +13 -16
- data/spec/models/source_spec.rb +29 -32
- data/spec/models/stories_spec.rb +13 -22
- data/spec/models/story_cluster_spec.rb +17 -20
- data/spec/models/story_links_spec.rb +17 -20
- data/spec/models/story_spec.rb +59 -50
- data/spec/models/story_translations_en_spec.rb +53 -0
- data/spec/models/story_translations_spec.rb +41 -0
- data/spec/models/summary_spec.rb +10 -13
- data/spec/models/time_series_list_spec.rb +16 -19
- data/spec/models/time_series_spec.rb +13 -16
- data/spec/models/trend_spec.rb +13 -16
- data/spec/models/trends_spec.rb +13 -16
- data/spec/spec_helper.rb +6 -10
- metadata +68 -194
@@ -1,96 +1,96 @@
|
|
1
1
|
=begin
|
2
|
-
|
2
|
+
#AYLIEN News API
|
3
3
|
|
4
|
-
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
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.
|
7
5
|
|
8
|
-
|
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: 4.1.3-SNAPSHOT
|
9
10
|
|
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
11
|
=end
|
16
12
|
|
17
13
|
require 'date'
|
18
14
|
|
19
15
|
module AylienNewsApi
|
20
|
-
|
21
16
|
class TimeSeriesList
|
22
|
-
#
|
23
|
-
attr_accessor :time_series
|
24
|
-
|
25
|
-
# The size of each date range expressed as an interval to be added to the lower bound.
|
17
|
+
# The size of each date range expressed as an interval to be added to the lower bound.
|
26
18
|
attr_accessor :period
|
27
19
|
|
28
|
-
# The start published date of the time series
|
29
|
-
attr_accessor :published_at_start
|
30
|
-
|
31
20
|
# The end published date of the time series
|
32
21
|
attr_accessor :published_at_end
|
33
22
|
|
23
|
+
# The start published date of the time series
|
24
|
+
attr_accessor :published_at_start
|
25
|
+
|
26
|
+
# An array of time series
|
27
|
+
attr_accessor :time_series
|
34
28
|
|
35
29
|
# Attribute mapping from ruby-style variable name to JSON key.
|
36
30
|
def self.attribute_map
|
37
31
|
{
|
38
|
-
:'time_series' => :'time_series',
|
39
32
|
:'period' => :'period',
|
33
|
+
:'published_at_end' => :'published_at.end',
|
40
34
|
:'published_at_start' => :'published_at.start',
|
41
|
-
:'
|
35
|
+
:'time_series' => :'time_series'
|
42
36
|
}
|
43
37
|
end
|
44
38
|
|
45
39
|
# Attribute type mapping.
|
46
|
-
def self.
|
40
|
+
def self.openapi_types
|
47
41
|
{
|
48
|
-
:'time_series' => :'Array<TimeSeries>',
|
49
42
|
:'period' => :'String',
|
43
|
+
:'published_at_end' => :'DateTime',
|
50
44
|
:'published_at_start' => :'DateTime',
|
51
|
-
:'
|
45
|
+
:'time_series' => :'Array<TimeSeries>'
|
52
46
|
}
|
53
47
|
end
|
54
48
|
|
55
49
|
# Initializes the object
|
56
50
|
# @param [Hash] attributes Model attributes in the form of hash
|
57
51
|
def initialize(attributes = {})
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AylienNewsApi::TimeSeriesList` initialize method"
|
54
|
+
end
|
62
55
|
|
63
|
-
if
|
64
|
-
|
65
|
-
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `AylienNewsApi::TimeSeriesList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
66
60
|
end
|
67
|
-
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
68
63
|
|
69
|
-
if attributes.
|
64
|
+
if attributes.key?(:'period')
|
70
65
|
self.period = attributes[:'period']
|
71
66
|
end
|
72
67
|
|
73
|
-
if attributes.
|
74
|
-
self.
|
68
|
+
if attributes.key?(:'published_at_end')
|
69
|
+
self.published_at_end = attributes[:'published_at_end']
|
75
70
|
end
|
76
71
|
|
77
|
-
if attributes.
|
78
|
-
self.
|
72
|
+
if attributes.key?(:'published_at_start')
|
73
|
+
self.published_at_start = attributes[:'published_at_start']
|
79
74
|
end
|
80
75
|
|
76
|
+
if attributes.key?(:'time_series')
|
77
|
+
if (value = attributes[:'time_series']).is_a?(Array)
|
78
|
+
self.time_series = value
|
79
|
+
end
|
80
|
+
end
|
81
81
|
end
|
82
82
|
|
83
83
|
# Show invalid properties with the reasons. Usually used together with valid?
|
84
|
-
# @return Array for valid
|
84
|
+
# @return Array for valid properties with the reasons
|
85
85
|
def list_invalid_properties
|
86
86
|
invalid_properties = Array.new
|
87
|
-
|
87
|
+
invalid_properties
|
88
88
|
end
|
89
89
|
|
90
90
|
# Check to see if the all the properties in the model are valid
|
91
91
|
# @return true if the model is valid
|
92
92
|
def valid?
|
93
|
-
|
93
|
+
true
|
94
94
|
end
|
95
95
|
|
96
96
|
# Checks equality by comparing each attribute.
|
@@ -98,10 +98,10 @@ module AylienNewsApi
|
|
98
98
|
def ==(o)
|
99
99
|
return true if self.equal?(o)
|
100
100
|
self.class == o.class &&
|
101
|
-
time_series == o.time_series &&
|
102
101
|
period == o.period &&
|
102
|
+
published_at_end == o.published_at_end &&
|
103
103
|
published_at_start == o.published_at_start &&
|
104
|
-
|
104
|
+
time_series == o.time_series
|
105
105
|
end
|
106
106
|
|
107
107
|
# @see the `==` method
|
@@ -111,9 +111,16 @@ module AylienNewsApi
|
|
111
111
|
end
|
112
112
|
|
113
113
|
# Calculates hash code according to all attributes.
|
114
|
-
# @return [
|
114
|
+
# @return [Integer] Hash code
|
115
115
|
def hash
|
116
|
-
[
|
116
|
+
[period, published_at_end, published_at_start, time_series].hash
|
117
|
+
end
|
118
|
+
|
119
|
+
# Builds the object from hash
|
120
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
121
|
+
# @return [Object] Returns the model itself
|
122
|
+
def self.build_from_hash(attributes)
|
123
|
+
new.build_from_hash(attributes)
|
117
124
|
end
|
118
125
|
|
119
126
|
# Builds the object from hash
|
@@ -121,12 +128,12 @@ module AylienNewsApi
|
|
121
128
|
# @return [Object] Returns the model itself
|
122
129
|
def build_from_hash(attributes)
|
123
130
|
return nil unless attributes.is_a?(Hash)
|
124
|
-
self.class.
|
131
|
+
self.class.openapi_types.each_pair do |key, type|
|
125
132
|
if type =~ /\AArray<(.*)>/i
|
126
|
-
# check to ensure the input is an array given that the
|
133
|
+
# check to ensure the input is an array given that the attribute
|
127
134
|
# is documented as an array but the input is not
|
128
135
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
129
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
136
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
130
137
|
end
|
131
138
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
132
139
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -152,7 +159,7 @@ module AylienNewsApi
|
|
152
159
|
value.to_i
|
153
160
|
when :Float
|
154
161
|
value.to_f
|
155
|
-
when :
|
162
|
+
when :Boolean
|
156
163
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
157
164
|
true
|
158
165
|
else
|
@@ -173,8 +180,7 @@ module AylienNewsApi
|
|
173
180
|
end
|
174
181
|
end
|
175
182
|
else # model
|
176
|
-
|
177
|
-
temp_model.build_from_hash(value)
|
183
|
+
AylienNewsApi.const_get(type).build_from_hash(value)
|
178
184
|
end
|
179
185
|
end
|
180
186
|
|
@@ -208,7 +214,7 @@ module AylienNewsApi
|
|
208
214
|
# @return [Hash] Returns the value in the form of hash
|
209
215
|
def _to_hash(value)
|
210
216
|
if value.is_a?(Array)
|
211
|
-
value.compact.map{ |v| _to_hash(v) }
|
217
|
+
value.compact.map { |v| _to_hash(v) }
|
212
218
|
elsif value.is_a?(Hash)
|
213
219
|
{}.tap do |hash|
|
214
220
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -219,7 +225,5 @@ module AylienNewsApi
|
|
219
225
|
value
|
220
226
|
end
|
221
227
|
end
|
222
|
-
|
223
228
|
end
|
224
|
-
|
225
229
|
end
|
@@ -1,76 +1,76 @@
|
|
1
1
|
=begin
|
2
|
-
|
2
|
+
#AYLIEN News API
|
3
3
|
|
4
|
-
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
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.
|
7
5
|
|
8
|
-
|
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: 4.1.3-SNAPSHOT
|
9
10
|
|
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
11
|
=end
|
16
12
|
|
17
13
|
require 'date'
|
18
14
|
|
19
15
|
module AylienNewsApi
|
20
|
-
|
21
16
|
class Trend
|
22
|
-
# The value of the trend
|
23
|
-
attr_accessor :value
|
24
|
-
|
25
17
|
# The count of the trend
|
26
18
|
attr_accessor :count
|
27
19
|
|
20
|
+
# The value of the trend
|
21
|
+
attr_accessor :value
|
28
22
|
|
29
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
30
24
|
def self.attribute_map
|
31
25
|
{
|
32
|
-
:'
|
33
|
-
:'
|
26
|
+
:'count' => :'count',
|
27
|
+
:'value' => :'value'
|
34
28
|
}
|
35
29
|
end
|
36
30
|
|
37
31
|
# Attribute type mapping.
|
38
|
-
def self.
|
32
|
+
def self.openapi_types
|
39
33
|
{
|
40
|
-
:'
|
41
|
-
:'
|
34
|
+
:'count' => :'Integer',
|
35
|
+
:'value' => :'String'
|
42
36
|
}
|
43
37
|
end
|
44
38
|
|
45
39
|
# Initializes the object
|
46
40
|
# @param [Hash] attributes Model attributes in the form of hash
|
47
41
|
def initialize(attributes = {})
|
48
|
-
|
49
|
-
|
50
|
-
# convert string to symbol for hash key
|
51
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
52
|
-
|
53
|
-
if attributes.has_key?(:'value')
|
54
|
-
self.value = attributes[:'value']
|
42
|
+
if (!attributes.is_a?(Hash))
|
43
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AylienNewsApi::Trend` initialize method"
|
55
44
|
end
|
56
45
|
|
57
|
-
if
|
46
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
47
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
48
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
49
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `AylienNewsApi::Trend`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
50
|
+
end
|
51
|
+
h[k.to_sym] = v
|
52
|
+
}
|
53
|
+
|
54
|
+
if attributes.key?(:'count')
|
58
55
|
self.count = attributes[:'count']
|
59
56
|
end
|
60
57
|
|
58
|
+
if attributes.key?(:'value')
|
59
|
+
self.value = attributes[:'value']
|
60
|
+
end
|
61
61
|
end
|
62
62
|
|
63
63
|
# Show invalid properties with the reasons. Usually used together with valid?
|
64
|
-
# @return Array for valid
|
64
|
+
# @return Array for valid properties with the reasons
|
65
65
|
def list_invalid_properties
|
66
66
|
invalid_properties = Array.new
|
67
|
-
|
67
|
+
invalid_properties
|
68
68
|
end
|
69
69
|
|
70
70
|
# Check to see if the all the properties in the model are valid
|
71
71
|
# @return true if the model is valid
|
72
72
|
def valid?
|
73
|
-
|
73
|
+
true
|
74
74
|
end
|
75
75
|
|
76
76
|
# Checks equality by comparing each attribute.
|
@@ -78,8 +78,8 @@ module AylienNewsApi
|
|
78
78
|
def ==(o)
|
79
79
|
return true if self.equal?(o)
|
80
80
|
self.class == o.class &&
|
81
|
-
|
82
|
-
|
81
|
+
count == o.count &&
|
82
|
+
value == o.value
|
83
83
|
end
|
84
84
|
|
85
85
|
# @see the `==` method
|
@@ -89,9 +89,16 @@ module AylienNewsApi
|
|
89
89
|
end
|
90
90
|
|
91
91
|
# Calculates hash code according to all attributes.
|
92
|
-
# @return [
|
92
|
+
# @return [Integer] Hash code
|
93
93
|
def hash
|
94
|
-
[
|
94
|
+
[count, value].hash
|
95
|
+
end
|
96
|
+
|
97
|
+
# Builds the object from hash
|
98
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
+
# @return [Object] Returns the model itself
|
100
|
+
def self.build_from_hash(attributes)
|
101
|
+
new.build_from_hash(attributes)
|
95
102
|
end
|
96
103
|
|
97
104
|
# Builds the object from hash
|
@@ -99,12 +106,12 @@ module AylienNewsApi
|
|
99
106
|
# @return [Object] Returns the model itself
|
100
107
|
def build_from_hash(attributes)
|
101
108
|
return nil unless attributes.is_a?(Hash)
|
102
|
-
self.class.
|
109
|
+
self.class.openapi_types.each_pair do |key, type|
|
103
110
|
if type =~ /\AArray<(.*)>/i
|
104
|
-
# check to ensure the input is an array given that the
|
111
|
+
# check to ensure the input is an array given that the attribute
|
105
112
|
# is documented as an array but the input is not
|
106
113
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
107
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
114
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
108
115
|
end
|
109
116
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
110
117
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -130,7 +137,7 @@ module AylienNewsApi
|
|
130
137
|
value.to_i
|
131
138
|
when :Float
|
132
139
|
value.to_f
|
133
|
-
when :
|
140
|
+
when :Boolean
|
134
141
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
135
142
|
true
|
136
143
|
else
|
@@ -151,8 +158,7 @@ module AylienNewsApi
|
|
151
158
|
end
|
152
159
|
end
|
153
160
|
else # model
|
154
|
-
|
155
|
-
temp_model.build_from_hash(value)
|
161
|
+
AylienNewsApi.const_get(type).build_from_hash(value)
|
156
162
|
end
|
157
163
|
end
|
158
164
|
|
@@ -186,7 +192,7 @@ module AylienNewsApi
|
|
186
192
|
# @return [Hash] Returns the value in the form of hash
|
187
193
|
def _to_hash(value)
|
188
194
|
if value.is_a?(Array)
|
189
|
-
value.compact.map{ |v| _to_hash(v) }
|
195
|
+
value.compact.map { |v| _to_hash(v) }
|
190
196
|
elsif value.is_a?(Hash)
|
191
197
|
{}.tap do |hash|
|
192
198
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -197,7 +203,5 @@ module AylienNewsApi
|
|
197
203
|
value
|
198
204
|
end
|
199
205
|
end
|
200
|
-
|
201
206
|
end
|
202
|
-
|
203
207
|
end
|
@@ -1,78 +1,78 @@
|
|
1
1
|
=begin
|
2
|
-
|
2
|
+
#AYLIEN News API
|
3
3
|
|
4
|
-
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
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.
|
7
5
|
|
8
|
-
|
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: 4.1.3-SNAPSHOT
|
9
10
|
|
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
11
|
=end
|
16
12
|
|
17
13
|
require 'date'
|
18
14
|
|
19
15
|
module AylienNewsApi
|
20
|
-
|
21
16
|
class Trends
|
22
|
-
# An array of trends
|
23
|
-
attr_accessor :trends
|
24
|
-
|
25
17
|
# The field of trends
|
26
18
|
attr_accessor :field
|
27
19
|
|
20
|
+
# An array of trends
|
21
|
+
attr_accessor :trends
|
28
22
|
|
29
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
30
24
|
def self.attribute_map
|
31
25
|
{
|
32
|
-
:'
|
33
|
-
:'
|
26
|
+
:'field' => :'field',
|
27
|
+
:'trends' => :'trends'
|
34
28
|
}
|
35
29
|
end
|
36
30
|
|
37
31
|
# Attribute type mapping.
|
38
|
-
def self.
|
32
|
+
def self.openapi_types
|
39
33
|
{
|
40
|
-
:'
|
41
|
-
:'
|
34
|
+
:'field' => :'String',
|
35
|
+
:'trends' => :'Array<Trend>'
|
42
36
|
}
|
43
37
|
end
|
44
38
|
|
45
39
|
# Initializes the object
|
46
40
|
# @param [Hash] attributes Model attributes in the form of hash
|
47
41
|
def initialize(attributes = {})
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
42
|
+
if (!attributes.is_a?(Hash))
|
43
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AylienNewsApi::Trends` initialize method"
|
44
|
+
end
|
52
45
|
|
53
|
-
if
|
54
|
-
|
55
|
-
|
46
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
47
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
48
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
49
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `AylienNewsApi::Trends`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
50
|
end
|
57
|
-
|
51
|
+
h[k.to_sym] = v
|
52
|
+
}
|
58
53
|
|
59
|
-
if attributes.
|
54
|
+
if attributes.key?(:'field')
|
60
55
|
self.field = attributes[:'field']
|
61
56
|
end
|
62
57
|
|
58
|
+
if attributes.key?(:'trends')
|
59
|
+
if (value = attributes[:'trends']).is_a?(Array)
|
60
|
+
self.trends = value
|
61
|
+
end
|
62
|
+
end
|
63
63
|
end
|
64
64
|
|
65
65
|
# Show invalid properties with the reasons. Usually used together with valid?
|
66
|
-
# @return Array for valid
|
66
|
+
# @return Array for valid properties with the reasons
|
67
67
|
def list_invalid_properties
|
68
68
|
invalid_properties = Array.new
|
69
|
-
|
69
|
+
invalid_properties
|
70
70
|
end
|
71
71
|
|
72
72
|
# Check to see if the all the properties in the model are valid
|
73
73
|
# @return true if the model is valid
|
74
74
|
def valid?
|
75
|
-
|
75
|
+
true
|
76
76
|
end
|
77
77
|
|
78
78
|
# Checks equality by comparing each attribute.
|
@@ -80,8 +80,8 @@ module AylienNewsApi
|
|
80
80
|
def ==(o)
|
81
81
|
return true if self.equal?(o)
|
82
82
|
self.class == o.class &&
|
83
|
-
|
84
|
-
|
83
|
+
field == o.field &&
|
84
|
+
trends == o.trends
|
85
85
|
end
|
86
86
|
|
87
87
|
# @see the `==` method
|
@@ -91,9 +91,16 @@ module AylienNewsApi
|
|
91
91
|
end
|
92
92
|
|
93
93
|
# Calculates hash code according to all attributes.
|
94
|
-
# @return [
|
94
|
+
# @return [Integer] Hash code
|
95
95
|
def hash
|
96
|
-
[
|
96
|
+
[field, trends].hash
|
97
|
+
end
|
98
|
+
|
99
|
+
# Builds the object from hash
|
100
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
101
|
+
# @return [Object] Returns the model itself
|
102
|
+
def self.build_from_hash(attributes)
|
103
|
+
new.build_from_hash(attributes)
|
97
104
|
end
|
98
105
|
|
99
106
|
# Builds the object from hash
|
@@ -101,12 +108,12 @@ module AylienNewsApi
|
|
101
108
|
# @return [Object] Returns the model itself
|
102
109
|
def build_from_hash(attributes)
|
103
110
|
return nil unless attributes.is_a?(Hash)
|
104
|
-
self.class.
|
111
|
+
self.class.openapi_types.each_pair do |key, type|
|
105
112
|
if type =~ /\AArray<(.*)>/i
|
106
|
-
# check to ensure the input is an array given that the
|
113
|
+
# check to ensure the input is an array given that the attribute
|
107
114
|
# is documented as an array but the input is not
|
108
115
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
109
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
116
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
110
117
|
end
|
111
118
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
112
119
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -132,7 +139,7 @@ module AylienNewsApi
|
|
132
139
|
value.to_i
|
133
140
|
when :Float
|
134
141
|
value.to_f
|
135
|
-
when :
|
142
|
+
when :Boolean
|
136
143
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
137
144
|
true
|
138
145
|
else
|
@@ -153,8 +160,7 @@ module AylienNewsApi
|
|
153
160
|
end
|
154
161
|
end
|
155
162
|
else # model
|
156
|
-
|
157
|
-
temp_model.build_from_hash(value)
|
163
|
+
AylienNewsApi.const_get(type).build_from_hash(value)
|
158
164
|
end
|
159
165
|
end
|
160
166
|
|
@@ -188,7 +194,7 @@ module AylienNewsApi
|
|
188
194
|
# @return [Hash] Returns the value in the form of hash
|
189
195
|
def _to_hash(value)
|
190
196
|
if value.is_a?(Array)
|
191
|
-
value.compact.map{ |v| _to_hash(v) }
|
197
|
+
value.compact.map { |v| _to_hash(v) }
|
192
198
|
elsif value.is_a?(Hash)
|
193
199
|
{}.tap do |hash|
|
194
200
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -199,7 +205,5 @@ module AylienNewsApi
|
|
199
205
|
value
|
200
206
|
end
|
201
207
|
end
|
202
|
-
|
203
208
|
end
|
204
|
-
|
205
209
|
end
|