finnhub_ruby 1.1.10 → 1.1.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 EbitdaEstimates
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<EbitdaEstimatesInfo>',
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::EbitdaEstimates` 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::EbitdaEstimates`. 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
@@ -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
@@ -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
@@ -11,5 +11,5 @@ OpenAPI Generator version: 5.2.1
11
11
  =end
12
12
 
13
13
  module FinnhubRuby
14
- VERSION = '1.1.10'
14
+ VERSION = '1.1.11'
15
15
  end
data/lib/finnhub_ruby.rb CHANGED
@@ -53,6 +53,10 @@ require 'finnhub_ruby/models/earnings_call_transcripts'
53
53
  require 'finnhub_ruby/models/earnings_call_transcripts_list'
54
54
  require 'finnhub_ruby/models/earnings_estimates'
55
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'
56
60
  require 'finnhub_ruby/models/economic_calendar'
57
61
  require 'finnhub_ruby/models/economic_code'
58
62
  require 'finnhub_ruby/models/economic_data'