finnhub_ruby 1.0.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -2
  3. data/docs/CompanyProfile.md +1 -1
  4. data/docs/DefaultApi.md +394 -3
  5. data/docs/ETFCountryExposureData.md +19 -0
  6. data/docs/ETFHoldingsData.md +21 -0
  7. data/docs/ETFSectorExposureData.md +19 -0
  8. data/docs/ETFsCountryExposure.md +19 -0
  9. data/docs/ETFsHoldings.md +19 -0
  10. data/docs/ETFsIndustryExposure.md +19 -0
  11. data/docs/ETFsProfile.md +19 -0
  12. data/docs/IndexHistoricalConstituent.md +21 -0
  13. data/docs/IndicesConstituents.md +19 -0
  14. data/docs/IndicesHistoricalConstituents.md +19 -0
  15. data/docs/SimilarityIndex.md +21 -0
  16. data/docs/Stock.md +5 -1
  17. data/docs/Trend.md +3 -1
  18. data/lib/finnhub_ruby.rb +11 -0
  19. data/lib/finnhub_ruby/api/default_api.rb +447 -4
  20. data/lib/finnhub_ruby/api_client.rb +1 -2
  21. data/lib/finnhub_ruby/models/company_profile.rb +1 -1
  22. data/lib/finnhub_ruby/models/et_fs_country_exposure.rb +219 -0
  23. data/lib/finnhub_ruby/models/et_fs_holdings.rb +219 -0
  24. data/lib/finnhub_ruby/models/et_fs_industry_exposure.rb +219 -0
  25. data/lib/finnhub_ruby/models/et_fs_profile.rb +216 -0
  26. data/lib/finnhub_ruby/models/etf_country_exposure_data.rb +217 -0
  27. data/lib/finnhub_ruby/models/etf_holdings_data.rb +227 -0
  28. data/lib/finnhub_ruby/models/etf_sector_exposure_data.rb +217 -0
  29. data/lib/finnhub_ruby/models/index_historical_constituent.rb +227 -0
  30. data/lib/finnhub_ruby/models/indices_constituents.rb +219 -0
  31. data/lib/finnhub_ruby/models/indices_historical_constituents.rb +219 -0
  32. data/lib/finnhub_ruby/models/similarity_index.rb +229 -0
  33. data/lib/finnhub_ruby/models/stock.rb +24 -4
  34. data/lib/finnhub_ruby/models/trend.rb +14 -4
  35. data/lib/finnhub_ruby/version.rb +1 -1
  36. data/release.sh +1 -1
  37. data/spec/api/default_api_spec.rb +88 -2
  38. data/spec/models/et_fs_country_exposure_spec.rb +47 -0
  39. data/spec/models/et_fs_holdings_spec.rb +47 -0
  40. data/spec/models/et_fs_industry_exposure_spec.rb +47 -0
  41. data/spec/models/et_fs_profile_spec.rb +47 -0
  42. data/spec/models/etf_country_exposure_data_spec.rb +47 -0
  43. data/spec/models/etf_holdings_data_spec.rb +53 -0
  44. data/spec/models/etf_sector_exposure_data_spec.rb +47 -0
  45. data/spec/models/index_historical_constituent_spec.rb +53 -0
  46. data/spec/models/indices_constituents_spec.rb +47 -0
  47. data/spec/models/indices_historical_constituents_spec.rb +47 -0
  48. data/spec/models/similarity_index_spec.rb +53 -0
  49. data/spec/models/stock_spec.rb +12 -0
  50. data/spec/models/trend_spec.rb +6 -0
  51. data/test.rb +18 -0
  52. metadata +46 -3
  53. data/finnhub_ruby-1.0.0.gem +0 -0
@@ -23,12 +23,20 @@ module FinnhubRuby
23
23
  # Unique symbol used to identify this symbol used in <code>/stock/candle</code> endpoint.
24
24
  attr_accessor :symbol
25
25
 
26
+ # Security type.
27
+ attr_accessor :type
28
+
29
+ # Price's currency. This might be different from the reporting currency of fundamental data.
30
+ attr_accessor :currency
31
+
26
32
  # Attribute mapping from ruby-style variable name to JSON key.
27
33
  def self.attribute_map
