finnhub_ruby 1.1.9 → 1.1.13

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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -3
  3. data/docs/CryptoProfile.md +38 -0
  4. data/docs/DefaultApi.md +396 -11
  5. data/docs/EbitEstimates.md +22 -0
  6. data/docs/EbitEstimatesInfo.md +26 -0
  7. data/docs/EbitdaEstimates.md +22 -0
  8. data/docs/EbitdaEstimatesInfo.md +26 -0
  9. data/docs/MutualFundProfileData.md +9 -1
  10. data/docs/StockSymbol.md +7 -1
  11. data/docs/Transactions.md +2 -0
  12. data/docs/UsptoPatent.md +34 -0
  13. data/docs/UsptoPatentResult.md +20 -0
  14. data/docs/VisaApplication.md +62 -0
  15. data/docs/VisaApplicationResult.md +20 -0
  16. data/finnhub_ruby-1.1.10.gem +0 -0
  17. data/finnhub_ruby-1.1.11.gem +0 -0
  18. data/finnhub_ruby-1.1.12.gem +0 -0
  19. data/finnhub_ruby-1.1.9.gem +0 -0
  20. data/lib/finnhub_ruby/api/default_api.rb +369 -6
  21. data/lib/finnhub_ruby/models/crypto_profile.rb +319 -0
  22. data/lib/finnhub_ruby/models/ebit_estimates.rb +241 -0
  23. data/lib/finnhub_ruby/models/ebit_estimates_info.rb +259 -0
  24. data/lib/finnhub_ruby/models/ebitda_estimates.rb +241 -0
  25. data/lib/finnhub_ruby/models/ebitda_estimates_info.rb +259 -0
  26. data/lib/finnhub_ruby/models/mutual_fund_profile_data.rb +44 -4
  27. data/lib/finnhub_ruby/models/stock_symbol.rb +34 -4
  28. data/lib/finnhub_ruby/models/transactions.rb +11 -1
  29. data/lib/finnhub_ruby/models/uspto_patent.rb +301 -0
  30. data/lib/finnhub_ruby/models/uspto_patent_result.rb +231 -0
  31. data/lib/finnhub_ruby/models/visa_application.rb +439 -0
  32. data/lib/finnhub_ruby/models/visa_application_result.rb +231 -0
  33. data/lib/finnhub_ruby/version.rb +1 -1
  34. data/lib/finnhub_ruby.rb +9 -0
  35. data/spec/models/crypto_profile_spec.rb +94 -0
  36. data/spec/models/ebit_estimates_info_spec.rb +58 -0
  37. data/spec/models/ebit_estimates_spec.rb +46 -0
  38. data/spec/models/ebitda_estimates_info_spec.rb +58 -0
  39. data/spec/models/ebitda_estimates_spec.rb +46 -0
  40. data/spec/models/uspto_patent_result_spec.rb +40 -0
  41. data/spec/models/uspto_patent_spec.rb +82 -0
  42. data/spec/models/visa_application_result_spec.rb +40 -0
  43. data/spec/models/visa_application_spec.rb +166 -0
  44. metadata +42 -2
