finnhub_ruby 1.1.13 → 1.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/docs/BondCandles.md +22 -0
- data/docs/BondProfile.md +58 -0
- data/docs/DefaultApi.md +392 -8
- data/docs/InsiderSentiments.md +20 -0
- data/docs/InsiderSentimentsData.md +26 -0
- data/docs/LobbyingData.md +46 -0
- data/docs/LobbyingResult.md +20 -0
- data/docs/UsaSpending.md +56 -0
- data/docs/UsaSpendingResult.md +20 -0
- data/docs/VisaApplication.md +2 -2
- data/finnhub_ruby-1.1.13.gem +0 -0
- data/finnhub_ruby-1.1.14.gem +0 -0
- data/finnhub_ruby-1.1.15.gem +0 -0
- data/lib/finnhub_ruby/api/default_api.rb +395 -14
- data/lib/finnhub_ruby/models/bond_candles.rb +243 -0
- data/lib/finnhub_ruby/models/bond_profile.rb +419 -0
- data/lib/finnhub_ruby/models/insider_sentiments.rb +231 -0
- data/lib/finnhub_ruby/models/insider_sentiments_data.rb +259 -0
- data/lib/finnhub_ruby/models/lobbying_data.rb +359 -0
- data/lib/finnhub_ruby/models/lobbying_result.rb +231 -0
- data/lib/finnhub_ruby/models/usa_spending.rb +409 -0
- data/lib/finnhub_ruby/models/usa_spending_result.rb +231 -0
- data/lib/finnhub_ruby/models/visa_application.rb +7 -7
- data/lib/finnhub_ruby/version.rb +1 -1
- data/lib/finnhub_ruby.rb +8 -0
- data/spec/models/bond_candles_spec.rb +46 -0
- data/spec/models/bond_profile_spec.rb +154 -0
- data/spec/models/insider_sentiments_data_spec.rb +58 -0
- data/spec/models/insider_sentiments_spec.rb +40 -0
- data/spec/models/lobbying_data_spec.rb +118 -0
- data/spec/models/lobbying_result_spec.rb +40 -0
- data/spec/models/usa_spending_result_spec.rb +40 -0
- data/spec/models/usa_spending_spec.rb +148 -0
- metadata +37 -2
@@ -0,0 +1,409 @@
|
|
1
|
+
=begin
|
2
|
+
#Finnhub API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module FinnhubRuby
|
17
|
+
class UsaSpending
|
18
|
+
# Symbol.
|
19
|
+
attr_accessor :symbol
|
20
|
+
|
21
|
+
# Company's name.
|
22
|
+
attr_accessor :recipient_name
|
23
|
+
|
24
|
+
# Company's name.
|
25
|
+
attr_accessor :recipient_parent_name
|
26
|
+
|
27
|
+
# Description.
|
28
|
+
attr_accessor :award_description
|
29
|
+
|
30
|
+
# Recipient's country.
|
31
|
+
attr_accessor :country
|
32
|
+
|
33
|
+
# Period.
|
34
|
+
attr_accessor :action_date
|
35
|
+
|
36
|
+
# Income reported by lobbying firms.
|
37
|
+
attr_accessor :total_value
|
38
|
+
|
39
|
+
# Performance start date.
|
40
|
+
attr_accessor :performance_start_date
|
41
|
+
|
42
|
+
# Performance end date.
|
43
|
+
attr_accessor :performance_end_date
|
44
|
+
|
45
|
+
# Award agency.
|
46
|
+
attr_accessor :awarding_agency_name
|
47
|
+
|
48
|
+
# Award sub-agency.
|
49
|
+
attr_accessor :awarding_sub_agency_name
|
50
|
+
|
51
|
+
# Award office name.
|
52
|
+
attr_accessor :awarding_office_name
|
53
|
+
|
54
|
+
# Performance country.
|
55
|
+
attr_accessor :performance_country
|
56
|
+
|
57
|
+
# Performance city.
|
58
|
+
attr_accessor :performance_city
|
59
|
+
|
60
|
+
# Performance county.
|
61
|
+
attr_accessor :performance_county
|
62
|
+
|
63
|
+
# Performance state.
|
64
|
+
attr_accessor :performance_state
|
65
|
+
|
66
|
+
# Performance zip code.
|
67
|
+
attr_accessor :performance_zip_code
|
68
|
+
|
69
|
+
# Performance congressional district.
|
70
|
+
attr_accessor :performance_congressional_district
|
71
|
+
|
72
|
+
# NAICS code.
|
73
|
+
attr_accessor :naics_code
|
74
|
+
|
75
|
+
# Permalink.
|
76
|
+
attr_accessor :permalink
|
77
|
+
|
78
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
79
|
+
def self.attribute_map
|
80
|
+
{
|
81
|
+
:'symbol' => :'symbol',
|
82
|
+
:'recipient_name' => :'recipientName',
|
83
|
+
:'recipient_parent_name' => :'recipientParentName',
|
84
|
+
:'award_description' => :'awardDescription',
|
85
|
+
:'country' => :'country',
|
86
|
+
:'action_date' => :'actionDate',
|
87
|
+
:'total_value' => :'totalValue',
|
88
|
+
:'performance_start_date' => :'performanceStartDate',
|
89
|
+
:'performance_end_date' => :'performanceEndDate',
|
90
|
+
:'awarding_agency_name' => :'awardingAgencyName',
|
91
|
+
:'awarding_sub_agency_name' => :'awardingSubAgencyName',
|
92
|
+
:'awarding_office_name' => :'awardingOfficeName',
|
93
|
+
:'performance_country' => :'performanceCountry',
|
94
|
+
:'performance_city' => :'performanceCity',
|
95
|
+
:'performance_county' => :'performanceCounty',
|
96
|
+
:'performance_state' => :'performanceState',
|
97
|
+
:'performance_zip_code' => :'performanceZipCode',
|
98
|
+
:'performance_congressional_district' => :'performanceCongressionalDistrict',
|
99
|
+
:'naics_code' => :'naicsCode',
|
100
|
+
:'permalink' => :'permalink'
|
101
|
+
}
|
102
|
+
end
|
103
|
+
|
104
|
+
# Returns all the JSON keys this model knows about
|
105
|
+
def self.acceptable_attributes
|
106
|
+
attribute_map.values
|
107
|
+
end
|
108
|
+
|
109
|
+
# Attribute type mapping.
|
110
|
+
def self.openapi_types
|
111
|
+
{
|
112
|
+
:'symbol' => :'String',
|
113
|
+
:'recipient_name' => :'String',
|
114
|
+
:'recipient_parent_name' => :'String',
|
115
|
+
:'award_description' => :'String',
|
116
|
+
:'country' => :'String',
|
117
|
+
:'action_date' => :'String',
|
118
|
+
:'total_value' => :'Float',
|
119
|
+
:'performance_start_date' => :'String',
|
120
|
+
:'performance_end_date' => :'String',
|
121
|
+
:'awarding_agency_name' => :'String',
|
122
|
+
:'awarding_sub_agency_name' => :'String',
|
123
|
+
:'awarding_office_name' => :'String',
|
124
|
+
:'performance_country' => :'String',
|
125
|
+
:'performance_city' => :'String',
|
126
|
+
:'performance_county' => :'String',
|
127
|
+
:'performance_state' => :'String',
|
128
|
+
:'performance_zip_code' => :'String',
|
129
|
+
:'performance_congressional_district' => :'String',
|
130
|
+
:'naics_code' => :'String',
|
131
|
+
:'permalink' => :'String'
|
132
|
+
}
|
133
|
+
end
|
134
|
+
|
135
|
+
# List of attributes with nullable: true
|
136
|
+
def self.openapi_nullable
|
137
|
+
Set.new([
|
138
|
+
])
|
139
|
+
end
|
140
|
+
|
141
|
+
# Initializes the object
|
142
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
143
|
+
def initialize(attributes = {})
|
144
|
+
if (!attributes.is_a?(Hash))
|
145
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FinnhubRuby::UsaSpending` initialize method"
|
146
|
+
end
|
147
|
+
|
148
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
149
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
150
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
151
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FinnhubRuby::UsaSpending`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
152
|
+
end
|
153
|
+
h[k.to_sym] = v
|
154
|
+
}
|
155
|
+
|
156
|
+
if attributes.key?(:'symbol')
|
157
|
+
self.symbol = attributes[:'symbol']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'recipient_name')
|
161
|
+
self.recipient_name = attributes[:'recipient_name']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.key?(:'recipient_parent_name')
|
165
|
+
self.recipient_parent_name = attributes[:'recipient_parent_name']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.key?(:'award_description')
|
169
|
+
self.award_description = attributes[:'award_description']
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes.key?(:'country')
|
173
|
+
self.country = attributes[:'country']
|
174
|
+
end
|
175
|
+
|
176
|
+
if attributes.key?(:'action_date')
|
177
|
+
self.action_date = attributes[:'action_date']
|
178
|
+
end
|
179
|
+
|
180
|
+
if attributes.key?(:'total_value')
|
181
|
+
self.total_value = attributes[:'total_value']
|
182
|
+
end
|
183
|
+
|
184
|
+
if attributes.key?(:'performance_start_date')
|
185
|
+
self.performance_start_date = attributes[:'performance_start_date']
|
186
|
+
end
|
187
|
+
|
188
|
+
if attributes.key?(:'performance_end_date')
|
189
|
+
self.performance_end_date = attributes[:'performance_end_date']
|
190
|
+
end
|
191
|
+
|
192
|
+
if attributes.key?(:'awarding_agency_name')
|
193
|
+
self.awarding_agency_name = attributes[:'awarding_agency_name']
|
194
|
+
end
|
195
|
+
|
196
|
+
if attributes.key?(:'awarding_sub_agency_name')
|
197
|
+
self.awarding_sub_agency_name = attributes[:'awarding_sub_agency_name']
|
198
|
+
end
|
199
|
+
|
200
|
+
if attributes.key?(:'awarding_office_name')
|
201
|
+
self.awarding_office_name = attributes[:'awarding_office_name']
|
202
|
+
end
|
203
|
+
|
204
|
+
if attributes.key?(:'performance_country')
|
205
|
+
self.performance_country = attributes[:'performance_country']
|
206
|
+
end
|
207
|
+
|
208
|
+
if attributes.key?(:'performance_city')
|
209
|
+
self.performance_city = attributes[:'performance_city']
|
210
|
+
end
|
211
|
+
|
212
|
+
if attributes.key?(:'performance_county')
|
213
|
+
self.performance_county = attributes[:'performance_county']
|
214
|
+
end
|
215
|
+
|
216
|
+
if attributes.key?(:'performance_state')
|
217
|
+
self.performance_state = attributes[:'performance_state']
|
218
|
+
end
|
219
|
+
|
220
|
+
if attributes.key?(:'performance_zip_code')
|
221
|
+
self.performance_zip_code = attributes[:'performance_zip_code']
|
222
|
+
end
|
223
|
+
|
224
|
+
if attributes.key?(:'performance_congressional_district')
|
225
|
+
self.performance_congressional_district = attributes[:'performance_congressional_district']
|
226
|
+
end
|
227
|
+
|
228
|
+
if attributes.key?(:'naics_code')
|
229
|
+
self.naics_code = attributes[:'naics_code']
|
230
|
+
end
|
231
|
+
|
232
|
+
if attributes.key?(:'permalink')
|
233
|
+
self.permalink = attributes[:'permalink']
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
238
|
+
# @return Array for valid properties with the reasons
|
239
|
+
def list_invalid_properties
|
240
|
+
invalid_properties = Array.new
|
241
|
+
invalid_properties
|
242
|
+
end
|
243
|
+
|
244
|
+
# Check to see if the all the properties in the model are valid
|
245
|
+
# @return true if the model is valid
|
246
|
+
def valid?
|
247
|
+
true
|
248
|
+
end
|
249
|
+
|
250
|
+
# Checks equality by comparing each attribute.
|
251
|
+
# @param [Object] Object to be compared
|
252
|
+
def ==(o)
|
253
|
+
return true if self.equal?(o)
|
254
|
+
self.class == o.class &&
|
255
|
+
symbol == o.symbol &&
|
256
|
+
recipient_name == o.recipient_name &&
|
257
|
+
recipient_parent_name == o.recipient_parent_name &&
|
258
|
+
award_description == o.award_description &&
|
259
|
+
country == o.country &&
|
260
|
+
action_date == o.action_date &&
|
261
|
+
total_value == o.total_value &&
|
262
|
+
performance_start_date == o.performance_start_date &&
|
263
|
+
performance_end_date == o.performance_end_date &&
|
264
|
+
awarding_agency_name == o.awarding_agency_name &&
|
265
|
+
awarding_sub_agency_name == o.awarding_sub_agency_name &&
|
266
|
+
awarding_office_name == o.awarding_office_name &&
|
267
|
+
performance_country == o.performance_country &&
|
268
|
+
performance_city == o.performance_city &&
|
269
|
+
performance_county == o.performance_county &&
|
270
|
+
performance_state == o.performance_state &&
|
271
|
+
performance_zip_code == o.performance_zip_code &&
|
272
|
+
performance_congressional_district == o.performance_congressional_district &&
|
273
|
+
naics_code == o.naics_code &&
|
274
|
+
permalink == o.permalink
|
275
|
+
end
|
276
|
+
|
277
|
+
# @see the `==` method
|
278
|
+
# @param [Object] Object to be compared
|
279
|
+
def eql?(o)
|
280
|
+
self == o
|
281
|
+
end
|
282
|
+
|
283
|
+
# Calculates hash code according to all attributes.
|
284
|
+
# @return [Integer] Hash code
|
285
|
+
def hash
|
286
|
+
[symbol, recipient_name, recipient_parent_name, award_description, country, action_date, total_value, performance_start_date, performance_end_date, awarding_agency_name, awarding_sub_agency_name, awarding_office_name, performance_country, performance_city, performance_county, performance_state, performance_zip_code, performance_congressional_district, naics_code, permalink].hash
|
287
|
+
end
|
288
|
+
|
289
|
+
# Builds the object from hash
|
290
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
291
|
+
# @return [Object] Returns the model itself
|
292
|
+
def self.build_from_hash(attributes)
|
293
|
+
new.build_from_hash(attributes)
|
294
|
+
end
|
295
|
+
|
296
|
+
# Builds the object from hash
|
297
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
298
|
+
# @return [Object] Returns the model itself
|
299
|
+
def build_from_hash(attributes)
|
300
|
+
return nil unless attributes.is_a?(Hash)
|
301
|
+
self.class.openapi_types.each_pair do |key, type|
|
302
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
303
|
+
self.send("#{key}=", nil)
|
304
|
+
elsif type =~ /\AArray<(.*)>/i
|
305
|
+
# check to ensure the input is an array given that the attribute
|
306
|
+
# is documented as an array but the input is not
|
307
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
308
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
309
|
+
end
|
310
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
311
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
312
|
+
end
|
313
|
+
end
|
314
|
+
|
315
|
+
self
|
316
|
+
end
|
317
|
+
|
318
|
+
# Deserializes the data based on type
|
319
|
+
# @param string type Data type
|
320
|
+
# @param string value Value to be deserialized
|
321
|
+
# @return [Object] Deserialized data
|
322
|
+
def _deserialize(type, value)
|
323
|
+
case type.to_sym
|
324
|
+
when :Time
|
325
|
+
Time.parse(value)
|
326
|
+
when :Date
|
327
|
+
Date.parse(value)
|
328
|
+
when :String
|
329
|
+
value.to_s
|
330
|
+
when :Integer
|
331
|
+
value.to_i
|
332
|
+
when :Float
|
333
|
+
value.to_f
|
334
|
+
when :Boolean
|
335
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
336
|
+
true
|
337
|
+
else
|
338
|
+
false
|
339
|
+
end
|
340
|
+
when :Object
|
341
|
+
# generic object (usually a Hash), return directly
|
342
|
+
value
|
343
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
344
|
+
inner_type = Regexp.last_match[:inner_type]
|
345
|
+
value.map { |v| _deserialize(inner_type, v) }
|
346
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
347
|
+
k_type = Regexp.last_match[:k_type]
|
348
|
+
v_type = Regexp.last_match[:v_type]
|
349
|
+
{}.tap do |hash|
|
350
|
+
value.each do |k, v|
|
351
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
352
|
+
end
|
353
|
+
end
|
354
|
+
else # model
|
355
|
+
# models (e.g. Pet) or oneOf
|
356
|
+
klass = FinnhubRuby.const_get(type)
|
357
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
361
|
+
# Returns the string representation of the object
|
362
|
+
# @return [String] String presentation of the object
|
363
|
+
def to_s
|
364
|
+
to_hash.to_s
|
365
|
+
end
|
366
|
+
|
367
|
+
# to_body is an alias to to_hash (backward compatibility)
|
368
|
+
# @return [Hash] Returns the object in the form of hash
|
369
|
+
def to_body
|
370
|
+
to_hash
|
371
|
+
end
|
372
|
+
|
373
|
+
# Returns the object in the form of hash
|
374
|
+
# @return [Hash] Returns the object in the form of hash
|
375
|
+
def to_hash
|
376
|
+
hash = {}
|
377
|
+
self.class.attribute_map.each_pair do |attr, param|
|
378
|
+
value = self.send(attr)
|
379
|
+
if value.nil?
|
380
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
381
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
382
|
+
end
|
383
|
+
|
384
|
+
hash[param] = _to_hash(value)
|
385
|
+
end
|
386
|
+
hash
|
387
|
+
end
|
388
|
+
|
389
|
+
# Outputs non-array value in the form of hash
|
390
|
+
# For object, use to_hash. Otherwise, just return the value
|
391
|
+
# @param [Object] value Any valid value
|
392
|
+
# @return [Hash] Returns the value in the form of hash
|
393
|
+
def _to_hash(value)
|
394
|
+
if value.is_a?(Array)
|
395
|
+
value.compact.map { |v| _to_hash(v) }
|
396
|
+
elsif value.is_a?(Hash)
|
397
|
+
{}.tap do |hash|
|
398
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
399
|
+
end
|
400
|
+
elsif value.respond_to? :to_hash
|
401
|
+
value.to_hash
|
402
|
+
else
|
403
|
+
value
|
404
|
+
end
|
405
|
+
end
|
406
|
+
|
407
|
+
end
|
408
|
+
|
409
|
+
end
|
@@ -0,0 +1,231 @@
|
|
1
|
+
=begin
|
2
|
+
#Finnhub API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module FinnhubRuby
|
17
|
+
class UsaSpendingResult
|
18
|
+
# Symbol.
|
19
|
+
attr_accessor :symbol
|
20
|
+
|
21
|
+
# Array of government's spending data points.
|
22
|
+
attr_accessor :data
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'symbol' => :'symbol',
|
28
|
+
:'data' => :'data'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns all the JSON keys this model knows about
|
33
|
+
def self.acceptable_attributes
|
34
|
+
attribute_map.values
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.openapi_types
|
39
|
+
{
|
40
|
+
:'symbol' => :'String',
|
41
|
+
:'data' => :'Array<UsaSpending>'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of attributes with nullable: true
|
46
|
+
def self.openapi_nullable
|
47
|
+
Set.new([
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
if (!attributes.is_a?(Hash))
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FinnhubRuby::UsaSpendingResult` initialize method"
|
56
|
+
end
|
57
|
+
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FinnhubRuby::UsaSpendingResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
|
+
end
|
63
|
+
h[k.to_sym] = v
|
64
|
+
}
|
65
|
+
|
66
|
+
if attributes.key?(:'symbol')
|
67
|
+
self.symbol = attributes[:'symbol']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'data')
|
71
|
+
if (value = attributes[:'data']).is_a?(Array)
|
72
|
+
self.data = value
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
78
|
+
# @return Array for valid properties with the reasons
|
79
|
+
def list_invalid_properties
|
80
|
+
invalid_properties = Array.new
|
81
|
+
invalid_properties
|
82
|
+
end
|
83
|
+
|
84
|
+
# Check to see if the all the properties in the model are valid
|
85
|
+
# @return true if the model is valid
|
86
|
+
def valid?
|
87
|
+
true
|
88
|
+
end
|
89
|
+
|
90
|
+
# Checks equality by comparing each attribute.
|
91
|
+
# @param [Object] Object to be compared
|
92
|
+
def ==(o)
|
93
|
+
return true if self.equal?(o)
|
94
|
+
self.class == o.class &&
|
95
|
+
symbol == o.symbol &&
|
96
|
+
data == o.data
|
97
|
+
end
|
98
|
+
|
99
|
+
# @see the `==` method
|
100
|
+
# @param [Object] Object to be compared
|
101
|
+
def eql?(o)
|
102
|
+
self == o
|
103
|
+
end
|
104
|
+
|
105
|
+
# Calculates hash code according to all attributes.
|
106
|
+
# @return [Integer] Hash code
|
107
|
+
def hash
|
108
|
+
[symbol, data].hash
|
109
|
+
end
|
110
|
+
|
111
|
+
# Builds the object from hash
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
113
|
+
# @return [Object] Returns the model itself
|
114
|
+
def self.build_from_hash(attributes)
|
115
|
+
new.build_from_hash(attributes)
|
116
|
+
end
|
117
|
+
|
118
|
+
# Builds the object from hash
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
120
|
+
# @return [Object] Returns the model itself
|
121
|
+
def build_from_hash(attributes)
|
122
|
+
return nil unless attributes.is_a?(Hash)
|
123
|
+
self.class.openapi_types.each_pair do |key, type|
|
124
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
125
|
+
self.send("#{key}=", nil)
|
126
|
+
elsif type =~ /\AArray<(.*)>/i
|
127
|
+
# check to ensure the input is an array given that the attribute
|
128
|
+
# is documented as an array but the input is not
|
129
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
130
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
131
|
+
end
|
132
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
133
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
self
|
138
|
+
end
|
139
|
+
|
140
|
+
# Deserializes the data based on type
|
141
|
+
# @param string type Data type
|
142
|
+
# @param string value Value to be deserialized
|
143
|
+
# @return [Object] Deserialized data
|
144
|
+
def _deserialize(type, value)
|
145
|
+
case type.to_sym
|
146
|
+
when :Time
|
147
|
+
Time.parse(value)
|
148
|
+
when :Date
|
149
|
+
Date.parse(value)
|
150
|
+
when :String
|
151
|
+
value.to_s
|
152
|
+
when :Integer
|
153
|
+
value.to_i
|
154
|
+
when :Float
|
155
|
+
value.to_f
|
156
|
+
when :Boolean
|
157
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
158
|
+
true
|
159
|
+
else
|
160
|
+
false
|
161
|
+
end
|
162
|
+
when :Object
|
163
|
+
# generic object (usually a Hash), return directly
|
164
|
+
value
|
165
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
166
|
+
inner_type = Regexp.last_match[:inner_type]
|
167
|
+
value.map { |v| _deserialize(inner_type, v) }
|
168
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
169
|
+
k_type = Regexp.last_match[:k_type]
|
170
|
+
v_type = Regexp.last_match[:v_type]
|
171
|
+
{}.tap do |hash|
|
172
|
+
value.each do |k, v|
|
173
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
else # model
|
177
|
+
# models (e.g. Pet) or oneOf
|
178
|
+
klass = FinnhubRuby.const_get(type)
|
179
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the string representation of the object
|
184
|
+
# @return [String] String presentation of the object
|
185
|
+
def to_s
|
186
|
+
to_hash.to_s
|
187
|
+
end
|
188
|
+
|
189
|
+
# to_body is an alias to to_hash (backward compatibility)
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_body
|
192
|
+
to_hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the object in the form of hash
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_hash
|
198
|
+
hash = {}
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
200
|
+
value = self.send(attr)
|
201
|
+
if value.nil?
|
202
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
203
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
204
|
+
end
|
205
|
+
|
206
|
+
hash[param] = _to_hash(value)
|
207
|
+
end
|
208
|
+
hash
|
209
|
+
end
|
210
|
+
|
211
|
+
# Outputs non-array value in the form of hash
|
212
|
+
# For object, use to_hash. Otherwise, just return the value
|
213
|
+
# @param [Object] value Any valid value
|
214
|
+
# @return [Hash] Returns the value in the form of hash
|
215
|
+
def _to_hash(value)
|
216
|
+
if value.is_a?(Array)
|
217
|
+
value.compact.map { |v| _to_hash(v) }
|
218
|
+
elsif value.is_a?(Hash)
|
219
|
+
{}.tap do |hash|
|
220
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
221
|
+
end
|
222
|
+
elsif value.respond_to? :to_hash
|
223
|
+
value.to_hash
|
224
|
+
else
|
225
|
+
value
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
230
|
+
|
231
|
+
end
|
@@ -76,7 +76,7 @@ module FinnhubRuby
|
|
76
76
|
attr_accessor :wage_range_to
|
77
77
|
|
78
78
|
# Wage unit of pay.
|
79
|
-
attr_accessor :
|
79
|
+
attr_accessor :wage_unit_of_pay
|
80
80
|
|
81
81
|
# Wage level.
|
82
82
|
attr_accessor :wage_level
|
@@ -107,7 +107,7 @@ module FinnhubRuby
|
|
107
107
|
:'worksite_postal_code' => :'worksitePostalCode',
|
108
108
|
:'wage_range_from' => :'wageRangeFrom',
|
109
109
|
:'wage_range_to' => :'wageRangeTo',
|
110
|
-
:'
|
110
|
+
:'wage_unit_of_pay' => :'wageUnitOfPay',
|
111
111
|
:'wage_level' => :'wageLevel',
|
112
112
|
:'h1b_dependent' => :'h1bDependent'
|
113
113
|
}
|
@@ -141,7 +141,7 @@ module FinnhubRuby
|
|
141
141
|
:'worksite_postal_code' => :'String',
|
142
142
|
:'wage_range_from' => :'Float',
|
143
143
|
:'wage_range_to' => :'Float',
|
144
|
-
:'
|
144
|
+
:'wage_unit_of_pay' => :'String',
|
145
145
|
:'wage_level' => :'String',
|
146
146
|
:'h1b_dependent' => :'String'
|
147
147
|
}
|
@@ -248,8 +248,8 @@ module FinnhubRuby
|
|
248
248
|
self.wage_range_to = attributes[:'wage_range_to']
|
249
249
|
end
|
250
250
|
|
251
|
-
if attributes.key?(:'
|
252
|
-
self.
|
251
|
+
if attributes.key?(:'wage_unit_of_pay')
|
252
|
+
self.wage_unit_of_pay = attributes[:'wage_unit_of_pay']
|
253
253
|
end
|
254
254
|
|
255
255
|
if attributes.key?(:'wage_level')
|
@@ -299,7 +299,7 @@ module FinnhubRuby
|
|
299
299
|
worksite_postal_code == o.worksite_postal_code &&
|
300
300
|
wage_range_from == o.wage_range_from &&
|
301
301
|
wage_range_to == o.wage_range_to &&
|
302
|
-
|
302
|
+
wage_unit_of_pay == o.wage_unit_of_pay &&
|
303
303
|
wage_level == o.wage_level &&
|
304
304
|
h1b_dependent == o.h1b_dependent
|
305
305
|
end
|
@@ -313,7 +313,7 @@ module FinnhubRuby
|
|
313
313
|
# Calculates hash code according to all attributes.
|
314
314
|
# @return [Integer] Hash code
|
315
315
|
def hash
|
316
|
-
[year, quarter, symbol, case_number, case_status, received_date, visa_class, job_title, soc_code, full_time_position, begin_date, end_date, employer_name, worksite_address, worksite_city, worksite_county, worksite_state, worksite_postal_code, wage_range_from, wage_range_to,
|
316
|
+
[year, quarter, symbol, case_number, case_status, received_date, visa_class, job_title, soc_code, full_time_position, begin_date, end_date, employer_name, worksite_address, worksite_city, worksite_county, worksite_state, worksite_postal_code, wage_range_from, wage_range_to, wage_unit_of_pay, wage_level, h1b_dependent].hash
|
317
317
|
end
|
318
318
|
|
319
319
|
# Builds the object from hash
|
data/lib/finnhub_ruby/version.rb
CHANGED