finnhub_ruby 1.0.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -0,0 +1,19 @@
1
+ # FinnhubRuby::ETFCountryExposureData
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **country** | **String** | Country | [optional]
8
+ **exposure** | **String** | Percent of exposure. | [optional]
9
+
10
+ ## Code Sample
11
+
12
+ ```ruby
13
+ require 'FinnhubRuby'
14
+
15
+ instance = FinnhubRuby::ETFCountryExposureData.new(country: null,
16
+ exposure: null)
17
+ ```
18
+
19
+
@@ -0,0 +1,21 @@
1
+ # FinnhubRuby::ETFHoldingsData
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **symbol** | **String** | Symbol description | [optional]
8
+ **share** | **Float** | Number of shares owned by the ETF. | [optional]
9
+ **percent** | **Float** | Portfolio's percent | [optional]
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'FinnhubRuby'
15
+
16
+ instance = FinnhubRuby::ETFHoldingsData.new(symbol: null,
17
+ share: null,
18
+ percent: null)
19
+ ```
20
+
21
+
@@ -0,0 +1,19 @@
1
+ # FinnhubRuby::ETFSectorExposureData
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **industry** | **String** | Industry | [optional]
8
+ **exposure** | **String** | Percent of exposure. | [optional]
9
+
10
+ ## Code Sample
11
+
12
+ ```ruby
13
+ require 'FinnhubRuby'
14
+
15
+ instance = FinnhubRuby::ETFSectorExposureData.new(industry: null,
16
+ exposure: null)
17
+ ```
18
+
19
+
@@ -0,0 +1,19 @@
1
+ # FinnhubRuby::ETFsCountryExposure
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **symbol** | **String** | ETF symbol. | [optional]
8
+ **country_exposure** | **Array<Object>** | Array of countries and and exposure levels. | [optional]
9
+
10
+ ## Code Sample
11
+
12
+ ```ruby
13
+ require 'FinnhubRuby'
14
+
15
+ instance = FinnhubRuby::ETFsCountryExposure.new(symbol: null,
16
+ country_exposure: null)
17
+ ```
18
+
19
+
@@ -0,0 +1,19 @@
1
+ # FinnhubRuby::ETFsHoldings
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **symbol** | **String** | ETF symbol. | [optional]
8
+ **holdings** | **Array<Object>** | Array of holdings. | [optional]
9
+
10
+ ## Code Sample
11
+
12
+ ```ruby
13
+ require 'FinnhubRuby'
14
+
15
+ instance = FinnhubRuby::ETFsHoldings.new(symbol: null,
16
+ holdings: null)
17
+ ```
18
+
19
+
@@ -0,0 +1,19 @@
1
+ # FinnhubRuby::ETFsIndustryExposure
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **symbol** | **String** | ETF symbol. | [optional]
8
+ **sector_exposure** | **Array<Object>** | Array of industries and exposure levels. | [optional]
9
+
10
+ ## Code Sample
11
+
12
+ ```ruby
13
+ require 'FinnhubRuby'
14
+
15
+ instance = FinnhubRuby::ETFsIndustryExposure.new(symbol: null,
16
+ sector_exposure: null)
17
+ ```
18
+
19
+
@@ -0,0 +1,19 @@
1
+ # FinnhubRuby::ETFsProfile
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **symbol** | **String** | Use symbol returned in <code>/forex/symbol</code> endpoint for this field. | [optional]
8
+ **profile** | [**Object**](.md) | | [optional]
9
+
10
+ ## Code Sample
11
+
12
+ ```ruby
13
+ require 'FinnhubRuby'
14
+
15
+ instance = FinnhubRuby::ETFsProfile.new(symbol: null,
16
+ profile: null)
17
+ ```
18
+
19
+
@@ -0,0 +1,21 @@
1
+ # FinnhubRuby::IndexHistoricalConstituent
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **symbol** | **String** | Symbol | [optional]
8
+ **action** | **String** | <code>add</code> or <code>remove</code>. | [optional]
9
+ **date** | **Date** | Date of joining or leaving the index. | [optional]
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'FinnhubRuby'
15
+
16
+ instance = FinnhubRuby::IndexHistoricalConstituent.new(symbol: null,
17
+ action: null,
18
+ date: null)
19
+ ```
20
+
21
+
@@ -0,0 +1,19 @@
1
+ # FinnhubRuby::IndicesConstituents
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **symbol** | **String** | Index's symbol. | [optional]
8
+ **constituents** | **Array<String>** | Array of constituents. | [optional]
9
+
10
+ ## Code Sample
11
+
12
+ ```ruby
13
+ require 'FinnhubRuby'
14
+
15
+ instance = FinnhubRuby::IndicesConstituents.new(symbol: null,
16
+ constituents: null)
17
+ ```
18
+
19
+
@@ -0,0 +1,19 @@
1
+ # FinnhubRuby::IndicesHistoricalConstituents
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **symbol** | **String** | Index's symbol. | [optional]
8
+ **historical_constituents** | **Array<Object>** | Array of historical constituents. | [optional]
9
+
10
+ ## Code Sample
11
+
12
+ ```ruby
13
+ require 'FinnhubRuby'
14
+
15
+ instance = FinnhubRuby::IndicesHistoricalConstituents.new(symbol: null,
16
+ historical_constituents: null)
17
+ ```
18
+
19
+
@@ -0,0 +1,21 @@
1
+ # FinnhubRuby::SimilarityIndex
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **symbol** | **String** | Symbol. | [optional]
8
+ **cik** | **String** | CIK. | [optional]
9
+ **similarity** | **Array<Object>** | Array of filings with its cosine similarity compared to the same report of the previous year. | [optional]
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'FinnhubRuby'
15
+
16
+ instance = FinnhubRuby::SimilarityIndex.new(symbol: null,
17
+ cik: null,
18
+ similarity: null)
19
+ ```
20
+
21
+
@@ -7,6 +7,8 @@ Name | Type | Description | Notes
7
7
  **description** | **String** | Symbol description | [optional]
8
8
  **display_symbol** | **String** | Display symbol name. | [optional]
9
9
  **symbol** | **String** | Unique symbol used to identify this symbol used in <code>/stock/candle</code> endpoint. | [optional]
10
+ **type** | **String** | Security type. | [optional]
11
+ **currency** | **String** | Price's currency. This might be different from the reporting currency of fundamental data. | [optional]
10
12
 
11
13
  ## Code Sample
12
14
 
@@ -15,7 +17,9 @@ require 'FinnhubRuby'
15
17
 
16
18
  instance = FinnhubRuby::Stock.new(description: null,
17
19
  display_symbol: null,
18
- symbol: null)
20
+ symbol: null,
21
+ type: null,
22
+ currency: null)
19
23
  ```
