finnhub_ruby 1.1.8 → 1.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -4
  3. data/docs/CompanyESG.md +3 -3
  4. data/docs/CompanyEarningsQualityScore.md +22 -0
  5. data/docs/CompanyEarningsQualityScoreData.md +30 -0
  6. data/docs/CompanyProfile.md +4 -4
  7. data/docs/CountryMetadata.md +5 -1
  8. data/docs/CryptoProfile.md +38 -0
  9. data/docs/DefaultApi.md +391 -10
  10. data/docs/EbitEstimates.md +22 -0
  11. data/docs/EbitEstimatesInfo.md +26 -0
  12. data/docs/EbitdaEstimates.md +22 -0
  13. data/docs/EbitdaEstimatesInfo.md +26 -0
  14. data/docs/MutualFundProfileData.md +9 -1
  15. data/docs/StockSymbol.md +7 -1
  16. data/docs/Transactions.md +2 -0
  17. data/docs/UsptoPatent.md +34 -0
  18. data/docs/UsptoPatentResult.md +20 -0
  19. data/finnhub_ruby-1.1.10.gem +0 -0
  20. data/finnhub_ruby-1.1.11.gem +0 -0
  21. data/finnhub_ruby-1.1.8.gem +0 -0
  22. data/finnhub_ruby-1.1.9.gem +0 -0
  23. data/lib/finnhub_ruby/api/default_api.rb +361 -8
  24. data/lib/finnhub_ruby/models/company_earnings_quality_score.rb +241 -0
  25. data/lib/finnhub_ruby/models/company_earnings_quality_score_data.rb +279 -0
  26. data/lib/finnhub_ruby/models/company_esg.rb +3 -3
  27. data/lib/finnhub_ruby/models/company_profile.rb +4 -4
  28. data/lib/finnhub_ruby/models/country_metadata.rb +24 -4
  29. data/lib/finnhub_ruby/models/crypto_profile.rb +319 -0
  30. data/lib/finnhub_ruby/models/ebit_estimates.rb +241 -0
  31. data/lib/finnhub_ruby/models/ebit_estimates_info.rb +259 -0
  32. data/lib/finnhub_ruby/models/ebitda_estimates.rb +241 -0
  33. data/lib/finnhub_ruby/models/ebitda_estimates_info.rb +259 -0
  34. data/lib/finnhub_ruby/models/mutual_fund_profile_data.rb +44 -4
  35. data/lib/finnhub_ruby/models/stock_symbol.rb +34 -4
  36. data/lib/finnhub_ruby/models/transactions.rb +11 -1
  37. data/lib/finnhub_ruby/models/uspto_patent.rb +301 -0
  38. data/lib/finnhub_ruby/models/uspto_patent_result.rb +231 -0
  39. data/lib/finnhub_ruby/version.rb +1 -1
  40. data/lib/finnhub_ruby.rb +9 -0
  41. data/spec/models/company_earnings_quality_score_data_spec.rb +70 -0
  42. data/spec/models/company_earnings_quality_score_spec.rb +46 -0
  43. data/spec/models/crypto_profile_spec.rb +94 -0
  44. data/spec/models/ebit_estimates_info_spec.rb +58 -0
  45. data/spec/models/ebit_estimates_spec.rb +46 -0
  46. data/spec/models/ebitda_estimates_info_spec.rb +58 -0
  47. data/spec/models/ebitda_estimates_spec.rb +46 -0
  48. data/spec/models/uspto_patent_result_spec.rb +40 -0
  49. data/spec/models/uspto_patent_spec.rb +82 -0
  50. metadata +42 -2
@@ -0,0 +1,259 @@
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 EbitdaEstimatesInfo
18
+ # Average EBITDA estimates including Finnhub's proprietary estimates.
19
+ attr_accessor :ebitda_avg
20
+
21
+ # Highest estimate.
22
+ attr_accessor :ebitda_high
23
+
24
+ # Lowest estimate.
25
+ attr_accessor :ebitda_low
26
+
27
+ # Number of Analysts.
28
+ attr_accessor :number_analysts
29
+
30
+ # Period.
31
+ attr_accessor :period
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'ebitda_avg' => :'ebitdaAvg',
37
+ :'ebitda_high' => :'ebitdaHigh',
38
+ :'ebitda_low' => :'ebitdaLow',
39
+ :'number_analysts' => :'numberAnalysts',
40
+ :'period' => :'period'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'ebitda_avg' => :'Float',
53
+ :'ebitda_high' => :'Float',
54
+ :'ebitda_low' => :'Float',
55
+ :'number_analysts' => :'Integer',
56
+ :'period' => :'Date'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FinnhubRuby::EbitdaEstimatesInfo` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FinnhubRuby::EbitdaEstimatesInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'ebitda_avg')
82
+ self.ebitda_avg = attributes[:'ebitda_avg']
83
+ end
84
+
85
+ if attributes.key?(:'ebitda_high')
86
+ self.ebitda_high = attributes[:'ebitda_high']
87
+ end
88
+
89
+ if attributes.key?(:'ebitda_low')
90
+ self.ebitda_low = attributes[:'ebitda_low']
91
+ end
92
+
93
+ if attributes.key?(:'number_analysts')
94
+ self.number_analysts = attributes[:'number_analysts']
95
+ end
96
+
97
+ if attributes.key?(:'period')
98
+ self.period = attributes[:'period']
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ invalid_properties = Array.new
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ true
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ ebitda_avg == o.ebitda_avg &&
121
+ ebitda_high == o.ebitda_high &&
122
+ ebitda_low == o.ebitda_low &&
123
+ number_analysts == o.number_analysts &&
124
+ period == o.period
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(o)
130
+ self == o
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ def hash
136
+ [ebitda_avg, ebitda_high, ebitda_low, number_analysts, period].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def self.build_from_hash(attributes)
143
+ new.build_from_hash(attributes)
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ self.class.openapi_types.each_pair do |key, type|
152
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
153
+ self.send("#{key}=", nil)
154
+ elsif type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the attribute
156
+ # is documented as an array but the input is not
157
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
158
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
+ end
160
+ elsif !attributes[self.class.attribute_map[key]].nil?
161
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
+ end
163
+ end
164
+
165
+ self
166
+ end
167
+
168
+ # Deserializes the data based on type
169
+ # @param string type Data type
170
+ # @param string value Value to be deserialized
171
+ # @return [Object] Deserialized data
172
+ def _deserialize(type, value)
173
+ case type.to_sym
174
+ when :Time
175
+ Time.parse(value)
176
+ when :Date
177
+ Date.parse(value)
178
+ when :String
179
+ value.to_s
180
+ when :Integer
181
+ value.to_i
182
+ when :Float
183
+ value.to_f
184
+ when :Boolean
185
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
+ true
187
+ else
188
+ false
189
+ end
190
+ when :Object
191
+ # generic object (usually a Hash), return directly
192
+ value
193
+ when /\AArray<(?<inner_type>.+)>\z/
194
+ inner_type = Regexp.last_match[:inner_type]
195
+ value.map { |v| _deserialize(inner_type, v) }
196
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
+ k_type = Regexp.last_match[:k_type]
198
+ v_type = Regexp.last_match[:v_type]
199
+ {}.tap do |hash|
200
+ value.each do |k, v|
201
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
+ end
203
+ end
204
+ else # model
205
+ # models (e.g. Pet) or oneOf
206
+ klass = FinnhubRuby.const_get(type)
207
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
208
+ end
209
+ end
210
+
211
+ # Returns the string representation of the object
212
+ # @return [String] String presentation of the object
213
+ def to_s
214
+ to_hash.to_s
215
+ end
216
+
217
+ # to_body is an alias to to_hash (backward compatibility)
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_body
220
+ to_hash
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ if value.nil?
230
+ is_nullable = self.class.openapi_nullable.include?(attr)
231
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
+ end
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map { |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+
257
+ end
258
+
259
+ end
@@ -78,6 +78,18 @@ module FinnhubRuby
78
78
  # Turnover.
79
79
  attr_accessor :turnover
80
80
 
81
+ # Fund's series ID. This field can be used to group multiple share classes into 1 unique fund.
82
+ attr_accessor :series_id
83
+
84
+ # Fund's series name.
85
+ attr_accessor :series_name
86
+
87
+ # Class ID.
88
+ attr_accessor :class_id
89
+
90
+ # Class name.
91
+ attr_accessor :class_name
92
+
81
93
  # Attribute mapping from ruby-style variable name to JSON key.
82
94
  def self.attribute_map
83
95
  {
@@ -101,7 +113,11 @@ module FinnhubRuby
101
113
  :'cusip' => :'cusip',
102
114
  :'max_redemption_fee' => :'maxRedemptionFee',
103
115
  :'standard_min_investment' => :'standardMinInvestment',
104
- :'turnover' => :'turnover'
116
+ :'turnover' => :'turnover',
117
+ :'series_id' => :'seriesId',
118
+ :'series_name' => :'seriesName',
119
+ :'class_id' => :'classId',
120
+ :'class_name' => :'className'
105
121
  }
106
122
  end
107
123
 
@@ -133,7 +149,11 @@ module FinnhubRuby
133
149
  :'cusip' => :'String',
134
150
  :'max_redemption_fee' => :'Float',
135
151
  :'standard_min_investment' => :'Float',
136
- :'turnover' => :'Float'
152
+ :'turnover' => :'Float',
153
+ :'series_id' => :'String',
154
+ :'series_name' => :'String',
155
+ :'class_id' => :'String',
156
+ :'class_name' => :'String'
137
157
  }
138
158
  end
139
159
 
@@ -241,6 +261,22 @@ module FinnhubRuby
241
261
  if attributes.key?(:'turnover')
242
262
  self.turnover = attributes[:'turnover']
243
263
  end
264
+
265
+ if attributes.key?(:'series_id')
266
+ self.series_id = attributes[:'series_id']
267
+ end
268
+
269
+ if attributes.key?(:'series_name')
270
+ self.series_name = attributes[:'series_name']
271
+ end
272
+
273
+ if attributes.key?(:'class_id')
274
+ self.class_id = attributes[:'class_id']
275
+ end
276
+
277
+ if attributes.key?(:'class_name')
278
+ self.class_name = attributes[:'class_name']
279
+ end
244
280
  end
245
281
 
246
282
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -281,7 +317,11 @@ module FinnhubRuby
281
317
  cusip == o.cusip &&
282
318
  max_redemption_fee == o.max_redemption_fee &&
283
319
  standard_min_investment == o.standard_min_investment &&
284
- turnover == o.turnover
320
+ turnover == o.turnover &&
321
+ series_id == o.series_id &&
322
+ series_name == o.series_name &&
323
+ class_id == o.class_id &&
324
+ class_name == o.class_name
285
325
  end
286
326
 
287
327
  # @see the `==` method
@@ -293,7 +333,7 @@ module FinnhubRuby
293
333
  # Calculates hash code according to all attributes.
294
334
  # @return [Integer] Hash code
295
335
  def hash
296
- [name, category, investment_segment, total_nav, expense_ratio, benchmark, inception_date, description, fund_family, manager, status, beta, deferred_load, fee12b1, front_load, ira_min_investment, isin, cusip, max_redemption_fee, standard_min_investment, turnover].hash
336
+ [name, category, investment_segment, total_nav, expense_ratio, benchmark, inception_date, description, fund_family, manager, status, beta, deferred_load, fee12b1, front_load, ira_min_investment, isin, cusip, max_redemption_fee, standard_min_investment, turnover, series_id, series_name, class_id, class_name].hash
297
337
  end
298
338
 
299
339
  # Builds the object from hash
@@ -33,9 +33,18 @@ module FinnhubRuby
33
33
  # FIGI identifier.
34
34
  attr_accessor :figi
35
35
 
36
+ # Global Share Class FIGI.
37
+ attr_accessor :share_class_figi
38
+
36
39
  # Price's currency. This might be different from the reporting currency of fundamental data.
37
40
  attr_accessor :currency
38
41
 
42
+ # Alternative ticker for exchanges with multiple tickers for 1 stock such as BSE.
43
+ attr_accessor :symbol2
44
+
45
+ # ISIN. This field is only available for EU stocks and selected Asian markets. Entitlement from Finnhub is required to access this field.
46
+ attr_accessor :isin
47
+
39
48
  # Attribute mapping from ruby-style variable name to JSON key.
40
49
  def self.attribute_map
41
50
  {
@@ -45,7 +54,10 @@ module FinnhubRuby
45
54
  :'type' => :'type',
46
55
  :'mic' => :'mic',
47
56
  :'figi' => :'figi',
48
- :'currency' => :'currency'
57
+ :'share_class_figi' => :'shareClassFIGI',
58
+ :'currency' => :'currency',
59
+ :'symbol2' => :'symbol2',
60
+ :'isin' => :'isin'
49
61
  }
50
62
  end
51
63
 
@@ -63,7 +75,10 @@ module FinnhubRuby
63
75
  :'type' => :'String',
64
76
  :'mic' => :'String',
65
77
  :'figi' => :'String',
66
- :'currency' => :'String'
78
+ :'share_class_figi' => :'String',
79
+ :'currency' => :'String',
80
+ :'symbol2' => :'String',
81
+ :'isin' => :'String'
67
82
  }
68
83
  end
69
84
 
@@ -112,9 +127,21 @@ module FinnhubRuby
112
127
  self.figi = attributes[:'figi']
113
128
  end
114
129
 
130
+ if attributes.key?(:'share_class_figi')
131
+ self.share_class_figi = attributes[:'share_class_figi']
132
+ end
133
+
115
134
  if attributes.key?(:'currency')
116
135
  self.currency = attributes[:'currency']
117
136
  end
137
+
138
+ if attributes.key?(:'symbol2')
139
+ self.symbol2 = attributes[:'symbol2']
140
+ end
141
+
142
+ if attributes.key?(:'isin')
143
+ self.isin = attributes[:'isin']
144
+ end
118
145
  end
119
146
 
120
147
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -141,7 +168,10 @@ module FinnhubRuby
141
168
  type == o.type &&
142
169
  mic == o.mic &&
143
170
  figi == o.figi &&
144
- currency == o.currency
171
+ share_class_figi == o.share_class_figi &&
172
+ currency == o.currency &&
173
+ symbol2 == o.symbol2 &&
174
+ isin == o.isin
145
175
  end
146
176
 
147
177
  # @see the `==` method
@@ -153,7 +183,7 @@ module FinnhubRuby
153
183
  # Calculates hash code according to all attributes.
154
184
  # @return [Integer] Hash code
155
185
  def hash
156
- [description, display_symbol, symbol, type, mic, figi, currency].hash
186
+ [description, display_symbol, symbol, type, mic, figi, share_class_figi, currency, symbol2, isin].hash
157
187
  end
158
188
 
159
189
  # Builds the object from hash
@@ -15,6 +15,9 @@ require 'time'
15
15
 
16
16
  module FinnhubRuby
17
17
  class Transactions
18
+ # Symbol.
19
+ attr_accessor :symbol
20
+
18
21
  # Insider's name.
19
22
  attr_accessor :name
20
23
 
@@ -39,6 +42,7 @@ module FinnhubRuby
39
42
  # Attribute mapping from ruby-style variable name to JSON key.
40
43
  def self.attribute_map
41
44
  {
45
+ :'symbol' => :'symbol',
42
46
  :'name' => :'name',
43
47
  :'share' => :'share',
44
48
  :'change' => :'change',
@@ -57,6 +61,7 @@ module FinnhubRuby
57
61
  # Attribute type mapping.
58
62
  def self.openapi_types
59
63
  {
64
+ :'symbol' => :'String',
60
65
  :'name' => :'String',
61
66
  :'share' => :'Integer',
62
67
  :'change' => :'Integer',
@@ -88,6 +93,10 @@ module FinnhubRuby
88
93
  h[k.to_sym] = v
89
94
  }
90
95
 
96
+ if attributes.key?(:'symbol')
97
+ self.symbol = attributes[:'symbol']
98
+ end
99
+
91
100
  if attributes.key?(:'name')
92
101
  self.name = attributes[:'name']
93
102
  end
@@ -135,6 +144,7 @@ module FinnhubRuby
135
144
  def ==(o)
136
145
  return true if self.equal?(o)
137
146
  self.class == o.class &&
147
+ symbol == o.symbol &&
138
148
  name == o.name &&
139
149
  share == o.share &&
140
150
  change == o.change &&
@@ -153,7 +163,7 @@ module FinnhubRuby
153
163
  # Calculates hash code according to all attributes.
154
164
  # @return [Integer] Hash code
155
165
  def hash
156
- [name, share, change, filing_date, transaction_date, transaction_price, transaction_code].hash
166
+ [symbol, name, share, change, filing_date, transaction_date, transaction_price, transaction_code].hash
157
167
  end
158
168
 
159
169
  # Builds the object from hash