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
@@ -0,0 +1,219 @@
|
|
1
|
+
=begin
|
2
|
+
#AYLIEN News API
|
3
|
+
|
4
|
+
#The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 3.0
|
7
|
+
Contact: support@aylien.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.1.3-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module AylienNewsApi
|
16
|
+
class Clusters
|
17
|
+
# The total number of clusters
|
18
|
+
attr_accessor :cluster_count
|
19
|
+
|
20
|
+
# An array of clusters
|
21
|
+
attr_accessor :clusters
|
22
|
+
|
23
|
+
# The next page cursor
|
24
|
+
attr_accessor :next_page_cursor
|
25
|
+
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
27
|
+
def self.attribute_map
|
28
|
+
{
|
29
|
+
:'cluster_count' => :'cluster_count',
|
30
|
+
:'clusters' => :'clusters',
|
31
|
+
:'next_page_cursor' => :'next_page_cursor'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'cluster_count' => :'Integer',
|
39
|
+
:'clusters' => :'Array<Cluster>',
|
40
|
+
:'next_page_cursor' => :'String'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Initializes the object
|
45
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
46
|
+
def initialize(attributes = {})
|
47
|
+
if (!attributes.is_a?(Hash))
|
48
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AylienNewsApi::Clusters` initialize method"
|
49
|
+
end
|
50
|
+
|
51
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
53
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
54
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `AylienNewsApi::Clusters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
55
|
+
end
|
56
|
+
h[k.to_sym] = v
|
57
|
+
}
|
58
|
+
|
59
|
+
if attributes.key?(:'cluster_count')
|
60
|
+
self.cluster_count = attributes[:'cluster_count']
|
61
|
+
end
|
62
|
+
|
63
|
+
if attributes.key?(:'clusters')
|
64
|
+
if (value = attributes[:'clusters']).is_a?(Array)
|
65
|
+
self.clusters = value
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.key?(:'next_page_cursor')
|
70
|
+
self.next_page_cursor = attributes[:'next_page_cursor']
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
75
|
+
# @return Array for valid properties with the reasons
|
76
|
+
def list_invalid_properties
|
77
|
+
invalid_properties = Array.new
|
78
|
+
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
|
+
true
|
85
|
+
end
|
86
|
+
|
87
|
+
# Checks equality by comparing each attribute.
|
88
|
+
# @param [Object] Object to be compared
|
89
|
+
def ==(o)
|
90
|
+
return true if self.equal?(o)
|
91
|
+
self.class == o.class &&
|
92
|
+
cluster_count == o.cluster_count &&
|
93
|
+
clusters == o.clusters &&
|
94
|
+
next_page_cursor == o.next_page_cursor
|
95
|
+
end
|
96
|
+
|
97
|
+
# @see the `==` method
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def eql?(o)
|
100
|
+
self == o
|
101
|
+
end
|
102
|
+
|
103
|
+
# Calculates hash code according to all attributes.
|
104
|
+
# @return [Integer] Hash code
|
105
|
+
def hash
|
106
|
+
[cluster_count, clusters, next_page_cursor].hash
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def self.build_from_hash(attributes)
|
113
|
+
new.build_from_hash(attributes)
|
114
|
+
end
|
115
|
+
|
116
|
+
# Builds the object from hash
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
+
# @return [Object] Returns the model itself
|
119
|
+
def build_from_hash(attributes)
|
120
|
+
return nil unless attributes.is_a?(Hash)
|
121
|
+
self.class.openapi_types.each_pair do |key, type|
|
122
|
+
if type =~ /\AArray<(.*)>/i
|
123
|
+
# check to ensure the input is an array given that the attribute
|
124
|
+
# is documented as an array but the input is not
|
125
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
126
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
127
|
+
end
|
128
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
129
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
130
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
131
|
+
end
|
132
|
+
|
133
|
+
self
|
134
|
+
end
|
135
|
+
|
136
|
+
# Deserializes the data based on type
|
137
|
+
# @param string type Data type
|
138
|
+
# @param string value Value to be deserialized
|
139
|
+
# @return [Object] Deserialized data
|
140
|
+
def _deserialize(type, value)
|
141
|
+
case type.to_sym
|
142
|
+
when :DateTime
|
143
|
+
DateTime.parse(value)
|
144
|
+
when :Date
|
145
|
+
Date.parse(value)
|
146
|
+
when :String
|
147
|
+
value.to_s
|
148
|
+
when :Integer
|
149
|
+
value.to_i
|
150
|
+
when :Float
|
151
|
+
value.to_f
|
152
|
+
when :Boolean
|
153
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
154
|
+
true
|
155
|
+
else
|
156
|
+
false
|
157
|
+
end
|
158
|
+
when :Object
|
159
|
+
# generic object (usually a Hash), return directly
|
160
|
+
value
|
161
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
162
|
+
inner_type = Regexp.last_match[:inner_type]
|
163
|
+
value.map { |v| _deserialize(inner_type, v) }
|
164
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
165
|
+
k_type = Regexp.last_match[:k_type]
|
166
|
+
v_type = Regexp.last_match[:v_type]
|
167
|
+
{}.tap do |hash|
|
168
|
+
value.each do |k, v|
|
169
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
else # model
|
173
|
+
AylienNewsApi.const_get(type).build_from_hash(value)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
# Returns the string representation of the object
|
178
|
+
# @return [String] String presentation of the object
|
179
|
+
def to_s
|
180
|
+
to_hash.to_s
|
181
|
+
end
|
182
|
+
|
183
|
+
# to_body is an alias to to_hash (backward compatibility)
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_body
|
186
|
+
to_hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Returns the object in the form of hash
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_hash
|
192
|
+
hash = {}
|
193
|
+
self.class.attribute_map.each_pair do |attr, param|
|
194
|
+
value = self.send(attr)
|
195
|
+
next if value.nil?
|
196
|
+
hash[param] = _to_hash(value)
|
197
|
+
end
|
198
|
+
hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Outputs non-array value in the form of hash
|
202
|
+
# For object, use to_hash. Otherwise, just return the value
|
203
|
+
# @param [Object] value Any valid value
|
204
|
+
# @return [Hash] Returns the value in the form of hash
|
205
|
+
def _to_hash(value)
|
206
|
+
if value.is_a?(Array)
|
207
|
+
value.compact.map { |v| _to_hash(v) }
|
208
|
+
elsif value.is_a?(Hash)
|
209
|
+
{}.tap do |hash|
|
210
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
211
|
+
end
|
212
|
+
elsif value.respond_to? :to_hash
|
213
|
+
value.to_hash
|
214
|
+
else
|
215
|
+
value
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
@@ -1,116 +1,105 @@
|
|
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 Coverages
|
22
|
-
#
|
23
|
-
attr_accessor :
|
17
|
+
# An array of coverages for the input story
|
18
|
+
attr_accessor :coverages
|
24
19
|
|
25
20
|
# The input story body
|
26
21
|
attr_accessor :story_body
|
27
22
|
|
28
|
-
# The input story published date
|
29
|
-
attr_accessor :story_published_at
|
30
|
-
|
31
23
|
# The input story language
|
32
24
|
attr_accessor :story_language
|
33
25
|
|
34
|
-
#
|
35
|
-
attr_accessor :
|
36
|
-
|
37
|
-
# An array of clusters
|
38
|
-
attr_accessor :clusters
|
26
|
+
# The input story published date
|
27
|
+
attr_accessor :story_published_at
|
39
28
|
|
29
|
+
# The input story title
|
30
|
+
attr_accessor :story_title
|
40
31
|
|
41
32
|
# Attribute mapping from ruby-style variable name to JSON key.
|
42
33
|
def self.attribute_map
|
43
34
|
{
|
44
|
-
:'
|
35
|
+
:'coverages' => :'coverages',
|
45
36
|
:'story_body' => :'story_body',
|
46
|
-
:'story_published_at' => :'story_published_at',
|
47
37
|
:'story_language' => :'story_language',
|
48
|
-
:'
|
49
|
-
:'
|
38
|
+
:'story_published_at' => :'story_published_at',
|
39
|
+
:'story_title' => :'story_title'
|
50
40
|
}
|
51
41
|
end
|
52
42
|
|
53
43
|
# Attribute type mapping.
|
54
|
-
def self.
|
44
|
+
def self.openapi_types
|
55
45
|
{
|
56
|
-
:'
|
46
|
+
:'coverages' => :'Array<Story>',
|
57
47
|
:'story_body' => :'String',
|
58
|
-
:'story_published_at' => :'DateTime',
|
59
48
|
:'story_language' => :'String',
|
60
|
-
:'
|
61
|
-
:'
|
49
|
+
:'story_published_at' => :'DateTime',
|
50
|
+
:'story_title' => :'String'
|
62
51
|
}
|
63
52
|
end
|
64
53
|
|
65
54
|
# Initializes the object
|
66
55
|
# @param [Hash] attributes Model attributes in the form of hash
|
67
56
|
def initialize(attributes = {})
|
68
|
-
|
57
|
+
if (!attributes.is_a?(Hash))
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AylienNewsApi::Coverages` initialize method"
|
59
|
+
end
|
69
60
|
|
70
|
-
# convert string to symbol for hash key
|
71
|
-
attributes = attributes.each_with_object({}){|(k,v), h|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
62
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
63
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
64
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `AylienNewsApi::Coverages`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
65
|
+
end
|
66
|
+
h[k.to_sym] = v
|
67
|
+
}
|
72
68
|
|
73
|
-
if attributes.
|
74
|
-
|
69
|
+
if attributes.key?(:'coverages')
|
70
|
+
if (value = attributes[:'coverages']).is_a?(Array)
|
71
|
+
self.coverages = value
|
72
|
+
end
|
75
73
|
end
|
76
74
|
|
77
|
-
if attributes.
|
75
|
+
if attributes.key?(:'story_body')
|
78
76
|
self.story_body = attributes[:'story_body']
|
79
77
|
end
|
80
78
|
|
81
|
-
if attributes.
|
82
|
-
self.story_published_at = attributes[:'story_published_at']
|
83
|
-
end
|
84
|
-
|
85
|
-
if attributes.has_key?(:'story_language')
|
79
|
+
if attributes.key?(:'story_language')
|
86
80
|
self.story_language = attributes[:'story_language']
|
87
81
|
end
|
88
82
|
|
89
|
-
if attributes.
|
90
|
-
|
91
|
-
self.coverages = value
|
92
|
-
end
|
83
|
+
if attributes.key?(:'story_published_at')
|
84
|
+
self.story_published_at = attributes[:'story_published_at']
|
93
85
|
end
|
94
86
|
|
95
|
-
if attributes.
|
96
|
-
|
97
|
-
self.clusters = value
|
98
|
-
end
|
87
|
+
if attributes.key?(:'story_title')
|
88
|
+
self.story_title = attributes[:'story_title']
|
99
89
|
end
|
100
|
-
|
101
90
|
end
|
102
91
|
|
103
92
|
# Show invalid properties with the reasons. Usually used together with valid?
|
104
|
-
# @return Array for valid
|
93
|
+
# @return Array for valid properties with the reasons
|
105
94
|
def list_invalid_properties
|
106
95
|
invalid_properties = Array.new
|
107
|
-
|
96
|
+
invalid_properties
|
108
97
|
end
|
109
98
|
|
110
99
|
# Check to see if the all the properties in the model are valid
|
111
100
|
# @return true if the model is valid
|
112
101
|
def valid?
|
113
|
-
|
102
|
+
true
|
114
103
|
end
|
115
104
|
|
116
105
|
# Checks equality by comparing each attribute.
|
@@ -118,12 +107,11 @@ module AylienNewsApi
|
|
118
107
|
def ==(o)
|
119
108
|
return true if self.equal?(o)
|
120
109
|
self.class == o.class &&
|
121
|
-
|
110
|
+
coverages == o.coverages &&
|
122
111
|
story_body == o.story_body &&
|
123
|
-
story_published_at == o.story_published_at &&
|
124
112
|
story_language == o.story_language &&
|
125
|
-
|
126
|
-
|
113
|
+
story_published_at == o.story_published_at &&
|
114
|
+
story_title == o.story_title
|
127
115
|
end
|
128
116
|
|
129
117
|
# @see the `==` method
|
@@ -133,9 +121,16 @@ module AylienNewsApi
|
|
133
121
|
end
|
134
122
|
|
135
123
|
# Calculates hash code according to all attributes.
|
136
|
-
# @return [
|
124
|
+
# @return [Integer] Hash code
|
137
125
|
def hash
|
138
|
-
[
|
126
|
+
[coverages, story_body, story_language, story_published_at, story_title].hash
|
127
|
+
end
|
128
|
+
|
129
|
+
# Builds the object from hash
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
131
|
+
# @return [Object] Returns the model itself
|
132
|
+
def self.build_from_hash(attributes)
|
133
|
+
new.build_from_hash(attributes)
|
139
134
|
end
|
140
135
|
|
141
136
|
# Builds the object from hash
|
@@ -143,12 +138,12 @@ module AylienNewsApi
|
|
143
138
|
# @return [Object] Returns the model itself
|
144
139
|
def build_from_hash(attributes)
|
145
140
|
return nil unless attributes.is_a?(Hash)
|
146
|
-
self.class.
|
141
|
+
self.class.openapi_types.each_pair do |key, type|
|
147
142
|
if type =~ /\AArray<(.*)>/i
|
148
|
-
# check to ensure the input is an array given that the
|
143
|
+
# check to ensure the input is an array given that the attribute
|
149
144
|
# is documented as an array but the input is not
|
150
145
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
151
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
146
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
152
147
|
end
|
153
148
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
154
149
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -174,7 +169,7 @@ module AylienNewsApi
|
|
174
169
|
value.to_i
|
175
170
|
when :Float
|
176
171
|
value.to_f
|
177
|
-
when :
|
172
|
+
when :Boolean
|
178
173
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
179
174
|
true
|
180
175
|
else
|
@@ -195,8 +190,7 @@ module AylienNewsApi
|
|
195
190
|
end
|
196
191
|
end
|
197
192
|
else # model
|
198
|
-
|
199
|
-
temp_model.build_from_hash(value)
|
193
|
+
AylienNewsApi.const_get(type).build_from_hash(value)
|
200
194
|
end
|
201
195
|
end
|
202
196
|
|
@@ -230,7 +224,7 @@ module AylienNewsApi
|
|
230
224
|
# @return [Hash] Returns the value in the form of hash
|
231
225
|
def _to_hash(value)
|
232
226
|
if value.is_a?(Array)
|
233
|
-
value.compact.map{ |v| _to_hash(v) }
|
227
|
+
value.compact.map { |v| _to_hash(v) }
|
234
228
|
elsif value.is_a?(Hash)
|
235
229
|
{}.tap do |hash|
|
236
230
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -241,7 +235,5 @@ module AylienNewsApi
|
|
241
235
|
value
|
242
236
|
end
|
243
237
|
end
|
244
|
-
|
245
238
|
end
|
246
|
-
|
247
239
|
end
|