20
24
 
21
25
 
@@ -5,13 +5,15 @@
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
7
  **adx** | **Float** | ADX reading | [optional]
8
+ **trending** | **Boolean** | Whether market is trending or going sideway | [optional]
8
9
 
9
10
  ## Code Sample
10
11
 
11
12
  ```ruby
12
13
  require 'FinnhubRuby'
13
14
 
14
- instance = FinnhubRuby::Trend.new(adx: null)
15
+ instance = FinnhubRuby::Trend.new(adx: null,
16
+ trending: null)
15
17
  ```
16
18
 
17
19
 
@@ -30,6 +30,13 @@ require 'finnhub_ruby/models/crypto_candles'
30
30
  require 'finnhub_ruby/models/crypto_symbol'
31
31
  require 'finnhub_ruby/models/development'
32
32
  require 'finnhub_ruby/models/dividends'
33
+ require 'finnhub_ruby/models/etf_country_exposure_data'
34
+ require 'finnhub_ruby/models/etf_holdings_data'
35
+ require 'finnhub_ruby/models/etf_sector_exposure_data'
36
+ require 'finnhub_ruby/models/et_fs_country_exposure'
37
+ require 'finnhub_ruby/models/et_fs_holdings'
38
+ require 'finnhub_ruby/models/et_fs_industry_exposure'
39
+ require 'finnhub_ruby/models/et_fs_profile'
33
40
  require 'finnhub_ruby/models/earning_estimate'
