finnhub_ruby 1.1.9 → 1.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -3
- data/docs/CryptoProfile.md +38 -0
- data/docs/DefaultApi.md +396 -11
- data/docs/EbitEstimates.md +22 -0
- data/docs/EbitEstimatesInfo.md +26 -0
- data/docs/EbitdaEstimates.md +22 -0
- data/docs/EbitdaEstimatesInfo.md +26 -0
- data/docs/MutualFundProfileData.md +9 -1
- data/docs/StockSymbol.md +7 -1
- data/docs/Transactions.md +2 -0
- data/docs/UsptoPatent.md +34 -0
- data/docs/UsptoPatentResult.md +20 -0
- data/docs/VisaApplication.md +62 -0
- data/docs/VisaApplicationResult.md +20 -0
- data/finnhub_ruby-1.1.10.gem +0 -0
- data/finnhub_ruby-1.1.11.gem +0 -0
- data/finnhub_ruby-1.1.12.gem +0 -0
- data/finnhub_ruby-1.1.9.gem +0 -0
- data/lib/finnhub_ruby/api/default_api.rb +369 -6
- data/lib/finnhub_ruby/models/crypto_profile.rb +319 -0
- data/lib/finnhub_ruby/models/ebit_estimates.rb +241 -0
- data/lib/finnhub_ruby/models/ebit_estimates_info.rb +259 -0
- data/lib/finnhub_ruby/models/ebitda_estimates.rb +241 -0
- data/lib/finnhub_ruby/models/ebitda_estimates_info.rb +259 -0
- data/lib/finnhub_ruby/models/mutual_fund_profile_data.rb +44 -4
- data/lib/finnhub_ruby/models/stock_symbol.rb +34 -4
- data/lib/finnhub_ruby/models/transactions.rb +11 -1
- data/lib/finnhub_ruby/models/uspto_patent.rb +301 -0
- data/lib/finnhub_ruby/models/uspto_patent_result.rb +231 -0
- data/lib/finnhub_ruby/models/visa_application.rb +439 -0
- data/lib/finnhub_ruby/models/visa_application_result.rb +231 -0
- data/lib/finnhub_ruby/version.rb +1 -1
- data/lib/finnhub_ruby.rb +9 -0
- data/spec/models/crypto_profile_spec.rb +94 -0
- data/spec/models/ebit_estimates_info_spec.rb +58 -0
- data/spec/models/ebit_estimates_spec.rb +46 -0
- data/spec/models/ebitda_estimates_info_spec.rb +58 -0
- data/spec/models/ebitda_estimates_spec.rb +46 -0
- data/spec/models/uspto_patent_result_spec.rb +40 -0
- data/spec/models/uspto_patent_spec.rb +82 -0
- data/spec/models/visa_application_result_spec.rb +40 -0
- data/spec/models/visa_application_spec.rb +166 -0
- metadata +42 -2
@@ -0,0 +1,439 @@
|
|
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 VisaApplication
|
18
|
+
# Year.
|
19
|
+
attr_accessor :year
|
20
|
+
|
21
|
+
# Quarter.
|
22
|
+
attr_accessor :quarter
|
23
|
+
|
24
|
+
# Symbol.
|
25
|
+
attr_accessor :symbol
|
26
|
+
|
27
|
+
# Case number.
|
28
|
+
attr_accessor :case_number
|
29
|
+
|
30
|
+
# Case status.
|
31
|
+
attr_accessor :case_status
|
32
|
+
|
33
|
+
# Received date.
|
34
|
+
attr_accessor :received_date
|
35
|
+
|
36
|
+
# Visa class.
|
37
|
+
attr_accessor :visa_class
|
38
|
+
|
39
|
+
# Job Title.
|
40
|
+
attr_accessor :job_title
|
41
|
+
|
42
|
+
# SOC Code. A list of SOC code can be found <a href=\"https://www.bls.gov/oes/current/oes_stru.htm\" target=\"_blank\">here</a>.
|
43
|
+
attr_accessor :soc_code
|
44
|
+
|
45
|
+
# Full-time position flag.
|
46
|
+
attr_accessor :full_time_position
|
47
|
+
|
48
|
+
# Job's start date.
|
49
|
+
attr_accessor :begin_date
|
50
|
+
|
51
|
+
# Job's end date.
|
52
|
+
attr_accessor :end_date
|
53
|
+
|
54
|
+
# Company's name.
|
55
|
+
attr_accessor :employer_name
|
56
|
+
|
57
|
+
# Worksite address.
|
58
|
+
attr_accessor :worksite_address
|
59
|
+
|
60
|
+
# Worksite city.
|
61
|
+
attr_accessor :worksite_city
|
62
|
+
|
63
|
+
# Worksite county.
|
64
|
+
attr_accessor :worksite_county
|
65
|
+
|
66
|
+
# Worksite state.
|
67
|
+
attr_accessor :worksite_state
|
68
|
+
|
69
|
+
# Worksite postal code.
|
70
|
+
attr_accessor :worksite_postal_code
|
71
|
+
|
72
|
+
# Wage range from.
|
73
|
+
attr_accessor :wage_range_from
|
74
|
+
|
75
|
+
# Wage range to.
|
76
|
+
attr_accessor :wage_range_to
|
77
|
+
|
78
|
+
# Wage unit of pay.
|
79
|
+
attr_accessor :wave_unit_of_pay
|
80
|
+
|
81
|
+
# Wage level.
|
82
|
+
attr_accessor :wage_level
|
83
|
+
|
84
|
+
# H1B dependent flag.
|
85
|
+
attr_accessor :h1b_dependent
|
86
|
+
|
87
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
88
|
+
def self.attribute_map
|
89
|
+
{
|
90
|
+
:'year' => :'year',
|
91
|
+
:'quarter' => :'quarter',
|
92
|
+
:'symbol' => :'symbol',
|
93
|
+
:'case_number' => :'caseNumber',
|
94
|
+
:'case_status' => :'caseStatus',
|
95
|
+
:'received_date' => :'receivedDate',
|
96
|
+
:'visa_class' => :'visaClass',
|
97
|
+
:'job_title' => :'jobTitle',
|
98
|
+
:'soc_code' => :'socCode',
|
99
|
+
:'full_time_position' => :'fullTimePosition',
|
100
|
+
:'begin_date' => :'beginDate',
|
101
|
+
:'end_date' => :'endDate',
|
102
|
+
:'employer_name' => :'employerName',
|
103
|
+
:'worksite_address' => :'worksiteAddress',
|
104
|
+
:'worksite_city' => :'worksiteCity',
|
105
|
+
:'worksite_county' => :'worksiteCounty',
|
106
|
+
:'worksite_state' => :'worksiteState',
|
107
|
+
:'worksite_postal_code' => :'worksitePostalCode',
|
108
|
+
:'wage_range_from' => :'wageRangeFrom',
|
109
|
+
:'wage_range_to' => :'wageRangeTo',
|
110
|
+
:'wave_unit_of_pay' => :'waveUnitOfPay',
|
111
|
+
:'wage_level' => :'wageLevel',
|
112
|
+
:'h1b_dependent' => :'h1bDependent'
|
113
|
+
}
|
114
|
+
end
|
115
|
+
|
116
|
+
# Returns all the JSON keys this model knows about
|
117
|
+
def self.acceptable_attributes
|
118
|
+
attribute_map.values
|
119
|
+
end
|
120
|
+
|
121
|
+
# Attribute type mapping.
|
122
|
+
def self.openapi_types
|
123
|
+
{
|
124
|
+
:'year' => :'Integer',
|
125
|
+
:'quarter' => :'Integer',
|
126
|
+
:'symbol' => :'String',
|
127
|
+
:'case_number' => :'String',
|
128
|
+
:'case_status' => :'String',
|
129
|
+
:'received_date' => :'String',
|
130
|
+
:'visa_class' => :'String',
|
131
|
+
:'job_title' => :'String',
|
132
|
+
:'soc_code' => :'String',
|
133
|
+
:'full_time_position' => :'String',
|
134
|
+
:'begin_date' => :'String',
|
135
|
+
:'end_date' => :'String',
|
136
|
+
:'employer_name' => :'String',
|
137
|
+
:'worksite_address' => :'String',
|
138
|
+
:'worksite_city' => :'String',
|
139
|
+
:'worksite_county' => :'String',
|
140
|
+
:'worksite_state' => :'String',
|
141
|
+
:'worksite_postal_code' => :'String',
|
142
|
+
:'wage_range_from' => :'Float',
|
143
|
+
:'wage_range_to' => :'Float',
|
144
|
+
:'wave_unit_of_pay' => :'String',
|
145
|
+
:'wage_level' => :'String',
|
146
|
+
:'h1b_dependent' => :'String'
|
147
|
+
}
|
148
|
+
end
|
149
|
+
|
150
|
+
# List of attributes with nullable: true
|
151
|
+
def self.openapi_nullable
|
152
|
+
Set.new([
|
153
|
+
])
|
154
|
+
end
|
155
|
+
|
156
|
+
# Initializes the object
|
157
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
158
|
+
def initialize(attributes = {})
|
159
|
+
if (!attributes.is_a?(Hash))
|
160
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FinnhubRuby::VisaApplication` initialize method"
|
161
|
+
end
|
162
|
+
|
163
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
164
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
165
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
166
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FinnhubRuby::VisaApplication`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
167
|
+
end
|
168
|
+
h[k.to_sym] = v
|
169
|
+
}
|
170
|
+
|
171
|
+
if attributes.key?(:'year')
|
172
|
+
self.year = attributes[:'year']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'quarter')
|
176
|
+
self.quarter = attributes[:'quarter']
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.key?(:'symbol')
|
180
|
+
self.symbol = attributes[:'symbol']
|
181
|
+
end
|
182
|
+
|
183
|
+
if attributes.key?(:'case_number')
|
184
|
+
self.case_number = attributes[:'case_number']
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.key?(:'case_status')
|
188
|
+
self.case_status = attributes[:'case_status']
|
189
|
+
end
|
190
|
+
|
191
|
+
if attributes.key?(:'received_date')
|
192
|
+
self.received_date = attributes[:'received_date']
|
193
|
+
end
|
194
|
+
|
195
|
+
if attributes.key?(:'visa_class')
|
196
|
+
self.visa_class = attributes[:'visa_class']
|
197
|
+
end
|
198
|
+
|
199
|
+
if attributes.key?(:'job_title')
|
200
|
+
self.job_title = attributes[:'job_title']
|
201
|
+
end
|
202
|
+
|
203
|
+
if attributes.key?(:'soc_code')
|
204
|
+
self.soc_code = attributes[:'soc_code']
|
205
|
+
end
|
206
|
+
|
207
|
+
if attributes.key?(:'full_time_position')
|
208
|
+
self.full_time_position = attributes[:'full_time_position']
|
209
|
+
end
|
210
|
+
|
211
|
+
if attributes.key?(:'begin_date')
|
212
|
+
self.begin_date = attributes[:'begin_date']
|
213
|
+
end
|
214
|
+
|
215
|
+
if attributes.key?(:'end_date')
|
216
|
+
self.end_date = attributes[:'end_date']
|
217
|
+
end
|
218
|
+
|
219
|
+
if attributes.key?(:'employer_name')
|
220
|
+
self.employer_name = attributes[:'employer_name']
|
221
|
+
end
|
222
|
+
|
223
|
+
if attributes.key?(:'worksite_address')
|
224
|
+
self.worksite_address = attributes[:'worksite_address']
|
225
|
+
end
|
226
|
+
|
227
|
+
if attributes.key?(:'worksite_city')
|
228
|
+
self.worksite_city = attributes[:'worksite_city']
|
229
|
+
end
|
230
|
+
|
231
|
+
if attributes.key?(:'worksite_county')
|
232
|
+
self.worksite_county = attributes[:'worksite_county']
|
233
|
+
end
|
234
|
+
|
235
|
+
if attributes.key?(:'worksite_state')
|
236
|
+
self.worksite_state = attributes[:'worksite_state']
|
237
|
+
end
|
238
|
+
|
239
|
+
if attributes.key?(:'worksite_postal_code')
|
240
|
+
self.worksite_postal_code = attributes[:'worksite_postal_code']
|
241
|
+
end
|
242
|
+
|
243
|
+
if attributes.key?(:'wage_range_from')
|
244
|
+
self.wage_range_from = attributes[:'wage_range_from']
|
245
|
+
end
|
246
|
+
|
247
|
+
if attributes.key?(:'wage_range_to')
|
248
|
+
self.wage_range_to = attributes[:'wage_range_to']
|
249
|
+
end
|
250
|
+
|
251
|
+
if attributes.key?(:'wave_unit_of_pay')
|
252
|
+
self.wave_unit_of_pay = attributes[:'wave_unit_of_pay']
|
253
|
+
end
|
254
|
+
|
255
|
+
if attributes.key?(:'wage_level')
|
256
|
+
self.wage_level = attributes[:'wage_level']
|
257
|
+
end
|
258
|
+
|
259
|
+
if attributes.key?(:'h1b_dependent')
|
260
|
+
self.h1b_dependent = attributes[:'h1b_dependent']
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
264
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
265
|
+
# @return Array for valid properties with the reasons
|
266
|
+
def list_invalid_properties
|
267
|
+
invalid_properties = Array.new
|
268
|
+
invalid_properties
|
269
|
+
end
|
270
|
+
|
271
|
+
# Check to see if the all the properties in the model are valid
|
272
|
+
# @return true if the model is valid
|
273
|
+
def valid?
|
274
|
+
true
|
275
|
+
end
|
276
|
+
|
277
|
+
# Checks equality by comparing each attribute.
|
278
|
+
# @param [Object] Object to be compared
|
279
|
+
def ==(o)
|
280
|
+
return true if self.equal?(o)
|
281
|
+
self.class == o.class &&
|
282
|
+
year == o.year &&
|
283
|
+
quarter == o.quarter &&
|
284
|
+
symbol == o.symbol &&
|
285
|
+
case_number == o.case_number &&
|
286
|
+
case_status == o.case_status &&
|
287
|
+
received_date == o.received_date &&
|
288
|
+
visa_class == o.visa_class &&
|
289
|
+
job_title == o.job_title &&
|
290
|
+
soc_code == o.soc_code &&
|
291
|
+
full_time_position == o.full_time_position &&
|
292
|
+
begin_date == o.begin_date &&
|
293
|
+
end_date == o.end_date &&
|
294
|
+
employer_name == o.employer_name &&
|
295
|
+
worksite_address == o.worksite_address &&
|
296
|
+
worksite_city == o.worksite_city &&
|
297
|
+
worksite_county == o.worksite_county &&
|
298
|
+
worksite_state == o.worksite_state &&
|
299
|
+
worksite_postal_code == o.worksite_postal_code &&
|
300
|
+
wage_range_from == o.wage_range_from &&
|
301
|
+
wage_range_to == o.wage_range_to &&
|
302
|
+
wave_unit_of_pay == o.wave_unit_of_pay &&
|
303
|
+
wage_level == o.wage_level &&
|
304
|
+
h1b_dependent == o.h1b_dependent
|
305
|
+
end
|
306
|
+
|
307
|
+
# @see the `==` method
|
308
|
+
# @param [Object] Object to be compared
|
309
|
+
def eql?(o)
|
310
|
+
self == o
|
311
|
+
end
|
312
|
+
|
313
|
+
# Calculates hash code according to all attributes.
|
314
|
+
# @return [Integer] Hash code
|
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, wave_unit_of_pay, wage_level, h1b_dependent].hash
|
317
|
+
end
|
318
|
+
|
319
|
+
# Builds the object from hash
|
320
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
321
|
+
# @return [Object] Returns the model itself
|
322
|
+
def self.build_from_hash(attributes)
|
323
|
+
new.build_from_hash(attributes)
|
324
|
+
end
|
325
|
+
|
326
|
+
# Builds the object from hash
|
327
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
328
|
+
# @return [Object] Returns the model itself
|
329
|
+
def build_from_hash(attributes)
|
330
|
+
return nil unless attributes.is_a?(Hash)
|
331
|
+
self.class.openapi_types.each_pair do |key, type|
|
332
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
333
|
+
self.send("#{key}=", nil)
|
334
|
+
elsif type =~ /\AArray<(.*)>/i
|
335
|
+
# check to ensure the input is an array given that the attribute
|
336
|
+
# is documented as an array but the input is not
|
337
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
338
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
339
|
+
end
|
340
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
341
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
self
|
346
|
+
end
|
347
|
+
|
348
|
+
# Deserializes the data based on type
|
349
|
+
# @param string type Data type
|
350
|
+
# @param string value Value to be deserialized
|
351
|
+
# @return [Object] Deserialized data
|
352
|
+
def _deserialize(type, value)
|
353
|
+
case type.to_sym
|
354
|
+
when :Time
|
355
|
+
Time.parse(value)
|
356
|
+
when :Date
|
357
|
+
Date.parse(value)
|
358
|
+
when :String
|
359
|
+
value.to_s
|
360
|
+
when :Integer
|
361
|
+
value.to_i
|
362
|
+
when :Float
|
363
|
+
value.to_f
|
364
|
+
when :Boolean
|
365
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
366
|
+
true
|
367
|
+
else
|
368
|
+
false
|
369
|
+
end
|
370
|
+
when :Object
|
371
|
+
# generic object (usually a Hash), return directly
|
372
|
+
value
|
373
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
374
|
+
inner_type = Regexp.last_match[:inner_type]
|
375
|
+
value.map { |v| _deserialize(inner_type, v) }
|
376
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
377
|
+
k_type = Regexp.last_match[:k_type]
|
378
|
+
v_type = Regexp.last_match[:v_type]
|
379
|
+
{}.tap do |hash|
|
380
|
+
value.each do |k, v|
|
381
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
382
|
+
end
|
383
|
+
end
|
384
|
+
else # model
|
385
|
+
# models (e.g. Pet) or oneOf
|
386
|
+
klass = FinnhubRuby.const_get(type)
|
387
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
388
|
+
end
|
389
|
+
end
|
390
|
+
|
391
|
+
# Returns the string representation of the object
|
392
|
+
# @return [String] String presentation of the object
|
393
|
+
def to_s
|
394
|
+
to_hash.to_s
|
395
|
+
end
|
396
|
+
|
397
|
+
# to_body is an alias to to_hash (backward compatibility)
|
398
|
+
# @return [Hash] Returns the object in the form of hash
|
399
|
+
def to_body
|
400
|
+
to_hash
|
401
|
+
end
|
402
|
+
|
403
|
+
# Returns the object in the form of hash
|
404
|
+
# @return [Hash] Returns the object in the form of hash
|
405
|
+
def to_hash
|
406
|
+
hash = {}
|
407
|
+
self.class.attribute_map.each_pair do |attr, param|
|
408
|
+
value = self.send(attr)
|
409
|
+
if value.nil?
|
410
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
411
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
412
|
+
end
|
413
|
+
|
414
|
+
hash[param] = _to_hash(value)
|
415
|
+
end
|
416
|
+
hash
|
417
|
+
end
|
418
|
+
|
419
|
+
# Outputs non-array value in the form of hash
|
420
|
+
# For object, use to_hash. Otherwise, just return the value
|
421
|
+
# @param [Object] value Any valid value
|
422
|
+
# @return [Hash] Returns the value in the form of hash
|
423
|
+
def _to_hash(value)
|
424
|
+
if value.is_a?(Array)
|
425
|
+
value.compact.map { |v| _to_hash(v) }
|
426
|
+
elsif value.is_a?(Hash)
|
427
|
+
{}.tap do |hash|
|
428
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
429
|
+
end
|
430
|
+
elsif value.respond_to? :to_hash
|
431
|
+
value.to_hash
|
432
|
+
else
|
433
|
+
value
|
434
|
+
end
|
435
|
+
end
|
436
|
+
|
437
|
+
end
|
438
|
+
|
439
|
+
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 VisaApplicationResult
|
18
|
+
# Symbol.
|
19
|
+
attr_accessor :symbol
|
20
|
+
|
21
|
+
# Array of H1b and Permanent visa applications.
|
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<VisaApplication>'
|
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::VisaApplicationResult` 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::VisaApplicationResult`. 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
|
data/lib/finnhub_ruby/version.rb
CHANGED
data/lib/finnhub_ruby.rb
CHANGED
@@ -32,6 +32,7 @@ require 'finnhub_ruby/models/company_profile2'
|
|
32
32
|
require 'finnhub_ruby/models/country_metadata'
|
33
33
|
require 'finnhub_ruby/models/covid_info'
|
34
34
|
require 'finnhub_ruby/models/crypto_candles'
|
35
|
+
require 'finnhub_ruby/models/crypto_profile'
|
35
36
|
require 'finnhub_ruby/models/crypto_symbol'
|
36
37
|
require 'finnhub_ruby/models/development'
|
37
38
|
require 'finnhub_ruby/models/dividends'
|
@@ -52,6 +53,10 @@ require 'finnhub_ruby/models/earnings_call_transcripts'
|
|
52
53
|
require 'finnhub_ruby/models/earnings_call_transcripts_list'
|
53
54
|
require 'finnhub_ruby/models/earnings_estimates'
|
54
55
|
require 'finnhub_ruby/models/earnings_estimates_info'
|
56
|
+
require 'finnhub_ruby/models/ebit_estimates'
|
57
|
+
require 'finnhub_ruby/models/ebit_estimates_info'
|
58
|
+
require 'finnhub_ruby/models/ebitda_estimates'
|
59
|
+
require 'finnhub_ruby/models/ebitda_estimates_info'
|
55
60
|
require 'finnhub_ruby/models/economic_calendar'
|
56
61
|
require 'finnhub_ruby/models/economic_code'
|
57
62
|
require 'finnhub_ruby/models/economic_data'
|
@@ -123,6 +128,10 @@ require 'finnhub_ruby/models/transcript_participant'
|
|
123
128
|
require 'finnhub_ruby/models/trend'
|
124
129
|
require 'finnhub_ruby/models/twitter_sentiment_content'
|
125
130
|
require 'finnhub_ruby/models/upgrade_downgrade'
|
131
|
+
require 'finnhub_ruby/models/uspto_patent'
|
132
|
+
require 'finnhub_ruby/models/uspto_patent_result'
|
133
|
+
require 'finnhub_ruby/models/visa_application'
|
134
|
+
require 'finnhub_ruby/models/visa_application_result'
|
126
135
|
|
127
136
|
# APIs
|
128
137
|
require 'finnhub_ruby/api/default_api'
|