28
34
  {
29
35
  :'description' => :'description',
30
36
  :'display_symbol' => :'displaySymbol',
31
- :'symbol' => :'symbol'
37
+ :'symbol' => :'symbol',
38
+ :'type' => :'type',
39
+ :'currency' => :'currency'
32
40
  }
33
41
  end
34
42
 
@@ -37,7 +45,9 @@ module FinnhubRuby
37
45
  {
38
46
  :'description' => :'String',
39
47
  :'display_symbol' => :'String',
40
- :'symbol' => :'String'
48
+ :'symbol' => :'String',
49
+ :'type' => :'String',
50
+ :'currency' => :'String'
41
51
  }
42
52
  end
43
53
 
@@ -73,6 +83,14 @@ module FinnhubRuby
73
83
  if attributes.key?(:'symbol')
74
84
  self.symbol = attributes[:'symbol']
75
85
  end
86
+
87
+ if attributes.key?(:'type')
88
+ self.type = attributes[:'type']
89
+ end
90
+
91
+ if attributes.key?(:'currency')
92
+ self.currency = attributes[:'currency']
93
+ end
76
94
  end
77
95
 
78
96
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -95,7 +113,9 @@ module FinnhubRuby
95
113
  self.class == o.class &&
96
114
  description == o.description &&
97
115
  display_symbol == o.display_symbol &&
98
- symbol == o.symbol
116
+ symbol == o.symbol &&
117
+ type == o.type &&
118
+ currency == o.currency
99
119
  end
100
120
 
101
121
  # @see the `==` method
@@ -107,7 +127,7 @@ module FinnhubRuby
107
127
  # Calculates hash code according to all attributes.
108
128
  # @return [Integer] Hash code
109
129
  def hash
110
- [description, display_symbol, symbol].hash
130
+ [description, display_symbol, symbol, type, currency].hash
111
131
  end
112
132
 
113
133
  # Builds the object from hash
@@ -17,17 +17,22 @@ module FinnhubRuby
17
17
  # ADX reading
18
18
  attr_accessor :adx
19
19
 
20
+ # Whether market is trending or going sideway
21
+ attr_accessor :trending
22
+
20
23
  # Attribute mapping from ruby-style variable name to JSON key.
21
24
  def self.attribute_map
22
25
  {
23
- :'adx' => :'adx'
26
+ :'adx' => :'adx',
27
+ :'trending' => :'trending'
24
28
  }
25
29
  end
26
30
 
27
31
  # Attribute type mapping.
28
32
  def self.openapi_types
29
33
  {
30
- :'adx' => :'Float'
34
+ :'adx' => :'Float',
35
+ :'trending' => :'Boolean'
31
36
  }
32
37
  end
33
38
 
@@ -55,6 +60,10 @@ module FinnhubRuby
55
60
  if attributes.key?(:'adx')
56
61
  self.adx = attributes[:'adx']
57
62
  end
63
+
64
+ if attributes.key?(:'trending')
65
+ self.trending = attributes[:'trending']
66
+ end
58
67
  end
59
68
 
60
69
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -75,7 +84,8 @@ module FinnhubRuby
75
84
  def ==(o)
76
85
  return true if self.equal?(o)
77
86
  self.class == o.class &&
78
- adx == o.adx
87
+ adx == o.adx &&
88
+ trending == o.trending
79
89
  end
80
90
 
81
91
  # @see the `==` method
@@ -87,7 +97,7 @@ module FinnhubRuby
87
97
  # Calculates hash code according to all attributes.
88
98
  # @return [Integer] Hash code
89
99
  def hash
90
- [adx].hash
100
+ [adx, trending].hash
91
101
  end
92
102
 
93
103
  # Builds the object from hash
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module FinnhubRuby
14
- VERSION = '1.0.1'
14
+ VERSION = '1.1.2'
15
15
  end
data/release.sh CHANGED
@@ -1,2 +1,2 @@
1
1
  gem build finnhub_ruby.gemspec
2
- gem push finnhub_ruby-1.0.0.gem
2
+ gem push finnhub_ruby-1.0.1.gem
@@ -230,7 +230,7 @@ describe 'DefaultApi' do
230
230
  # @option opts [Date] :from From date: 2020-03-15.
231
231
  # @option opts [Date] :to To date: 2020-03-16.
232
232
  # @option opts [String] :symbol Filter by symbol: AAPL.
