finnhub_ruby 1.1.16 → 1.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/docs/Company.md +1 -1
- data/docs/DefaultApi.md +74 -2
- data/docs/KeyCustomersSuppliers.md +4 -0
- data/docs/MutualFundProfileData.md +5 -1
- data/docs/SectorMetric.md +20 -0
- data/docs/SectorMetricData.md +20 -0
- data/finnhub_ruby-1.1.16.gem +0 -0
- data/lib/finnhub_ruby/api/default_api.rb +68 -4
- data/lib/finnhub_ruby/models/company.rb +1 -1
- data/lib/finnhub_ruby/models/key_customers_suppliers.rb +21 -1
- data/lib/finnhub_ruby/models/mutual_fund_profile_data.rb +24 -4
- data/lib/finnhub_ruby/models/sector_metric.rb +231 -0
- data/lib/finnhub_ruby/models/sector_metric_data.rb +229 -0
- data/lib/finnhub_ruby/version.rb +1 -1
- data/lib/finnhub_ruby.rb +2 -0
- data/spec/models/sector_metric_data_spec.rb +40 -0
- data/spec/models/sector_metric_spec.rb +40 -0
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 840da9e6e0893fda73e5b4ee3943a54a5a5e54d9163ff43b4a7a8925e4db121a
|
4
|
+
data.tar.gz: 2cc86c1ecc481e58b0df75ada3bc472c54baf83dd20e1cffb1f185feda1ca955
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7cc0a9a720915e41db73ec91cfec803454ddd3962ab6bde38dc60a84a1dd4fc18b4749e903ec34f1ba0f2f6e6d4353728a141defd3137649075fe558ccd32e1
|
7
|
+
data.tar.gz: 62ab3be671f5dca7b274a361fca6695dd3c3e7fed067f716303fc561e54f81ea17bf6a1c5f0084feaece85ac5fbb2fdc13a3d62d5c355f07faf9ccaede3f470c
|
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.17
|
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.17'
|
17
17
|
```
|
18
18
|
|
19
19
|
## Getting Started
|
data/docs/Company.md
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
| **name** | **String** | Executive name | [optional] |
|
8
8
|
| **age** | **Integer** | Age | [optional] |
|
9
9
|
| **title** | **String** | Title | [optional] |
|
10
|
-
| **since** | **String** | Year appointed | [optional] |
|
10
|
+
| **since** | **String** | Year first appointed as executive/director of the company | [optional] |
|
11
11
|
| **sex** | **String** | Sex | [optional] |
|
12
12
|
| **compensation** | **Integer** | Total compensation | [optional] |
|
13
13
|
| **currency** | **String** | Compensation currency | [optional] |
|
data/docs/DefaultApi.md
CHANGED
@@ -64,6 +64,7 @@ All URIs are relative to *https://finnhub.io/api/v1*
|
|
64
64
|
| [**quote**](DefaultApi.md#quote) | **GET** /quote | Quote |
|
65
65
|
| [**recommendation_trends**](DefaultApi.md#recommendation_trends) | **GET** /stock/recommendation | Recommendation Trends |
|
66
66
|
| [**revenue_breakdown**](DefaultApi.md#revenue_breakdown) | **GET** /stock/revenue-breakdown | Revenue Breakdown |
|
67
|
+
| [**sector_metric**](DefaultApi.md#sector_metric) | **GET** /sector/metrics | Sector Metrics |
|
67
68
|
| [**similarity_index**](DefaultApi.md#similarity_index) | **GET** /stock/similarity-index | Similarity Index |
|
68
69
|
| [**social_sentiment**](DefaultApi.md#social_sentiment) | **GET** /stock/social-sentiment | Social Sentiment |
|
69
70
|
| [**stock_basic_dividends**](DefaultApi.md#stock_basic_dividends) | **GET** /stock/dividend2 | Dividends 2 (Basic) |
|
@@ -3329,7 +3330,7 @@ end
|
|
3329
3330
|
|
3330
3331
|
International Filings
|
3331
3332
|
|
3332
|
-
List filings for international companies. Limit to 250 documents at a time. These are the documents we use to source our fundamental data.
|
3333
|
+
List filings for international companies. Limit to 250 documents at a time. These are the documents we use to source our fundamental data. Only support SEDAR and UK Companies House for normal usage. Enterprise clients who need access to the full filings for global markets should contact us for the access.
|
3333
3334
|
|
3334
3335
|
### Examples
|
3335
3336
|
|
@@ -4136,7 +4137,7 @@ end
|
|
4136
4137
|
|
4137
4138
|
Major Press Releases
|
4138
4139
|
|
4139
|
-
Get latest major press releases of a company. This data can be used to highlight the most significant events comprised of mostly press releases sourced from the exchanges, BusinessWire, AccessWire, GlobeNewswire, Newsfile, and PRNewswire.
|
4140
|
+
<p>Get latest major press releases of a company. This data can be used to highlight the most significant events comprised of mostly press releases sourced from the exchanges, BusinessWire, AccessWire, GlobeNewswire, Newsfile, and PRNewswire.</p><p>Full-text press releases data is available for Enterprise clients. <a href=\"mailto:support@finnhub.io\">Contact Us</a> to learn more.</p>
|
4140
4141
|
|
4141
4142
|
### Examples
|
4142
4143
|
|
@@ -4495,6 +4496,77 @@ end
|
|
4495
4496
|
- **Accept**: application/json
|
4496
4497
|
|
4497
4498
|
|
4499
|
+
## sector_metric
|
4500
|
+
|
4501
|
+
> <SectorMetric> sector_metric(region)
|
4502
|
+
|
4503
|
+
Sector Metrics
|
4504
|
+
|
4505
|
+
Get ratios for different sectors and regions/indices.
|
4506
|
+
|
4507
|
+
### Examples
|
4508
|
+
|
4509
|
+
```ruby
|
4510
|
+
require 'time'
|
4511
|
+
require 'finnhub_ruby'
|
4512
|
+
# setup authorization
|
4513
|
+
FinnhubRuby.configure do |config|
|
4514
|
+
# Configure API key authorization: api_key
|
4515
|
+
config.api_key['api_key'] = 'YOUR API KEY'
|
4516
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
4517
|
+
# config.api_key_prefix['api_key'] = 'Bearer'
|
4518
|
+
end
|
4519
|
+
|
4520
|
+
api_instance = FinnhubRuby::DefaultApi.new
|
4521
|
+
region = 'region_example' # String | Region. A list of supported values for this field can be found <a href=\"https://docs.google.com/spreadsheets/d/1afedyv7yWJ-z7pMjaAZK-f6ENY3mI3EBCk95QffpoHw/edit?usp=sharing\" target=\"_blank\">here</a>.
|
4522
|
+
|
4523
|
+
begin
|
4524
|
+
# Sector Metrics
|
4525
|
+
result = api_instance.sector_metric(region)
|
4526
|
+
p result
|
4527
|
+
rescue FinnhubRuby::ApiError => e
|
4528
|
+
puts "Error when calling DefaultApi->sector_metric: #{e}"
|
4529
|
+
end
|
4530
|
+
```
|
4531
|
+
|
4532
|
+
#### Using the sector_metric_with_http_info variant
|
4533
|
+
|
4534
|
+
This returns an Array which contains the response data, status code and headers.
|
4535
|
+
|
4536
|
+
> <Array(<SectorMetric>, Integer, Hash)> sector_metric_with_http_info(region)
|
4537
|
+
|
4538
|
+
```ruby
|
4539
|
+
begin
|
4540
|
+
# Sector Metrics
|
4541
|
+
data, status_code, headers = api_instance.sector_metric_with_http_info(region)
|
4542
|
+
p status_code # => 2xx
|
4543
|
+
p headers # => { ... }
|
4544
|
+
p data # => <SectorMetric>
|
4545
|
+
rescue FinnhubRuby::ApiError => e
|
4546
|
+
puts "Error when calling DefaultApi->sector_metric_with_http_info: #{e}"
|
4547
|
+
end
|
4548
|
+
```
|
4549
|
+
|
4550
|
+
### Parameters
|
4551
|
+
|
4552
|
+
| Name | Type | Description | Notes |
|
4553
|
+
| ---- | ---- | ----------- | ----- |
|
4554
|
+
| **region** | **String** | Region. A list of supported values for this field can be found <a href=\"https://docs.google.com/spreadsheets/d/1afedyv7yWJ-z7pMjaAZK-f6ENY3mI3EBCk95QffpoHw/edit?usp=sharing\" target=\"_blank\">here</a>. | |
|
4555
|
+
|
4556
|
+
### Return type
|
4557
|
+
|
4558
|
+
[**SectorMetric**](SectorMetric.md)
|
4559
|
+
|
4560
|
+
### Authorization
|
4561
|
+
|
4562
|
+
[api_key](../README.md#api_key)
|
4563
|
+
|
4564
|
+
### HTTP request headers
|
4565
|
+
|
4566
|
+
- **Content-Type**: Not defined
|
4567
|
+
- **Accept**: application/json
|
4568
|
+
|
4569
|
+
|
4498
4570
|
## similarity_index
|
4499
4571
|
|
4500
4572
|
> <SimilarityIndex> similarity_index(opts)
|
@@ -6,6 +6,8 @@
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **symbol** | **String** | Symbol | [optional] |
|
8
8
|
| **name** | **String** | Name | [optional] |
|
9
|
+
| **country** | **String** | Country | [optional] |
|
10
|
+
| **industry** | **String** | Industry | [optional] |
|
9
11
|
| **customer** | **Boolean** | Whether the company is a customer. | [optional] |
|
10
12
|
| **supplier** | **Boolean** | Whether the company is a supplier | [optional] |
|
11
13
|
| **one_month_correlation** | **Float** | 1-month price correlation | [optional] |
|
@@ -23,6 +25,8 @@ require 'finnhub_ruby'
|
|
23
25
|
instance = FinnhubRuby::KeyCustomersSuppliers.new(
|
24
26
|
symbol: null,
|
25
27
|
name: null,
|
28
|
+
country: null,
|
29
|
+
industry: null,
|
26
30
|
customer: null,
|
27
31
|
supplier: null,
|
28
32
|
one_month_correlation: null,
|
@@ -29,6 +29,8 @@
|
|
29
29
|
| **series_name** | **String** | Fund's series name. | [optional] |
|
30
30
|
| **class_id** | **String** | Class ID. | [optional] |
|
31
31
|
| **class_name** | **String** | Class name. | [optional] |
|
32
|
+
| **sfdr_classification** | **String** | SFDR classification for EU funds. Under the new classifications, a fund's strategy will labeled under either Article 6, 8 or 9. Article 6 covers funds which do not integrate any kind of sustainability into the investment process. Article 8, also known as ‘environmental and socially promoting’, applies “… where a financial product promotes, among other characteristics, environmental or social characteristics, or a combination of those characteristics, provided that the companies in which the investments are made follow good governance practices.”. Article 9, also known as ‘products targeting sustainable investments’, covers products targeting bespoke sustainable investments and applies “… where a financial product has sustainable investment as its objective and an index has been designated as a reference benchmark.” | [optional] |
|
33
|
+
| **currency** | **String** | Fund's currency | [optional] |
|
32
34
|
|
33
35
|
## Example
|
34
36
|
|
@@ -60,7 +62,9 @@ instance = FinnhubRuby::MutualFundProfileData.new(
|
|
60
62
|
series_id: null,
|
61
63
|
series_name: null,
|
62
64
|
class_id: null,
|
63
|
-
class_name: null
|
65
|
+
class_name: null,
|
66
|
+
sfdr_classification: null,
|
67
|
+
currency: null
|
64
68
|
)
|
65
69
|
```
|
66
70
|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# FinnhubRuby::SectorMetric
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **region** | **String** | Region. | [optional] |
|
8
|
+
| **data** | [**Array<SectorMetricData>**](SectorMetricData.md) | Metrics for each sector. | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'finnhub_ruby'
|
14
|
+
|
15
|
+
instance = FinnhubRuby::SectorMetric.new(
|
16
|
+
region: null,
|
17
|
+
data: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# FinnhubRuby::SectorMetricData
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **sector** | **String** | Sector | [optional] |
|
8
|
+
| **metrics** | **Object** | Metrics data in key-value format. <code>a</code> and <code>m</code> fields are for average and median respectively. | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'finnhub_ruby'
|
14
|
+
|
15
|
+
instance = FinnhubRuby::SectorMetricData.new(
|
16
|
+
sector: null,
|
17
|
+
metrics: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
Binary file
|
@@ -2966,7 +2966,7 @@ module FinnhubRuby
|
|
2966
2966
|
end
|
2967
2967
|
|
2968
2968
|
# International Filings
|
2969
|
-
# List filings for international companies. Limit to 250 documents at a time. These are the documents we use to source our fundamental data.
|
2969
|
+
# List filings for international companies. Limit to 250 documents at a time. These are the documents we use to source our fundamental data. Only support SEDAR and UK Companies House for normal usage. Enterprise clients who need access to the full filings for global markets should contact us for the access.
|
2970
2970
|
# @param [Hash] opts the optional parameters
|
2971
2971
|
# @option opts [String] :symbol Symbol. Leave empty to list latest filings.
|
2972
2972
|
# @option opts [String] :country Filter by country using country's 2-letter code.
|
@@ -2977,7 +2977,7 @@ module FinnhubRuby
|
|
2977
2977
|
end
|
2978
2978
|
|
2979
2979
|
# International Filings
|
2980
|
-
# List filings for international companies. Limit to 250 documents at a time. These are the documents we use to source our fundamental data.
|
2980
|
+
# List filings for international companies. Limit to 250 documents at a time. These are the documents we use to source our fundamental data. Only support SEDAR and UK Companies House for normal usage. Enterprise clients who need access to the full filings for global markets should contact us for the access.
|
2981
2981
|
# @param [Hash] opts the optional parameters
|
2982
2982
|
# @option opts [String] :symbol Symbol. Leave empty to list latest filings.
|
2983
2983
|
# @option opts [String] :country Filter by country using country's 2-letter code.
|
@@ -3690,7 +3690,7 @@ module FinnhubRuby
|
|
3690
3690
|
end
|
3691
3691
|
|
3692
3692
|
# Major Press Releases
|
3693
|
-
# Get latest major press releases of a company. This data can be used to highlight the most significant events comprised of mostly press releases sourced from the exchanges, BusinessWire, AccessWire, GlobeNewswire, Newsfile, and PRNewswire.
|
3693
|
+
# <p>Get latest major press releases of a company. This data can be used to highlight the most significant events comprised of mostly press releases sourced from the exchanges, BusinessWire, AccessWire, GlobeNewswire, Newsfile, and PRNewswire.</p><p>Full-text press releases data is available for Enterprise clients. <a href=\"mailto:support@finnhub.io\">Contact Us</a> to learn more.</p>
|
3694
3694
|
# @param symbol [String] Company symbol.
|
3695
3695
|
# @param [Hash] opts the optional parameters
|
3696
3696
|
# @option opts [Date] :from From time: 2020-01-01.
|
@@ -3702,7 +3702,7 @@ module FinnhubRuby
|
|
3702
3702
|
end
|
3703
3703
|
|
3704
3704
|
# Major Press Releases
|
3705
|
-
# Get latest major press releases of a company. This data can be used to highlight the most significant events comprised of mostly press releases sourced from the exchanges, BusinessWire, AccessWire, GlobeNewswire, Newsfile, and PRNewswire.
|
3705
|
+
# <p>Get latest major press releases of a company. This data can be used to highlight the most significant events comprised of mostly press releases sourced from the exchanges, BusinessWire, AccessWire, GlobeNewswire, Newsfile, and PRNewswire.</p><p>Full-text press releases data is available for Enterprise clients. <a href=\"mailto:support@finnhub.io\">Contact Us</a> to learn more.</p>
|
3706
3706
|
# @param symbol [String] Company symbol.
|
3707
3707
|
# @param [Hash] opts the optional parameters
|
3708
3708
|
# @option opts [Date] :from From time: 2020-01-01.
|
@@ -4014,6 +4014,70 @@ module FinnhubRuby
|
|
4014
4014
|
return data, status_code, headers
|
4015
4015
|
end
|
4016
4016
|
|
4017
|
+
# Sector Metrics
|
4018
|
+
# Get ratios for different sectors and regions/indices.
|
4019
|
+
# @param region [String] Region. A list of supported values for this field can be found <a href=\"https://docs.google.com/spreadsheets/d/1afedyv7yWJ-z7pMjaAZK-f6ENY3mI3EBCk95QffpoHw/edit?usp=sharing\" target=\"_blank\">here</a>.
|
4020
|
+
# @param [Hash] opts the optional parameters
|
4021
|
+
# @return [SectorMetric]
|
4022
|
+
def sector_metric(region, opts = {})
|
4023
|
+
data, _status_code, _headers = sector_metric_with_http_info(region, opts)
|
4024
|
+
data
|
4025
|
+
end
|
4026
|
+
|
4027
|
+
# Sector Metrics
|
4028
|
+
# Get ratios for different sectors and regions/indices.
|
4029
|
+
# @param region [String] Region. A list of supported values for this field can be found <a href=\"https://docs.google.com/spreadsheets/d/1afedyv7yWJ-z7pMjaAZK-f6ENY3mI3EBCk95QffpoHw/edit?usp=sharing\" target=\"_blank\">here</a>.
|
4030
|
+
# @param [Hash] opts the optional parameters
|
4031
|
+
# @return [Array<(SectorMetric, Integer, Hash)>] SectorMetric data, response status code and response headers
|
4032
|
+
def sector_metric_with_http_info(region, opts = {})
|
4033
|
+
if @api_client.config.debugging
|
4034
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.sector_metric ...'
|
4035
|
+
end
|
4036
|
+
# verify the required parameter 'region' is set
|
4037
|
+
if @api_client.config.client_side_validation && region.nil?
|
4038
|
+
fail ArgumentError, "Missing the required parameter 'region' when calling DefaultApi.sector_metric"
|
4039
|
+
end
|
4040
|
+
# resource path
|
4041
|
+
local_var_path = '/sector/metrics'
|
4042
|
+
|
4043
|
+
# query parameters
|
4044
|
+
query_params = opts[:query_params] || {}
|
4045
|
+
query_params[:'region'] = region
|
4046
|
+
|
4047
|
+
# header parameters
|
4048
|
+
header_params = opts[:header_params] || {}
|
4049
|
+
# HTTP header 'Accept' (if needed)
|
4050
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
4051
|
+
|
4052
|
+
# form parameters
|
4053
|
+
form_params = opts[:form_params] || {}
|
4054
|
+
|
4055
|
+
# http body (model)
|
4056
|
+
post_body = opts[:debug_body]
|
4057
|
+
|
4058
|
+
# return_type
|
4059
|
+
return_type = opts[:debug_return_type] || 'SectorMetric'
|
4060
|
+
|
4061
|
+
# auth_names
|
4062
|
+
auth_names = opts[:debug_auth_names] || ['api_key']
|
4063
|
+
|
4064
|
+
new_options = opts.merge(
|
4065
|
+
:operation => :"DefaultApi.sector_metric",
|
4066
|
+
:header_params => header_params,
|
4067
|
+
:query_params => query_params,
|
4068
|
+
:form_params => form_params,
|
4069
|
+
:body => post_body,
|
4070
|
+
:auth_names => auth_names,
|
4071
|
+
:return_type => return_type
|
4072
|
+
)
|
4073
|
+
|
4074
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
4075
|
+
if @api_client.config.debugging
|
4076
|
+
@api_client.config.logger.debug "API called: DefaultApi#sector_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
4077
|
+
end
|
4078
|
+
return data, status_code, headers
|
4079
|
+
end
|
4080
|
+
|
4017
4081
|
# Similarity Index
|
4018
4082
|
# <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>
|
4019
4083
|
# @param [Hash] opts the optional parameters
|
@@ -21,6 +21,12 @@ module FinnhubRuby
|
|
21
21
|
# Name
|
22
22
|
attr_accessor :name
|
23
23
|
|
24
|
+
# Country
|
25
|
+
attr_accessor :country
|
26
|
+
|
27
|
+
# Industry
|
28
|
+
attr_accessor :industry
|
29
|
+
|
24
30
|
# Whether the company is a customer.
|
25
31
|
attr_accessor :customer
|
26
32
|
|
@@ -50,6 +56,8 @@ module FinnhubRuby
|
|
50
56
|
{
|
51
57
|
:'symbol' => :'symbol',
|
52
58
|
:'name' => :'name',
|
59
|
+
:'country' => :'country',
|
60
|
+
:'industry' => :'industry',
|
53
61
|
:'customer' => :'customer',
|
54
62
|
:'supplier' => :'supplier',
|
55
63
|
:'one_month_correlation' => :'oneMonthCorrelation',
|
@@ -71,6 +79,8 @@ module FinnhubRuby
|
|
71
79
|
{
|
72
80
|
:'symbol' => :'String',
|
73
81
|
:'name' => :'String',
|
82
|
+
:'country' => :'String',
|
83
|
+
:'industry' => :'String',
|
74
84
|
:'customer' => :'Boolean',
|
75
85
|
:'supplier' => :'Boolean',
|
76
86
|
:'one_month_correlation' => :'Float',
|
@@ -111,6 +121,14 @@ module FinnhubRuby
|
|
111
121
|
self.name = attributes[:'name']
|
112
122
|
end
|
113
123
|
|
124
|
+
if attributes.key?(:'country')
|
125
|
+
self.country = attributes[:'country']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'industry')
|
129
|
+
self.industry = attributes[:'industry']
|
130
|
+
end
|
131
|
+
|
114
132
|
if attributes.key?(:'customer')
|
115
133
|
self.customer = attributes[:'customer']
|
116
134
|
end
|
@@ -164,6 +182,8 @@ module FinnhubRuby
|
|
164
182
|
self.class == o.class &&
|
165
183
|
symbol == o.symbol &&
|
166
184
|
name == o.name &&
|
185
|
+
country == o.country &&
|
186
|
+
industry == o.industry &&
|
167
187
|
customer == o.customer &&
|
168
188
|
supplier == o.supplier &&
|
169
189
|
one_month_correlation == o.one_month_correlation &&
|
@@ -183,7 +203,7 @@ module FinnhubRuby
|
|
183
203
|
# Calculates hash code according to all attributes.
|
184
204
|
# @return [Integer] Hash code
|
185
205
|
def hash
|
186
|
-
[symbol, name, customer, supplier, one_month_correlation, one_year_correlation, six_month_correlation, three_month_correlation, two_week_correlation, two_year_correlation].hash
|
206
|
+
[symbol, name, country, industry, customer, supplier, one_month_correlation, one_year_correlation, six_month_correlation, three_month_correlation, two_week_correlation, two_year_correlation].hash
|
187
207
|
end
|
188
208
|
|
189
209
|
# Builds the object from hash
|
@@ -90,6 +90,12 @@ module FinnhubRuby
|
|
90
90
|
# Class name.
|
91
91
|
attr_accessor :class_name
|
92
92
|
|
93
|
+
# SFDR classification for EU funds. Under the new classifications, a fund's strategy will labeled under either Article 6, 8 or 9. Article 6 covers funds which do not integrate any kind of sustainability into the investment process. Article 8, also known as ‘environmental and socially promoting’, applies “… where a financial product promotes, among other characteristics, environmental or social characteristics, or a combination of those characteristics, provided that the companies in which the investments are made follow good governance practices.”. Article 9, also known as ‘products targeting sustainable investments’, covers products targeting bespoke sustainable investments and applies “… where a financial product has sustainable investment as its objective and an index has been designated as a reference benchmark.”
|
94
|
+
attr_accessor :sfdr_classification
|
95
|
+
|
96
|
+
# Fund's currency
|
97
|
+
attr_accessor :currency
|
98
|
+
|
93
99
|
# Attribute mapping from ruby-style variable name to JSON key.
|
94
100
|
def self.attribute_map
|
95
101
|
{
|
@@ -117,7 +123,9 @@ module FinnhubRuby
|
|
117
123
|
:'series_id' => :'seriesId',
|
118
124
|
:'series_name' => :'seriesName',
|
119
125
|
:'class_id' => :'classId',
|
120
|
-
:'class_name' => :'className'
|
126
|
+
:'class_name' => :'className',
|
127
|
+
:'sfdr_classification' => :'sfdrClassification',
|
128
|
+
:'currency' => :'currency'
|
121
129
|
}
|
122
130
|
end
|
123
131
|
|
@@ -153,7 +161,9 @@ module FinnhubRuby
|
|
153
161
|
:'series_id' => :'String',
|
154
162
|
:'series_name' => :'String',
|
155
163
|
:'class_id' => :'String',
|
156
|
-
:'class_name' => :'String'
|
164
|
+
:'class_name' => :'String',
|
165
|
+
:'sfdr_classification' => :'String',
|
166
|
+
:'currency' => :'String'
|
157
167
|
}
|
158
168
|
end
|
159
169
|
|
@@ -277,6 +287,14 @@ module FinnhubRuby
|
|
277
287
|
if attributes.key?(:'class_name')
|
278
288
|
self.class_name = attributes[:'class_name']
|
279
289
|
end
|
290
|
+
|
291
|
+
if attributes.key?(:'sfdr_classification')
|
292
|
+
self.sfdr_classification = attributes[:'sfdr_classification']
|
293
|
+
end
|
294
|
+
|
295
|
+
if attributes.key?(:'currency')
|
296
|
+
self.currency = attributes[:'currency']
|
297
|
+
end
|
280
298
|
end
|
281
299
|
|
282
300
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -321,7 +339,9 @@ module FinnhubRuby
|
|
321
339
|
series_id == o.series_id &&
|
322
340
|
series_name == o.series_name &&
|
323
341
|
class_id == o.class_id &&
|
324
|
-
class_name == o.class_name
|
342
|
+
class_name == o.class_name &&
|
343
|
+
sfdr_classification == o.sfdr_classification &&
|
344
|
+
currency == o.currency
|
325
345
|
end
|
326
346
|
|
327
347
|
# @see the `==` method
|
@@ -333,7 +353,7 @@ module FinnhubRuby
|
|
333
353
|
# Calculates hash code according to all attributes.
|
334
354
|
# @return [Integer] Hash code
|
335
355
|
def 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
|
356
|
+
[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, sfdr_classification, currency].hash
|
337
357
|
end
|
338
358
|
|
339
359
|
# Builds the object from hash
|
@@ -0,0 +1,231 @@
|
|
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 SectorMetric
|
18
|
+
# Region.
|
19
|
+
attr_accessor :region
|
20
|
+
|
21
|
+
# Metrics for each sector.
|
22
|
+
attr_accessor :data
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'region' => :'region',
|
28
|
+
:'data' => :'data'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns all the JSON keys this model knows about
|
33
|
+
def self.acceptable_attributes
|
34
|
+
attribute_map.values
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.openapi_types
|
39
|
+
{
|
40
|
+
:'region' => :'String',
|
41
|
+
:'data' => :'Array<SectorMetricData>'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of attributes with nullable: true
|
46
|
+
def self.openapi_nullable
|
47
|
+
Set.new([
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
if (!attributes.is_a?(Hash))
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FinnhubRuby::SectorMetric` initialize method"
|
56
|
+
end
|
57
|
+
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FinnhubRuby::SectorMetric`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
|
+
end
|
63
|
+
h[k.to_sym] = v
|
64
|
+
}
|
65
|
+
|
66
|
+
if attributes.key?(:'region')
|
67
|
+
self.region = attributes[:'region']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'data')
|
71
|
+
if (value = attributes[:'data']).is_a?(Array)
|
72
|
+
self.data = value
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
78
|
+
# @return Array for valid properties with the reasons
|
79
|
+
def list_invalid_properties
|
80
|
+
invalid_properties = Array.new
|
81
|
+
invalid_properties
|
82
|
+
end
|
83
|
+
|
84
|
+
# Check to see if the all the properties in the model are valid
|
85
|
+
# @return true if the model is valid
|
86
|
+
def valid?
|
87
|
+
true
|
88
|
+
end
|
89
|
+
|
90
|
+
# Checks equality by comparing each attribute.
|
91
|
+
# @param [Object] Object to be compared
|
92
|
+
def ==(o)
|
93
|
+
return true if self.equal?(o)
|
94
|
+
self.class == o.class &&
|
95
|
+
region == o.region &&
|
96
|
+
data == o.data
|
97
|
+
end
|
98
|
+
|
99
|
+
# @see the `==` method
|
100
|
+
# @param [Object] Object to be compared
|
101
|
+
def eql?(o)
|
102
|
+
self == o
|
103
|
+
end
|
104
|
+
|
105
|
+
# Calculates hash code according to all attributes.
|
106
|
+
# @return [Integer] Hash code
|
107
|
+
def hash
|
108
|
+
[region, data].hash
|
109
|
+
end
|
110
|
+
|
111
|
+
# Builds the object from hash
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
113
|
+
# @return [Object] Returns the model itself
|
114
|
+
def self.build_from_hash(attributes)
|
115
|
+
new.build_from_hash(attributes)
|
116
|
+
end
|
117
|
+
|
118
|
+
# Builds the object from hash
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
120
|
+
# @return [Object] Returns the model itself
|
121
|
+
def build_from_hash(attributes)
|
122
|
+
return nil unless attributes.is_a?(Hash)
|
123
|
+
self.class.openapi_types.each_pair do |key, type|
|
124
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
125
|
+
self.send("#{key}=", nil)
|
126
|
+
elsif type =~ /\AArray<(.*)>/i
|
127
|
+
# check to ensure the input is an array given that the attribute
|
128
|
+
# is documented as an array but the input is not
|
129
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
130
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
131
|
+
end
|
132
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
133
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
self
|
138
|
+
end
|
139
|
+
|
140
|
+
# Deserializes the data based on type
|
141
|
+
# @param string type Data type
|
142
|
+
# @param string value Value to be deserialized
|
143
|
+
# @return [Object] Deserialized data
|
144
|
+
def _deserialize(type, value)
|
145
|
+
case type.to_sym
|
146
|
+
when :Time
|
147
|
+
Time.parse(value)
|
148
|
+
when :Date
|
149
|
+
Date.parse(value)
|
150
|
+
when :String
|
151
|
+
value.to_s
|
152
|
+
when :Integer
|
153
|
+
value.to_i
|
154
|
+
when :Float
|
155
|
+
value.to_f
|
156
|
+
when :Boolean
|
157
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
158
|
+
true
|
159
|
+
else
|
160
|
+
false
|
161
|
+
end
|
162
|
+
when :Object
|
163
|
+
# generic object (usually a Hash), return directly
|
164
|
+
value
|
165
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
166
|
+
inner_type = Regexp.last_match[:inner_type]
|
167
|
+
value.map { |v| _deserialize(inner_type, v) }
|
168
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
169
|
+
k_type = Regexp.last_match[:k_type]
|
170
|
+
v_type = Regexp.last_match[:v_type]
|
171
|
+
{}.tap do |hash|
|
172
|
+
value.each do |k, v|
|
173
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
else # model
|
177
|
+
# models (e.g. Pet) or oneOf
|
178
|
+
klass = FinnhubRuby.const_get(type)
|
179
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the string representation of the object
|
184
|
+
# @return [String] String presentation of the object
|
185
|
+
def to_s
|
186
|
+
to_hash.to_s
|
187
|
+
end
|
188
|
+
|
189
|
+
# to_body is an alias to to_hash (backward compatibility)
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_body
|
192
|
+
to_hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the object in the form of hash
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_hash
|
198
|
+
hash = {}
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
200
|
+
value = self.send(attr)
|
201
|
+
if value.nil?
|
202
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
203
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
204
|
+
end
|
205
|
+
|
206
|
+
hash[param] = _to_hash(value)
|
207
|
+
end
|
208
|
+
hash
|
209
|
+
end
|
210
|
+
|
211
|
+
# Outputs non-array value in the form of hash
|
212
|
+
# For object, use to_hash. Otherwise, just return the value
|
213
|
+
# @param [Object] value Any valid value
|
214
|
+
# @return [Hash] Returns the value in the form of hash
|
215
|
+
def _to_hash(value)
|
216
|
+
if value.is_a?(Array)
|
217
|
+
value.compact.map { |v| _to_hash(v) }
|
218
|
+
elsif value.is_a?(Hash)
|
219
|
+
{}.tap do |hash|
|
220
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
221
|
+
end
|
222
|
+
elsif value.respond_to? :to_hash
|
223
|
+
value.to_hash
|
224
|
+
else
|
225
|
+
value
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
230
|
+
|
231
|
+
end
|
@@ -0,0 +1,229 @@
|
|
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 SectorMetricData
|
18
|
+
# Sector
|
19
|
+
attr_accessor :sector
|
20
|
+
|
21
|
+
# Metrics data in key-value format. <code>a</code> and <code>m</code> fields are for average and median respectively.
|
22
|
+
attr_accessor :metrics
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'sector' => :'sector',
|
28
|
+
:'metrics' => :'metrics'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns all the JSON keys this model knows about
|
33
|
+
def self.acceptable_attributes
|
34
|
+
attribute_map.values
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.openapi_types
|
39
|
+
{
|
40
|
+
:'sector' => :'String',
|
41
|
+
:'metrics' => :'Object'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of attributes with nullable: true
|
46
|
+
def self.openapi_nullable
|
47
|
+
Set.new([
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
if (!attributes.is_a?(Hash))
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FinnhubRuby::SectorMetricData` initialize method"
|
56
|
+
end
|
57
|
+
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FinnhubRuby::SectorMetricData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
|
+
end
|
63
|
+
h[k.to_sym] = v
|
64
|
+
}
|
65
|
+
|
66
|
+
if attributes.key?(:'sector')
|
67
|
+
self.sector = attributes[:'sector']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'metrics')
|
71
|
+
self.metrics = attributes[:'metrics']
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
76
|
+
# @return Array for valid properties with the reasons
|
77
|
+
def list_invalid_properties
|
78
|
+
invalid_properties = Array.new
|
79
|
+
invalid_properties
|
80
|
+
end
|
81
|
+
|
82
|
+
# Check to see if the all the properties in the model are valid
|
83
|
+
# @return true if the model is valid
|
84
|
+
def valid?
|
85
|
+
true
|
86
|
+
end
|
87
|
+
|
88
|
+
# Checks equality by comparing each attribute.
|
89
|
+
# @param [Object] Object to be compared
|
90
|
+
def ==(o)
|
91
|
+
return true if self.equal?(o)
|
92
|
+
self.class == o.class &&
|
93
|
+
sector == o.sector &&
|
94
|
+
metrics == o.metrics
|
95
|
+
end
|
96
|
+
|
97
|
+
# @see the `==` method
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def eql?(o)
|
100
|
+
self == o
|
101
|
+
end
|
102
|
+
|
103
|
+
# Calculates hash code according to all attributes.
|
104
|
+
# @return [Integer] Hash code
|
105
|
+
def hash
|
106
|
+
[sector, metrics].hash
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def self.build_from_hash(attributes)
|
113
|
+
new.build_from_hash(attributes)
|
114
|
+
end
|
115
|
+
|
116
|
+
# Builds the object from hash
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
+
# @return [Object] Returns the model itself
|
119
|
+
def build_from_hash(attributes)
|
120
|
+
return nil unless attributes.is_a?(Hash)
|
121
|
+
self.class.openapi_types.each_pair do |key, type|
|
122
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
123
|
+
self.send("#{key}=", nil)
|
124
|
+
elsif type =~ /\AArray<(.*)>/i
|
125
|
+
# check to ensure the input is an array given that the attribute
|
126
|
+
# is documented as an array but the input is not
|
127
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
128
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
129
|
+
end
|
130
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
131
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
self
|
136
|
+
end
|
137
|
+
|
138
|
+
# Deserializes the data based on type
|
139
|
+
# @param string type Data type
|
140
|
+
# @param string value Value to be deserialized
|
141
|
+
# @return [Object] Deserialized data
|
142
|
+
def _deserialize(type, value)
|
143
|
+
case type.to_sym
|
144
|
+
when :Time
|
145
|
+
Time.parse(value)
|
146
|
+
when :Date
|
147
|
+
Date.parse(value)
|
148
|
+
when :String
|
149
|
+
value.to_s
|
150
|
+
when :Integer
|
151
|
+
value.to_i
|
152
|
+
when :Float
|
153
|
+
value.to_f
|
154
|
+
when :Boolean
|
155
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
156
|
+
true
|
157
|
+
else
|
158
|
+
false
|
159
|
+
end
|
160
|
+
when :Object
|
161
|
+
# generic object (usually a Hash), return directly
|
162
|
+
value
|
163
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
164
|
+
inner_type = Regexp.last_match[:inner_type]
|
165
|
+
value.map { |v| _deserialize(inner_type, v) }
|
166
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
167
|
+
k_type = Regexp.last_match[:k_type]
|
168
|
+
v_type = Regexp.last_match[:v_type]
|
169
|
+
{}.tap do |hash|
|
170
|
+
value.each do |k, v|
|
171
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
else # model
|
175
|
+
# models (e.g. Pet) or oneOf
|
176
|
+
klass = FinnhubRuby.const_get(type)
|
177
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
# Returns the string representation of the object
|
182
|
+
# @return [String] String presentation of the object
|
183
|
+
def to_s
|
184
|
+
to_hash.to_s
|
185
|
+
end
|
186
|
+
|
187
|
+
# to_body is an alias to to_hash (backward compatibility)
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_body
|
190
|
+
to_hash
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns the object in the form of hash
|
194
|
+
# @return [Hash] Returns the object in the form of hash
|
195
|
+
def to_hash
|
196
|
+
hash = {}
|
197
|
+
self.class.attribute_map.each_pair do |attr, param|
|
198
|
+
value = self.send(attr)
|
199
|
+
if value.nil?
|
200
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
201
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
202
|
+
end
|
203
|
+
|
204
|
+
hash[param] = _to_hash(value)
|
205
|
+
end
|
206
|
+
hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Outputs non-array value in the form of hash
|
210
|
+
# For object, use to_hash. Otherwise, just return the value
|
211
|
+
# @param [Object] value Any valid value
|
212
|
+
# @return [Hash] Returns the value in the form of hash
|
213
|
+
def _to_hash(value)
|
214
|
+
if value.is_a?(Array)
|
215
|
+
value.compact.map { |v| _to_hash(v) }
|
216
|
+
elsif value.is_a?(Hash)
|
217
|
+
{}.tap do |hash|
|
218
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
219
|
+
end
|
220
|
+
elsif value.respond_to? :to_hash
|
221
|
+
value.to_hash
|
222
|
+
else
|
223
|
+
value
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
data/lib/finnhub_ruby/version.rb
CHANGED
data/lib/finnhub_ruby.rb
CHANGED
@@ -114,6 +114,8 @@ require 'finnhub_ruby/models/revenue_breakdown'
|
|
114
114
|
require 'finnhub_ruby/models/revenue_estimates'
|
115
115
|
require 'finnhub_ruby/models/revenue_estimates_info'
|
116
116
|
require 'finnhub_ruby/models/sec_sentiment_analysis'
|
117
|
+
require 'finnhub_ruby/models/sector_metric'
|
118
|
+
require 'finnhub_ruby/models/sector_metric_data'
|
117
119
|
require 'finnhub_ruby/models/sentiment'
|
118
120
|
require 'finnhub_ruby/models/similarity_index'
|
119
121
|
require 'finnhub_ruby/models/similarity_index_info'
|
@@ -0,0 +1,40 @@
|
|
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::SectorMetricData
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe FinnhubRuby::SectorMetricData do
|
21
|
+
let(:instance) { FinnhubRuby::SectorMetricData.new }
|
22
|
+
|
23
|
+
describe 'test an instance of SectorMetricData' do
|
24
|
+
it 'should create an instance of SectorMetricData' do
|
25
|
+
expect(instance).to be_instance_of(FinnhubRuby::SectorMetricData)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
describe 'test attribute "sector"' 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 "metrics"' 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
|
+
end
|
@@ -0,0 +1,40 @@
|
|
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::SectorMetric
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe FinnhubRuby::SectorMetric do
|
21
|
+
let(:instance) { FinnhubRuby::SectorMetric.new }
|
22
|
+
|
23
|
+
describe 'test an instance of SectorMetric' do
|
24
|
+
it 'should create an instance of SectorMetric' do
|
25
|
+
expect(instance).to be_instance_of(FinnhubRuby::SectorMetric)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
describe 'test attribute "region"' 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 "data"' 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
|
+
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.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenAPI-Generator
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -161,6 +161,8 @@ files:
|
|
161
161
|
- docs/RevenueEstimates.md
|
162
162
|
- docs/RevenueEstimatesInfo.md
|
163
163
|
- docs/SECSentimentAnalysis.md
|
164
|
+
- docs/SectorMetric.md
|
165
|
+
- docs/SectorMetricData.md
|
164
166
|
- docs/Sentiment.md
|
165
167
|
- docs/SimilarityIndex.md
|
166
168
|
- docs/SimilarityIndexInfo.md
|
@@ -193,6 +195,7 @@ files:
|
|
193
195
|
- finnhub_ruby-1.1.13.gem
|
194
196
|
- finnhub_ruby-1.1.14.gem
|
195
197
|
- finnhub_ruby-1.1.15.gem
|
198
|
+
- finnhub_ruby-1.1.16.gem
|
196
199
|
- finnhub_ruby-1.1.7.gem
|
197
200
|
- finnhub_ruby-1.1.8.gem
|
198
201
|
- finnhub_ruby-1.1.9.gem
|
@@ -316,6 +319,8 @@ files:
|
|
316
319
|
- lib/finnhub_ruby/models/revenue_estimates.rb
|
317
320
|
- lib/finnhub_ruby/models/revenue_estimates_info.rb
|
318
321
|
- lib/finnhub_ruby/models/sec_sentiment_analysis.rb
|
322
|
+
- lib/finnhub_ruby/models/sector_metric.rb
|
323
|
+
- lib/finnhub_ruby/models/sector_metric_data.rb
|
319
324
|
- lib/finnhub_ruby/models/sentiment.rb
|
320
325
|
- lib/finnhub_ruby/models/similarity_index.rb
|
321
326
|
- lib/finnhub_ruby/models/similarity_index_info.rb
|
@@ -447,6 +452,8 @@ files:
|
|
447
452
|
- spec/models/revenue_estimates_info_spec.rb
|
448
453
|
- spec/models/revenue_estimates_spec.rb
|
449
454
|
- spec/models/sec_sentiment_analysis_spec.rb
|
455
|
+
- spec/models/sector_metric_data_spec.rb
|
456
|
+
- spec/models/sector_metric_spec.rb
|
450
457
|
- spec/models/sentiment_spec.rb
|
451
458
|
- spec/models/similarity_index_info_spec.rb
|
452
459
|
- spec/models/similarity_index_spec.rb
|
@@ -546,6 +553,7 @@ test_files:
|
|
546
553
|
- spec/models/company_earnings_quality_score_data_spec.rb
|
547
554
|
- spec/models/earnings_estimates_info_spec.rb
|
548
555
|
- spec/models/forex_symbol_spec.rb
|
556
|
+
- spec/models/sector_metric_spec.rb
|
549
557
|
- spec/models/key_customers_suppliers_spec.rb
|
550
558
|
- spec/models/symbol_lookup_info_spec.rb
|
551
559
|
- spec/models/lobbying_data_spec.rb
|
@@ -601,6 +609,7 @@ test_files:
|
|
601
609
|
- spec/models/quote_spec.rb
|
602
610
|
- spec/models/filing_sentiment_spec.rb
|
603
611
|
- spec/models/upgrade_downgrade_spec.rb
|
612
|
+
- spec/models/sector_metric_data_spec.rb
|
604
613
|
- spec/models/covid_info_spec.rb
|
605
614
|
- spec/models/technical_analysis_spec.rb
|
606
615
|
- spec/models/mutual_fund_country_exposure_spec.rb
|