aylien_news_api 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +21 -21
- data/aylien_news_api-0.3.0.gem +0 -0
- data/aylien_news_api.gemspec +3 -2
- data/docs/DefaultApi.md +451 -250
- data/docs/Media.md +4 -0
- data/lib/aylien_news_api/api/default_api.rb +965 -341
- data/lib/aylien_news_api/api_client.rb +13 -5
- data/lib/aylien_news_api/configuration.rb +6 -6
- data/lib/aylien_news_api/models/author.rb +3 -3
- data/lib/aylien_news_api/models/autocomplete.rb +3 -3
- data/lib/aylien_news_api/models/autocompletes.rb +3 -3
- data/lib/aylien_news_api/models/category.rb +3 -3
- data/lib/aylien_news_api/models/category_links.rb +3 -3
- data/lib/aylien_news_api/models/coverages.rb +3 -3
- data/lib/aylien_news_api/models/entities.rb +3 -3
- data/lib/aylien_news_api/models/entity.rb +3 -4
- data/lib/aylien_news_api/models/entity_links.rb +3 -3
- data/lib/aylien_news_api/models/error.rb +3 -3
- data/lib/aylien_news_api/models/error_links.rb +3 -3
- data/lib/aylien_news_api/models/errors.rb +3 -3
- data/lib/aylien_news_api/models/histogram_interval.rb +3 -3
- data/lib/aylien_news_api/models/histograms.rb +3 -3
- data/lib/aylien_news_api/models/location.rb +3 -3
- data/lib/aylien_news_api/models/media.rb +59 -7
- data/lib/aylien_news_api/models/rank.rb +3 -3
- data/lib/aylien_news_api/models/rankings.rb +3 -3
- data/lib/aylien_news_api/models/related_stories.rb +3 -3
- data/lib/aylien_news_api/models/scope.rb +3 -3
- data/lib/aylien_news_api/models/sentiment.rb +3 -4
- data/lib/aylien_news_api/models/sentiments.rb +3 -3
- data/lib/aylien_news_api/models/share_count.rb +3 -3
- data/lib/aylien_news_api/models/share_counts.rb +3 -3
- data/lib/aylien_news_api/models/source.rb +3 -3
- data/lib/aylien_news_api/models/stories.rb +3 -3
- data/lib/aylien_news_api/models/story.rb +3 -3
- data/lib/aylien_news_api/models/story_cluster.rb +3 -3
- data/lib/aylien_news_api/models/story_links.rb +3 -3
- data/lib/aylien_news_api/models/summary.rb +3 -3
- data/lib/aylien_news_api/models/time_series.rb +3 -3
- data/lib/aylien_news_api/models/time_series_list.rb +3 -3
- data/lib/aylien_news_api/models/trend.rb +3 -3
- data/lib/aylien_news_api/models/trends.rb +3 -3
- data/lib/aylien_news_api/version.rb +1 -1
- metadata +4 -6
@@ -23,6 +23,18 @@ module AylienNewsApi
|
|
23
23
|
# A URL which points to the media file
|
24
24
|
attr_accessor :url
|
25
25
|
|
26
|
+
# The format of media
|
27
|
+
attr_accessor :format
|
28
|
+
|
29
|
+
# The content length of media
|
30
|
+
attr_accessor :content_length
|
31
|
+
|
32
|
+
# The width of media
|
33
|
+
attr_accessor :width
|
34
|
+
|
35
|
+
# The height of media
|
36
|
+
attr_accessor :height
|
37
|
+
|
26
38
|
class EnumAttributeValidator
|
27
39
|
attr_reader :datatype
|
28
40
|
attr_reader :allowable_values
|
@@ -49,7 +61,11 @@ module AylienNewsApi
|
|
49
61
|
def self.attribute_map
|
50
62
|
{
|
51
63
|
:'type' => :'type',
|
52
|
-
:'url' => :'url'
|
64
|
+
:'url' => :'url',
|
65
|
+
:'format' => :'format',
|
66
|
+
:'content_length' => :'content_length',
|
67
|
+
:'width' => :'width',
|
68
|
+
:'height' => :'height'
|
53
69
|
}
|
54
70
|
end
|
55
71
|
|
@@ -57,7 +73,11 @@ module AylienNewsApi
|
|
57
73
|
def self.api_types
|
58
74
|
{
|
59
75
|
:'type' => :'String',
|
60
|
-
:'url' => :'String'
|
76
|
+
:'url' => :'String',
|
77
|
+
:'format' => :'String',
|
78
|
+
:'content_length' => :'Integer',
|
79
|
+
:'width' => :'Integer',
|
80
|
+
:'height' => :'Integer'
|
61
81
|
}
|
62
82
|
end
|
63
83
|
|
@@ -77,6 +97,22 @@ module AylienNewsApi
|
|
77
97
|
self.url = attributes[:'url']
|
78
98
|
end
|
79
99
|
|
100
|
+
if attributes.has_key?(:'format')
|
101
|
+
self.format = attributes[:'format']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.has_key?(:'content_length')
|
105
|
+
self.content_length = attributes[:'content_length']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.has_key?(:'width')
|
109
|
+
self.width = attributes[:'width']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.has_key?(:'height')
|
113
|
+
self.height = attributes[:'height']
|
114
|
+
end
|
115
|
+
|
80
116
|
end
|
81
117
|
|
82
118
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -91,6 +127,8 @@ module AylienNewsApi
|
|
91
127
|
def valid?
|
92
128
|
type_validator = EnumAttributeValidator.new('String', ["image", "video"])
|
93
129
|
return false unless type_validator.valid?(@type)
|
130
|
+
format_validator = EnumAttributeValidator.new('String', ["BMP", "GIF", "JPEG", "PNG", "TIFF", "PSD", "ICO", "CUR", "WEBP", "SVG"])
|
131
|
+
return false unless format_validator.valid?(@format)
|
94
132
|
return true
|
95
133
|
end
|
96
134
|
|
@@ -104,13 +142,27 @@ module AylienNewsApi
|
|
104
142
|
@type = type
|
105
143
|
end
|
106
144
|
|
145
|
+
# Custom attribute writer method checking allowed values (enum).
|
146
|
+
# @param [Object] format Object to be assigned
|
147
|
+
def format=(format)
|
148
|
+
validator = EnumAttributeValidator.new('String', ["BMP", "GIF", "JPEG", "PNG", "TIFF", "PSD", "ICO", "CUR", "WEBP", "SVG"])
|
149
|
+
unless validator.valid?(format)
|
150
|
+
fail ArgumentError, "invalid value for 'format', must be one of #{validator.allowable_values}."
|
151
|
+
end
|
152
|
+
@format = format
|
153
|
+
end
|
154
|
+
|
107
155
|
# Checks equality by comparing each attribute.
|
108
156
|
# @param [Object] Object to be compared
|
109
157
|
def ==(o)
|
110
158
|
return true if self.equal?(o)
|
111
159
|
self.class == o.class &&
|
112
160
|
type == o.type &&
|
113
|
-
url == o.url
|
161
|
+
url == o.url &&
|
162
|
+
format == o.format &&
|
163
|
+
content_length == o.content_length &&
|
164
|
+
width == o.width &&
|
165
|
+
height == o.height
|
114
166
|
end
|
115
167
|
|
116
168
|
# @see the `==` method
|
@@ -122,7 +174,7 @@ module AylienNewsApi
|
|
122
174
|
# Calculates hash code according to all attributes.
|
123
175
|
# @return [Fixnum] Hash code
|
124
176
|
def hash
|
125
|
-
[type, url].hash
|
177
|
+
[type, url, format, content_length, width, height].hash
|
126
178
|
end
|
127
179
|
|
128
180
|
# Builds the object from hash
|
@@ -131,7 +183,7 @@ module AylienNewsApi
|
|
131
183
|
def build_from_hash(attributes)
|
132
184
|
return nil unless attributes.is_a?(Hash)
|
133
185
|
self.class.api_types.each_pair do |key, type|
|
134
|
-
if type =~
|
186
|
+
if type =~ /\AArray<(.*)>/i
|
135
187
|
# check to ensure the input is an array given that the the attribute
|
136
188
|
# is documented as an array but the input is not
|
137
189
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -162,7 +214,7 @@ module AylienNewsApi
|
|
162
214
|
when :Float
|
163
215
|
value.to_f
|
164
216
|
when :BOOLEAN
|
165
|
-
if value.to_s =~
|
217
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
166
218
|
true
|
167
219
|
else
|
168
220
|
false
|
@@ -173,7 +225,7 @@ module AylienNewsApi
|
|
173
225
|
when /\AArray<(?<inner_type>.+)>\z/
|
174
226
|
inner_type = Regexp.last_match[:inner_type]
|
175
227
|
value.map { |v| _deserialize(inner_type, v) }
|
176
|
-
when /\AHash<(?<k_type
|
228
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
177
229
|
k_type = Regexp.last_match[:k_type]
|
178
230
|
v_type = Regexp.last_match[:v_type]
|
179
231
|
{}.tap do |hash|
|
@@ -108,7 +108,7 @@ module AylienNewsApi
|
|
108
108
|
def build_from_hash(attributes)
|
109
109
|
return nil unless attributes.is_a?(Hash)
|
110
110
|
self.class.api_types.each_pair do |key, type|
|
111
|
-
if type =~
|
111
|
+
if type =~ /\AArray<(.*)>/i
|
112
112
|
# check to ensure the input is an array given that the the attribute
|
113
113
|
# is documented as an array but the input is not
|
114
114
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -139,7 +139,7 @@ module AylienNewsApi
|
|
139
139
|
when :Float
|
140
140
|
value.to_f
|
141
141
|
when :BOOLEAN
|
142
|
-
if value.to_s =~
|
142
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
143
143
|
true
|
144
144
|
else
|
145
145
|
false
|
@@ -150,7 +150,7 @@ module AylienNewsApi
|
|
150
150
|
when /\AArray<(?<inner_type>.+)>\z/
|
151
151
|
inner_type = Regexp.last_match[:inner_type]
|
152
152
|
value.map { |v| _deserialize(inner_type, v) }
|
153
|
-
when /\AHash<(?<k_type
|
153
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
154
154
|
k_type = Regexp.last_match[:k_type]
|
155
155
|
v_type = Regexp.last_match[:v_type]
|
156
156
|
{}.tap do |hash|
|
@@ -89,7 +89,7 @@ module AylienNewsApi
|
|
89
89
|
def build_from_hash(attributes)
|
90
90
|
return nil unless attributes.is_a?(Hash)
|
91
91
|
self.class.api_types.each_pair do |key, type|
|
92
|
-
if type =~
|
92
|
+
if type =~ /\AArray<(.*)>/i
|
93
93
|
# check to ensure the input is an array given that the the attribute
|
94
94
|
# is documented as an array but the input is not
|
95
95
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -120,7 +120,7 @@ module AylienNewsApi
|
|
120
120
|
when :Float
|
121
121
|
value.to_f
|
122
122
|
when :BOOLEAN
|
123
|
-
if value.to_s =~
|
123
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
124
124
|
true
|
125
125
|
else
|
126
126
|
false
|
@@ -131,7 +131,7 @@ module AylienNewsApi
|
|
131
131
|
when /\AArray<(?<inner_type>.+)>\z/
|
132
132
|
inner_type = Regexp.last_match[:inner_type]
|
133
133
|
value.map { |v| _deserialize(inner_type, v) }
|
134
|
-
when /\AHash<(?<k_type
|
134
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
135
135
|
k_type = Regexp.last_match[:k_type]
|
136
136
|
v_type = Regexp.last_match[:v_type]
|
137
137
|
{}.tap do |hash|
|
@@ -132,7 +132,7 @@ module AylienNewsApi
|
|
132
132
|
def build_from_hash(attributes)
|
133
133
|
return nil unless attributes.is_a?(Hash)
|
134
134
|
self.class.api_types.each_pair do |key, type|
|
135
|
-
if type =~
|
135
|
+
if type =~ /\AArray<(.*)>/i
|
136
136
|
# check to ensure the input is an array given that the the attribute
|
137
137
|
# is documented as an array but the input is not
|
138
138
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -163,7 +163,7 @@ module AylienNewsApi
|
|
163
163
|
when :Float
|
164
164
|
value.to_f
|
165
165
|
when :BOOLEAN
|
166
|
-
if value.to_s =~
|
166
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
167
167
|
true
|
168
168
|
else
|
169
169
|
false
|
@@ -174,7 +174,7 @@ module AylienNewsApi
|
|
174
174
|
when /\AArray<(?<inner_type>.+)>\z/
|
175
175
|
inner_type = Regexp.last_match[:inner_type]
|
176
176
|
value.map { |v| _deserialize(inner_type, v) }
|
177
|
-
when /\AHash<(?<k_type
|
177
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
178
178
|
k_type = Regexp.last_match[:k_type]
|
179
179
|
v_type = Regexp.last_match[:v_type]
|
180
180
|
{}.tap do |hash|
|
@@ -151,7 +151,7 @@ module AylienNewsApi
|
|
151
151
|
def build_from_hash(attributes)
|
152
152
|
return nil unless attributes.is_a?(Hash)
|
153
153
|
self.class.api_types.each_pair do |key, type|
|
154
|
-
if type =~
|
154
|
+
if type =~ /\AArray<(.*)>/i
|
155
155
|
# check to ensure the input is an array given that the the attribute
|
156
156
|
# is documented as an array but the input is not
|
157
157
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -182,7 +182,7 @@ module AylienNewsApi
|
|
182
182
|
when :Float
|
183
183
|
value.to_f
|
184
184
|
when :BOOLEAN
|
185
|
-
if value.to_s =~
|
185
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
186
186
|
true
|
187
187
|
else
|
188
188
|
false
|
@@ -193,7 +193,7 @@ module AylienNewsApi
|
|
193
193
|
when /\AArray<(?<inner_type>.+)>\z/
|
194
194
|
inner_type = Regexp.last_match[:inner_type]
|
195
195
|
value.map { |v| _deserialize(inner_type, v) }
|
196
|
-
when /\AHash<(?<k_type
|
196
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
197
197
|
k_type = Regexp.last_match[:k_type]
|
198
198
|
v_type = Regexp.last_match[:v_type]
|
199
199
|
{}.tap do |hash|
|
@@ -83,7 +83,6 @@ module AylienNewsApi
|
|
83
83
|
# @return Array for valid properies with the reasons
|
84
84
|
def list_invalid_properties
|
85
85
|
invalid_properties = Array.new
|
86
|
-
|
87
86
|
if !@score.nil? && @score > 1.0
|
88
87
|
invalid_properties.push("invalid value for 'score', must be smaller than or equal to 1.0.")
|
89
88
|
end
|
@@ -157,7 +156,7 @@ module AylienNewsApi
|
|
157
156
|
def build_from_hash(attributes)
|
158
157
|
return nil unless attributes.is_a?(Hash)
|
159
158
|
self.class.api_types.each_pair do |key, type|
|
160
|
-
if type =~
|
159
|
+
if type =~ /\AArray<(.*)>/i
|
161
160
|
# check to ensure the input is an array given that the the attribute
|
162
161
|
# is documented as an array but the input is not
|
163
162
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -188,7 +187,7 @@ module AylienNewsApi
|
|
188
187
|
when :Float
|
189
188
|
value.to_f
|
190
189
|
when :BOOLEAN
|
191
|
-
if value.to_s =~
|
190
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
192
191
|
true
|
193
192
|
else
|
194
193
|
false
|
@@ -199,7 +198,7 @@ module AylienNewsApi
|
|
199
198
|
when /\AArray<(?<inner_type>.+)>\z/
|
200
199
|
inner_type = Regexp.last_match[:inner_type]
|
201
200
|
value.map { |v| _deserialize(inner_type, v) }
|
202
|
-
when /\AHash<(?<k_type
|
201
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
203
202
|
k_type = Regexp.last_match[:k_type]
|
204
203
|
v_type = Regexp.last_match[:v_type]
|
205
204
|
{}.tap do |hash|
|
@@ -98,7 +98,7 @@ module AylienNewsApi
|
|
98
98
|
def build_from_hash(attributes)
|
99
99
|
return nil unless attributes.is_a?(Hash)
|
100
100
|
self.class.api_types.each_pair do |key, type|
|
101
|
-
if type =~
|
101
|
+
if type =~ /\AArray<(.*)>/i
|
102
102
|
# check to ensure the input is an array given that the the attribute
|
103
103
|
# is documented as an array but the input is not
|
104
104
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -129,7 +129,7 @@ module AylienNewsApi
|
|
129
129
|
when :Float
|
130
130
|
value.to_f
|
131
131
|
when :BOOLEAN
|
132
|
-
if value.to_s =~
|
132
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
133
133
|
true
|
134
134
|
else
|
135
135
|
false
|
@@ -140,7 +140,7 @@ module AylienNewsApi
|
|
140
140
|
when /\AArray<(?<inner_type>.+)>\z/
|
141
141
|
inner_type = Regexp.last_match[:inner_type]
|
142
142
|
value.map { |v| _deserialize(inner_type, v) }
|
143
|
-
when /\AHash<(?<k_type
|
143
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
144
144
|
k_type = Regexp.last_match[:k_type]
|
145
145
|
v_type = Regexp.last_match[:v_type]
|
146
146
|
{}.tap do |hash|
|
@@ -98,7 +98,7 @@ module AylienNewsApi
|
|
98
98
|
def build_from_hash(attributes)
|
99
99
|
return nil unless attributes.is_a?(Hash)
|
100
100
|
self.class.api_types.each_pair do |key, type|
|
101
|
-
if type =~
|
101
|
+
if type =~ /\AArray<(.*)>/i
|
102
102
|
# check to ensure the input is an array given that the the attribute
|
103
103
|
# is documented as an array but the input is not
|
104
104
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -129,7 +129,7 @@ module AylienNewsApi
|
|
129
129
|
when :Float
|
130
130
|
value.to_f
|
131
131
|
when :BOOLEAN
|
132
|
-
if value.to_s =~
|
132
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
133
133
|
true
|
134
134
|
else
|
135
135
|
false
|
@@ -140,7 +140,7 @@ module AylienNewsApi
|
|
140
140
|
when /\AArray<(?<inner_type>.+)>\z/
|
141
141
|
inner_type = Regexp.last_match[:inner_type]
|
142
142
|
value.map { |v| _deserialize(inner_type, v) }
|
143
|
-
when /\AHash<(?<k_type
|
143
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
144
144
|
k_type = Regexp.last_match[:k_type]
|
145
145
|
v_type = Regexp.last_match[:v_type]
|
146
146
|
{}.tap do |hash|
|
@@ -126,7 +126,7 @@ module AylienNewsApi
|
|
126
126
|
def build_from_hash(attributes)
|
127
127
|
return nil unless attributes.is_a?(Hash)
|
128
128
|
self.class.api_types.each_pair do |key, type|
|
129
|
-
if type =~
|
129
|
+
if type =~ /\AArray<(.*)>/i
|
130
130
|
# check to ensure the input is an array given that the the attribute
|
131
131
|
# is documented as an array but the input is not
|
132
132
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -157,7 +157,7 @@ module AylienNewsApi
|
|
157
157
|
when :Float
|
158
158
|
value.to_f
|
159
159
|
when :BOOLEAN
|
160
|
-
if value.to_s =~
|
160
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
161
161
|
true
|
162
162
|
else
|
163
163
|
false
|
@@ -168,7 +168,7 @@ module AylienNewsApi
|
|
168
168
|
when /\AArray<(?<inner_type>.+)>\z/
|
169
169
|
inner_type = Regexp.last_match[:inner_type]
|
170
170
|
value.map { |v| _deserialize(inner_type, v) }
|
171
|
-
when /\AHash<(?<k_type
|
171
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
172
172
|
k_type = Regexp.last_match[:k_type]
|
173
173
|
v_type = Regexp.last_match[:v_type]
|
174
174
|
{}.tap do |hash|
|
@@ -192,7 +192,7 @@ module AylienNewsApi
|
|
192
192
|
def build_from_hash(attributes)
|
193
193
|
return nil unless attributes.is_a?(Hash)
|
194
194
|
self.class.api_types.each_pair do |key, type|
|
195
|
-
if type =~
|
195
|
+
if type =~ /\AArray<(.*)>/i
|
196
196
|
# check to ensure the input is an array given that the the attribute
|
197
197
|
# is documented as an array but the input is not
|
198
198
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -223,7 +223,7 @@ module AylienNewsApi
|
|
223
223
|
when :Float
|
224
224
|
value.to_f
|
225
225
|
when :BOOLEAN
|
226
|
-
if value.to_s =~
|
226
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
227
227
|
true
|
228
228
|
else
|
229
229
|
false
|
@@ -234,7 +234,7 @@ module AylienNewsApi
|
|
234
234
|
when /\AArray<(?<inner_type>.+)>\z/
|
235
235
|
inner_type = Regexp.last_match[:inner_type]
|
236
236
|
value.map { |v| _deserialize(inner_type, v) }
|
237
|
-
when /\AHash<(?<k_type
|
237
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
238
238
|
k_type = Regexp.last_match[:k_type]
|
239
239
|
v_type = Regexp.last_match[:v_type]
|
240
240
|
{}.tap do |hash|
|
@@ -112,7 +112,7 @@ module AylienNewsApi
|
|
112
112
|
def build_from_hash(attributes)
|
113
113
|
return nil unless attributes.is_a?(Hash)
|
114
114
|
self.class.api_types.each_pair do |key, type|
|
115
|
-
if type =~
|
115
|
+
if type =~ /\AArray<(.*)>/i
|
116
116
|
# check to ensure the input is an array given that the the attribute
|
117
117
|
# is documented as an array but the input is not
|
118
118
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -143,7 +143,7 @@ module AylienNewsApi
|
|
143
143
|
when :Float
|
144
144
|
value.to_f
|
145
145
|
when :BOOLEAN
|
146
|
-
if value.to_s =~
|
146
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
147
147
|
true
|
148
148
|
else
|
149
149
|
false
|
@@ -154,7 +154,7 @@ module AylienNewsApi
|
|
154
154
|
when /\AArray<(?<inner_type>.+)>\z/
|
155
155
|
inner_type = Regexp.last_match[:inner_type]
|
156
156
|
value.map { |v| _deserialize(inner_type, v) }
|
157
|
-
when /\AHash<(?<k_type
|
157
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
158
158
|
k_type = Regexp.last_match[:k_type]
|
159
159
|
v_type = Regexp.last_match[:v_type]
|
160
160
|
{}.tap do |hash|
|
@@ -286,7 +286,7 @@ module AylienNewsApi
|
|
286
286
|
def build_from_hash(attributes)
|
287
287
|
return nil unless attributes.is_a?(Hash)
|
288
288
|
self.class.api_types.each_pair do |key, type|
|
289
|
-
if type =~
|
289
|
+
if type =~ /\AArray<(.*)>/i
|
290
290
|
# check to ensure the input is an array given that the the attribute
|
291
291
|
# is documented as an array but the input is not
|
292
292
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -317,7 +317,7 @@ module AylienNewsApi
|
|
317
317
|
when :Float
|
318
318
|
value.to_f
|
319
319
|
when :BOOLEAN
|
320
|
-
if value.to_s =~
|
320
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
321
321
|
true
|
322
322
|
else
|
323
323
|
false
|
@@ -328,7 +328,7 @@ module AylienNewsApi
|
|
328
328
|
when /\AArray<(?<inner_type>.+)>\z/
|
329
329
|
inner_type = Regexp.last_match[:inner_type]
|
330
330
|
value.map { |v| _deserialize(inner_type, v) }
|
331
|
-
when /\AHash<(?<k_type
|
331
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
332
332
|
k_type = Regexp.last_match[:k_type]
|
333
333
|
v_type = Regexp.last_match[:v_type]
|
334
334
|
{}.tap do |hash|
|
@@ -132,7 +132,7 @@ module AylienNewsApi
|
|
132
132
|
def build_from_hash(attributes)
|
133
133
|
return nil unless attributes.is_a?(Hash)
|
134
134
|
self.class.api_types.each_pair do |key, type|
|
135
|
-
if type =~
|
135
|
+
if type =~ /\AArray<(.*)>/i
|
136
136
|
# check to ensure the input is an array given that the the attribute
|
137
137
|
# is documented as an array but the input is not
|
138
138
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -163,7 +163,7 @@ module AylienNewsApi
|
|
163
163
|
when :Float
|
164
164
|
value.to_f
|
165
165
|
when :BOOLEAN
|
166
|
-
if value.to_s =~
|
166
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
167
167
|
true
|
168
168
|
else
|
169
169
|
false
|
@@ -174,7 +174,7 @@ module AylienNewsApi
|
|
174
174
|
when /\AArray<(?<inner_type>.+)>\z/
|
175
175
|
inner_type = Regexp.last_match[:inner_type]
|
176
176
|
value.map { |v| _deserialize(inner_type, v) }
|
177
|
-
when /\AHash<(?<k_type
|
177
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
178
178
|
k_type = Regexp.last_match[:k_type]
|
179
179
|
v_type = Regexp.last_match[:v_type]
|
180
180
|
{}.tap do |hash|
|