233
- # @option opts [AnyType] :international Set to &lt;code&gt;true&lt;/code&gt; to include international markets. Default value is &lt;code&gt;false&lt;/code&gt;
233
+ # @option opts [Boolean] :international Set to &lt;code&gt;true&lt;/code&gt; to include international markets. Default value is &lt;code&gt;false&lt;/code&gt;
234
234
  # @return [EarningsCalendar]
235
235
  describe 'earnings_calendar test' do
236
236
  it 'should work' do
@@ -261,6 +261,54 @@ describe 'DefaultApi' do
261
261
  end
262
262
  end
263
263
 
264
+ # unit tests for etfs_country_exposure
265
+ # ETFs Country Exposure
266
+ # Get ETF country exposure data.
267
+ # @param symbol ETF symbol.
268
+ # @param [Hash] opts the optional parameters
269
+ # @return [ETFsCountryExposure]
270
+ describe 'etfs_country_exposure test' do
271
+ it 'should work' do
272
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
273
+ end
274
+ end
275
+
276
+ # unit tests for etfs_holdings
277
+ # ETFs Holdings
278
+ # Get current ETF holdings.
279
+ # @param symbol ETF symbol.
280
+ # @param [Hash] opts the optional parameters
281
+ # @return [ETFsHoldings]
282
+ describe 'etfs_holdings test' do
283
+ it 'should work' do
284
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
285
+ end
286
+ end
287
+
288
+ # unit tests for etfs_industry_exposure
289
+ # ETFs Industry Exposure
290
+ # Get ETF industry exposure data.
291
+ # @param symbol ETF symbol.
292
+ # @param [Hash] opts the optional parameters
293
+ # @return [ETFsIndustryExposure]
294
+ describe 'etfs_industry_exposure test' do
295
+ it 'should work' do
296
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
297
+ end
298
+ end
299
+
300
+ # unit tests for etfs_profile
301
+ # ETFs Profile
302
+ # Get ETF profile information. Currently support all US ETFs.
303
+ # @param symbol ETF symbol.
304
+ # @param [Hash] opts the optional parameters
305
+ # @return [ETFsProfile]
306
+ describe 'etfs_profile test' do
307
+ it 'should work' do
308
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
309
+ end
310
+ end
311
+
264
312
  # unit tests for filings
265
313
  # Filings
266
314
  # List company&#39;s filing. Limit to 250 documents at a time. This data is available for bulk download on &lt;a href&#x3D;\&quot;https://www.kaggle.com/finnhub/sec-filings\&quot; target&#x3D;\&quot;_blank\&quot;&gt;Kaggle SEC Filings database&lt;/a&gt;.
@@ -383,6 +431,30 @@ describe 'DefaultApi' do
383
431
  end
384
432
  end
385
433
 
434
+ # unit tests for indices_constituents
435
+ # Indices Constituents
436
+ # Get a list of index&#39;s constituents. Currently support &lt;code&gt;^GSPC (S&amp;P 500)&lt;/code&gt;, &lt;code&gt;^NDX (Nasdaq 100)&lt;/code&gt;, &lt;code&gt;^DJI (Dow Jones)&lt;/code&gt;
437
+ # @param symbol symbol
438
+ # @param [Hash] opts the optional parameters
439
+ # @return [IndicesConstituents]
440
+ describe 'indices_constituents test' do
441
+ it 'should work' do
442
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
443
+ end
444
+ end
445
+
446
+ # unit tests for indices_historical_constituents
447
+ # Indices Historical Constituents
448
+ # Get full history of index&#39;s constituents including symbols and dates of joining and leaving the Index. Currently support &lt;code&gt;^GSPC (S&amp;P 500)&lt;/code&gt;, &lt;code&gt;^NDX (Nasdaq 100)&lt;/code&gt;, &lt;code&gt;^DJI (Dow Jones)&lt;/code&gt;
449
+ # @param symbol symbol
450
+ # @param [Hash] opts the optional parameters
451
+ # @return [IndicesHistoricalConstituents]
452
+ describe 'indices_historical_constituents test' do
453
+ it 'should work' do
454
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
455
+ end
456
+ end
457
+
386
458
  # unit tests for investors_ownership
387
459
  # Investors Ownership
388
460
  # Get a full list of shareholders/investors of a company in descending order of the number of shares held.
@@ -484,6 +556,20 @@ describe 'DefaultApi' do
484
556
  end
485
557
  end
486
558
 
