finnhub_ruby 1.1.9 → 1.1.10
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.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/docs/CryptoProfile.md +38 -0
- data/docs/DefaultApi.md +88 -9
- data/finnhub_ruby-1.1.9.gem +0 -0
- data/lib/finnhub_ruby/api/default_api.rb +74 -4
- data/lib/finnhub_ruby/models/crypto_profile.rb +319 -0
- data/lib/finnhub_ruby/version.rb +1 -1
- data/lib/finnhub_ruby.rb +1 -0
- data/spec/models/crypto_profile_spec.rb +94 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbdf62aa52f5b7d31e2134fd935b04906e61fd118678ee2d3021c58bc669424a
|
4
|
+
data.tar.gz: 8ec2fa32472ecff1afb17a345c6c78182b3cfdec7ea6779c03f1488789ad6f94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a983fadf46c2bdeeba2b924090291cc80e31b8744aaf010d98ddf9e4e24fe48d3dd862f82962b0fbbc10150da45f3d3879291099ce0bd405f8b9682b80836f0
|
7
|
+
data.tar.gz: efc37d1b2179e095a91b04961a08abff5e3fc5e4e6b63921f405016c20f7d728177615ea925ecb88736b39d5bf713ae0382964b250c49f13078ba561c26f5e7c
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# finnhub-ruby
|
2
2
|
- API documentation: https://finnhub.io/docs/api
|
3
3
|
- API version: 1.0.0
|
4
|
-
- Package version: 1.1.
|
4
|
+
- Package version: 1.1.10
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
https://rubygems.org/gems/finnhub_ruby
|
@@ -13,7 +13,7 @@ gem install finnhub_ruby
|
|
13
13
|
or in your Gemfile
|
14
14
|
|
15
15
|
```ruby
|
16
|
-
gem 'finnhub_ruby', '~> 1.1.
|
16
|
+
gem 'finnhub_ruby', '~> 1.1.10'
|
17
17
|
```
|
18
18
|
|
19
19
|
## Getting Started
|
@@ -243,6 +243,9 @@ puts(finnhub_client.company_esg_score('AAPL'))
|
|
243
243
|
# Company Earnings Quality
|
244
244
|
puts(finnhub_client.company_earnings_quality_score('AAPL', 'quarterly'))
|
245
245
|
|
246
|
+
# Crypto Profile
|
247
|
+
puts(finnhub_client.crypto_profile('BTC'))
|
248
|
+
|
246
249
|
```
|
247
250
|
|
248
251
|
## License
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# FinnhubRuby::CryptoProfile
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **long_name** | **String** | Long name. | [optional] |
|
8
|
+
| **name** | **String** | Name. | [optional] |
|
9
|
+
| **description** | **String** | Description. | [optional] |
|
10
|
+
| **website** | **String** | Project's website. | [optional] |
|
11
|
+
| **market_cap** | **Float** | Market capitalization. | [optional] |
|
12
|
+
| **total_supply** | **Float** | Total supply. | [optional] |
|
13
|
+
| **max_supply** | **Float** | Max supply. | [optional] |
|
14
|
+
| **circulating_supply** | **Float** | Circulating supply. | [optional] |
|
15
|
+
| **logo** | **String** | Logo image. | [optional] |
|
16
|
+
| **launch_date** | **String** | Launch date. | [optional] |
|
17
|
+
| **proof_type** | **String** | Proof type. | [optional] |
|
18
|
+
|
19
|
+
## Example
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
require 'finnhub_ruby'
|
23
|
+
|
24
|
+
instance = FinnhubRuby::CryptoProfile.new(
|
25
|
+
long_name: null,
|
26
|
+
name: null,
|
27
|
+
description: null,
|
28
|
+
website: null,
|
29
|
+
market_cap: null,
|
30
|
+
total_supply: null,
|
31
|
+
max_supply: null,
|
32
|
+
circulating_supply: null,
|
33
|
+
logo: null,
|
34
|
+
launch_date: null,
|
35
|
+
proof_type: null
|
36
|
+
)
|
37
|
+
```
|
38
|
+
|
data/docs/DefaultApi.md
CHANGED
@@ -20,6 +20,7 @@ All URIs are relative to *https://finnhub.io/api/v1*
|
|
20
20
|
| [**covid19**](DefaultApi.md#covid19) | **GET** /covid19/us | COVID-19 |
|
21
21
|
| [**crypto_candles**](DefaultApi.md#crypto_candles) | **GET** /crypto/candle | Crypto Candles |
|
22
22
|
| [**crypto_exchanges**](DefaultApi.md#crypto_exchanges) | **GET** /crypto/exchange | Crypto Exchanges |
|
23
|
+
| [**crypto_profile**](DefaultApi.md#crypto_profile) | **GET** /crypto/profile | Crypto Profile |
|
23
24
|
| [**crypto_symbols**](DefaultApi.md#crypto_symbols) | **GET** /crypto/symbol | Crypto Symbol |
|
24
25
|
| [**earnings_calendar**](DefaultApi.md#earnings_calendar) | **GET** /calendar/earnings | Earnings Calendar |
|
25
26
|
| [**economic_calendar**](DefaultApi.md#economic_calendar) | **GET** /calendar/economic | Economic Calendar |
|
@@ -321,7 +322,7 @@ end
|
|
321
322
|
|
322
323
|
api_instance = FinnhubRuby::DefaultApi.new
|
323
324
|
symbol = 'symbol_example' # String | Symbol.
|
324
|
-
freq = 'freq_example' # String | Frequency. Currently
|
325
|
+
freq = 'freq_example' # String | Frequency. Currently support <code>annual</code> and <code>quarterly</code>
|
325
326
|
|
326
327
|
begin
|
327
328
|
# Company Earnings Quality Score
|
@@ -355,7 +356,7 @@ end
|
|
355
356
|
| Name | Type | Description | Notes |
|
356
357
|
| ---- | ---- | ----------- | ----- |
|
357
358
|
| **symbol** | **String** | Symbol. | |
|
358
|
-
| **freq** | **String** | Frequency. Currently
|
359
|
+
| **freq** | **String** | Frequency. Currently support <code>annual</code> and <code>quarterly</code> | |
|
359
360
|
|
360
361
|
### Return type
|
361
362
|
|
@@ -1244,6 +1245,77 @@ This endpoint does not need any parameter.
|
|
1244
1245
|
- **Accept**: application/json
|
1245
1246
|
|
1246
1247
|
|
1248
|
+
## crypto_profile
|
1249
|
+
|
1250
|
+
> <CryptoProfile> crypto_profile(symbol)
|
1251
|
+
|
1252
|
+
Crypto Profile
|
1253
|
+
|
1254
|
+
Get crypto's profile.
|
1255
|
+
|
1256
|
+
### Examples
|
1257
|
+
|
1258
|
+
```ruby
|
1259
|
+
require 'time'
|
1260
|
+
require 'finnhub_ruby'
|
1261
|
+
# setup authorization
|
1262
|
+
FinnhubRuby.configure do |config|
|
1263
|
+
# Configure API key authorization: api_key
|
1264
|
+
config.api_key['api_key'] = 'YOUR API KEY'
|
1265
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1266
|
+
# config.api_key_prefix['api_key'] = 'Bearer'
|
1267
|
+
end
|
1268
|
+
|
1269
|
+
api_instance = FinnhubRuby::DefaultApi.new
|
1270
|
+
symbol = 'symbol_example' # String | Crypto symbol such as BTC or ETH.
|
1271
|
+
|
1272
|
+
begin
|
1273
|
+
# Crypto Profile
|
1274
|
+
result = api_instance.crypto_profile(symbol)
|
1275
|
+
p result
|
1276
|
+
rescue FinnhubRuby::ApiError => e
|
1277
|
+
puts "Error when calling DefaultApi->crypto_profile: #{e}"
|
1278
|
+
end
|
1279
|
+
```
|
1280
|
+
|
1281
|
+
#### Using the crypto_profile_with_http_info variant
|
1282
|
+
|
1283
|
+
This returns an Array which contains the response data, status code and headers.
|
1284
|
+
|
1285
|
+
> <Array(<CryptoProfile>, Integer, Hash)> crypto_profile_with_http_info(symbol)
|
1286
|
+
|
1287
|
+
```ruby
|
1288
|
+
begin
|
1289
|
+
# Crypto Profile
|
1290
|
+
data, status_code, headers = api_instance.crypto_profile_with_http_info(symbol)
|
1291
|
+
p status_code # => 2xx
|
1292
|
+
p headers # => { ... }
|
1293
|
+
p data # => <CryptoProfile>
|
1294
|
+
rescue FinnhubRuby::ApiError => e
|
1295
|
+
puts "Error when calling DefaultApi->crypto_profile_with_http_info: #{e}"
|
1296
|
+
end
|
1297
|
+
```
|
1298
|
+
|
1299
|
+
### Parameters
|
1300
|
+
|
1301
|
+
| Name | Type | Description | Notes |
|
1302
|
+
| ---- | ---- | ----------- | ----- |
|
1303
|
+
| **symbol** | **String** | Crypto symbol such as BTC or ETH. | |
|
1304
|
+
|
1305
|
+
### Return type
|
1306
|
+
|
1307
|
+
[**CryptoProfile**](CryptoProfile.md)
|
1308
|
+
|
1309
|
+
### Authorization
|
1310
|
+
|
1311
|
+
[api_key](../README.md#api_key)
|
1312
|
+
|
1313
|
+
### HTTP request headers
|
1314
|
+
|
1315
|
+
- **Content-Type**: Not defined
|
1316
|
+
- **Accept**: application/json
|
1317
|
+
|
1318
|
+
|
1247
1319
|
## crypto_symbols
|
1248
1320
|
|
1249
1321
|
> <Array<CryptoSymbol>> crypto_symbols(exchange)
|
@@ -1396,7 +1468,7 @@ end
|
|
1396
1468
|
|
1397
1469
|
## economic_calendar
|
1398
1470
|
|
1399
|
-
> <EconomicCalendar> economic_calendar
|
1471
|
+
> <EconomicCalendar> economic_calendar(opts)
|
1400
1472
|
|
1401
1473
|
Economic Calendar
|
1402
1474
|
|
@@ -1416,10 +1488,14 @@ FinnhubRuby.configure do |config|
|
|
1416
1488
|
end
|
1417
1489
|
|
1418
1490
|
api_instance = FinnhubRuby::DefaultApi.new
|
1491
|
+
opts = {
|
1492
|
+
from: Date.parse('2013-10-20'), # Date | From date <code>YYYY-MM-DD</code>.
|
1493
|
+
to: Date.parse('2013-10-20') # Date | To date <code>YYYY-MM-DD</code>.
|
1494
|
+
}
|
1419
1495
|
|
1420
1496
|
begin
|
1421
1497
|
# Economic Calendar
|
1422
|
-
result = api_instance.economic_calendar
|
1498
|
+
result = api_instance.economic_calendar(opts)
|
1423
1499
|
p result
|
1424
1500
|
rescue FinnhubRuby::ApiError => e
|
1425
1501
|
puts "Error when calling DefaultApi->economic_calendar: #{e}"
|
@@ -1430,12 +1506,12 @@ end
|
|
1430
1506
|
|
1431
1507
|
This returns an Array which contains the response data, status code and headers.
|
1432
1508
|
|
1433
|
-
> <Array(<EconomicCalendar>, Integer, Hash)> economic_calendar_with_http_info
|
1509
|
+
> <Array(<EconomicCalendar>, Integer, Hash)> economic_calendar_with_http_info(opts)
|
1434
1510
|
|
1435
1511
|
```ruby
|
1436
1512
|
begin
|
1437
1513
|
# Economic Calendar
|
1438
|
-
data, status_code, headers = api_instance.economic_calendar_with_http_info
|
1514
|
+
data, status_code, headers = api_instance.economic_calendar_with_http_info(opts)
|
1439
1515
|
p status_code # => 2xx
|
1440
1516
|
p headers # => { ... }
|
1441
1517
|
p data # => <EconomicCalendar>
|
@@ -1446,7 +1522,10 @@ end
|
|
1446
1522
|
|
1447
1523
|
### Parameters
|
1448
1524
|
|
1449
|
-
|
1525
|
+
| Name | Type | Description | Notes |
|
1526
|
+
| ---- | ---- | ----------- | ----- |
|
1527
|
+
| **from** | **Date** | From date <code>YYYY-MM-DD</code>. | [optional] |
|
1528
|
+
| **to** | **Date** | To date <code>YYYY-MM-DD</code>. | [optional] |
|
1450
1529
|
|
1451
1530
|
### Return type
|
1452
1531
|
|
@@ -2799,7 +2878,7 @@ FinnhubRuby.configure do |config|
|
|
2799
2878
|
end
|
2800
2879
|
|
2801
2880
|
api_instance = FinnhubRuby::DefaultApi.new
|
2802
|
-
symbol = 'symbol_example' # String | Symbol of the company: AAPL.
|
2881
|
+
symbol = 'symbol_example' # String | Symbol of the company: AAPL. Leave this param blank to get the latest transactions.
|
2803
2882
|
opts = {
|
2804
2883
|
from: Date.parse('2013-10-20'), # Date | From date: 2020-03-15.
|
2805
2884
|
to: Date.parse('2013-10-20') # Date | To date: 2020-03-16.
|
@@ -2836,7 +2915,7 @@ end
|
|
2836
2915
|
|
2837
2916
|
| Name | Type | Description | Notes |
|
2838
2917
|
| ---- | ---- | ----------- | ----- |
|
2839
|
-
| **symbol** | **String** | Symbol of the company: AAPL. | |
|
2918
|
+
| **symbol** | **String** | Symbol of the company: AAPL. Leave this param blank to get the latest transactions. | |
|
2840
2919
|
| **from** | **Date** | From date: 2020-03-15. | [optional] |
|
2841
2920
|
| **to** | **Date** | To date: 2020-03-16. | [optional] |
|
2842
2921
|
|
Binary file
|
@@ -231,7 +231,7 @@ module FinnhubRuby
|
|
231
231
|
# Company Earnings Quality Score
|
232
232
|
# <p>This endpoint provides Earnings Quality Score for global companies.</p><p> Earnings quality refers to the extent to which current earnings predict future earnings. \"High-quality\" earnings are expected to persist, while \"low-quality\" earnings do not. A higher score means a higher earnings quality</p><p>Finnhub uses a proprietary model which takes into consideration 4 criteria:</p> <ul style=\"list-style-type: unset; margin-left: 30px;\"><li>Profitability</li><li>Growth</li><li>Cash Generation & Capital Allocation</li><li>Leverage</li></ul><br/><p>We then compare the metrics of each company in each category against its peers in the same industry to gauge how quality its earnings is.</p>
|
233
233
|
# @param symbol [String] Symbol.
|
234
|
-
# @param freq [String] Frequency. Currently
|
234
|
+
# @param freq [String] Frequency. Currently support <code>annual</code> and <code>quarterly</code>
|
235
235
|
# @param [Hash] opts the optional parameters
|
236
236
|
# @return [CompanyEarningsQualityScore]
|
237
237
|
def company_earnings_quality_score(symbol, freq, opts = {})
|
@@ -242,7 +242,7 @@ module FinnhubRuby
|
|
242
242
|
# Company Earnings Quality Score
|
243
243
|
# <p>This endpoint provides Earnings Quality Score for global companies.</p><p> Earnings quality refers to the extent to which current earnings predict future earnings. \"High-quality\" earnings are expected to persist, while \"low-quality\" earnings do not. A higher score means a higher earnings quality</p><p>Finnhub uses a proprietary model which takes into consideration 4 criteria:</p> <ul style=\"list-style-type: unset; margin-left: 30px;\"><li>Profitability</li><li>Growth</li><li>Cash Generation & Capital Allocation</li><li>Leverage</li></ul><br/><p>We then compare the metrics of each company in each category against its peers in the same industry to gauge how quality its earnings is.</p>
|
244
244
|
# @param symbol [String] Symbol.
|
245
|
-
# @param freq [String] Frequency. Currently
|
245
|
+
# @param freq [String] Frequency. Currently support <code>annual</code> and <code>quarterly</code>
|
246
246
|
# @param [Hash] opts the optional parameters
|
247
247
|
# @return [Array<(CompanyEarningsQualityScore, Integer, Hash)>] CompanyEarningsQualityScore data, response status code and response headers
|
248
248
|
def company_earnings_quality_score_with_http_info(symbol, freq, opts = {})
|
@@ -1091,6 +1091,70 @@ module FinnhubRuby
|
|
1091
1091
|
return data, status_code, headers
|
1092
1092
|
end
|
1093
1093
|
|
1094
|
+
# Crypto Profile
|
1095
|
+
# Get crypto's profile.
|
1096
|
+
# @param symbol [String] Crypto symbol such as BTC or ETH.
|
1097
|
+
# @param [Hash] opts the optional parameters
|
1098
|
+
# @return [CryptoProfile]
|
1099
|
+
def crypto_profile(symbol, opts = {})
|
1100
|
+
data, _status_code, _headers = crypto_profile_with_http_info(symbol, opts)
|
1101
|
+
data
|
1102
|
+
end
|
1103
|
+
|
1104
|
+
# Crypto Profile
|
1105
|
+
# Get crypto's profile.
|
1106
|
+
# @param symbol [String] Crypto symbol such as BTC or ETH.
|
1107
|
+
# @param [Hash] opts the optional parameters
|
1108
|
+
# @return [Array<(CryptoProfile, Integer, Hash)>] CryptoProfile data, response status code and response headers
|
1109
|
+
def crypto_profile_with_http_info(symbol, opts = {})
|
1110
|
+
if @api_client.config.debugging
|
1111
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.crypto_profile ...'
|
1112
|
+
end
|
1113
|
+
# verify the required parameter 'symbol' is set
|
1114
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
1115
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.crypto_profile"
|
1116
|
+
end
|
1117
|
+
# resource path
|
1118
|
+
local_var_path = '/crypto/profile'
|
1119
|
+
|
1120
|
+
# query parameters
|
1121
|
+
query_params = opts[:query_params] || {}
|
1122
|
+
query_params[:'symbol'] = symbol
|
1123
|
+
|
1124
|
+
# header parameters
|
1125
|
+
header_params = opts[:header_params] || {}
|
1126
|
+
# HTTP header 'Accept' (if needed)
|
1127
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1128
|
+
|
1129
|
+
# form parameters
|
1130
|
+
form_params = opts[:form_params] || {}
|
1131
|
+
|
1132
|
+
# http body (model)
|
1133
|
+
post_body = opts[:debug_body]
|
1134
|
+
|
1135
|
+
# return_type
|
1136
|
+
return_type = opts[:debug_return_type] || 'CryptoProfile'
|
1137
|
+
|
1138
|
+
# auth_names
|
1139
|
+
auth_names = opts[:debug_auth_names] || ['api_key']
|
1140
|
+
|
1141
|
+
new_options = opts.merge(
|
1142
|
+
:operation => :"DefaultApi.crypto_profile",
|
1143
|
+
:header_params => header_params,
|
1144
|
+
:query_params => query_params,
|
1145
|
+
:form_params => form_params,
|
1146
|
+
:body => post_body,
|
1147
|
+
:auth_names => auth_names,
|
1148
|
+
:return_type => return_type
|
1149
|
+
)
|
1150
|
+
|
1151
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1152
|
+
if @api_client.config.debugging
|
1153
|
+
@api_client.config.logger.debug "API called: DefaultApi#crypto_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1154
|
+
end
|
1155
|
+
return data, status_code, headers
|
1156
|
+
end
|
1157
|
+
|
1094
1158
|
# Crypto Symbol
|
1095
1159
|
# List supported crypto symbols by exchange
|
1096
1160
|
# @param exchange [String] Exchange you want to get the list of symbols from.
|
@@ -1227,6 +1291,8 @@ module FinnhubRuby
|
|
1227
1291
|
# Economic Calendar
|
1228
1292
|
# <p>Get recent and upcoming economic releases.</p><p>Historical events and surprises are available for Enterprise clients.</p>
|
1229
1293
|
# @param [Hash] opts the optional parameters
|
1294
|
+
# @option opts [Date] :from From date <code>YYYY-MM-DD</code>.
|
1295
|
+
# @option opts [Date] :to To date <code>YYYY-MM-DD</code>.
|
1230
1296
|
# @return [EconomicCalendar]
|
1231
1297
|
def economic_calendar(opts = {})
|
1232
1298
|
data, _status_code, _headers = economic_calendar_with_http_info(opts)
|
@@ -1236,6 +1302,8 @@ module FinnhubRuby
|
|
1236
1302
|
# Economic Calendar
|
1237
1303
|
# <p>Get recent and upcoming economic releases.</p><p>Historical events and surprises are available for Enterprise clients.</p>
|
1238
1304
|
# @param [Hash] opts the optional parameters
|
1305
|
+
# @option opts [Date] :from From date <code>YYYY-MM-DD</code>.
|
1306
|
+
# @option opts [Date] :to To date <code>YYYY-MM-DD</code>.
|
1239
1307
|
# @return [Array<(EconomicCalendar, Integer, Hash)>] EconomicCalendar data, response status code and response headers
|
1240
1308
|
def economic_calendar_with_http_info(opts = {})
|
1241
1309
|
if @api_client.config.debugging
|
@@ -1246,6 +1314,8 @@ module FinnhubRuby
|
|
1246
1314
|
|
1247
1315
|
# query parameters
|
1248
1316
|
query_params = opts[:query_params] || {}
|
1317
|
+
query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
|
1318
|
+
query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
|
1249
1319
|
|
1250
1320
|
# header parameters
|
1251
1321
|
header_params = opts[:header_params] || {}
|
@@ -2465,7 +2535,7 @@ module FinnhubRuby
|
|
2465
2535
|
|
2466
2536
|
# Insider Transactions
|
2467
2537
|
# Company insider transactions data sourced from <code>Form 3,4,5</code>. This endpoint only covers US companies at the moment. Limit to 100 transactions per API call.
|
2468
|
-
# @param symbol [String] Symbol of the company: AAPL.
|
2538
|
+
# @param symbol [String] Symbol of the company: AAPL. Leave this param blank to get the latest transactions.
|
2469
2539
|
# @param [Hash] opts the optional parameters
|
2470
2540
|
# @option opts [Date] :from From date: 2020-03-15.
|
2471
2541
|
# @option opts [Date] :to To date: 2020-03-16.
|
@@ -2477,7 +2547,7 @@ module FinnhubRuby
|
|
2477
2547
|
|
2478
2548
|
# Insider Transactions
|
2479
2549
|
# Company insider transactions data sourced from <code>Form 3,4,5</code>. This endpoint only covers US companies at the moment. Limit to 100 transactions per API call.
|
2480
|
-
# @param symbol [String] Symbol of the company: AAPL.
|
2550
|
+
# @param symbol [String] Symbol of the company: AAPL. Leave this param blank to get the latest transactions.
|
2481
2551
|
# @param [Hash] opts the optional parameters
|
2482
2552
|
# @option opts [Date] :from From date: 2020-03-15.
|
2483
2553
|
# @option opts [Date] :to To date: 2020-03-16.
|
@@ -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
|
data/lib/finnhub_ruby/version.rb
CHANGED
data/lib/finnhub_ruby.rb
CHANGED
@@ -32,6 +32,7 @@ require 'finnhub_ruby/models/company_profile2'
|
|
32
32
|
require 'finnhub_ruby/models/country_metadata'
|
33
33
|
require 'finnhub_ruby/models/covid_info'
|
34
34
|
require 'finnhub_ruby/models/crypto_candles'
|
35
|
+
require 'finnhub_ruby/models/crypto_profile'
|
35
36
|
require 'finnhub_ruby/models/crypto_symbol'
|
36
37
|
require 'finnhub_ruby/models/development'
|
37
38
|
require 'finnhub_ruby/models/dividends'
|
@@ -0,0 +1,94 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for FinnhubRuby::CryptoProfile
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe FinnhubRuby::CryptoProfile do
|
21
|
+
let(:instance) { FinnhubRuby::CryptoProfile.new }
|
22
|
+
|
23
|
+
describe 'test an instance of CryptoProfile' do
|
24
|
+
it 'should create an instance of CryptoProfile' do
|
25
|
+
expect(instance).to be_instance_of(FinnhubRuby::CryptoProfile)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
describe 'test attribute "long_name"' do
|
29
|
+
it 'should work' do
|
30
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe 'test attribute "name"' do
|
35
|
+
it 'should work' do
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe 'test attribute "description"' do
|
41
|
+
it 'should work' do
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe 'test attribute "website"' do
|
47
|
+
it 'should work' do
|
48
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe 'test attribute "market_cap"' do
|
53
|
+
it 'should work' do
|
54
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe 'test attribute "total_supply"' do
|
59
|
+
it 'should work' do
|
60
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe 'test attribute "max_supply"' do
|
65
|
+
it 'should work' do
|
66
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
describe 'test attribute "circulating_supply"' do
|
71
|
+
it 'should work' do
|
72
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
describe 'test attribute "logo"' do
|
77
|
+
it 'should work' do
|
78
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
describe 'test attribute "launch_date"' do
|
83
|
+
it 'should work' do
|
84
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
describe 'test attribute "proof_type"' do
|
89
|
+
it 'should work' do
|
90
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finnhub_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenAPI-Generator
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- docs/CountryMetadata.md
|
77
77
|
- docs/CovidInfo.md
|
78
78
|
- docs/CryptoCandles.md
|
79
|
+
- docs/CryptoProfile.md
|
79
80
|
- docs/CryptoSymbol.md
|
80
81
|
- docs/DefaultApi.md
|
81
82
|
- docs/Development.md
|
@@ -172,6 +173,7 @@ files:
|
|
172
173
|
- docs/UpgradeDowngrade.md
|
173
174
|
- finnhub_ruby-1.1.7.gem
|
174
175
|
- finnhub_ruby-1.1.8.gem
|
176
|
+
- finnhub_ruby-1.1.9.gem
|
175
177
|
- finnhub_ruby.gemspec
|
176
178
|
- git_push.sh
|
177
179
|
- lib/finnhub_ruby.rb
|
@@ -194,6 +196,7 @@ files:
|
|
194
196
|
- lib/finnhub_ruby/models/country_metadata.rb
|
195
197
|
- lib/finnhub_ruby/models/covid_info.rb
|
196
198
|
- lib/finnhub_ruby/models/crypto_candles.rb
|
199
|
+
- lib/finnhub_ruby/models/crypto_profile.rb
|
197
200
|
- lib/finnhub_ruby/models/crypto_symbol.rb
|
198
201
|
- lib/finnhub_ruby/models/development.rb
|
199
202
|
- lib/finnhub_ruby/models/dividends.rb
|
@@ -322,6 +325,7 @@ files:
|
|
322
325
|
- spec/models/country_metadata_spec.rb
|
323
326
|
- spec/models/covid_info_spec.rb
|
324
327
|
- spec/models/crypto_candles_spec.rb
|
328
|
+
- spec/models/crypto_profile_spec.rb
|
325
329
|
- spec/models/crypto_symbol_spec.rb
|
326
330
|
- spec/models/development_spec.rb
|
327
331
|
- spec/models/dividends2_info_spec.rb
|
@@ -478,6 +482,7 @@ test_files:
|
|
478
482
|
- spec/models/revenue_breakdown_spec.rb
|
479
483
|
- spec/models/company_spec.rb
|
480
484
|
- spec/models/investment_theme_portfolio_spec.rb
|
485
|
+
- spec/models/crypto_profile_spec.rb
|
481
486
|
- spec/models/etf_country_exposure_data_spec.rb
|
482
487
|
- spec/models/company_earnings_quality_score_data_spec.rb
|
483
488
|
- spec/models/earnings_estimates_info_spec.rb
|