34
41
  require 'finnhub_ruby/models/earning_release'
35
42
  require 'finnhub_ruby/models/earning_result'
@@ -51,7 +58,10 @@ require 'finnhub_ruby/models/forexrates'
51
58
  require 'finnhub_ruby/models/fund_ownership'
52
59
  require 'finnhub_ruby/models/ipo_calendar'
53
60
  require 'finnhub_ruby/models/ipo_event'
61
+ require 'finnhub_ruby/models/index_historical_constituent'
54
62
  require 'finnhub_ruby/models/indicator'
63
+ require 'finnhub_ruby/models/indices_constituents'
64
+ require 'finnhub_ruby/models/indices_historical_constituents'
55
65
  require 'finnhub_ruby/models/investor'
56
66
  require 'finnhub_ruby/models/investors_ownership'
57
67
  require 'finnhub_ruby/models/last_bid_ask'
@@ -65,6 +75,7 @@ require 'finnhub_ruby/models/recommendation_trend'
65
75
  require 'finnhub_ruby/models/report'
66
76
  require 'finnhub_ruby/models/revenue_estimates'
67
77
  require 'finnhub_ruby/models/sentiment'
78
+ require 'finnhub_ruby/models/similarity_index'
68
79
  require 'finnhub_ruby/models/split'
69
80
  require 'finnhub_ruby/models/stock'
70
81
  require 'finnhub_ruby/models/stock_candles'
@@ -1011,7 +1011,7 @@ module FinnhubRuby
1011
1011
  # @option opts [Date] :from From date: 2020-03-15.
1012
1012
  # @option opts [Date] :to To date: 2020-03-16.
1013
1013
  # @option opts [String] :symbol Filter by symbol: AAPL.
1014
- # @option opts [AnyType] :international Set to <code>true</code> to include international markets. Default value is <code>false</code>
1014
+ # @option opts [Boolean] :international Set to <code>true</code> to include international markets. Default value is <code>false</code>
1015
1015
  # @return [EarningsCalendar]
1016
1016
  def earnings_calendar(opts = {})
1017
1017
  data, _status_code, _headers = earnings_calendar_with_http_info(opts)
@@ -1024,7 +1024,7 @@ module FinnhubRuby
1024
1024
  # @option opts [Date] :from From date: 2020-03-15.
1025
1025
  # @option opts [Date] :to To date: 2020-03-16.
1026
1026
  # @option opts [String] :symbol Filter by symbol: AAPL.
1027
- # @option opts [AnyType] :international Set to <code>true</code> to include international markets. Default value is <code>false</code>
1027
+ # @option opts [Boolean] :international Set to <code>true</code> to include international markets. Default value is <code>false</code>
1028
1028
  # @return [Array<(EarningsCalendar, Integer, Hash)>] EarningsCalendar data, response status code and response headers
1029
1029
  def earnings_calendar_with_http_info(opts = {})
1030
1030
  if @api_client.config.debugging
@@ -1192,6 +1192,258 @@ module FinnhubRuby
1192
1192
  return data, status_code, headers
1193
1193
  end
1194
1194
 