559
+ # unit tests for similarity_index
560
+ # Similarity Index
561
+ # &lt;p&gt;Calculate the textual difference between a company&#39;s 10-K / 10-Q reports and the same type of report in the previous year using Cosine Similarity. For example, this endpoint compares 2019&#39;s 10-K with 2018&#39;s 10-K. Companies breaking from its routines in disclosure of financial condition and risk analysis section can signal a significant change in the company&#39;s stock price in the upcoming 4 quarters.&lt;/p&gt;
562
+ # @param [Hash] opts the optional parameters
563
+ # @option opts [String] :symbol Symbol. Required if cik is empty
564
+ # @option opts [String] :cik CIK. Required if symbol is empty
565
+ # @option opts [String] :freq &lt;code&gt;annual&lt;/code&gt; or &lt;code&gt;quarterly&lt;/code&gt;. Default to &lt;code&gt;annual&lt;/code&gt;
566
+ # @return [SimilarityIndex]
567
+ describe 'similarity_index test' do
568
+ it 'should work' do
569
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
570
+ end
571
+ end
572
+
487
573
  # unit tests for stock_bidask
488
574
  # Last Bid-Ask
489
575
  # Get last bid/ask data for US stocks.
@@ -542,7 +628,7 @@ describe 'DefaultApi' do
542
628
 
543
629
  # unit tests for stock_symbols
544
630
  # Stock Symbol
545
- # List supported stocks.
631
+ # List supported stocks. A list of supported CFD Indices can be found &lt;a href&#x3D;\&quot;https://docs.google.com/spreadsheets/d/1BAbIXBgl405fj0oHeEyRFEu8mW4QD1PhvtaBATLoR14/edit?usp&#x3D;sharing\&quot; target&#x3D;\&quot;_blank\&quot;&gt;here&lt;/a&gt;.
546
632
  # @param exchange Exchange you want to get the list of symbols from. List of exchanges with fundamental data can be found &lt;a href&#x3D;\&quot;https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp&#x3D;sharing\&quot; target&#x3D;\&quot;_blank\&quot;&gt;here&lt;/a&gt;.
547
633
  # @param [Hash] opts the optional parameters
548
634
  # @return [Array<Stock>]
@@ -0,0 +1,47 @@
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: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for FinnhubRuby::ETFsCountryExposure
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'ETFsCountryExposure' do
21
+ before do
22
+ # run before each test
23
+ @instance = FinnhubRuby::ETFsCountryExposure.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of ETFsCountryExposure' do
31
+ it 'should create an instance of ETFsCountryExposure' do
32
+ expect(@instance).to be_instance_of(FinnhubRuby::ETFsCountryExposure)
33
+ end
34
+ end
35
+ describe 'test attribute "symbol"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "country_exposure"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ end
@@ -0,0 +1,47 @@
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: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for FinnhubRuby::ETFsHoldings
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'ETFsHoldings' do
21
+ before do
22
+ # run before each test
23
+ @instance = FinnhubRuby::ETFsHoldings.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of ETFsHoldings' do
31
+ it 'should create an instance of ETFsHoldings' do
32
+ expect(@instance).to be_instance_of(FinnhubRuby::ETFsHoldings)
33
+ end
34
+ end
35
+ describe 'test attribute "symbol"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "holdings"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ end
@@ -0,0 +1,47 @@
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: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for FinnhubRuby::ETFsIndustryExposure
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'ETFsIndustryExposure' do
21
+ before do
22
+ # run before each test
23
+ @instance = FinnhubRuby::ETFsIndustryExposure.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of ETFsIndustryExposure' do
31
+ it 'should create an instance of ETFsIndustryExposure' do
32
+ expect(@instance).to be_instance_of(FinnhubRuby::ETFsIndustryExposure)
33
+ end
34
+ end
35
+ describe 'test attribute "symbol"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "sector_exposure"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ end
@@ -0,0 +1,47 @@
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: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for FinnhubRuby::ETFsProfile
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'ETFsProfile' do
21
+ before do
22
+ # run before each test
23
+ @instance = FinnhubRuby::ETFsProfile.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of ETFsProfile' do
31
+ it 'should create an instance of ETFsProfile' do
32
+ expect(@instance).to be_instance_of(FinnhubRuby::ETFsProfile)
33
+ end
34
+ end
35
+ describe 'test attribute "symbol"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "profile"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ end