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,217 @@
|
|
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 StoryTranslationsEn
|
17
|
+
# Translation of body
|
18
|
+
attr_accessor :body
|
19
|
+
|
20
|
+
# Translation of a concatenation of title and body
|
21
|
+
attr_accessor :text
|
22
|
+
|
23
|
+
# Translation of title
|
24
|
+
attr_accessor :title
|
25
|
+
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
27
|
+
def self.attribute_map
|
28
|
+
{
|
29
|
+
:'body' => :'body',
|
30
|
+
:'text' => :'text',
|
31
|
+
:'title' => :'title'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'body' => :'String',
|
39
|
+
:'text' => :'String',
|
40
|
+
:'title' => :'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::StoryTranslationsEn` 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::StoryTranslationsEn`. 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?(:'body')
|
60
|
+
self.body = attributes[:'body']
|
61
|
+
end
|
62
|
+
|
63
|
+
if attributes.key?(:'text')
|
64
|
+
self.text = attributes[:'text']
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.key?(:'title')
|
68
|
+
self.title = attributes[:'title']
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
73
|
+
# @return Array for valid properties with the reasons
|
74
|
+
def list_invalid_properties
|
75
|
+
invalid_properties = Array.new
|
76
|
+
invalid_properties
|
77
|
+
end
|
78
|
+
|
79
|
+
# Check to see if the all the properties in the model are valid
|
80
|
+
# @return true if the model is valid
|
81
|
+
def valid?
|
82
|
+
true
|
83
|
+
end
|
84
|
+
|
85
|
+
# Checks equality by comparing each attribute.
|
86
|
+
# @param [Object] Object to be compared
|
87
|
+
def ==(o)
|
88
|
+
return true if self.equal?(o)
|
89
|
+
self.class == o.class &&
|
90
|
+
body == o.body &&
|
91
|
+
text == o.text &&
|
92
|
+
title == o.title
|
93
|
+
end
|
94
|
+
|
95
|
+
# @see the `==` method
|
96
|
+
# @param [Object] Object to be compared
|
97
|
+
def eql?(o)
|
98
|
+
self == o
|
99
|
+
end
|
100
|
+
|
101
|
+
# Calculates hash code according to all attributes.
|
102
|
+
# @return [Integer] Hash code
|
103
|
+
def hash
|
104
|
+
[body, text, title].hash
|
105
|
+
end
|
106
|
+
|
107
|
+
# Builds the object from hash
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
+
# @return [Object] Returns the model itself
|
110
|
+
def self.build_from_hash(attributes)
|
111
|
+
new.build_from_hash(attributes)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Builds the object from hash
|
115
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
116
|
+
# @return [Object] Returns the model itself
|
117
|
+
def build_from_hash(attributes)
|
118
|
+
return nil unless attributes.is_a?(Hash)
|
119
|
+
self.class.openapi_types.each_pair do |key, type|
|
120
|
+
if type =~ /\AArray<(.*)>/i
|
121
|
+
# check to ensure the input is an array given that the attribute
|
122
|
+
# is documented as an array but the input is not
|
123
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
124
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
125
|
+
end
|
126
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
127
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
128
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
129
|
+
end
|
130
|
+
|
131
|
+
self
|
132
|
+
end
|
133
|
+
|
134
|
+
# Deserializes the data based on type
|
135
|
+
# @param string type Data type
|
136
|
+
# @param string value Value to be deserialized
|
137
|
+
# @return [Object] Deserialized data
|
138
|
+
def _deserialize(type, value)
|
139
|
+
case type.to_sym
|
140
|
+
when :DateTime
|
141
|
+
DateTime.parse(value)
|
142
|
+
when :Date
|
143
|
+
Date.parse(value)
|
144
|
+
when :String
|
145
|
+
value.to_s
|
146
|
+
when :Integer
|
147
|
+
value.to_i
|
148
|
+
when :Float
|
149
|
+
value.to_f
|
150
|
+
when :Boolean
|
151
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
152
|
+
true
|
153
|
+
else
|
154
|
+
false
|
155
|
+
end
|
156
|
+
when :Object
|
157
|
+
# generic object (usually a Hash), return directly
|
158
|
+
value
|
159
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
160
|
+
inner_type = Regexp.last_match[:inner_type]
|
161
|
+
value.map { |v| _deserialize(inner_type, v) }
|
162
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
163
|
+
k_type = Regexp.last_match[:k_type]
|
164
|
+
v_type = Regexp.last_match[:v_type]
|
165
|
+
{}.tap do |hash|
|
166
|
+
value.each do |k, v|
|
167
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
else # model
|
171
|
+
AylienNewsApi.const_get(type).build_from_hash(value)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Returns the string representation of the object
|
176
|
+
# @return [String] String presentation of the object
|
177
|
+
def to_s
|
178
|
+
to_hash.to_s
|
179
|
+
end
|
180
|
+
|
181
|
+
# to_body is an alias to to_hash (backward compatibility)
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
183
|
+
def to_body
|
184
|
+
to_hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the object in the form of hash
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_hash
|
190
|
+
hash = {}
|
191
|
+
self.class.attribute_map.each_pair do |attr, param|
|
192
|
+
value = self.send(attr)
|
193
|
+
next if value.nil?
|
194
|
+
hash[param] = _to_hash(value)
|
195
|
+
end
|
196
|
+
hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Outputs non-array value in the form of hash
|
200
|
+
# For object, use to_hash. Otherwise, just return the value
|
201
|
+
# @param [Object] value Any valid value
|
202
|
+
# @return [Hash] Returns the value in the form of hash
|
203
|
+
def _to_hash(value)
|
204
|
+
if value.is_a?(Array)
|
205
|
+
value.compact.map { |v| _to_hash(v) }
|
206
|
+
elsif value.is_a?(Hash)
|
207
|
+
{}.tap do |hash|
|
208
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
209
|
+
end
|
210
|
+
elsif value.respond_to? :to_hash
|
211
|
+
value.to_hash
|
212
|
+
else
|
213
|
+
value
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
@@ -1,28 +1,22 @@
|
|
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 Summary
|
22
17
|
# An array of the suggested summary sentences
|
23
18
|
attr_accessor :sentences
|
24
19
|
|
25
|
-
|
26
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
27
21
|
def self.attribute_map
|
28
22
|
{
|
@@ -31,7 +25,7 @@ module AylienNewsApi
|
|
31
25
|
end
|
32
26
|
|
33
27
|
# Attribute type mapping.
|
34
|
-
def self.
|
28
|
+
def self.openapi_types
|
35
29
|
{
|
36
30
|
:'sentences' => :'Array<String>'
|
37
31
|
}
|
@@ -40,30 +34,36 @@ module AylienNewsApi
|
|
40
34
|
# Initializes the object
|
41
35
|
# @param [Hash] attributes Model attributes in the form of hash
|
42
36
|
def initialize(attributes = {})
|
43
|
-
|
37
|
+
if (!attributes.is_a?(Hash))
|
38
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AylienNewsApi::Summary` initialize method"
|
39
|
+
end
|
44
40
|
|
45
|
-
# convert string to symbol for hash key
|
46
|
-
attributes = attributes.each_with_object({}){|(k,v), h|
|
41
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
42
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
43
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
44
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `AylienNewsApi::Summary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
45
|
+
end
|
46
|
+
h[k.to_sym] = v
|
47
|
+
}
|
47
48
|
|
48
|
-
if attributes.
|
49
|
+
if attributes.key?(:'sentences')
|
49
50
|
if (value = attributes[:'sentences']).is_a?(Array)
|
50
51
|
self.sentences = value
|
51
52
|
end
|
52
53
|
end
|
53
|
-
|
54
54
|
end
|
55
55
|
|
56
56
|
# Show invalid properties with the reasons. Usually used together with valid?
|
57
|
-
# @return Array for valid
|
57
|
+
# @return Array for valid properties with the reasons
|
58
58
|
def list_invalid_properties
|
59
59
|
invalid_properties = Array.new
|
60
|
-
|
60
|
+
invalid_properties
|
61
61
|
end
|
62
62
|
|
63
63
|
# Check to see if the all the properties in the model are valid
|
64
64
|
# @return true if the model is valid
|
65
65
|
def valid?
|
66
|
-
|
66
|
+
true
|
67
67
|
end
|
68
68
|
|
69
69
|
# Checks equality by comparing each attribute.
|
@@ -81,22 +81,29 @@ module AylienNewsApi
|
|
81
81
|
end
|
82
82
|
|
83
83
|
# Calculates hash code according to all attributes.
|
84
|
-
# @return [
|
84
|
+
# @return [Integer] Hash code
|
85
85
|
def hash
|
86
86
|
[sentences].hash
|
87
87
|
end
|
88
88
|
|
89
|
+
# Builds the object from hash
|
90
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
91
|
+
# @return [Object] Returns the model itself
|
92
|
+
def self.build_from_hash(attributes)
|
93
|
+
new.build_from_hash(attributes)
|
94
|
+
end
|
95
|
+
|
89
96
|
# Builds the object from hash
|
90
97
|
# @param [Hash] attributes Model attributes in the form of hash
|
91
98
|
# @return [Object] Returns the model itself
|
92
99
|
def build_from_hash(attributes)
|
93
100
|
return nil unless attributes.is_a?(Hash)
|
94
|
-
self.class.
|
101
|
+
self.class.openapi_types.each_pair do |key, type|
|
95
102
|
if type =~ /\AArray<(.*)>/i
|
96
|
-
# check to ensure the input is an array given that the
|
103
|
+
# check to ensure the input is an array given that the attribute
|
97
104
|
# is documented as an array but the input is not
|
98
105
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
99
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
106
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
100
107
|
end
|
101
108
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
102
109
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -122,7 +129,7 @@ module AylienNewsApi
|
|
122
129
|
value.to_i
|
123
130
|
when :Float
|
124
131
|
value.to_f
|
125
|
-
when :
|
132
|
+
when :Boolean
|
126
133
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
127
134
|
true
|
128
135
|
else
|
@@ -143,8 +150,7 @@ module AylienNewsApi
|
|
143
150
|
end
|
144
151
|
end
|
145
152
|
else # model
|
146
|
-
|
147
|
-
temp_model.build_from_hash(value)
|
153
|
+
AylienNewsApi.const_get(type).build_from_hash(value)
|
148
154
|
end
|
149
155
|
end
|
150
156
|
|
@@ -178,7 +184,7 @@ module AylienNewsApi
|
|
178
184
|
# @return [Hash] Returns the value in the form of hash
|
179
185
|
def _to_hash(value)
|
180
186
|
if value.is_a?(Array)
|
181
|
-
value.compact.map{ |v| _to_hash(v) }
|
187
|
+
value.compact.map { |v| _to_hash(v) }
|
182
188
|
elsif value.is_a?(Hash)
|
183
189
|
{}.tap do |hash|
|
184
190
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -189,7 +195,5 @@ module AylienNewsApi
|
|
189
195
|
value
|
190
196
|
end
|
191
197
|
end
|
192
|
-
|
193
198
|
end
|
194
|
-
|
195
199
|
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 TimeSeries
|
22
|
-
# The published date of the time series bin
|
23
|
-
attr_accessor :published_at
|
24
|
-
|
25
17
|
# The count of time series bin
|
26
18
|
attr_accessor :count
|
27
19
|
|
20
|
+
# The published date of the time series bin
|
21
|
+
attr_accessor :published_at
|
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
|
+
:'published_at' => :'published_at'
|
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
|
+
:'published_at' => :'DateTime'
|
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?(:'published_at')
|
54
|
-
self.published_at = attributes[:'published_at']
|
42
|
+
if (!attributes.is_a?(Hash))
|
43
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AylienNewsApi::TimeSeries` 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::TimeSeries`. 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?(:'published_at')
|
59
|
+
self.published_at = attributes[:'published_at']
|
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
|
+
published_at == o.published_at
|
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, published_at].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
|