finnhub_ruby 1.1.6 → 1.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +51 -14
  3. data/docs/CompanyESG.md +28 -0
  4. data/docs/CompanyEarningsQualityScore.md +22 -0
  5. data/docs/CompanyEarningsQualityScoreData.md +30 -0
  6. data/docs/CompanyProfile.md +5 -5
  7. data/docs/CountryMetadata.md +5 -1
  8. data/docs/CryptoProfile.md +38 -0
  9. data/docs/DefaultApi.md +241 -20
  10. data/docs/EarningRelease.md +2 -2
  11. data/docs/EarningsEstimates.md +1 -1
  12. data/docs/EarningsEstimatesInfo.md +26 -0
  13. data/docs/IPOEvent.md +2 -2
  14. data/docs/KeyCustomersSuppliers.md +13 -1
  15. data/docs/RevenueEstimates.md +1 -1
  16. data/docs/RevenueEstimatesInfo.md +26 -0
  17. data/docs/Sentiment.md +2 -2
  18. data/docs/SimilarityIndex.md +1 -1
  19. data/docs/SimilarityIndexInfo.md +40 -0
  20. data/finnhub_ruby-1.1.7.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/finnhub_ruby.gemspec +1 -1
  24. data/lib/finnhub_ruby/api/default_api.rb +216 -14
  25. data/lib/finnhub_ruby/api_client.rb +1 -1
  26. data/lib/finnhub_ruby/api_error.rb +1 -1
  27. data/lib/finnhub_ruby/configuration.rb +1 -1
  28. data/lib/finnhub_ruby/models/aggregate_indicators.rb +1 -1
  29. data/lib/finnhub_ruby/models/basic_financials.rb +1 -1
  30. data/lib/finnhub_ruby/models/breakdown_item.rb +1 -1
  31. data/lib/finnhub_ruby/models/company.rb +1 -1
  32. data/lib/finnhub_ruby/models/company_earnings_quality_score.rb +241 -0
  33. data/lib/finnhub_ruby/models/company_earnings_quality_score_data.rb +279 -0
  34. data/lib/finnhub_ruby/models/company_esg.rb +268 -0
  35. data/lib/finnhub_ruby/models/company_executive.rb +1 -1
  36. data/lib/finnhub_ruby/models/company_news.rb +1 -1
  37. data/lib/finnhub_ruby/models/company_news_statistics.rb +1 -1
  38. data/lib/finnhub_ruby/models/company_profile.rb +6 -6
  39. data/lib/finnhub_ruby/models/company_profile2.rb +1 -1
  40. data/lib/finnhub_ruby/models/country_metadata.rb +25 -5
  41. data/lib/finnhub_ruby/models/covid_info.rb +1 -1
  42. data/lib/finnhub_ruby/models/crypto_candles.rb +1 -1
  43. data/lib/finnhub_ruby/models/crypto_profile.rb +319 -0
  44. data/lib/finnhub_ruby/models/crypto_symbol.rb +1 -1
  45. data/lib/finnhub_ruby/models/development.rb +1 -1
  46. data/lib/finnhub_ruby/models/dividends.rb +1 -1
  47. data/lib/finnhub_ruby/models/dividends2.rb +1 -1
  48. data/lib/finnhub_ruby/models/dividends2_info.rb +1 -1
  49. data/lib/finnhub_ruby/models/earning_release.rb +3 -3
  50. data/lib/finnhub_ruby/models/earning_result.rb +1 -1
  51. data/lib/finnhub_ruby/models/earnings_calendar.rb +1 -1
  52. data/lib/finnhub_ruby/models/earnings_call_transcripts.rb +1 -1
  53. data/lib/finnhub_ruby/models/earnings_call_transcripts_list.rb +1 -1
  54. data/lib/finnhub_ruby/models/earnings_estimates.rb +2 -2
  55. data/lib/finnhub_ruby/models/earnings_estimates_info.rb +259 -0
  56. data/lib/finnhub_ruby/models/economic_calendar.rb +1 -1
  57. data/lib/finnhub_ruby/models/economic_code.rb +1 -1
  58. data/lib/finnhub_ruby/models/economic_data.rb +1 -1
  59. data/lib/finnhub_ruby/models/economic_data_info.rb +1 -1
  60. data/lib/finnhub_ruby/models/economic_event.rb +1 -1
  61. data/lib/finnhub_ruby/models/etf_country_exposure_data.rb +1 -1
  62. data/lib/finnhub_ruby/models/etf_holdings_data.rb +1 -1
  63. data/lib/finnhub_ruby/models/etf_profile_data.rb +1 -1
  64. data/lib/finnhub_ruby/models/etf_sector_exposure_data.rb +1 -1
  65. data/lib/finnhub_ruby/models/etfs_country_exposure.rb +1 -1
  66. data/lib/finnhub_ruby/models/etfs_holdings.rb +1 -1
  67. data/lib/finnhub_ruby/models/etfs_profile.rb +1 -1
  68. data/lib/finnhub_ruby/models/etfs_sector_exposure.rb +1 -1
  69. data/lib/finnhub_ruby/models/fda_comittee_meeting.rb +1 -1
  70. data/lib/finnhub_ruby/models/filing.rb +1 -1
  71. data/lib/finnhub_ruby/models/filing_sentiment.rb +1 -1
  72. data/lib/finnhub_ruby/models/financial_statements.rb +1 -1
  73. data/lib/finnhub_ruby/models/financials_as_reported.rb +1 -1
  74. data/lib/finnhub_ruby/models/forex_candles.rb +1 -1
  75. data/lib/finnhub_ruby/models/forex_symbol.rb +1 -1
  76. data/lib/finnhub_ruby/models/forexrates.rb +1 -1
  77. data/lib/finnhub_ruby/models/fund_ownership.rb +1 -1
  78. data/lib/finnhub_ruby/models/fund_ownership_info.rb +1 -1
  79. data/lib/finnhub_ruby/models/historical_nbbo.rb +1 -1
  80. data/lib/finnhub_ruby/models/index_historical_constituent.rb +1 -1
  81. data/lib/finnhub_ruby/models/indicator.rb +1 -1
  82. data/lib/finnhub_ruby/models/indices_constituents.rb +1 -1
  83. data/lib/finnhub_ruby/models/indices_historical_constituents.rb +1 -1
  84. data/lib/finnhub_ruby/models/insider_transactions.rb +1 -1
  85. data/lib/finnhub_ruby/models/international_filing.rb +1 -1
  86. data/lib/finnhub_ruby/models/investment_theme_portfolio.rb +1 -1
  87. data/lib/finnhub_ruby/models/investment_themes.rb +1 -1
  88. data/lib/finnhub_ruby/models/ipo_calendar.rb +1 -1
  89. data/lib/finnhub_ruby/models/ipo_event.rb +3 -3
  90. data/lib/finnhub_ruby/models/key_customers_suppliers.rb +65 -5
  91. data/lib/finnhub_ruby/models/last_bid_ask.rb +1 -1
  92. data/lib/finnhub_ruby/models/market_news.rb +1 -1
  93. data/lib/finnhub_ruby/models/mutual_fund_country_exposure.rb +1 -1
  94. data/lib/finnhub_ruby/models/mutual_fund_country_exposure_data.rb +1 -1
  95. data/lib/finnhub_ruby/models/mutual_fund_holdings.rb +1 -1
  96. data/lib/finnhub_ruby/models/mutual_fund_holdings_data.rb +1 -1
  97. data/lib/finnhub_ruby/models/mutual_fund_profile.rb +1 -1
  98. data/lib/finnhub_ruby/models/mutual_fund_profile_data.rb +1 -1
  99. data/lib/finnhub_ruby/models/mutual_fund_sector_exposure.rb +1 -1
  100. data/lib/finnhub_ruby/models/mutual_fund_sector_exposure_data.rb +1 -1
  101. data/lib/finnhub_ruby/models/news_sentiment.rb +1 -1
  102. data/lib/finnhub_ruby/models/ownership.rb +1 -1
  103. data/lib/finnhub_ruby/models/ownership_info.rb +1 -1
  104. data/lib/finnhub_ruby/models/pattern_recognition.rb +1 -1
  105. data/lib/finnhub_ruby/models/press_release.rb +1 -1
  106. data/lib/finnhub_ruby/models/price_target.rb +1 -1
  107. data/lib/finnhub_ruby/models/quote.rb +1 -1
  108. data/lib/finnhub_ruby/models/recommendation_trend.rb +1 -1
  109. data/lib/finnhub_ruby/models/reddit_sentiment_content.rb +1 -1
  110. data/lib/finnhub_ruby/models/report.rb +1 -1
  111. data/lib/finnhub_ruby/models/revenue_breakdown.rb +1 -1
  112. data/lib/finnhub_ruby/models/revenue_estimates.rb +2 -2
  113. data/lib/finnhub_ruby/models/revenue_estimates_info.rb +259 -0
  114. data/lib/finnhub_ruby/models/sec_sentiment_analysis.rb +1 -1
  115. data/lib/finnhub_ruby/models/sentiment.rb +3 -3
  116. data/lib/finnhub_ruby/models/similarity_index.rb +2 -2
  117. data/lib/finnhub_ruby/models/similarity_index_info.rb +329 -0
  118. data/lib/finnhub_ruby/models/social_sentiment.rb +1 -1
  119. data/lib/finnhub_ruby/models/split.rb +1 -1
  120. data/lib/finnhub_ruby/models/stock_candles.rb +1 -1
  121. data/lib/finnhub_ruby/models/stock_symbol.rb +1 -1
  122. data/lib/finnhub_ruby/models/stock_transcripts.rb +1 -1
  123. data/lib/finnhub_ruby/models/supply_chain_relationships.rb +1 -1
  124. data/lib/finnhub_ruby/models/support_resistance.rb +1 -1
  125. data/lib/finnhub_ruby/models/symbol_lookup.rb +1 -1
  126. data/lib/finnhub_ruby/models/symbol_lookup_info.rb +1 -1
  127. data/lib/finnhub_ruby/models/technical_analysis.rb +1 -1
  128. data/lib/finnhub_ruby/models/tick_data.rb +1 -1
  129. data/lib/finnhub_ruby/models/transactions.rb +1 -1
  130. data/lib/finnhub_ruby/models/transcript_content.rb +1 -1
  131. data/lib/finnhub_ruby/models/transcript_participant.rb +1 -1
  132. data/lib/finnhub_ruby/models/trend.rb +1 -1
  133. data/lib/finnhub_ruby/models/twitter_sentiment_content.rb +1 -1
  134. data/lib/finnhub_ruby/models/upgrade_downgrade.rb +1 -1
  135. data/lib/finnhub_ruby/version.rb +2 -2
  136. data/lib/finnhub_ruby.rb +8 -3
  137. data/release.sh +1 -1
  138. data/spec/api_client_spec.rb +1 -1
  139. data/spec/configuration_spec.rb +1 -1
  140. data/spec/models/company_earnings_quality_score_data_spec.rb +70 -0
  141. data/spec/models/company_earnings_quality_score_spec.rb +46 -0
  142. data/spec/models/company_esg_spec.rb +64 -0
  143. data/spec/models/crypto_profile_spec.rb +94 -0
  144. data/spec/models/earnings_estimates_info_spec.rb +58 -0
  145. data/spec/models/revenue_estimates_info_spec.rb +58 -0
  146. data/spec/models/similarity_index_info_spec.rb +100 -0
  147. data/spec/spec_helper.rb +1 -1
  148. metadata +33 -3
  149. data/finnhub_ruby-1.1.5.gem +0 -0