1195
+ # ETFs Country Exposure
1196
+ # Get ETF country exposure data.
1197
+ # @param symbol [String] ETF symbol.
1198
+ # @param [Hash] opts the optional parameters
1199
+ # @return [ETFsCountryExposure]
1200
+ def etfs_country_exposure(symbol, opts = {})
1201
+ data, _status_code, _headers = etfs_country_exposure_with_http_info(symbol, opts)
1202
+ data
1203
+ end
1204
+
1205
+ # ETFs Country Exposure
1206
+ # Get ETF country exposure data.
1207
+ # @param symbol [String] ETF symbol.
1208
+ # @param [Hash] opts the optional parameters
1209
+ # @return [Array<(ETFsCountryExposure, Integer, Hash)>] ETFsCountryExposure data, response status code and response headers
1210
+ def etfs_country_exposure_with_http_info(symbol, opts = {})
1211
+ if @api_client.config.debugging
1212
+ @api_client.config.logger.debug 'Calling API: DefaultApi.etfs_country_exposure ...'
1213
+ end
1214
+ # verify the required parameter 'symbol' is set
1215
+ if @api_client.config.client_side_validation && symbol.nil?
1216
+ fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.etfs_country_exposure"
1217
+ end
1218
+ # resource path
1219
+ local_var_path = '/etf/country'
1220
+
1221
+ # query parameters
1222
+ query_params = opts[:query_params] || {}
1223
+ query_params[:'symbol'] = symbol
1224
+
1225
+ # header parameters
1226
+ header_params = opts[:header_params] || {}
1227
+ # HTTP header 'Accept' (if needed)
1228
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1229
+
1230
+ # form parameters
1231
+ form_params = opts[:form_params] || {}
1232
+
1233
+ # http body (model)
1234
+ post_body = opts[:body]
1235
+
1236
+ # return_type
1237
+ return_type = opts[:return_type] || 'ETFsCountryExposure'
1238
+
1239
+ # auth_names
1240
+ auth_names = opts[:auth_names] || ['api_key']
1241
+
1242
+ new_options = opts.merge(
1243
+ :header_params => header_params,
1244
+ :query_params => query_params,
1245
+ :form_params => form_params,
1246
+ :body => post_body,
1247
+ :auth_names => auth_names,
1248
+ :return_type => return_type
1249
+ )
1250
+
1251
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1252
+ if @api_client.config.debugging
1253
+ @api_client.config.logger.debug "API called: DefaultApi#etfs_country_exposure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1254
+ end
1255
+ return data, status_code, headers
1256
+ end
1257
+
1258
+ # ETFs Holdings
1259
+ # Get current ETF holdings.
1260
+ # @param symbol [String] ETF symbol.
1261
+ # @param [Hash] opts the optional parameters
1262
+ # @return [ETFsHoldings]
1263
+ def etfs_holdings(symbol, opts = {})
1264
+ data, _status_code, _headers = etfs_holdings_with_http_info(symbol, opts)
1265
+ data
1266
+ end
1267
+
1268
+ # ETFs Holdings
1269
+ # Get current ETF holdings.
1270
+ # @param symbol [String] ETF symbol.
1271
+ # @param [Hash] opts the optional parameters
1272
+ # @return [Array<(ETFsHoldings, Integer, Hash)>] ETFsHoldings data, response status code and response headers
1273
+ def etfs_holdings_with_http_info(symbol, opts = {})
1274
+ if @api_client.config.debugging
1275
+ @api_client.config.logger.debug 'Calling API: DefaultApi.etfs_holdings ...'
1276
+ end
1277
+ # verify the required parameter 'symbol' is set
1278
+ if @api_client.config.client_side_validation && symbol.nil?
1279
+ fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.etfs_holdings"
1280
+ end
1281
+ # resource path
1282
+ local_var_path = '/etf/holdings'
1283
+
1284
+ # query parameters
1285
+ query_params = opts[:query_params] || {}
1286
+ query_params[:'symbol'] = symbol
1287
+
1288
+ # header parameters
1289
+ header_params = opts[:header_params] || {}
1290
+ # HTTP header 'Accept' (if needed)
1291
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1292
+
1293
+ # form parameters
1294
+ form_params = opts[:form_params] || {}
1295
+
1296
+ # http body (model)
1297
+ post_body = opts[:body]
1298
+
1299
+ # return_type
1300
+ return_type = opts[:return_type] || 'ETFsHoldings'
1301
+
1302
+ # auth_names
1303
+ auth_names = opts[:auth_names] || ['api_key']
1304
+
1305
+ new_options = opts.merge(
1306
+ :header_params => header_params,
1307
+ :query_params => query_params,
1308
+ :form_params => form_params,
1309
+ :body => post_body,
1310
+ :auth_names => auth_names,
1311
+ :return_type => return_type
1312
+ )
1313
+
1314
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1315
+ if @api_client.config.debugging
1316
+ @api_client.config.logger.debug "API called: DefaultApi#etfs_holdings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1317
+ end
1318
+ return data, status_code, headers
1319
+ end
1320
+
1321
+ # ETFs Industry Exposure
1322
+ # Get ETF industry exposure data.
1323
+ # @param symbol [String] ETF symbol.
1324
+ # @param [Hash] opts the optional parameters
1325
+ # @return [ETFsIndustryExposure]
1326
+ def etfs_industry_exposure(symbol, opts = {})
1327
+ data, _status_code, _headers = etfs_industry_exposure_with_http_info(symbol, opts)
1328
+ data
1329
+ end
1330
+
1331
+ # ETFs Industry Exposure
1332
+ # Get ETF industry exposure data.
1333
+ # @param symbol [String] ETF symbol.
1334
+ # @param [Hash] opts the optional parameters
1335
+ # @return [Array<(ETFsIndustryExposure, Integer, Hash)>] ETFsIndustryExposure data, response status code and response headers
1336
+ def etfs_industry_exposure_with_http_info(symbol, opts = {})
1337
+ if @api_client.config.debugging
1338
+ @api_client.config.logger.debug 'Calling API: DefaultApi.etfs_industry_exposure ...'
1339
+ end
1340
+ # verify the required parameter 'symbol' is set
1341
+ if @api_client.config.client_side_validation && symbol.nil?
1342
+ fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.etfs_industry_exposure"
1343
+ end
1344
+ # resource path
1345
+ local_var_path = '/etf/sector'
1346
+
1347
+ # query parameters
1348
+ query_params = opts[:query_params] || {}
1349
+ query_params[:'symbol'] = symbol
1350
+
1351
+ # header parameters
1352
+ header_params = opts[:header_params] || {}
1353
+ # HTTP header 'Accept' (if needed)
1354
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1355
+
1356
+ # form parameters
1357
+ form_params = opts[:form_params] || {}
1358
+
1359
+ # http body (model)
1360
+ post_body = opts[:body]
1361
+
1362
+ # return_type
1363
+ return_type = opts[:return_type] || 'ETFsIndustryExposure'
1364
+
1365
+ # auth_names
1366
+ auth_names = opts[:auth_names] || ['api_key']
1367
+
1368
+ new_options = opts.merge(
1369
+ :header_params => header_params,
1370
+ :query_params => query_params,
1371
+ :form_params => form_params,
1372
+ :body => post_body,
1373
+ :auth_names => auth_names,
1374
+ :return_type => return_type
1375
+ )
1376
+
1377
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1378
+ if @api_client.config.debugging
1379
+ @api_client.config.logger.debug "API called: DefaultApi#etfs_industry_exposure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1380
+ end
1381
+ return data, status_code, headers
1382
+ end
1383
+
1384
+ # ETFs Profile
1385
+ # Get ETF profile information. Currently support all US ETFs.
1386
+ # @param symbol [String] ETF symbol.
1387
+ # @param [Hash] opts the optional parameters
1388
+ # @return [ETFsProfile]
1389
+ def etfs_profile(symbol, opts = {})
1390
+ data, _status_code, _headers = etfs_profile_with_http_info(symbol, opts)
1391
+ data
1392
+ end
1393
+
1394
+ # ETFs Profile
1395
+ # Get ETF profile information. Currently support all US ETFs.
1396
+ # @param symbol [String] ETF symbol.
1397
+ # @param [Hash] opts the optional parameters
1398
+ # @return [Array<(ETFsProfile, Integer, Hash)>] ETFsProfile data, response status code and response headers
1399
+ def etfs_profile_with_http_info(symbol, opts = {})
1400
+ if @api_client.config.debugging
1401
+ @api_client.config.logger.debug 'Calling API: DefaultApi.etfs_profile ...'
1402
+ end
1403
+ # verify the required parameter 'symbol' is set
1404
+ if @api_client.config.client_side_validation && symbol.nil?
1405
+ fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.etfs_profile"
1406
+ end
1407
+ # resource path
1408
+ local_var_path = '/etf/profile'
1409
+
1410
+ # query parameters
1411
+ query_params = opts[:query_params] || {}
1412
+ query_params[:'symbol'] = symbol
1413
+
1414
+ # header parameters
1415
+ header_params = opts[:header_params] || {}
1416
+ # HTTP header 'Accept' (if needed)
1417
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1418
+
1419
+ # form parameters
1420
+ form_params = opts[:form_params] || {}
1421
+
1422
+ # http body (model)
1423
+ post_body = opts[:body]
1424
+
1425
+ # return_type
1426
+ return_type = opts[:return_type] || 'ETFsProfile'
1427
+
1428
+ # auth_names
1429
+ auth_names = opts[:auth_names] || ['api_key']
1430
+
1431
+ new_options = opts.merge(
1432
+ :header_params => header_params,
1433
+ :query_params => query_params,
1434
+ :form_params => form_params,
1435
+ :body => post_body,
1436
+ :auth_names => auth_names,
1437
+ :return_type => return_type
1438
+ )
1439
+
1440
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1441
+ if @api_client.config.debugging
1442
+ @api_client.config.logger.debug "API called: DefaultApi#etfs_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1443
+ end
1444
+ return data, status_code, headers
1445
+ end
1446
+
1195
1447
  # Filings
1196
1448
  # List company's filing. Limit to 250 documents at a time. This data is available for bulk download on <a href=\"https://www.kaggle.com/finnhub/sec-filings\" target=\"_blank\">Kaggle SEC Filings database</a>.
1197
1449
  # @param [Hash] opts the optional parameters
@@ -1805,6 +2057,132 @@ module FinnhubRuby
1805
2057
  return data, status_code, headers
1806
2058
  end
1807
2059
 
2060
+ # Indices Constituents
2061
+ # Get a list of index's constituents. Currently support <code>^GSPC (S&P 500)</code>, <code>^NDX (Nasdaq 100)</code>, <code>^DJI (Dow Jones)</code>
2062
+ # @param symbol [String] symbol
2063
+ # @param [Hash] opts the optional parameters
2064
+ # @return [IndicesConstituents]
2065
+ def indices_constituents(symbol, opts = {})
2066
+ data, _status_code, _headers = indices_constituents_with_http_info(symbol, opts)
2067
+ data
2068
+ end
2069
+
2070
+ # Indices Constituents
2071
+ # 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;
2072
+ # @param symbol [String] symbol
2073
+ # @param [Hash] opts the optional parameters
2074
+ # @return [Array<(IndicesConstituents, Integer, Hash)>] IndicesConstituents data, response status code and response headers
2075
+ def indices_constituents_with_http_info(symbol, opts = {})
2076
+ if @api_client.config.debugging
2077
+ @api_client.config.logger.debug 'Calling API: DefaultApi.indices_constituents ...'
2078
+ end
2079
+ # verify the required parameter 'symbol' is set
2080
+ if @api_client.config.client_side_validation && symbol.nil?
2081
+ fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.indices_constituents"
2082
+ end
2083
+ # resource path
2084
+ local_var_path = '/index/constituents'
2085
+
2086
+ # query parameters
2087
+ query_params = opts[:query_params] || {}
2088
+ query_params[:'symbol'] = symbol
2089
+
2090
+ # header parameters
2091
+ header_params = opts[:header_params] || {}
2092
+ # HTTP header 'Accept' (if needed)
2093
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2094
+
2095
+ # form parameters
2096
+ form_params = opts[:form_params] || {}
2097
+
2098
+ # http body (model)
2099
+ post_body = opts[:body]
2100
+
2101
+ # return_type
2102
+ return_type = opts[:return_type] || 'IndicesConstituents'
2103
+
2104
+ # auth_names
2105
+ auth_names = opts[:auth_names] || ['api_key']
2106
+
2107
+ new_options = opts.merge(
2108
+ :header_params => header_params,
2109
+ :query_params => query_params,
2110
+ :form_params => form_params,
2111
+ :body => post_body,
2112
+ :auth_names => auth_names,
2113
+ :return_type => return_type
2114
+ )
2115
+
2116
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2117
+ if @api_client.config.debugging
2118
+ @api_client.config.logger.debug "API called: DefaultApi#indices_constituents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2119
+ end
2120
+ return data, status_code, headers
2121
+ end
2122
+
2123
+ # Indices Historical Constituents
2124
+ # Get full history of index's constituents including symbols and dates of joining and leaving the Index. Currently support <code>^GSPC (S&P 500)</code>, <code>^NDX (Nasdaq 100)</code>, <code>^DJI (Dow Jones)</code>
2125
+ # @param symbol [String] symbol
2126
+ # @param [Hash] opts the optional parameters
2127
+ # @return [IndicesHistoricalConstituents]
2128
+ def indices_historical_constituents(symbol, opts = {})
2129
+ data, _status_code, _headers = indices_historical_constituents_with_http_info(symbol, opts)
2130
+ data
2131
+ end
2132
+
2133
+ # Indices Historical Constituents
2134
+ # 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;
2135
+ # @param symbol [String] symbol
2136
+ # @param [Hash] opts the optional parameters
2137
+ # @return [Array<(IndicesHistoricalConstituents, Integer, Hash)>] IndicesHistoricalConstituents data, response status code and response headers
2138
+ def indices_historical_constituents_with_http_info(symbol, opts = {})
2139
+ if @api_client.config.debugging
2140
+ @api_client.config.logger.debug 'Calling API: DefaultApi.indices_historical_constituents ...'
2141
+ end
2142
+ # verify the required parameter 'symbol' is set
2143
+ if @api_client.config.client_side_validation && symbol.nil?
2144
+ fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.indices_historical_constituents"
2145
+ end
2146
+ # resource path
2147
+ local_var_path = '/index/historical-constituents'
2148
+
2149
+ # query parameters
2150
+ query_params = opts[:query_params] || {}
2151
+ query_params[:'symbol'] = symbol
2152
+
2153
+ # header parameters
2154
+ header_params = opts[:header_params] || {}
2155
+ # HTTP header 'Accept' (if needed)
2156
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2157
+
2158
+ # form parameters
2159
+ form_params = opts[:form_params] || {}
2160
+
2161
+ # http body (model)
2162
+ post_body = opts[:body]
2163
+
2164
+ # return_type
2165
+ return_type = opts[:return_type] || 'IndicesHistoricalConstituents'
2166
+
2167
+ # auth_names
2168
+ auth_names = opts[:auth_names] || ['api_key']
2169
+
2170
+ new_options = opts.merge(
2171
+ :header_params => header_params,
2172
+ :query_params => query_params,
2173
+ :form_params => form_params,
2174
+ :body => post_body,
2175
+ :auth_names => auth_names,
2176
+ :return_type => return_type
2177
+ )
2178
+
2179
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2180
+ if @api_client.config.debugging
2181
+ @api_client.config.logger.debug "API called: DefaultApi#indices_historical_constituents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2182
+ end
2183
+ return data, status_code, headers
2184
+ end
2185
+
1808
2186
  # Investors Ownership
1809
2187
  # Get a full list of shareholders/investors of a company in descending order of the number of shares held.
1810
2188
  # @param symbol [String] Symbol of the company: AAPL.
@@ -2332,6 +2710,71 @@ module FinnhubRuby
2332
2710
  return data, status_code, headers
2333
2711
  end
2334
2712
 
2713
+ # Similarity Index
2714
+ # <p>Calculate the textual difference between a company'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's 10-K with 2018'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's stock price in the upcoming 4 quarters.</p>
2715
+ # @param [Hash] opts the optional parameters
2716
+ # @option opts [String] :symbol Symbol. Required if cik is empty
2717
+ # @option opts [String] :cik CIK. Required if symbol is empty
2718
+ # @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;
2719
+ # @return [SimilarityIndex]
2720
+ def similarity_index(opts = {})
2721
+ data, _status_code, _headers = similarity_index_with_http_info(opts)
2722
+ data
2723
+ end
2724
+
2725
+ # Similarity Index
2726
+ # &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;
2727
+ # @param [Hash] opts the optional parameters
2728
+ # @option opts [String] :symbol Symbol. Required if cik is empty
2729
+ # @option opts [String] :cik CIK. Required if symbol is empty
2730
+ # @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;
2731
+ # @return [Array<(SimilarityIndex, Integer, Hash)>] SimilarityIndex data, response status code and response headers
2732
+ def similarity_index_with_http_info(opts = {})
2733
+ if @api_client.config.debugging
2734
+ @api_client.config.logger.debug 'Calling API: DefaultApi.similarity_index ...'
2735
+ end
2736
+ # resource path
2737
+ local_var_path = '/stock/similarity-index'
2738
+
2739
+ # query parameters
2740
+ query_params = opts[:query_params] || {}
2741
+ query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
2742
+ query_params[:'cik'] = opts[:'cik'] if !opts[:'cik'].nil?
2743
+ query_params[:'freq'] = opts[:'freq'] if !opts[:'freq'].nil?
2744
+
2745
+ # header parameters
2746
+ header_params = opts[:header_params] || {}
2747
+ # HTTP header 'Accept' (if needed)
2748
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2749
+
2750
+ # form parameters
2751
+ form_params = opts[:form_params] || {}
2752
+
2753
+ # http body (model)
2754
+ post_body = opts[:body]
2755
+
2756
+ # return_type
2757
+ return_type = opts[:return_type] || 'SimilarityIndex'
2758
+
2759
+ # auth_names
2760
+ auth_names = opts[:auth_names] || ['api_key']
2761
+
2762
+ new_options = opts.merge(
2763
+ :header_params => header_params,
2764
+ :query_params => query_params,
2765
+ :form_params => form_params,
2766
+ :body => post_body,
2767
+ :auth_names => auth_names,
2768
+ :return_type => return_type
2769
+ )
2770
+
2771
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2772
+ if @api_client.config.debugging
2773
+ @api_client.config.logger.debug "API called: DefaultApi#similarity_index\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2774
+ end
2775
+ return data, status_code, headers
2776
+ end
2777
+
2335
2778
  # Last Bid-Ask
2336
2779
  # Get last bid/ask data for US stocks.
2337
2780
  # @param symbol [String] Symbol.
@@ -2637,7 +3080,7 @@ module FinnhubRuby
2637
3080
  end
2638
3081
 
2639
3082
  # Stock Symbol
2640
- # List supported stocks.
3083
+ # List supported stocks. A list of supported CFD Indices can be found <a href=\"https://docs.google.com/spreadsheets/d/1BAbIXBgl405fj0oHeEyRFEu8mW4QD1PhvtaBATLoR14/edit?usp=sharing\" target=\"_blank\">here</a>.
2641
3084
  # @param exchange [String] 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;.
2642
3085
  # @param [Hash] opts the optional parameters
2643
3086
  # @return [Array<Stock>]
@@ -2647,7 +3090,7 @@ module FinnhubRuby
2647
3090
  end
2648
3091
 
2649
3092
  # Stock Symbol
2650
- # List supported stocks.
3093
+ # 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;.
2651
3094
  # @param exchange [String] 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;.
2652
3095
  # @param [Hash] opts the optional parameters
2653
3096
  # @return [Array<(Array<Stock>, Integer, Hash)>] Array<Stock> data, response status code and response headers