finnhub_ruby 1.1.15 → 1.1.16
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 +2 -2
- data/docs/DefaultApi.md +78 -2
- data/docs/UsaSpending.md +56 -0
- data/docs/UsaSpendingResult.md +20 -0
- data/finnhub_ruby-1.1.15.gem +0 -0
- data/lib/finnhub_ruby/api/default_api.rb +82 -4
- data/lib/finnhub_ruby/models/usa_spending.rb +409 -0
- data/lib/finnhub_ruby/models/usa_spending_result.rb +231 -0
- data/lib/finnhub_ruby/version.rb +1 -1
- data/lib/finnhub_ruby.rb +2 -0
- data/spec/models/usa_spending_result_spec.rb +40 -0
- data/spec/models/usa_spending_spec.rb +148 -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: 0e7bac941b8f3c132c056f81150cdf4df5c9a090516deb7d9c8c3f2f0f0d7531
|
4
|
+
data.tar.gz: 7902eb891dfa9aa9a8a3c8ebe301f4b2703ed5175aefde9caeead3fbad2a6ea3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bee858deb0f608f67b7c59e97fed2412d4e7dac705e6b11260c03b09a952ae095442f723f796de3dece6ecbb2a25da8abca7708289c5820fa8689d3bc9d5debf
|
7
|
+
data.tar.gz: ea7a78b43a3c1ef3313367ac53f62d43d1e2b3ebe250fbacb8553a241c8dc2582f85e8a117fb0d9edf1a0699ef62104ebc45ed7c1386f8fd3aeeaf76cd5a55e5
|
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.16
|
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.16'
|
17
17
|
```
|
18
18
|
|
19
19
|
## Getting Started
|
data/docs/DefaultApi.md
CHANGED
@@ -75,6 +75,7 @@ All URIs are relative to *https://finnhub.io/api/v1*
|
|
75
75
|
| [**stock_splits**](DefaultApi.md#stock_splits) | **GET** /stock/split | Splits |
|
76
76
|
| [**stock_symbols**](DefaultApi.md#stock_symbols) | **GET** /stock/symbol | Stock Symbol |
|
77
77
|
| [**stock_tick**](DefaultApi.md#stock_tick) | **GET** /stock/tick | Tick Data |
|
78
|
+
| [**stock_usa_spending**](DefaultApi.md#stock_usa_spending) | **GET** /stock/usa-spending | USA Spending |
|
78
79
|
| [**stock_uspto_patent**](DefaultApi.md#stock_uspto_patent) | **GET** /stock/uspto-patent | USPTO Patents |
|
79
80
|
| [**stock_visa_application**](DefaultApi.md#stock_visa_application) | **GET** /stock/visa-application | H1-B Visa Application |
|
80
81
|
| [**supply_chain_relationships**](DefaultApi.md#supply_chain_relationships) | **GET** /stock/supply-chain | Supply Chain Relationships |
|
@@ -3693,7 +3694,7 @@ end
|
|
3693
3694
|
|
3694
3695
|
Mutual Funds Holdings
|
3695
3696
|
|
3696
|
-
Get full Mutual Funds holdings/constituents.
|
3697
|
+
Get full Mutual Funds holdings/constituents. This endpoint covers both US and global mutual funds. For international funds, you must query the data using ISIN.
|
3697
3698
|
|
3698
3699
|
### Examples
|
3699
3700
|
|
@@ -3770,7 +3771,7 @@ end
|
|
3770
3771
|
|
3771
3772
|
Mutual Funds Profile
|
3772
3773
|
|
3773
|
-
Get mutual funds profile information. This endpoint covers US mutual funds
|
3774
|
+
Get mutual funds profile information. This endpoint covers both US and global mutual funds. For international funds, you must query the data using ISIN.
|
3774
3775
|
|
3775
3776
|
### Examples
|
3776
3777
|
|
@@ -5325,6 +5326,81 @@ end
|
|
5325
5326
|
- **Accept**: application/json
|
5326
5327
|
|
5327
5328
|
|
5329
|
+
## stock_usa_spending
|
5330
|
+
|
5331
|
+
> <UsaSpendingResult> stock_usa_spending(symbol, from, to)
|
5332
|
+
|
5333
|
+
USA Spending
|
5334
|
+
|
5335
|
+
Get a list of government's spending activities from USASpending dataset for public companies. This dataset can help you identify companies that win big government contracts which is extremely important for industries such as Defense, Aerospace, and Education.
|
5336
|
+
|
5337
|
+
### Examples
|
5338
|
+
|
5339
|
+
```ruby
|
5340
|
+
require 'time'
|
5341
|
+
require 'finnhub_ruby'
|
5342
|
+
# setup authorization
|
5343
|
+
FinnhubRuby.configure do |config|
|
5344
|
+
# Configure API key authorization: api_key
|
5345
|
+
config.api_key['api_key'] = 'YOUR API KEY'
|
5346
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
5347
|
+
# config.api_key_prefix['api_key'] = 'Bearer'
|
5348
|
+
end
|
5349
|
+
|
5350
|
+
api_instance = FinnhubRuby::DefaultApi.new
|
5351
|
+
symbol = 'symbol_example' # String | Symbol.
|
5352
|
+
from = Date.parse('2013-10-20') # Date | From date <code>YYYY-MM-DD</code>. Filter for <code>actionDate</code>
|
5353
|
+
to = Date.parse('2013-10-20') # Date | To date <code>YYYY-MM-DD</code>. Filter for <code>actionDate</code>
|
5354
|
+
|
5355
|
+
begin
|
5356
|
+
# USA Spending
|
5357
|
+
result = api_instance.stock_usa_spending(symbol, from, to)
|
5358
|
+
p result
|
5359
|
+
rescue FinnhubRuby::ApiError => e
|
5360
|
+
puts "Error when calling DefaultApi->stock_usa_spending: #{e}"
|
5361
|
+
end
|
5362
|
+
```
|
5363
|
+
|
5364
|
+
#### Using the stock_usa_spending_with_http_info variant
|
5365
|
+
|
5366
|
+
This returns an Array which contains the response data, status code and headers.
|
5367
|
+
|
5368
|
+
> <Array(<UsaSpendingResult>, Integer, Hash)> stock_usa_spending_with_http_info(symbol, from, to)
|
5369
|
+
|
5370
|
+
```ruby
|
5371
|
+
begin
|
5372
|
+
# USA Spending
|
5373
|
+
data, status_code, headers = api_instance.stock_usa_spending_with_http_info(symbol, from, to)
|
5374
|
+
p status_code # => 2xx
|
5375
|
+
p headers # => { ... }
|
5376
|
+
p data # => <UsaSpendingResult>
|
5377
|
+
rescue FinnhubRuby::ApiError => e
|
5378
|
+
puts "Error when calling DefaultApi->stock_usa_spending_with_http_info: #{e}"
|
5379
|
+
end
|
5380
|
+
```
|
5381
|
+
|
5382
|
+
### Parameters
|
5383
|
+
|
5384
|
+
| Name | Type | Description | Notes |
|
5385
|
+
| ---- | ---- | ----------- | ----- |
|
5386
|
+
| **symbol** | **String** | Symbol. | |
|
5387
|
+
| **from** | **Date** | From date <code>YYYY-MM-DD</code>. Filter for <code>actionDate</code> | |
|
5388
|
+
| **to** | **Date** | To date <code>YYYY-MM-DD</code>. Filter for <code>actionDate</code> | |
|
5389
|
+
|
5390
|
+
### Return type
|
5391
|
+
|
5392
|
+
[**UsaSpendingResult**](UsaSpendingResult.md)
|
5393
|
+
|
5394
|
+
### Authorization
|
5395
|
+
|
5396
|
+
[api_key](../README.md#api_key)
|
5397
|
+
|
5398
|
+
### HTTP request headers
|
5399
|
+
|
5400
|
+
- **Content-Type**: Not defined
|
5401
|
+
- **Accept**: application/json
|
5402
|
+
|
5403
|
+
|
5328
5404
|
## stock_uspto_patent
|
5329
5405
|
|
5330
5406
|
> <UsptoPatentResult> stock_uspto_patent(symbol, from, to)
|
data/docs/UsaSpending.md
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# FinnhubRuby::UsaSpending
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **symbol** | **String** | Symbol. | [optional] |
|
8
|
+
| **recipient_name** | **String** | Company's name. | [optional] |
|
9
|
+
| **recipient_parent_name** | **String** | Company's name. | [optional] |
|
10
|
+
| **award_description** | **String** | Description. | [optional] |
|
11
|
+
| **country** | **String** | Recipient's country. | [optional] |
|
12
|
+
| **action_date** | **String** | Period. | [optional] |
|
13
|
+
| **total_value** | **Float** | Income reported by lobbying firms. | [optional] |
|
14
|
+
| **performance_start_date** | **String** | Performance start date. | [optional] |
|
15
|
+
| **performance_end_date** | **String** | Performance end date. | [optional] |
|
16
|
+
| **awarding_agency_name** | **String** | Award agency. | [optional] |
|
17
|
+
| **awarding_sub_agency_name** | **String** | Award sub-agency. | [optional] |
|
18
|
+
| **awarding_office_name** | **String** | Award office name. | [optional] |
|
19
|
+
| **performance_country** | **String** | Performance country. | [optional] |
|
20
|
+
| **performance_city** | **String** | Performance city. | [optional] |
|
21
|
+
| **performance_county** | **String** | Performance county. | [optional] |
|
22
|
+
| **performance_state** | **String** | Performance state. | [optional] |
|
23
|
+
| **performance_zip_code** | **String** | Performance zip code. | [optional] |
|
24
|
+
| **performance_congressional_district** | **String** | Performance congressional district. | [optional] |
|
25
|
+
| **naics_code** | **String** | NAICS code. | [optional] |
|
26
|
+
| **permalink** | **String** | Permalink. | [optional] |
|
27
|
+
|
28
|
+
## Example
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
require 'finnhub_ruby'
|
32
|
+
|
33
|
+
instance = FinnhubRuby::UsaSpending.new(
|
34
|
+
symbol: null,
|
35
|
+
recipient_name: null,
|
36
|
+
recipient_parent_name: null,
|
37
|
+
award_description: null,
|
38
|
+
country: null,
|
39
|
+
action_date: null,
|
40
|
+
total_value: null,
|
41
|
+
performance_start_date: null,
|
42
|
+
performance_end_date: null,
|
43
|
+
awarding_agency_name: null,
|
44
|
+
awarding_sub_agency_name: null,
|
45
|
+
awarding_office_name: null,
|
46
|
+
performance_country: null,
|
47
|
+
performance_city: null,
|
48
|
+
performance_county: null,
|
49
|
+
performance_state: null,
|
50
|
+
performance_zip_code: null,
|
51
|
+
performance_congressional_district: null,
|
52
|
+
naics_code: null,
|
53
|
+
permalink: null
|
54
|
+
)
|
55
|
+
```
|
56
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# FinnhubRuby::UsaSpendingResult
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **symbol** | **String** | Symbol. | [optional] |
|
8
|
+
| **data** | [**Array<UsaSpending>**](UsaSpending.md) | Array of government's spending data points. | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'finnhub_ruby'
|
14
|
+
|
15
|
+
instance = FinnhubRuby::UsaSpendingResult.new(
|
16
|
+
symbol: null,
|
17
|
+
data: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
Binary file
|
@@ -3295,7 +3295,7 @@ module FinnhubRuby
|
|
3295
3295
|
end
|
3296
3296
|
|
3297
3297
|
# Mutual Funds Holdings
|
3298
|
-
# Get full Mutual Funds holdings/constituents.
|
3298
|
+
# Get full Mutual Funds holdings/constituents. This endpoint covers both US and global mutual funds. For international funds, you must query the data using ISIN.
|
3299
3299
|
# @param [Hash] opts the optional parameters
|
3300
3300
|
# @option opts [String] :symbol Fund's symbol.
|
3301
3301
|
# @option opts [String] :isin Fund's isin.
|
@@ -3307,7 +3307,7 @@ module FinnhubRuby
|
|
3307
3307
|
end
|
3308
3308
|
|
3309
3309
|
# Mutual Funds Holdings
|
3310
|
-
# Get full Mutual Funds holdings/constituents.
|
3310
|
+
# Get full Mutual Funds holdings/constituents. This endpoint covers both US and global mutual funds. For international funds, you must query the data using ISIN.
|
3311
3311
|
# @param [Hash] opts the optional parameters
|
3312
3312
|
# @option opts [String] :symbol Fund's symbol.
|
3313
3313
|
# @option opts [String] :isin Fund's isin.
|
@@ -3361,7 +3361,7 @@ module FinnhubRuby
|
|
3361
3361
|
end
|
3362
3362
|
|
3363
3363
|
# Mutual Funds Profile
|
3364
|
-
# Get mutual funds profile information. This endpoint covers US mutual funds
|
3364
|
+
# Get mutual funds profile information. This endpoint covers both US and global mutual funds. For international funds, you must query the data using ISIN.
|
3365
3365
|
# @param [Hash] opts the optional parameters
|
3366
3366
|
# @option opts [String] :symbol Fund's symbol.
|
3367
3367
|
# @option opts [String] :isin Fund's isin.
|
@@ -3372,7 +3372,7 @@ module FinnhubRuby
|
|
3372
3372
|
end
|
3373
3373
|
|
3374
3374
|
# Mutual Funds Profile
|
3375
|
-
# Get mutual funds profile information. This endpoint covers US mutual funds
|
3375
|
+
# Get mutual funds profile information. This endpoint covers both US and global mutual funds. For international funds, you must query the data using ISIN.
|
3376
3376
|
# @param [Hash] opts the optional parameters
|
3377
3377
|
# @option opts [String] :symbol Fund's symbol.
|
3378
3378
|
# @option opts [String] :isin Fund's isin.
|
@@ -4840,6 +4840,84 @@ module FinnhubRuby
|
|
4840
4840
|
return data, status_code, headers
|
4841
4841
|
end
|
4842
4842
|
|
4843
|
+
# USA Spending
|
4844
|
+
# Get a list of government's spending activities from USASpending dataset for public companies. This dataset can help you identify companies that win big government contracts which is extremely important for industries such as Defense, Aerospace, and Education.
|
4845
|
+
# @param symbol [String] Symbol.
|
4846
|
+
# @param from [Date] From date <code>YYYY-MM-DD</code>. Filter for <code>actionDate</code>
|
4847
|
+
# @param to [Date] To date <code>YYYY-MM-DD</code>. Filter for <code>actionDate</code>
|
4848
|
+
# @param [Hash] opts the optional parameters
|
4849
|
+
# @return [UsaSpendingResult]
|
4850
|
+
def stock_usa_spending(symbol, from, to, opts = {})
|
4851
|
+
data, _status_code, _headers = stock_usa_spending_with_http_info(symbol, from, to, opts)
|
4852
|
+
data
|
4853
|
+
end
|
4854
|
+
|
4855
|
+
# USA Spending
|
4856
|
+
# Get a list of government's spending activities from USASpending dataset for public companies. This dataset can help you identify companies that win big government contracts which is extremely important for industries such as Defense, Aerospace, and Education.
|
4857
|
+
# @param symbol [String] Symbol.
|
4858
|
+
# @param from [Date] From date <code>YYYY-MM-DD</code>. Filter for <code>actionDate</code>
|
4859
|
+
# @param to [Date] To date <code>YYYY-MM-DD</code>. Filter for <code>actionDate</code>
|
4860
|
+
# @param [Hash] opts the optional parameters
|
4861
|
+
# @return [Array<(UsaSpendingResult, Integer, Hash)>] UsaSpendingResult data, response status code and response headers
|
4862
|
+
def stock_usa_spending_with_http_info(symbol, from, to, opts = {})
|
4863
|
+
if @api_client.config.debugging
|
4864
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.stock_usa_spending ...'
|
4865
|
+
end
|
4866
|
+
# verify the required parameter 'symbol' is set
|
4867
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
4868
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_usa_spending"
|
4869
|
+
end
|
4870
|
+
# verify the required parameter 'from' is set
|
4871
|
+
if @api_client.config.client_side_validation && from.nil?
|
4872
|
+
fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.stock_usa_spending"
|
4873
|
+
end
|
4874
|
+
# verify the required parameter 'to' is set
|
4875
|
+
if @api_client.config.client_side_validation && to.nil?
|
4876
|
+
fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.stock_usa_spending"
|
4877
|
+
end
|
4878
|
+
# resource path
|
4879
|
+
local_var_path = '/stock/usa-spending'
|
4880
|
+
|
4881
|
+
# query parameters
|
4882
|
+
query_params = opts[:query_params] || {}
|
4883
|
+
query_params[:'symbol'] = symbol
|
4884
|
+
query_params[:'from'] = from
|
4885
|
+
query_params[:'to'] = to
|
4886
|
+
|
4887
|
+
# header parameters
|
4888
|
+
header_params = opts[:header_params] || {}
|
4889
|
+
# HTTP header 'Accept' (if needed)
|
4890
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
4891
|
+
|
4892
|
+
# form parameters
|
4893
|
+
form_params = opts[:form_params] || {}
|
4894
|
+
|
4895
|
+
# http body (model)
|
4896
|
+
post_body = opts[:debug_body]
|
4897
|
+
|
4898
|
+
# return_type
|
4899
|
+
return_type = opts[:debug_return_type] || 'UsaSpendingResult'
|
4900
|
+
|
4901
|
+
# auth_names
|
4902
|
+
auth_names = opts[:debug_auth_names] || ['api_key']
|
4903
|
+
|
4904
|
+
new_options = opts.merge(
|
4905
|
+
:operation => :"DefaultApi.stock_usa_spending",
|
4906
|
+
:header_params => header_params,
|
4907
|
+
:query_params => query_params,
|
4908
|
+
:form_params => form_params,
|
4909
|
+
:body => post_body,
|
4910
|
+
:auth_names => auth_names,
|
4911
|
+
:return_type => return_type
|
4912
|
+
)
|
4913
|
+
|
4914
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
4915
|
+
if @api_client.config.debugging
|
4916
|
+
@api_client.config.logger.debug "API called: DefaultApi#stock_usa_spending\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
4917
|
+
end
|
4918
|
+
return data, status_code, headers
|
4919
|
+
end
|
4920
|
+
|
4843
4921
|
# USPTO Patents
|
4844
4922
|
# List USPTO patents for companies. Limit to 250 records per API call.
|
4845
4923
|
# @param symbol [String] Symbol.
|
@@ -0,0 +1,409 @@
|
|
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 UsaSpending
|
18
|
+
# Symbol.
|
19
|
+
attr_accessor :symbol
|
20
|
+
|
21
|
+
# Company's name.
|
22
|
+
attr_accessor :recipient_name
|
23
|
+
|
24
|
+
# Company's name.
|
25
|
+
attr_accessor :recipient_parent_name
|
26
|
+
|
27
|
+
# Description.
|
28
|
+
attr_accessor :award_description
|
29
|
+
|
30
|
+
# Recipient's country.
|
31
|
+
attr_accessor :country
|
32
|
+
|
33
|
+
# Period.
|
34
|
+
attr_accessor :action_date
|
35
|
+
|
36
|
+
# Income reported by lobbying firms.
|
37
|
+
attr_accessor :total_value
|
38
|
+
|
39
|
+
# Performance start date.
|
40
|
+
attr_accessor :performance_start_date
|
41
|
+
|
42
|
+
# Performance end date.
|
43
|
+
attr_accessor :performance_end_date
|
44
|
+
|
45
|
+
# Award agency.
|
46
|
+
attr_accessor :awarding_agency_name
|
47
|
+
|
48
|
+
# Award sub-agency.
|
49
|
+
attr_accessor :awarding_sub_agency_name
|
50
|
+
|
51
|
+
# Award office name.
|
52
|
+
attr_accessor :awarding_office_name
|
53
|
+
|
54
|
+
# Performance country.
|
55
|
+
attr_accessor :performance_country
|
56
|
+
|
57
|
+
# Performance city.
|
58
|
+
attr_accessor :performance_city
|
59
|
+
|
60
|
+
# Performance county.
|
61
|
+
attr_accessor :performance_county
|
62
|
+
|
63
|
+
# Performance state.
|
64
|
+
attr_accessor :performance_state
|
65
|
+
|
66
|
+
# Performance zip code.
|
67
|
+
attr_accessor :performance_zip_code
|
68
|
+
|
69
|
+
# Performance congressional district.
|
70
|
+
attr_accessor :performance_congressional_district
|
71
|
+
|
72
|
+
# NAICS code.
|
73
|
+
attr_accessor :naics_code
|
74
|
+
|
75
|
+
# Permalink.
|
76
|
+
attr_accessor :permalink
|
77
|
+
|
78
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
79
|
+
def self.attribute_map
|
80
|
+
{
|
81
|
+
:'symbol' => :'symbol',
|
82
|
+
:'recipient_name' => :'recipientName',
|
83
|
+
:'recipient_parent_name' => :'recipientParentName',
|
84
|
+
:'award_description' => :'awardDescription',
|
85
|
+
:'country' => :'country',
|
86
|
+
:'action_date' => :'actionDate',
|
87
|
+
:'total_value' => :'totalValue',
|
88
|
+
:'performance_start_date' => :'performanceStartDate',
|
89
|
+
:'performance_end_date' => :'performanceEndDate',
|
90
|
+
:'awarding_agency_name' => :'awardingAgencyName',
|
91
|
+
:'awarding_sub_agency_name' => :'awardingSubAgencyName',
|
92
|
+
:'awarding_office_name' => :'awardingOfficeName',
|
93
|
+
:'performance_country' => :'performanceCountry',
|
94
|
+
:'performance_city' => :'performanceCity',
|
95
|
+
:'performance_county' => :'performanceCounty',
|
96
|
+
:'performance_state' => :'performanceState',
|
97
|
+
:'performance_zip_code' => :'performanceZipCode',
|
98
|
+
:'performance_congressional_district' => :'performanceCongressionalDistrict',
|
99
|
+
:'naics_code' => :'naicsCode',
|
100
|
+
:'permalink' => :'permalink'
|
101
|
+
}
|
102
|
+
end
|
103
|
+
|
104
|
+
# Returns all the JSON keys this model knows about
|
105
|
+
def self.acceptable_attributes
|
106
|
+
attribute_map.values
|
107
|
+
end
|
108
|
+
|
109
|
+
# Attribute type mapping.
|
110
|
+
def self.openapi_types
|
111
|
+
{
|
112
|
+
:'symbol' => :'String',
|
113
|
+
:'recipient_name' => :'String',
|
114
|
+
:'recipient_parent_name' => :'String',
|
115
|
+
:'award_description' => :'String',
|
116
|
+
:'country' => :'String',
|
117
|
+
:'action_date' => :'String',
|
118
|
+
:'total_value' => :'Float',
|
119
|
+
:'performance_start_date' => :'String',
|
120
|
+
:'performance_end_date' => :'String',
|
121
|
+
:'awarding_agency_name' => :'String',
|
122
|
+
:'awarding_sub_agency_name' => :'String',
|
123
|
+
:'awarding_office_name' => :'String',
|
124
|
+
:'performance_country' => :'String',
|
125
|
+
:'performance_city' => :'String',
|
126
|
+
:'performance_county' => :'String',
|
127
|
+
:'performance_state' => :'String',
|
128
|
+
:'performance_zip_code' => :'String',
|
129
|
+
:'performance_congressional_district' => :'String',
|
130
|
+
:'naics_code' => :'String',
|
131
|
+
:'permalink' => :'String'
|
132
|
+
}
|
133
|
+
end
|
134
|
+
|
135
|
+
# List of attributes with nullable: true
|
136
|
+
def self.openapi_nullable
|
137
|
+
Set.new([
|
138
|
+
])
|
139
|
+
end
|
140
|
+
|
141
|
+
# Initializes the object
|
142
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
143
|
+
def initialize(attributes = {})
|
144
|
+
if (!attributes.is_a?(Hash))
|
145
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FinnhubRuby::UsaSpending` initialize method"
|
146
|
+
end
|
147
|
+
|
148
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
149
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
150
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
151
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FinnhubRuby::UsaSpending`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
152
|
+
end
|
153
|
+
h[k.to_sym] = v
|
154
|
+
}
|
155
|
+
|
156
|
+
if attributes.key?(:'symbol')
|
157
|
+
self.symbol = attributes[:'symbol']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'recipient_name')
|
161
|
+
self.recipient_name = attributes[:'recipient_name']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.key?(:'recipient_parent_name')
|
165
|
+
self.recipient_parent_name = attributes[:'recipient_parent_name']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.key?(:'award_description')
|
169
|
+
self.award_description = attributes[:'award_description']
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes.key?(:'country')
|
173
|
+
self.country = attributes[:'country']
|
174
|
+
end
|
175
|
+
|
176
|
+
if attributes.key?(:'action_date')
|
177
|
+
self.action_date = attributes[:'action_date']
|
178
|
+
end
|
179
|
+
|
180
|
+
if attributes.key?(:'total_value')
|
181
|
+
self.total_value = attributes[:'total_value']
|
182
|
+
end
|
183
|
+
|
184
|
+
if attributes.key?(:'performance_start_date')
|
185
|
+
self.performance_start_date = attributes[:'performance_start_date']
|
186
|
+
end
|
187
|
+
|
188
|
+
if attributes.key?(:'performance_end_date')
|
189
|
+
self.performance_end_date = attributes[:'performance_end_date']
|
190
|
+
end
|
191
|
+
|
192
|
+
if attributes.key?(:'awarding_agency_name')
|
193
|
+
self.awarding_agency_name = attributes[:'awarding_agency_name']
|
194
|
+
end
|
195
|
+
|
196
|
+
if attributes.key?(:'awarding_sub_agency_name')
|
197
|
+
self.awarding_sub_agency_name = attributes[:'awarding_sub_agency_name']
|
198
|
+
end
|
199
|
+
|
200
|
+
if attributes.key?(:'awarding_office_name')
|
201
|
+
self.awarding_office_name = attributes[:'awarding_office_name']
|
202
|
+
end
|
203
|
+
|
204
|
+
if attributes.key?(:'performance_country')
|
205
|
+
self.performance_country = attributes[:'performance_country']
|
206
|
+
end
|
207
|
+
|
208
|
+
if attributes.key?(:'performance_city')
|
209
|
+
self.performance_city = attributes[:'performance_city']
|
210
|
+
end
|
211
|
+
|
212
|
+
if attributes.key?(:'performance_county')
|
213
|
+
self.performance_county = attributes[:'performance_county']
|
214
|
+
end
|
215
|
+
|
216
|
+
if attributes.key?(:'performance_state')
|
217
|
+
self.performance_state = attributes[:'performance_state']
|
218
|
+
end
|
219
|
+
|
220
|
+
if attributes.key?(:'performance_zip_code')
|
221
|
+
self.performance_zip_code = attributes[:'performance_zip_code']
|
222
|
+
end
|
223
|
+
|
224
|
+
if attributes.key?(:'performance_congressional_district')
|
225
|
+
self.performance_congressional_district = attributes[:'performance_congressional_district']
|
226
|
+
end
|
227
|
+
|
228
|
+
if attributes.key?(:'naics_code')
|
229
|
+
self.naics_code = attributes[:'naics_code']
|
230
|
+
end
|
231
|
+
|
232
|
+
if attributes.key?(:'permalink')
|
233
|
+
self.permalink = attributes[:'permalink']
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
238
|
+
# @return Array for valid properties with the reasons
|
239
|
+
def list_invalid_properties
|
240
|
+
invalid_properties = Array.new
|
241
|
+
invalid_properties
|
242
|
+
end
|
243
|
+
|
244
|
+
# Check to see if the all the properties in the model are valid
|
245
|
+
# @return true if the model is valid
|
246
|
+
def valid?
|
247
|
+
true
|
248
|
+
end
|
249
|
+
|
250
|
+
# Checks equality by comparing each attribute.
|
251
|
+
# @param [Object] Object to be compared
|
252
|
+
def ==(o)
|
253
|
+
return true if self.equal?(o)
|
254
|
+
self.class == o.class &&
|
255
|
+
symbol == o.symbol &&
|
256
|
+
recipient_name == o.recipient_name &&
|
257
|
+
recipient_parent_name == o.recipient_parent_name &&
|
258
|
+
award_description == o.award_description &&
|
259
|
+
country == o.country &&
|
260
|
+
action_date == o.action_date &&
|
261
|
+
total_value == o.total_value &&
|
262
|
+
performance_start_date == o.performance_start_date &&
|
263
|
+
performance_end_date == o.performance_end_date &&
|
264
|
+
awarding_agency_name == o.awarding_agency_name &&
|
265
|
+
awarding_sub_agency_name == o.awarding_sub_agency_name &&
|
266
|
+
awarding_office_name == o.awarding_office_name &&
|
267
|
+
performance_country == o.performance_country &&
|
268
|
+
performance_city == o.performance_city &&
|
269
|
+
performance_county == o.performance_county &&
|
270
|
+
performance_state == o.performance_state &&
|
271
|
+
performance_zip_code == o.performance_zip_code &&
|
272
|
+
performance_congressional_district == o.performance_congressional_district &&
|
273
|
+
naics_code == o.naics_code &&
|
274
|
+
permalink == o.permalink
|
275
|
+
end
|
276
|
+
|
277
|
+
# @see the `==` method
|
278
|
+
# @param [Object] Object to be compared
|
279
|
+
def eql?(o)
|
280
|
+
self == o
|
281
|
+
end
|
282
|
+
|
283
|
+
# Calculates hash code according to all attributes.
|
284
|
+
# @return [Integer] Hash code
|
285
|
+
def hash
|
286
|
+
[symbol, recipient_name, recipient_parent_name, award_description, country, action_date, total_value, performance_start_date, performance_end_date, awarding_agency_name, awarding_sub_agency_name, awarding_office_name, performance_country, performance_city, performance_county, performance_state, performance_zip_code, performance_congressional_district, naics_code, permalink].hash
|
287
|
+
end
|
288
|
+
|
289
|
+
# Builds the object from hash
|
290
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
291
|
+
# @return [Object] Returns the model itself
|
292
|
+
def self.build_from_hash(attributes)
|
293
|
+
new.build_from_hash(attributes)
|
294
|
+
end
|
295
|
+
|
296
|
+
# Builds the object from hash
|
297
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
298
|
+
# @return [Object] Returns the model itself
|
299
|
+
def build_from_hash(attributes)
|
300
|
+
return nil unless attributes.is_a?(Hash)
|
301
|
+
self.class.openapi_types.each_pair do |key, type|
|
302
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
303
|
+
self.send("#{key}=", nil)
|
304
|
+
elsif type =~ /\AArray<(.*)>/i
|
305
|
+
# check to ensure the input is an array given that the attribute
|
306
|
+
# is documented as an array but the input is not
|
307
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
308
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
309
|
+
end
|
310
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
311
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
312
|
+
end
|
313
|
+
end
|
314
|
+
|
315
|
+
self
|
316
|
+
end
|
317
|
+
|
318
|
+
# Deserializes the data based on type
|
319
|
+
# @param string type Data type
|
320
|
+
# @param string value Value to be deserialized
|
321
|
+
# @return [Object] Deserialized data
|
322
|
+
def _deserialize(type, value)
|
323
|
+
case type.to_sym
|
324
|
+
when :Time
|
325
|
+
Time.parse(value)
|
326
|
+
when :Date
|
327
|
+
Date.parse(value)
|
328
|
+
when :String
|
329
|
+
value.to_s
|
330
|
+
when :Integer
|
331
|
+
value.to_i
|
332
|
+
when :Float
|
333
|
+
value.to_f
|
334
|
+
when :Boolean
|
335
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
336
|
+
true
|
337
|
+
else
|
338
|
+
false
|
339
|
+
end
|
340
|
+
when :Object
|
341
|
+
# generic object (usually a Hash), return directly
|
342
|
+
value
|
343
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
344
|
+
inner_type = Regexp.last_match[:inner_type]
|
345
|
+
value.map { |v| _deserialize(inner_type, v) }
|
346
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
347
|
+
k_type = Regexp.last_match[:k_type]
|
348
|
+
v_type = Regexp.last_match[:v_type]
|
349
|
+
{}.tap do |hash|
|
350
|
+
value.each do |k, v|
|
351
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
352
|
+
end
|
353
|
+
end
|
354
|
+
else # model
|
355
|
+
# models (e.g. Pet) or oneOf
|
356
|
+
klass = FinnhubRuby.const_get(type)
|
357
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
361
|
+
# Returns the string representation of the object
|
362
|
+
# @return [String] String presentation of the object
|
363
|
+
def to_s
|
364
|
+
to_hash.to_s
|
365
|
+
end
|
366
|
+
|
367
|
+
# to_body is an alias to to_hash (backward compatibility)
|
368
|
+
# @return [Hash] Returns the object in the form of hash
|
369
|
+
def to_body
|
370
|
+
to_hash
|
371
|
+
end
|
372
|
+
|
373
|
+
# Returns the object in the form of hash
|
374
|
+
# @return [Hash] Returns the object in the form of hash
|
375
|
+
def to_hash
|
376
|
+
hash = {}
|
377
|
+
self.class.attribute_map.each_pair do |attr, param|
|
378
|
+
value = self.send(attr)
|
379
|
+
if value.nil?
|
380
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
381
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
382
|
+
end
|
383
|
+
|
384
|
+
hash[param] = _to_hash(value)
|
385
|
+
end
|
386
|
+
hash
|
387
|
+
end
|
388
|
+
|
389
|
+
# Outputs non-array value in the form of hash
|
390
|
+
# For object, use to_hash. Otherwise, just return the value
|
391
|
+
# @param [Object] value Any valid value
|
392
|
+
# @return [Hash] Returns the value in the form of hash
|
393
|
+
def _to_hash(value)
|
394
|
+
if value.is_a?(Array)
|
395
|
+
value.compact.map { |v| _to_hash(v) }
|
396
|
+
elsif value.is_a?(Hash)
|
397
|
+
{}.tap do |hash|
|
398
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
399
|
+
end
|
400
|
+
elsif value.respond_to? :to_hash
|
401
|
+
value.to_hash
|
402
|
+
else
|
403
|
+
value
|
404
|
+
end
|
405
|
+
end
|
406
|
+
|
407
|
+
end
|
408
|
+
|
409
|
+
end
|
@@ -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 UsaSpendingResult
|
18
|
+
# Symbol.
|
19
|
+
attr_accessor :symbol
|
20
|
+
|
21
|
+
# Array of government's spending data points.
|
22
|
+
attr_accessor :data
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'symbol' => :'symbol',
|
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
|
+
:'symbol' => :'String',
|
41
|
+
:'data' => :'Array<UsaSpending>'
|
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::UsaSpendingResult` 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::UsaSpendingResult`. 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?(:'symbol')
|
67
|
+
self.symbol = attributes[:'symbol']
|
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
|
+
symbol == o.symbol &&
|
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
|
+
[symbol, 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
|
data/lib/finnhub_ruby/version.rb
CHANGED
data/lib/finnhub_ruby.rb
CHANGED
@@ -134,6 +134,8 @@ require 'finnhub_ruby/models/transcript_participant'
|
|
134
134
|
require 'finnhub_ruby/models/trend'
|
135
135
|
require 'finnhub_ruby/models/twitter_sentiment_content'
|
136
136
|
require 'finnhub_ruby/models/upgrade_downgrade'
|
137
|
+
require 'finnhub_ruby/models/usa_spending'
|
138
|
+
require 'finnhub_ruby/models/usa_spending_result'
|
137
139
|
require 'finnhub_ruby/models/uspto_patent'
|
138
140
|
require 'finnhub_ruby/models/uspto_patent_result'
|
139
141
|
require 'finnhub_ruby/models/visa_application'
|
@@ -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::UsaSpendingResult
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe FinnhubRuby::UsaSpendingResult do
|
21
|
+
let(:instance) { FinnhubRuby::UsaSpendingResult.new }
|
22
|
+
|
23
|
+
describe 'test an instance of UsaSpendingResult' do
|
24
|
+
it 'should create an instance of UsaSpendingResult' do
|
25
|
+
expect(instance).to be_instance_of(FinnhubRuby::UsaSpendingResult)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
describe 'test attribute "symbol"' 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
|
@@ -0,0 +1,148 @@
|
|
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::UsaSpending
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe FinnhubRuby::UsaSpending do
|
21
|
+
let(:instance) { FinnhubRuby::UsaSpending.new }
|
22
|
+
|
23
|
+
describe 'test an instance of UsaSpending' do
|
24
|
+
it 'should create an instance of UsaSpending' do
|
25
|
+
expect(instance).to be_instance_of(FinnhubRuby::UsaSpending)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
describe 'test attribute "symbol"' 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 "recipient_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 "recipient_parent_name"' 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 "award_description"' 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 "country"' 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 "action_date"' 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 "total_value"' 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 "performance_start_date"' 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 "performance_end_date"' 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 "awarding_agency_name"' 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 "awarding_sub_agency_name"' 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
|
+
describe 'test attribute "awarding_office_name"' do
|
95
|
+
it 'should work' do
|
96
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
describe 'test attribute "performance_country"' do
|
101
|
+
it 'should work' do
|
102
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
describe 'test attribute "performance_city"' do
|
107
|
+
it 'should work' do
|
108
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
describe 'test attribute "performance_county"' do
|
113
|
+
it 'should work' do
|
114
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
describe 'test attribute "performance_state"' do
|
119
|
+
it 'should work' do
|
120
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
describe 'test attribute "performance_zip_code"' do
|
125
|
+
it 'should work' do
|
126
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
describe 'test attribute "performance_congressional_district"' do
|
131
|
+
it 'should work' do
|
132
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
describe 'test attribute "naics_code"' do
|
137
|
+
it 'should work' do
|
138
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
describe 'test attribute "permalink"' do
|
143
|
+
it 'should work' do
|
144
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
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.16
|
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-04-
|
11
|
+
date: 2022-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -181,6 +181,8 @@ files:
|
|
181
181
|
- docs/Trend.md
|
182
182
|
- docs/TwitterSentimentContent.md
|
183
183
|
- docs/UpgradeDowngrade.md
|
184
|
+
- docs/UsaSpending.md
|
185
|
+
- docs/UsaSpendingResult.md
|
184
186
|
- docs/UsptoPatent.md
|
185
187
|
- docs/UsptoPatentResult.md
|
186
188
|
- docs/VisaApplication.md
|
@@ -190,6 +192,7 @@ files:
|
|
190
192
|
- finnhub_ruby-1.1.12.gem
|
191
193
|
- finnhub_ruby-1.1.13.gem
|
192
194
|
- finnhub_ruby-1.1.14.gem
|
195
|
+
- finnhub_ruby-1.1.15.gem
|
193
196
|
- finnhub_ruby-1.1.7.gem
|
194
197
|
- finnhub_ruby-1.1.8.gem
|
195
198
|
- finnhub_ruby-1.1.9.gem
|
@@ -334,6 +337,8 @@ files:
|
|
334
337
|
- lib/finnhub_ruby/models/trend.rb
|
335
338
|
- lib/finnhub_ruby/models/twitter_sentiment_content.rb
|
336
339
|
- lib/finnhub_ruby/models/upgrade_downgrade.rb
|
340
|
+
- lib/finnhub_ruby/models/usa_spending.rb
|
341
|
+
- lib/finnhub_ruby/models/usa_spending_result.rb
|
337
342
|
- lib/finnhub_ruby/models/uspto_patent.rb
|
338
343
|
- lib/finnhub_ruby/models/uspto_patent_result.rb
|
339
344
|
- lib/finnhub_ruby/models/visa_application.rb
|
@@ -462,6 +467,8 @@ files:
|
|
462
467
|
- spec/models/trend_spec.rb
|
463
468
|
- spec/models/twitter_sentiment_content_spec.rb
|
464
469
|
- spec/models/upgrade_downgrade_spec.rb
|
470
|
+
- spec/models/usa_spending_result_spec.rb
|
471
|
+
- spec/models/usa_spending_spec.rb
|
465
472
|
- spec/models/uspto_patent_result_spec.rb
|
466
473
|
- spec/models/uspto_patent_spec.rb
|
467
474
|
- spec/models/visa_application_result_spec.rb
|
@@ -581,6 +588,7 @@ test_files:
|
|
581
588
|
- spec/models/breakdown_item_spec.rb
|
582
589
|
- spec/models/last_bid_ask_spec.rb
|
583
590
|
- spec/models/indicator_spec.rb
|
591
|
+
- spec/models/usa_spending_result_spec.rb
|
584
592
|
- spec/models/ownership_spec.rb
|
585
593
|
- spec/models/revenue_estimates_info_spec.rb
|
586
594
|
- spec/models/sentiment_spec.rb
|
@@ -599,6 +607,7 @@ test_files:
|
|
599
607
|
- spec/models/stock_candles_spec.rb
|
600
608
|
- spec/models/earnings_call_transcripts_list_spec.rb
|
601
609
|
- spec/models/economic_data_spec.rb
|
610
|
+
- spec/models/usa_spending_spec.rb
|
602
611
|
- spec/models/crypto_symbol_spec.rb
|
603
612
|
- spec/models/mutual_fund_profile_spec.rb
|
604
613
|
- spec/models/ebitda_estimates_info_spec.rb
|