@@ -0,0 +1,319 @@
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 CryptoProfile
18
+ # Long name.
19
+ attr_accessor :long_name
20
+
21
+ # Name.
22
+ attr_accessor :name
23
+
24
+ # Description.
25
+ attr_accessor :description
26
+
27
+ # Project's website.
28
+ attr_accessor :website
29
+
30
+ # Market capitalization.
31
+ attr_accessor :market_cap
32
+
33
+ # Total supply.
34
+ attr_accessor :total_supply
35
+
36
+ # Max supply.
37
+ attr_accessor :max_supply
38
+
39
+ # Circulating supply.
40
+ attr_accessor :circulating_supply
41
+
42
+ # Logo image.
43
+ attr_accessor :logo
44
+
45
+ # Launch date.
46
+ attr_accessor :launch_date
47
+
48
+ # Proof type.
49
+ attr_accessor :proof_type
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'long_name' => :'longName',
55
+ :'name' => :'name',
56
+ :'description' => :'description',
57
+ :'website' => :'website',
58
+ :'market_cap' => :'marketCap',
59
+ :'total_supply' => :'totalSupply',
60
+ :'max_supply' => :'maxSupply',
61
+ :'circulating_supply' => :'circulatingSupply',
62
+ :'logo' => :'logo',
63
+ :'launch_date' => :'launchDate',
64
+ :'proof_type' => :'proofType'
65
+ }
66
+ end
67
+
68
+ # Returns all the JSON keys this model knows about
69
+ def self.acceptable_attributes
70
+ attribute_map.values
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.openapi_types
75
+ {
76
+ :'long_name' => :'String',
77
+ :'name' => :'String',
78
+ :'description' => :'String',
79
+ :'website' => :'String',
80
+ :'market_cap' => :'Float',
81
+ :'total_supply' => :'Float',
82
+ :'max_supply' => :'Float',
83
+ :'circulating_supply' => :'Float',
84
+ :'logo' => :'String',
85
+ :'launch_date' => :'String',
86
+ :'proof_type' => :'String'
87
+ }
88
+ end
89
+
90
+ # List of attributes with nullable: true
91
+ def self.openapi_nullable
92
+ Set.new([
93
+ ])
94
+ end
95
+
96
+ # Initializes the object
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ def initialize(attributes = {})
99
+ if (!attributes.is_a?(Hash))
100
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FinnhubRuby::CryptoProfile` initialize method"
101
+ end
102
+
103
+ # check to see if the attribute exists and convert string to symbol for hash key
104
+ attributes = attributes.each_with_object({}) { |(k, v), h|
105
+ if (!self.class.attribute_map.key?(k.to_sym))
106
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FinnhubRuby::CryptoProfile`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
107
+ end
108
+ h[k.to_sym] = v
109
+ }
110
+
111
+ if attributes.key?(:'long_name')
112
+ self.long_name = attributes[:'long_name']
113
+ end
114
+
115
+ if attributes.key?(:'name')
116
+ self.name = attributes[:'name']
117
+ end
118
+
119
+ if attributes.key?(:'description')
120
+ self.description = attributes[:'description']
121
+ end
122
+
123
+ if attributes.key?(:'website')
124
+ self.website = attributes[:'website']
125
+ end
126
+
127
+ if attributes.key?(:'market_cap')
128
+ self.market_cap = attributes[:'market_cap']
129
+ end
130
+
131
+ if attributes.key?(:'total_supply')
132
+ self.total_supply = attributes[:'total_supply']
133
+ end
134
+
135
+ if attributes.key?(:'max_supply')
136
+ self.max_supply = attributes[:'max_supply']
137
+ end
138
+
139
+ if attributes.key?(:'circulating_supply')
140
+ self.circulating_supply = attributes[:'circulating_supply']
141
+ end
142
+
143
+ if attributes.key?(:'logo')
144
+ self.logo = attributes[:'logo']
145
+ end
146
+
147
+ if attributes.key?(:'launch_date')
148
+ self.launch_date = attributes[:'launch_date']
149
+ end
150
+
151
+ if attributes.key?(:'proof_type')
152
+ self.proof_type = attributes[:'proof_type']
153
+ end
154
+ end
155
+
156
+ # Show invalid properties with the reasons. Usually used together with valid?
157
+ # @return Array for valid properties with the reasons
158
+ def list_invalid_properties
159
+ invalid_properties = Array.new
160
+ invalid_properties
161
+ end
162
+
163
+ # Check to see if the all the properties in the model are valid
164
+ # @return true if the model is valid
165
+ def valid?
166
+ true
167
+ end
168
+
169
+ # Checks equality by comparing each attribute.
170
+ # @param [Object] Object to be compared
171
+ def ==(o)
172
+ return true if self.equal?(o)
173
+ self.class == o.class &&
174
+ long_name == o.long_name &&
175
+ name == o.name &&
176
+ description == o.description &&
177
+ website == o.website &&
178
+ market_cap == o.market_cap &&
179
+ total_supply == o.total_supply &&
180
+ max_supply == o.max_supply &&
181
+ circulating_supply == o.circulating_supply &&
182
+ logo == o.logo &&
183
+ launch_date == o.launch_date &&
184
+ proof_type == o.proof_type
185
+ end
186
+
187
+ # @see the `==` method
188
+ # @param [Object] Object to be compared
189
+ def eql?(o)
190
+ self == o
191
+ end
192
+
193
+ # Calculates hash code according to all attributes.
194
+ # @return [Integer] Hash code
195
+ def hash
196
+ [long_name, name, description, website, market_cap, total_supply, max_supply, circulating_supply, logo, launch_date, proof_type].hash
197
+ end
198
+
199
+ # Builds the object from hash
200
+ # @param [Hash] attributes Model attributes in the form of hash
201
+ # @return [Object] Returns the model itself
202
+ def self.build_from_hash(attributes)
203
+ new.build_from_hash(attributes)
204
+ end
205
+
206
+ # Builds the object from hash
207
+ # @param [Hash] attributes Model attributes in the form of hash
208
+ # @return [Object] Returns the model itself
209
+ def build_from_hash(attributes)
210
+ return nil unless attributes.is_a?(Hash)
211
+ self.class.openapi_types.each_pair do |key, type|
212
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
213
+ self.send("#{key}=", nil)
214
+ elsif type =~ /\AArray<(.*)>/i
215
+ # check to ensure the input is an array given that the attribute
216
+ # is documented as an array but the input is not
217
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
218
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
219
+ end
220
+ elsif !attributes[self.class.attribute_map[key]].nil?
221
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
222
+ end
223
+ end
224
+
225
+ self
226
+ end
227
+
228
+ # Deserializes the data based on type
229
+ # @param string type Data type
230
+ # @param string value Value to be deserialized
231
+ # @return [Object] Deserialized data
232
+ def _deserialize(type, value)
233
+ case type.to_sym
234
+ when :Time
235
+ Time.parse(value)
236
+ when :Date
237
+ Date.parse(value)
238
+ when :String
239
+ value.to_s
240
+ when :Integer
241
+ value.to_i
242
+ when :Float
243
+ value.to_f
244
+ when :Boolean
245
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
246
+ true
247
+ else
248
+ false
249
+ end
250
+ when :Object
251
+ # generic object (usually a Hash), return directly
252
+ value
253
+ when /\AArray<(?<inner_type>.+)>\z/
254
+ inner_type = Regexp.last_match[:inner_type]
255
+ value.map { |v| _deserialize(inner_type, v) }
256
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
257
+ k_type = Regexp.last_match[:k_type]
258
+ v_type = Regexp.last_match[:v_type]
259
+ {}.tap do |hash|
260
+ value.each do |k, v|
261
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
262
+ end
263
+ end
264
+ else # model
265
+ # models (e.g. Pet) or oneOf
266
+ klass = FinnhubRuby.const_get(type)
267
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
268
+ end
269
+ end
270
+
271
+ # Returns the string representation of the object
272
+ # @return [String] String presentation of the object
273
+ def to_s
274
+ to_hash.to_s
275
+ end
276
+
277
+ # to_body is an alias to to_hash (backward compatibility)
278
+ # @return [Hash] Returns the object in the form of hash
279
+ def to_body
280
+ to_hash
281
+ end
282
+
283
+ # Returns the object in the form of hash
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_hash
286
+ hash = {}
287
+ self.class.attribute_map.each_pair do |attr, param|
288
+ value = self.send(attr)
289
+ if value.nil?
290
+ is_nullable = self.class.openapi_nullable.include?(attr)
291
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
292
+ end
293
+
294
+ hash[param] = _to_hash(value)
295
+ end
296
+ hash
297
+ end
298
+
299
+ # Outputs non-array value in the form of hash
300
+ # For object, use to_hash. Otherwise, just return the value
301
+ # @param [Object] value Any valid value
302
+ # @return [Hash] Returns the value in the form of hash
303
+ def _to_hash(value)
304
+ if value.is_a?(Array)
305
+ value.compact.map { |v| _to_hash(v) }
306
+ elsif value.is_a?(Hash)
307
+ {}.tap do |hash|
308
+ value.each { |k, v| hash[k] = _to_hash(v) }
309
+ end
310
+ elsif value.respond_to? :to_hash
311
+ value.to_hash
312
+ else
313
+ value
314
+ end
315
+ end
316
+
317
+ end
318
+
319
+ end
@@ -0,0 +1,241 @@
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 EbitEstimates
18
+ # List of estimates
19
+ attr_accessor :data
20
+
21
+ # Frequency: annual or quarterly.
22
+ attr_accessor :freq
23
+
24
+ # Company symbol.
25
+ attr_accessor :symbol
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'data' => :'data',
31
+ :'freq' => :'freq',
32
+ :'symbol' => :'symbol'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'data' => :'Array<EbitEstimatesInfo>',
45
+ :'freq' => :'String',
46
+ :'symbol' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FinnhubRuby::EbitEstimates` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FinnhubRuby::EbitEstimates`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'data')
72
+ if (value = attributes[:'data']).is_a?(Array)
73
+ self.data = value
74
+ end
75
+ end
76
+
77
+ if attributes.key?(:'freq')
78
+ self.freq = attributes[:'freq']
79
+ end
80
+
81
+ if attributes.key?(:'symbol')
82
+ self.symbol = attributes[:'symbol']
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ data == o.data &&
105
+ freq == o.freq &&
106
+ symbol == o.symbol
107
+ end
108
+
109
+ # @see the `==` method
110
+ # @param [Object] Object to be compared
111
+ def eql?(o)
112
+ self == o
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Integer] Hash code
117
+ def hash
118
+ [data, freq, symbol].hash
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def self.build_from_hash(attributes)
125
+ new.build_from_hash(attributes)
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ self.class.openapi_types.each_pair do |key, type|
134
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
135
+ self.send("#{key}=", nil)
136
+ elsif type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
140
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
+ end
142
+ elsif !attributes[self.class.attribute_map[key]].nil?
143
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
144
+ end
145
+ end
146
+
147
+ self
148
+ end
149
+
150
+ # Deserializes the data based on type
151
+ # @param string type Data type
152
+ # @param string value Value to be deserialized
153
+ # @return [Object] Deserialized data
154
+ def _deserialize(type, value)
155
+ case type.to_sym
156
+ when :Time
157
+ Time.parse(value)
158
+ when :Date
159
+ Date.parse(value)
160
+ when :String
161
+ value.to_s
162
+ when :Integer
163
+ value.to_i
164
+ when :Float
165
+ value.to_f
166
+ when :Boolean
167
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
168
+ true
169
+ else
170
+ false
171
+ end
172
+ when :Object
173
+ # generic object (usually a Hash), return directly
174
+ value
175
+ when /\AArray<(?<inner_type>.+)>\z/
176
+ inner_type = Regexp.last_match[:inner_type]
177
+ value.map { |v| _deserialize(inner_type, v) }
178
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
179
+ k_type = Regexp.last_match[:k_type]
180
+ v_type = Regexp.last_match[:v_type]
181
+ {}.tap do |hash|
182
+ value.each do |k, v|
183
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
184
+ end
185
+ end
186
+ else # model
187
+ # models (e.g. Pet) or oneOf
188
+ klass = FinnhubRuby.const_get(type)
189
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
190
+ end
191
+ end
192
+
193
+ # Returns the string representation of the object
194
+ # @return [String] String presentation of the object
195
+ def to_s
196
+ to_hash.to_s
197
+ end
198
+
199
+ # to_body is an alias to to_hash (backward compatibility)
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_body
202
+ to_hash
203
+ end
204
+
205
+ # Returns the object in the form of hash
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_hash
208
+ hash = {}
209
+ self.class.attribute_map.each_pair do |attr, param|
210
+ value = self.send(attr)
211
+ if value.nil?
212
+ is_nullable = self.class.openapi_nullable.include?(attr)
213
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
214
+ end
215
+
216
+ hash[param] = _to_hash(value)
217
+ end
218
+ hash
219
+ end
220
+
221
+ # Outputs non-array value in the form of hash
222
+ # For object, use to_hash. Otherwise, just return the value
223
+ # @param [Object] value Any valid value
224
+ # @return [Hash] Returns the value in the form of hash
225
+ def _to_hash(value)
226
+ if value.is_a?(Array)
227
+ value.compact.map { |v| _to_hash(v) }
228
+ elsif value.is_a?(Hash)
229
+ {}.tap do |hash|
230
+ value.each { |k, v| hash[k] = _to_hash(v) }
231
+ end
232
+ elsif value.respond_to? :to_hash
233
+ value.to_hash
234
+ else
235
+ value
236
+ end
237
+ end
238
+
239
+ end
240
+
241
+ end