aylien_news_api 0.4.0 → 4.1.1
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 +7 -1
- data/README.md +117 -4
- data/Rakefile +10 -0
- data/aylien_news_api.gemspec +20 -28
- data/docs/Author.md +12 -1
- data/docs/Autocomplete.md +10 -0
- data/docs/Autocompletes.md +9 -0
- data/docs/Category.md +19 -3
- data/docs/CategoryLinks.md +11 -1
- data/docs/CategoryTaxonomy.md +16 -0
- data/docs/Cluster.md +29 -0
- data/docs/Clusters.md +21 -0
- data/docs/Coverages.md +16 -4
- data/docs/DefaultApi.md +1299 -826
- 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 +11 -0
- data/docs/Errors.md +9 -0
- data/docs/HistogramInterval.md +10 -0
- data/docs/Histograms.md +20 -3
- data/docs/Location.md +13 -2
- data/docs/Media.md +18 -4
- data/docs/MediaFormat.md +16 -0
- data/docs/MediaType.md +16 -0
- data/docs/Rank.md +12 -1
- data/docs/Rankings.md +9 -0
- data/docs/RelatedStories.md +18 -3
- data/docs/RepresentativeStory.md +23 -0
- data/docs/Scope.md +15 -3
- data/docs/ScopeLevel.md +16 -0
- data/docs/Sentiment.md +11 -1
- data/docs/SentimentPolarity.md +16 -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 +17 -2
- data/docs/Story.md +48 -16
- data/docs/StoryCluster.md +14 -1
- data/docs/StoryLinks.md +14 -1
- data/docs/StoryTranslation.md +19 -0
- 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 +15 -1
- data/docs/Warning.md +21 -0
- data/git_push.sh +58 -0
- data/lib/aylien_news_api.rb +22 -14
- data/lib/aylien_news_api/api/default_api.rb +2407 -1520
- data/lib/aylien_news_api/api_client.rb +137 -111
- data/lib/aylien_news_api/api_error.rb +37 -18
- data/lib/aylien_news_api/configuration.rb +74 -36
- data/lib/aylien_news_api/models/author.rb +66 -50
- data/lib/aylien_news_api/models/autocomplete.rb +52 -36
- data/lib/aylien_news_api/models/autocompletes.rb +51 -35
- data/lib/aylien_news_api/models/category.rb +85 -94
- data/lib/aylien_news_api/models/category_links.rb +63 -47
- data/lib/aylien_news_api/models/category_taxonomy.rb +36 -0
- data/lib/aylien_news_api/models/cluster.rb +265 -0
- data/lib/aylien_news_api/models/clusters.rb +229 -0
- data/lib/aylien_news_api/models/coverages.rb +76 -72
- data/lib/aylien_news_api/models/entities.rb +64 -48
- data/lib/aylien_news_api/models/entity.rb +93 -79
- data/lib/aylien_news_api/models/entity_links.rb +51 -35
- data/lib/aylien_news_api/models/error.rb +76 -60
- data/lib/aylien_news_api/models/error_links.rb +62 -37
- data/lib/aylien_news_api/models/errors.rb +51 -35
- data/lib/aylien_news_api/models/histogram_interval.rb +52 -36
- data/lib/aylien_news_api/models/histograms.rb +96 -60
- data/lib/aylien_news_api/models/location.rb +67 -51
- data/lib/aylien_news_api/models/media.rb +83 -114
- data/lib/aylien_news_api/models/media_format.rb +44 -0
- data/lib/aylien_news_api/models/media_type.rb +36 -0
- data/lib/aylien_news_api/models/rank.rb +64 -48
- data/lib/aylien_news_api/models/rankings.rb +51 -35
- data/lib/aylien_news_api/models/related_stories.rb +84 -60
- data/lib/aylien_news_api/models/representative_story.rb +237 -0
- data/lib/aylien_news_api/models/scope.rb +73 -91
- data/lib/aylien_news_api/models/scope_level.rb +37 -0
- data/lib/aylien_news_api/models/sentiment.rb +63 -82
- data/lib/aylien_news_api/models/sentiment_polarity.rb +37 -0
- data/lib/aylien_news_api/models/sentiments.rb +62 -48
- data/lib/aylien_news_api/models/share_count.rb +52 -36
- data/lib/aylien_news_api/models/share_counts.rb +54 -38
- data/lib/aylien_news_api/models/source.rb +111 -96
- data/lib/aylien_news_api/models/stories.rb +86 -50
- data/lib/aylien_news_api/models/story.rb +188 -158
- data/lib/aylien_news_api/models/story_cluster.rb +68 -52
- data/lib/aylien_news_api/models/story_links.rb +70 -44
- data/lib/aylien_news_api/models/story_translation.rb +217 -0
- data/lib/aylien_news_api/models/story_translations.rb +207 -0
- data/lib/aylien_news_api/models/story_translations_en.rb +227 -0
- data/lib/aylien_news_api/models/summary.rb +51 -35
- data/lib/aylien_news_api/models/time_series.rb +63 -47
- data/lib/aylien_news_api/models/time_series_list.rb +72 -56
- data/lib/aylien_news_api/models/trend.rb +63 -47
- data/lib/aylien_news_api/models/trends.rb +77 -41
- data/lib/aylien_news_api/models/warning.rb +226 -0
- data/lib/aylien_news_api/version.rb +12 -14
- data/spec/api/default_api_spec.rb +620 -284
- data/spec/api_client_spec.rb +43 -161
- data/spec/configuration_spec.rb +22 -19
- data/spec/models/author_spec.rb +21 -34
- data/spec/models/autocomplete_spec.rb +17 -26
- data/spec/models/autocompletes_spec.rb +16 -21
- data/spec/models/category_links_spec.rb +19 -28
- data/spec/models/category_spec.rb +31 -50
- data/spec/models/category_taxonomy_spec.rb +35 -0
- data/spec/models/cluster_spec.rb +77 -0
- data/spec/models/clusters_spec.rb +53 -0
- data/spec/models/coverages_spec.rb +24 -45
- data/spec/models/entities_spec.rb +19 -28
- data/spec/models/entity_links_spec.rb +16 -21
- data/spec/models/entity_spec.rb +25 -46
- data/spec/models/error_links_spec.rb +22 -21
- data/spec/models/error_spec.rb +27 -52
- data/spec/models/errors_spec.rb +16 -21
- data/spec/models/histogram_interval_spec.rb +17 -26
- data/spec/models/histograms_spec.rb +36 -45
- data/spec/models/location_spec.rb +21 -34
- data/spec/models/media_format_spec.rb +35 -0
- data/spec/models/media_spec.rb +41 -26
- data/spec/models/media_type_spec.rb +35 -0
- data/spec/models/rank_spec.rb +20 -21
- data/spec/models/rankings_spec.rb +15 -16
- data/spec/models/related_stories_spec.rb +33 -38
- data/spec/models/representative_story_spec.rb +59 -0
- data/spec/models/scope_level_spec.rb +35 -0
- data/spec/models/scope_spec.rb +23 -40
- data/spec/models/sentiment_polarity_spec.rb +35 -0
- data/spec/models/sentiment_spec.rb +17 -26
- data/spec/models/sentiments_spec.rb +19 -28
- data/spec/models/share_count_spec.rb +17 -26
- data/spec/models/share_counts_spec.rb +19 -36
- data/spec/models/source_spec.rb +54 -49
- data/spec/models/stories_spec.rb +32 -33
- data/spec/models/story_cluster_spec.rb +23 -44
- data/spec/models/story_links_spec.rb +25 -32
- data/spec/models/story_spec.rb +65 -134
- data/spec/models/story_translation_spec.rb +47 -0
- 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 +16 -21
- data/spec/models/time_series_list_spec.rb +22 -39
- data/spec/models/time_series_spec.rb +19 -28
- data/spec/models/trend_spec.rb +19 -28
- data/spec/models/trends_spec.rb +30 -27
- data/spec/models/warning_spec.rb +53 -0
- data/spec/spec_helper.rb +11 -13
- metadata +91 -192
- 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,26 +1,22 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
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: 5.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
14
12
|
|
15
13
|
require 'date'
|
16
14
|
|
17
15
|
module AylienNewsApi
|
18
|
-
|
19
16
|
class EntityLinks
|
20
17
|
# A dbpedia resource URL
|
21
18
|
attr_accessor :dbpedia
|
22
19
|
|
23
|
-
|
24
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
25
21
|
def self.attribute_map
|
26
22
|
{
|
@@ -29,37 +25,49 @@ module AylienNewsApi
|
|
29
25
|
end
|
30
26
|
|
31
27
|
# Attribute type mapping.
|
32
|
-
def self.
|
28
|
+
def self.openapi_types
|
33
29
|
{
|
34
30
|
:'dbpedia' => :'String'
|
35
31
|
}
|
36
32
|
end
|
37
33
|
|
34
|
+
# List of attributes with nullable: true
|
35
|
+
def self.openapi_nullable
|
36
|
+
Set.new([
|
37
|
+
])
|
38
|
+
end
|
39
|
+
|
38
40
|
# Initializes the object
|
39
41
|
# @param [Hash] attributes Model attributes in the form of hash
|
40
42
|
def initialize(attributes = {})
|
41
|
-
|
43
|
+
if (!attributes.is_a?(Hash))
|
44
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AylienNewsApi::EntityLinks` initialize method"
|
45
|
+
end
|
42
46
|
|
43
|
-
# convert string to symbol for hash key
|
44
|
-
attributes = attributes.each_with_object({}){|(k,v), h|
|
47
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
48
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
49
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
50
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `AylienNewsApi::EntityLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
51
|
+
end
|
52
|
+
h[k.to_sym] = v
|
53
|
+
}
|
45
54
|
|
46
|
-
if attributes.
|
55
|
+
if attributes.key?(:'dbpedia')
|
47
56
|
self.dbpedia = attributes[:'dbpedia']
|
48
57
|
end
|
49
|
-
|
50
58
|
end
|
51
59
|
|
52
60
|
# Show invalid properties with the reasons. Usually used together with valid?
|
53
|
-
# @return Array for valid
|
61
|
+
# @return Array for valid properties with the reasons
|
54
62
|
def list_invalid_properties
|
55
63
|
invalid_properties = Array.new
|
56
|
-
|
64
|
+
invalid_properties
|
57
65
|
end
|
58
66
|
|
59
67
|
# Check to see if the all the properties in the model are valid
|
60
68
|
# @return true if the model is valid
|
61
69
|
def valid?
|
62
|
-
|
70
|
+
true
|
63
71
|
end
|
64
72
|
|
65
73
|
# Checks equality by comparing each attribute.
|
@@ -77,22 +85,29 @@ module AylienNewsApi
|
|
77
85
|
end
|
78
86
|
|
79
87
|
# Calculates hash code according to all attributes.
|
80
|
-
# @return [
|
88
|
+
# @return [Integer] Hash code
|
81
89
|
def hash
|
82
90
|
[dbpedia].hash
|
83
91
|
end
|
84
92
|
|
93
|
+
# Builds the object from hash
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
95
|
+
# @return [Object] Returns the model itself
|
96
|
+
def self.build_from_hash(attributes)
|
97
|
+
new.build_from_hash(attributes)
|
98
|
+
end
|
99
|
+
|
85
100
|
# Builds the object from hash
|
86
101
|
# @param [Hash] attributes Model attributes in the form of hash
|
87
102
|
# @return [Object] Returns the model itself
|
88
103
|
def build_from_hash(attributes)
|
89
104
|
return nil unless attributes.is_a?(Hash)
|
90
|
-
self.class.
|
105
|
+
self.class.openapi_types.each_pair do |key, type|
|
91
106
|
if type =~ /\AArray<(.*)>/i
|
92
|
-
# check to ensure the input is an array given that the
|
107
|
+
# check to ensure the input is an array given that the attribute
|
93
108
|
# is documented as an array but the input is not
|
94
109
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
95
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
110
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
96
111
|
end
|
97
112
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
98
113
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -118,7 +133,7 @@ module AylienNewsApi
|
|
118
133
|
value.to_i
|
119
134
|
when :Float
|
120
135
|
value.to_f
|
121
|
-
when :
|
136
|
+
when :Boolean
|
122
137
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
123
138
|
true
|
124
139
|
else
|
@@ -139,8 +154,7 @@ module AylienNewsApi
|
|
139
154
|
end
|
140
155
|
end
|
141
156
|
else # model
|
142
|
-
|
143
|
-
temp_model.build_from_hash(value)
|
157
|
+
AylienNewsApi.const_get(type).build_from_hash(value)
|
144
158
|
end
|
145
159
|
end
|
146
160
|
|
@@ -162,7 +176,11 @@ module AylienNewsApi
|
|
162
176
|
hash = {}
|
163
177
|
self.class.attribute_map.each_pair do |attr, param|
|
164
178
|
value = self.send(attr)
|
165
|
-
|
179
|
+
if value.nil?
|
180
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
181
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
182
|
+
end
|
183
|
+
|
166
184
|
hash[param] = _to_hash(value)
|
167
185
|
end
|
168
186
|
hash
|
@@ -174,7 +192,7 @@ module AylienNewsApi
|
|
174
192
|
# @return [Hash] Returns the value in the form of hash
|
175
193
|
def _to_hash(value)
|
176
194
|
if value.is_a?(Array)
|
177
|
-
value.compact.map{ |v| _to_hash(v) }
|
195
|
+
value.compact.map { |v| _to_hash(v) }
|
178
196
|
elsif value.is_a?(Hash)
|
179
197
|
{}.tap do |hash|
|
180
198
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -185,7 +203,5 @@ module AylienNewsApi
|
|
185
203
|
value
|
186
204
|
end
|
187
205
|
end
|
188
|
-
|
189
206
|
end
|
190
|
-
|
191
207
|
end
|
@@ -1,104 +1,112 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
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: 5.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
14
12
|
|
15
13
|
require 'date'
|
16
14
|
|
17
15
|
module AylienNewsApi
|
18
|
-
|
19
16
|
class Error
|
17
|
+
attr_accessor :code
|
18
|
+
|
19
|
+
attr_accessor :detail
|
20
|
+
|
20
21
|
attr_accessor :id
|
21
22
|
|
22
23
|
attr_accessor :links
|
23
24
|
|
24
25
|
attr_accessor :status
|
25
26
|
|
26
|
-
attr_accessor :code
|
27
|
-
|
28
27
|
attr_accessor :title
|
29
28
|
|
30
|
-
attr_accessor :detail
|
31
|
-
|
32
|
-
|
33
29
|
# Attribute mapping from ruby-style variable name to JSON key.
|
34
30
|
def self.attribute_map
|
35
31
|
{
|
32
|
+
:'code' => :'code',
|
33
|
+
:'detail' => :'detail',
|
36
34
|
:'id' => :'id',
|
37
35
|
:'links' => :'links',
|
38
36
|
:'status' => :'status',
|
39
|
-
:'
|
40
|
-
:'title' => :'title',
|
41
|
-
:'detail' => :'detail'
|
37
|
+
:'title' => :'title'
|
42
38
|
}
|
43
39
|
end
|
44
40
|
|
45
41
|
# Attribute type mapping.
|
46
|
-
def self.
|
42
|
+
def self.openapi_types
|
47
43
|
{
|
44
|
+
:'code' => :'String',
|
45
|
+
:'detail' => :'String',
|
48
46
|
:'id' => :'String',
|
49
47
|
:'links' => :'ErrorLinks',
|
50
48
|
:'status' => :'String',
|
51
|
-
:'
|
52
|
-
:'title' => :'String',
|
53
|
-
:'detail' => :'String'
|
49
|
+
:'title' => :'String'
|
54
50
|
}
|
55
51
|
end
|
56
52
|
|
53
|
+
# List of attributes with nullable: true
|
54
|
+
def self.openapi_nullable
|
55
|
+
Set.new([
|
56
|
+
])
|
57
|
+
end
|
58
|
+
|
57
59
|
# Initializes the object
|
58
60
|
# @param [Hash] attributes Model attributes in the form of hash
|
59
61
|
def initialize(attributes = {})
|
60
|
-
|
62
|
+
if (!attributes.is_a?(Hash))
|
63
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AylienNewsApi::Error` initialize method"
|
64
|
+
end
|
61
65
|
|
62
|
-
# convert string to symbol for hash key
|
63
|
-
attributes = attributes.each_with_object({}){|(k,v), h|
|
66
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
68
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `AylienNewsApi::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
70
|
+
end
|
71
|
+
h[k.to_sym] = v
|
72
|
+
}
|
64
73
|
|
65
|
-
if attributes.
|
66
|
-
self.
|
74
|
+
if attributes.key?(:'code')
|
75
|
+
self.code = attributes[:'code']
|
67
76
|
end
|
68
77
|
|
69
|
-
if attributes.
|
70
|
-
self.
|
78
|
+
if attributes.key?(:'detail')
|
79
|
+
self.detail = attributes[:'detail']
|
71
80
|
end
|
72
81
|
|
73
|
-
if attributes.
|
74
|
-
self.
|
82
|
+
if attributes.key?(:'id')
|
83
|
+
self.id = attributes[:'id']
|
75
84
|
end
|
76
85
|
|
77
|
-
if attributes.
|
78
|
-
self.
|
86
|
+
if attributes.key?(:'links')
|
87
|
+
self.links = attributes[:'links']
|
79
88
|
end
|
80
89
|
|
81
|
-
if attributes.
|
82
|
-
self.
|
90
|
+
if attributes.key?(:'status')
|
91
|
+
self.status = attributes[:'status']
|
83
92
|
end
|
84
93
|
|
85
|
-
if attributes.
|
86
|
-
self.
|
94
|
+
if attributes.key?(:'title')
|
95
|
+
self.title = attributes[:'title']
|
87
96
|
end
|
88
|
-
|
89
97
|
end
|
90
98
|
|
91
99
|
# Show invalid properties with the reasons. Usually used together with valid?
|
92
|
-
# @return Array for valid
|
100
|
+
# @return Array for valid properties with the reasons
|
93
101
|
def list_invalid_properties
|
94
102
|
invalid_properties = Array.new
|
95
|
-
|
103
|
+
invalid_properties
|
96
104
|
end
|
97
105
|
|
98
106
|
# Check to see if the all the properties in the model are valid
|
99
107
|
# @return true if the model is valid
|
100
108
|
def valid?
|
101
|
-
|
109
|
+
true
|
102
110
|
end
|
103
111
|
|
104
112
|
# Checks equality by comparing each attribute.
|
@@ -106,12 +114,12 @@ module AylienNewsApi
|
|
106
114
|
def ==(o)
|
107
115
|
return true if self.equal?(o)
|
108
116
|
self.class == o.class &&
|
117
|
+
code == o.code &&
|
118
|
+
detail == o.detail &&
|
109
119
|
id == o.id &&
|
110
120
|
links == o.links &&
|
111
121
|
status == o.status &&
|
112
|
-
|
113
|
-
title == o.title &&
|
114
|
-
detail == o.detail
|
122
|
+
title == o.title
|
115
123
|
end
|
116
124
|
|
117
125
|
# @see the `==` method
|
@@ -121,9 +129,16 @@ module AylienNewsApi
|
|
121
129
|
end
|
122
130
|
|
123
131
|
# Calculates hash code according to all attributes.
|
124
|
-
# @return [
|
132
|
+
# @return [Integer] Hash code
|
125
133
|
def hash
|
126
|
-
[id, links, status,
|
134
|
+
[code, detail, id, links, status, title].hash
|
135
|
+
end
|
136
|
+
|
137
|
+
# Builds the object from hash
|
138
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
139
|
+
# @return [Object] Returns the model itself
|
140
|
+
def self.build_from_hash(attributes)
|
141
|
+
new.build_from_hash(attributes)
|
127
142
|
end
|
128
143
|
|
129
144
|
# Builds the object from hash
|
@@ -131,12 +146,12 @@ module AylienNewsApi
|
|
131
146
|
# @return [Object] Returns the model itself
|
132
147
|
def build_from_hash(attributes)
|
133
148
|
return nil unless attributes.is_a?(Hash)
|
134
|
-
self.class.
|
149
|
+
self.class.openapi_types.each_pair do |key, type|
|
135
150
|
if type =~ /\AArray<(.*)>/i
|
136
|
-
# check to ensure the input is an array given that the
|
151
|
+
# check to ensure the input is an array given that the attribute
|
137
152
|
# is documented as an array but the input is not
|
138
153
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
139
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
154
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
140
155
|
end
|
141
156
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
142
157
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -162,7 +177,7 @@ module AylienNewsApi
|
|
162
177
|
value.to_i
|
163
178
|
when :Float
|
164
179
|
value.to_f
|
165
|
-
when :
|
180
|
+
when :Boolean
|
166
181
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
167
182
|
true
|
168
183
|
else
|
@@ -183,8 +198,7 @@ module AylienNewsApi
|
|
183
198
|
end
|
184
199
|
end
|
185
200
|
else # model
|
186
|
-
|
187
|
-
temp_model.build_from_hash(value)
|
201
|
+
AylienNewsApi.const_get(type).build_from_hash(value)
|
188
202
|
end
|
189
203
|
end
|
190
204
|
|
@@ -206,7 +220,11 @@ module AylienNewsApi
|
|
206
220
|
hash = {}
|
207
221
|
self.class.attribute_map.each_pair do |attr, param|
|
208
222
|
value = self.send(attr)
|
209
|
-
|
223
|
+
if value.nil?
|
224
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
225
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
226
|
+
end
|
227
|
+
|
210
228
|
hash[param] = _to_hash(value)
|
211
229
|
end
|
212
230
|
hash
|
@@ -218,7 +236,7 @@ module AylienNewsApi
|
|
218
236
|
# @return [Hash] Returns the value in the form of hash
|
219
237
|
def _to_hash(value)
|
220
238
|
if value.is_a?(Array)
|
221
|
-
value.compact.map{ |v| _to_hash(v) }
|
239
|
+
value.compact.map { |v| _to_hash(v) }
|
222
240
|
elsif value.is_a?(Hash)
|
223
241
|
{}.tap do |hash|
|
224
242
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -229,7 +247,5 @@ module AylienNewsApi
|
|
229
247
|
value
|
230
248
|
end
|
231
249
|
end
|
232
|
-
|
233
250
|
end
|
234
|
-
|
235
251
|
end
|
@@ -1,64 +1,80 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
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: 5.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
14
12
|
|
15
13
|
require 'date'
|
16
14
|
|
17
15
|
module AylienNewsApi
|
18
|
-
|
19
16
|
class ErrorLinks
|
20
17
|
attr_accessor :about
|
21
18
|
|
19
|
+
attr_accessor :docs
|
22
20
|
|
23
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
24
22
|
def self.attribute_map
|
25
23
|
{
|
26
|
-
:'about' => :'about'
|
24
|
+
:'about' => :'about',
|
25
|
+
:'docs' => :'docs'
|
27
26
|
}
|
28
27
|
end
|
29
28
|
|
30
29
|
# Attribute type mapping.
|
31
|
-
def self.
|
30
|
+
def self.openapi_types
|
32
31
|
{
|
33
|
-
:'about' => :'String'
|
32
|
+
:'about' => :'String',
|
33
|
+
:'docs' => :'String'
|
34
34
|
}
|
35
35
|
end
|
36
36
|
|
37
|
+
# List of attributes with nullable: true
|
38
|
+
def self.openapi_nullable
|
39
|
+
Set.new([
|
40
|
+
])
|
41
|
+
end
|
42
|
+
|
37
43
|
# Initializes the object
|
38
44
|
# @param [Hash] attributes Model attributes in the form of hash
|
39
45
|
def initialize(attributes = {})
|
40
|
-
|
46
|
+
if (!attributes.is_a?(Hash))
|
47
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AylienNewsApi::ErrorLinks` initialize method"
|
48
|
+
end
|
41
49
|
|
42
|
-
# convert string to symbol for hash key
|
43
|
-
attributes = attributes.each_with_object({}){|(k,v), h|
|
50
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
52
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
53
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `AylienNewsApi::ErrorLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
54
|
+
end
|
55
|
+
h[k.to_sym] = v
|
56
|
+
}
|
44
57
|
|
45
|
-
if attributes.
|
58
|
+
if attributes.key?(:'about')
|
46
59
|
self.about = attributes[:'about']
|
47
60
|
end
|
48
61
|
|
62
|
+
if attributes.key?(:'docs')
|
63
|
+
self.docs = attributes[:'docs']
|
64
|
+
end
|
49
65
|
end
|
50
66
|
|
51
67
|
# Show invalid properties with the reasons. Usually used together with valid?
|
52
|
-
# @return Array for valid
|
68
|
+
# @return Array for valid properties with the reasons
|
53
69
|
def list_invalid_properties
|
54
70
|
invalid_properties = Array.new
|
55
|
-
|
71
|
+
invalid_properties
|
56
72
|
end
|
57
73
|
|
58
74
|
# Check to see if the all the properties in the model are valid
|
59
75
|
# @return true if the model is valid
|
60
76
|
def valid?
|
61
|
-
|
77
|
+
true
|
62
78
|
end
|
63
79
|
|
64
80
|
# Checks equality by comparing each attribute.
|
@@ -66,7 +82,8 @@ module AylienNewsApi
|
|
66
82
|
def ==(o)
|
67
83
|
return true if self.equal?(o)
|
68
84
|
self.class == o.class &&
|
69
|
-
about == o.about
|
85
|
+
about == o.about &&
|
86
|
+
docs == o.docs
|
70
87
|
end
|
71
88
|
|
72
89
|
# @see the `==` method
|
@@ -76,9 +93,16 @@ module AylienNewsApi
|
|
76
93
|
end
|
77
94
|
|
78
95
|
# Calculates hash code according to all attributes.
|
79
|
-
# @return [
|
96
|
+
# @return [Integer] Hash code
|
80
97
|
def hash
|
81
|
-
[about].hash
|
98
|
+
[about, docs].hash
|
99
|
+
end
|
100
|
+
|
101
|
+
# Builds the object from hash
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
# @return [Object] Returns the model itself
|
104
|
+
def self.build_from_hash(attributes)
|
105
|
+
new.build_from_hash(attributes)
|
82
106
|
end
|
83
107
|
|
84
108
|
# Builds the object from hash
|
@@ -86,12 +110,12 @@ module AylienNewsApi
|
|
86
110
|
# @return [Object] Returns the model itself
|
87
111
|
def build_from_hash(attributes)
|
88
112
|
return nil unless attributes.is_a?(Hash)
|
89
|
-
self.class.
|
113
|
+
self.class.openapi_types.each_pair do |key, type|
|
90
114
|
if type =~ /\AArray<(.*)>/i
|
91
|
-
# check to ensure the input is an array given that the
|
115
|
+
# check to ensure the input is an array given that the attribute
|
92
116
|
# is documented as an array but the input is not
|
93
117
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
94
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
118
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
95
119
|
end
|
96
120
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
97
121
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -117,7 +141,7 @@ module AylienNewsApi
|
|
117
141
|
value.to_i
|
118
142
|
when :Float
|
119
143
|
value.to_f
|
120
|
-
when :
|
144
|
+
when :Boolean
|
121
145
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
122
146
|
true
|
123
147
|
else
|
@@ -138,8 +162,7 @@ module AylienNewsApi
|
|
138
162
|
end
|
139
163
|
end
|
140
164
|
else # model
|
141
|
-
|
142
|
-
temp_model.build_from_hash(value)
|
165
|
+
AylienNewsApi.const_get(type).build_from_hash(value)
|
143
166
|
end
|
144
167
|
end
|
145
168
|
|
@@ -161,7 +184,11 @@ module AylienNewsApi
|
|
161
184
|
hash = {}
|
162
185
|
self.class.attribute_map.each_pair do |attr, param|
|
163
186
|
value = self.send(attr)
|
164
|
-
|
187
|
+
if value.nil?
|
188
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
189
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
190
|
+
end
|
191
|
+
|
165
192
|
hash[param] = _to_hash(value)
|
166
193
|
end
|
167
194
|
hash
|
@@ -173,7 +200,7 @@ module AylienNewsApi
|
|
173
200
|
# @return [Hash] Returns the value in the form of hash
|
174
201
|
def _to_hash(value)
|
175
202
|
if value.is_a?(Array)
|
176
|
-
value.compact.map{ |v| _to_hash(v) }
|
203
|
+
value.compact.map { |v| _to_hash(v) }
|
177
204
|
elsif value.is_a?(Hash)
|
178
205
|
{}.tap do |hash|
|
179
206
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -184,7 +211,5 @@ module AylienNewsApi
|
|
184
211
|
value
|
185
212
|
end
|
186
213
|
end
|
187
|
-
|
188
214
|
end
|
189
|
-
|
190
215
|
end
|