@@ -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 CompanyEarningsQualityScore
18
+ # Symbol
19
+ attr_accessor :symbol
20
+
21
+ # Frequency
22
+ attr_accessor :freq
23
+
24
+ # Array of earnings quality score.
25
+ attr_accessor :data
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'symbol' => :'symbol',
31
+ :'freq' => :'freq',
32
+ :'data' => :'data'
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
+ :'symbol' => :'String',
45
+ :'freq' => :'String',
46
+ :'data' => :'Array<CompanyEarningsQualityScoreData>'
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::CompanyEarningsQualityScore` 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::CompanyEarningsQualityScore`. 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?(:'symbol')
72
+ self.symbol = attributes[:'symbol']
73
+ end
74
+
75
+ if attributes.key?(:'freq')
76
+ self.freq = attributes[:'freq']
77
+ end
78
+
79
+ if attributes.key?(:'data')
80
+ if (value = attributes[:'data']).is_a?(Array)
81
+ self.data = value
82
+ end
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
+ symbol == o.symbol &&
105
+ freq == o.freq &&
106
+ data == o.data
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
+ [symbol, freq, data].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
@@ -0,0 +1,279 @@
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 CompanyEarningsQualityScoreData
18
+ # Period
19
+ attr_accessor :period
20
+
21
+ # Growth Score
22
+ attr_accessor :growth
23
+
24
+ # Profitability Score
25
+ attr_accessor :profitability
26
+
27
+ # Cash Generation and Capital Allocation
28
+ attr_accessor :cash_generation_capital_allocation
29
+
30
+ # Leverage Score
31
+ attr_accessor :leverage
32
+
33
+ # Total Score
34
+ attr_accessor :score
35
+
36
+ # Letter Score
37
+ attr_accessor :letter_score
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'period' => :'period',
43
+ :'growth' => :'growth',
44
+ :'profitability' => :'profitability',
45
+ :'cash_generation_capital_allocation' => :'cashGenerationCapitalAllocation',
46
+ :'leverage' => :'leverage',
47
+ :'score' => :'score',
48
+ :'letter_score' => :'letterScore'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'period' => :'String',
61
+ :'growth' => :'Float',
62
+ :'profitability' => :'Float',
63
+ :'cash_generation_capital_allocation' => :'Float',
64
+ :'leverage' => :'Float',
65
+ :'score' => :'Float',
66
+ :'letter_score' => :'String'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FinnhubRuby::CompanyEarningsQualityScoreData` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FinnhubRuby::CompanyEarningsQualityScoreData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'period')
92
+ self.period = attributes[:'period']
93
+ end
94
+
95
+ if attributes.key?(:'growth')
96
+ self.growth = attributes[:'growth']
97
+ end
98
+
99
+ if attributes.key?(:'profitability')
100
+ self.profitability = attributes[:'profitability']
101
+ end
102
+
103
+ if attributes.key?(:'cash_generation_capital_allocation')
104
+ self.cash_generation_capital_allocation = attributes[:'cash_generation_capital_allocation']
105
+ end
106
+
107
+ if attributes.key?(:'leverage')
108
+ self.leverage = attributes[:'leverage']
109
+ end
110
+
111
+ if attributes.key?(:'score')
112
+ self.score = attributes[:'score']
113
+ end
114
+
115
+ if attributes.key?(:'letter_score')
116
+ self.letter_score = attributes[:'letter_score']
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ invalid_properties = Array.new
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ true
131
+ end
132
+
133
+ # Checks equality by comparing each attribute.
134
+ # @param [Object] Object to be compared
135
+ def ==(o)
136
+ return true if self.equal?(o)
137
+ self.class == o.class &&
138
+ period == o.period &&
139
+ growth == o.growth &&
140
+ profitability == o.profitability &&
141
+ cash_generation_capital_allocation == o.cash_generation_capital_allocation &&
142
+ leverage == o.leverage &&
143
+ score == o.score &&
144
+ letter_score == o.letter_score
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] Object to be compared
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Integer] Hash code
155
+ def hash
156
+ [period, growth, profitability, cash_generation_capital_allocation, leverage, score, letter_score].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def self.build_from_hash(attributes)
163
+ new.build_from_hash(attributes)
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def build_from_hash(attributes)
170
+ return nil unless attributes.is_a?(Hash)
171
+ self.class.openapi_types.each_pair do |key, type|
172
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
173
+ self.send("#{key}=", nil)
174
+ elsif type =~ /\AArray<(.*)>/i
175
+ # check to ensure the input is an array given that the attribute
176
+ # is documented as an array but the input is not
177
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
178
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
179
+ end
180
+ elsif !attributes[self.class.attribute_map[key]].nil?
181
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
182
+ end
183
+ end
184
+
185
+ self
186
+ end
187
+
188
+ # Deserializes the data based on type
189
+ # @param string type Data type
190
+ # @param string value Value to be deserialized
191
+ # @return [Object] Deserialized data
192
+ def _deserialize(type, value)
193
+ case type.to_sym
194
+ when :Time
195
+ Time.parse(value)
196
+ when :Date
197
+ Date.parse(value)
198
+ when :String
199
+ value.to_s
200
+ when :Integer
201
+ value.to_i
202
+ when :Float
203
+ value.to_f
204
+ when :Boolean
205
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
206
+ true
207
+ else
208
+ false
209
+ end
210
+ when :Object
211
+ # generic object (usually a Hash), return directly
212
+ value
213
+ when /\AArray<(?<inner_type>.+)>\z/
214
+ inner_type = Regexp.last_match[:inner_type]
215
+ value.map { |v| _deserialize(inner_type, v) }
216
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
217
+ k_type = Regexp.last_match[:k_type]
218
+ v_type = Regexp.last_match[:v_type]
219
+ {}.tap do |hash|
220
+ value.each do |k, v|
221
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
222
+ end
223
+ end
224
+ else # model
225
+ # models (e.g. Pet) or oneOf
226
+ klass = FinnhubRuby.const_get(type)
227
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
228
+ end
229
+ end
230
+
231
+ # Returns the string representation of the object
232
+ # @return [String] String presentation of the object
233
+ def to_s
234
+ to_hash.to_s
235
+ end
236
+
237
+ # to_body is an alias to to_hash (backward compatibility)
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_body
240
+ to_hash
241
+ end
242
+
243
+ # Returns the object in the form of hash
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_hash
246
+ hash = {}
247
+ self.class.attribute_map.each_pair do |attr, param|
248
+ value = self.send(attr)
249
+ if value.nil?
250
+ is_nullable = self.class.openapi_nullable.include?(attr)
251
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
252
+ end
253
+
254
+ hash[param] = _to_hash(value)
255
+ end
256
+ hash
257
+ end
258
+
259
+ # Outputs non-array value in the form of hash
260
+ # For object, use to_hash. Otherwise, just return the value
261
+ # @param [Object] value Any valid value
262
+ # @return [Hash] Returns the value in the form of hash
263
+ def _to_hash(value)
264
+ if value.is_a?(Array)
265
+ value.compact.map { |v| _to_hash(v) }
266
+ elsif value.is_a?(Hash)
267
+ {}.tap do |hash|
268
+ value.each { |k, v| hash[k] = _to_hash(v) }
269
+ end
270
+ elsif value.respond_to? :to_hash
271
+ value.to_hash
272
+ else
273
+ value
274
+ end
275
+ end
276
+
277
+ end
278
+
279
+ end