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.
- checksums.yaml +4 -4
- data/README.md +51 -14
- data/docs/CompanyESG.md +28 -0
- data/docs/CompanyEarningsQualityScore.md +22 -0
- data/docs/CompanyEarningsQualityScoreData.md +30 -0
- data/docs/CompanyProfile.md +5 -5
- data/docs/CountryMetadata.md +5 -1
- data/docs/CryptoProfile.md +38 -0
- data/docs/DefaultApi.md +241 -20
- data/docs/EarningRelease.md +2 -2
- data/docs/EarningsEstimates.md +1 -1
- data/docs/EarningsEstimatesInfo.md +26 -0
- data/docs/IPOEvent.md +2 -2
- data/docs/KeyCustomersSuppliers.md +13 -1
- data/docs/RevenueEstimates.md +1 -1
- data/docs/RevenueEstimatesInfo.md +26 -0
- data/docs/Sentiment.md +2 -2
- data/docs/SimilarityIndex.md +1 -1
- data/docs/SimilarityIndexInfo.md +40 -0
- data/finnhub_ruby-1.1.7.gem +0 -0
- data/finnhub_ruby-1.1.8.gem +0 -0
- data/finnhub_ruby-1.1.9.gem +0 -0
- data/finnhub_ruby.gemspec +1 -1
- data/lib/finnhub_ruby/api/default_api.rb +216 -14
- data/lib/finnhub_ruby/api_client.rb +1 -1
- data/lib/finnhub_ruby/api_error.rb +1 -1
- data/lib/finnhub_ruby/configuration.rb +1 -1
- data/lib/finnhub_ruby/models/aggregate_indicators.rb +1 -1
- data/lib/finnhub_ruby/models/basic_financials.rb +1 -1
- data/lib/finnhub_ruby/models/breakdown_item.rb +1 -1
- data/lib/finnhub_ruby/models/company.rb +1 -1
- data/lib/finnhub_ruby/models/company_earnings_quality_score.rb +241 -0
- data/lib/finnhub_ruby/models/company_earnings_quality_score_data.rb +279 -0
- data/lib/finnhub_ruby/models/company_esg.rb +268 -0
- data/lib/finnhub_ruby/models/company_executive.rb +1 -1
- data/lib/finnhub_ruby/models/company_news.rb +1 -1
- data/lib/finnhub_ruby/models/company_news_statistics.rb +1 -1
- data/lib/finnhub_ruby/models/company_profile.rb +6 -6
- data/lib/finnhub_ruby/models/company_profile2.rb +1 -1
- data/lib/finnhub_ruby/models/country_metadata.rb +25 -5
- data/lib/finnhub_ruby/models/covid_info.rb +1 -1
- data/lib/finnhub_ruby/models/crypto_candles.rb +1 -1
- data/lib/finnhub_ruby/models/crypto_profile.rb +319 -0
- data/lib/finnhub_ruby/models/crypto_symbol.rb +1 -1
- data/lib/finnhub_ruby/models/development.rb +1 -1
- data/lib/finnhub_ruby/models/dividends.rb +1 -1
- data/lib/finnhub_ruby/models/dividends2.rb +1 -1
- data/lib/finnhub_ruby/models/dividends2_info.rb +1 -1
- data/lib/finnhub_ruby/models/earning_release.rb +3 -3
- data/lib/finnhub_ruby/models/earning_result.rb +1 -1
- data/lib/finnhub_ruby/models/earnings_calendar.rb +1 -1
- data/lib/finnhub_ruby/models/earnings_call_transcripts.rb +1 -1
- data/lib/finnhub_ruby/models/earnings_call_transcripts_list.rb +1 -1
- data/lib/finnhub_ruby/models/earnings_estimates.rb +2 -2
- data/lib/finnhub_ruby/models/earnings_estimates_info.rb +259 -0
- data/lib/finnhub_ruby/models/economic_calendar.rb +1 -1
- data/lib/finnhub_ruby/models/economic_code.rb +1 -1
- data/lib/finnhub_ruby/models/economic_data.rb +1 -1
- data/lib/finnhub_ruby/models/economic_data_info.rb +1 -1
- data/lib/finnhub_ruby/models/economic_event.rb +1 -1
- data/lib/finnhub_ruby/models/etf_country_exposure_data.rb +1 -1
- data/lib/finnhub_ruby/models/etf_holdings_data.rb +1 -1
- data/lib/finnhub_ruby/models/etf_profile_data.rb +1 -1
- data/lib/finnhub_ruby/models/etf_sector_exposure_data.rb +1 -1
- data/lib/finnhub_ruby/models/etfs_country_exposure.rb +1 -1
- data/lib/finnhub_ruby/models/etfs_holdings.rb +1 -1
- data/lib/finnhub_ruby/models/etfs_profile.rb +1 -1
- data/lib/finnhub_ruby/models/etfs_sector_exposure.rb +1 -1
- data/lib/finnhub_ruby/models/fda_comittee_meeting.rb +1 -1
- data/lib/finnhub_ruby/models/filing.rb +1 -1
- data/lib/finnhub_ruby/models/filing_sentiment.rb +1 -1
- data/lib/finnhub_ruby/models/financial_statements.rb +1 -1
- data/lib/finnhub_ruby/models/financials_as_reported.rb +1 -1
- data/lib/finnhub_ruby/models/forex_candles.rb +1 -1
- data/lib/finnhub_ruby/models/forex_symbol.rb +1 -1
- data/lib/finnhub_ruby/models/forexrates.rb +1 -1
- data/lib/finnhub_ruby/models/fund_ownership.rb +1 -1
- data/lib/finnhub_ruby/models/fund_ownership_info.rb +1 -1
- data/lib/finnhub_ruby/models/historical_nbbo.rb +1 -1
- data/lib/finnhub_ruby/models/index_historical_constituent.rb +1 -1
- data/lib/finnhub_ruby/models/indicator.rb +1 -1
- data/lib/finnhub_ruby/models/indices_constituents.rb +1 -1
- data/lib/finnhub_ruby/models/indices_historical_constituents.rb +1 -1
- data/lib/finnhub_ruby/models/insider_transactions.rb +1 -1
- data/lib/finnhub_ruby/models/international_filing.rb +1 -1
- data/lib/finnhub_ruby/models/investment_theme_portfolio.rb +1 -1
- data/lib/finnhub_ruby/models/investment_themes.rb +1 -1
- data/lib/finnhub_ruby/models/ipo_calendar.rb +1 -1
- data/lib/finnhub_ruby/models/ipo_event.rb +3 -3
- data/lib/finnhub_ruby/models/key_customers_suppliers.rb +65 -5
- data/lib/finnhub_ruby/models/last_bid_ask.rb +1 -1
- data/lib/finnhub_ruby/models/market_news.rb +1 -1
- data/lib/finnhub_ruby/models/mutual_fund_country_exposure.rb +1 -1
- data/lib/finnhub_ruby/models/mutual_fund_country_exposure_data.rb +1 -1
- data/lib/finnhub_ruby/models/mutual_fund_holdings.rb +1 -1
- data/lib/finnhub_ruby/models/mutual_fund_holdings_data.rb +1 -1
- data/lib/finnhub_ruby/models/mutual_fund_profile.rb +1 -1
- data/lib/finnhub_ruby/models/mutual_fund_profile_data.rb +1 -1
- data/lib/finnhub_ruby/models/mutual_fund_sector_exposure.rb +1 -1
- data/lib/finnhub_ruby/models/mutual_fund_sector_exposure_data.rb +1 -1
- data/lib/finnhub_ruby/models/news_sentiment.rb +1 -1
- data/lib/finnhub_ruby/models/ownership.rb +1 -1
- data/lib/finnhub_ruby/models/ownership_info.rb +1 -1
- data/lib/finnhub_ruby/models/pattern_recognition.rb +1 -1
- data/lib/finnhub_ruby/models/press_release.rb +1 -1
- data/lib/finnhub_ruby/models/price_target.rb +1 -1
- data/lib/finnhub_ruby/models/quote.rb +1 -1
- data/lib/finnhub_ruby/models/recommendation_trend.rb +1 -1
- data/lib/finnhub_ruby/models/reddit_sentiment_content.rb +1 -1
- data/lib/finnhub_ruby/models/report.rb +1 -1
- data/lib/finnhub_ruby/models/revenue_breakdown.rb +1 -1
- data/lib/finnhub_ruby/models/revenue_estimates.rb +2 -2
- data/lib/finnhub_ruby/models/revenue_estimates_info.rb +259 -0
- data/lib/finnhub_ruby/models/sec_sentiment_analysis.rb +1 -1
- data/lib/finnhub_ruby/models/sentiment.rb +3 -3
- data/lib/finnhub_ruby/models/similarity_index.rb +2 -2
- data/lib/finnhub_ruby/models/similarity_index_info.rb +329 -0
- data/lib/finnhub_ruby/models/social_sentiment.rb +1 -1
- data/lib/finnhub_ruby/models/split.rb +1 -1
- data/lib/finnhub_ruby/models/stock_candles.rb +1 -1
- data/lib/finnhub_ruby/models/stock_symbol.rb +1 -1
- data/lib/finnhub_ruby/models/stock_transcripts.rb +1 -1
- data/lib/finnhub_ruby/models/supply_chain_relationships.rb +1 -1
- data/lib/finnhub_ruby/models/support_resistance.rb +1 -1
- data/lib/finnhub_ruby/models/symbol_lookup.rb +1 -1
- data/lib/finnhub_ruby/models/symbol_lookup_info.rb +1 -1
- data/lib/finnhub_ruby/models/technical_analysis.rb +1 -1
- data/lib/finnhub_ruby/models/tick_data.rb +1 -1
- data/lib/finnhub_ruby/models/transactions.rb +1 -1
- data/lib/finnhub_ruby/models/transcript_content.rb +1 -1
- data/lib/finnhub_ruby/models/transcript_participant.rb +1 -1
- data/lib/finnhub_ruby/models/trend.rb +1 -1
- data/lib/finnhub_ruby/models/twitter_sentiment_content.rb +1 -1
- data/lib/finnhub_ruby/models/upgrade_downgrade.rb +1 -1
- data/lib/finnhub_ruby/version.rb +2 -2
- data/lib/finnhub_ruby.rb +8 -3
- data/release.sh +1 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/company_earnings_quality_score_data_spec.rb +70 -0
- data/spec/models/company_earnings_quality_score_spec.rb +46 -0
- data/spec/models/company_esg_spec.rb +64 -0
- data/spec/models/crypto_profile_spec.rb +94 -0
- data/spec/models/earnings_estimates_info_spec.rb +58 -0
- data/spec/models/revenue_estimates_info_spec.rb +58 -0
- data/spec/models/similarity_index_info_spec.rb +100 -0
- data/spec/spec_helper.rb +1 -1
- metadata +33 -3
- data/finnhub_ruby-1.1.5.gem +0 -0
@@ -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
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.2.
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -72,8 +72,8 @@ module FinnhubRuby
|
|
72
72
|
:'quarter' => :'Integer',
|
73
73
|
:'eps_estimate' => :'Float',
|
74
74
|
:'eps_actual' => :'Float',
|
75
|
-
:'revenue_estimate' => :'
|
76
|
-
:'revenue_actual' => :'
|
75
|
+
:'revenue_estimate' => :'Float',
|
76
|
+
:'revenue_actual' => :'Float'
|
77
77
|
}
|
78
78
|
end
|
79
79
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.2.
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -41,7 +41,7 @@ module FinnhubRuby
|
|
41
41
|
# Attribute type mapping.
|
42
42
|
def self.openapi_types
|
43
43
|
{
|
44
|
-
:'data' => :'Array<
|
44
|
+
:'data' => :'Array<EarningsEstimatesInfo>',
|
45
45
|
:'freq' => :'String',
|
46
46
|
:'symbol' => :'String'
|
47
47
|
}
|
@@ -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 EarningsEstimatesInfo
|
18
|
+
# Average EPS estimates including Finnhub's proprietary estimates.
|
19
|
+
attr_accessor :eps_avg
|
20
|
+
|
21
|
+
# Highest estimate.
|
22
|
+
attr_accessor :eps_high
|
23
|
+
|
24
|
+
# Lowest estimate.
|
25
|
+
attr_accessor :eps_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
|
+
:'eps_avg' => :'epsAvg',
|
37
|
+
:'eps_high' => :'epsHigh',
|
38
|
+
:'eps_low' => :'epsLow',
|
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
|
+
:'eps_avg' => :'Float',
|
53
|
+
:'eps_high' => :'Float',
|
54
|
+
:'eps_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::EarningsEstimatesInfo` 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::EarningsEstimatesInfo`. 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?(:'eps_avg')
|
82
|
+
self.eps_avg = attributes[:'eps_avg']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'eps_high')
|
86
|
+
self.eps_high = attributes[:'eps_high']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'eps_low')
|
90
|
+
self.eps_low = attributes[:'eps_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
|
+
eps_avg == o.eps_avg &&
|
121
|
+
eps_high == o.eps_high &&
|
122
|
+
eps_low == o.eps_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
|
+
[eps_avg, eps_high, eps_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
|