snaptrade 1.17.13 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +26 -18
- data/README.md +2 -2
- data/docs/MonthlyDividends.md +1 -1
- data/docs/NetContributions.md +1 -1
- data/docs/PastValue.md +1 -1
- data/docs/ReferenceDataApi.md +9 -14
- data/docs/SubPeriodReturnRate.md +2 -2
- data/docs/TransactionsStatus.md +1 -1
- data/lib/snaptrade/api/reference_data_api.rb +19 -26
- data/lib/snaptrade/version.rb +1 -1
- data/spec/api/reference_data_api_spec.rb +2 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54248537533cc85b7e2a236fd171c32f6e4893f8c1e99af4a1d7edd14129c450
|
4
|
+
data.tar.gz: 913138150b71863d9a70fcb08fe78fc18717c565e0145026e4333b410b6d300f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2edd6fe7cdb16b1c4605f9dacba0c0f488c11758ebfb1efe75b008957919b57c271337b3e6c6a4ed67b077f66a2388eed232a219d78c0aa05f1aae2b690bc4bb
|
7
|
+
data.tar.gz: a674e881bb6caf2179f55e203616049f3faf4d8309666c771e24946f75c71fd1576a6ae487ae1421d6e33bcc80f33b40a235c42106144578fbb4bcda21e570d1
|
data/Gemfile.lock
CHANGED
@@ -9,40 +9,47 @@ GEM
|
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
11
|
ast (2.4.2)
|
12
|
+
base64 (0.1.1)
|
12
13
|
byebug (11.1.3)
|
13
14
|
coderay (1.1.3)
|
14
15
|
debug (1.8.0)
|
15
16
|
irb (>= 1.5.0)
|
16
17
|
reline (>= 0.3.1)
|
17
18
|
diff-lcs (1.5.0)
|
18
|
-
faraday (2.
|
19
|
-
|
19
|
+
faraday (2.7.11)
|
20
|
+
base64
|
21
|
+
faraday-net_http (>= 2.0, < 3.1)
|
22
|
+
ruby2_keywords (>= 0.0.4)
|
20
23
|
faraday-multipart (1.0.4)
|
21
24
|
multipart-post (~> 2)
|
22
|
-
faraday-net_http (3.
|
23
|
-
net-http
|
25
|
+
faraday-net_http (3.0.2)
|
24
26
|
io-console (0.6.0)
|
25
|
-
irb (1.
|
26
|
-
|
27
|
+
irb (1.8.1)
|
28
|
+
rdoc
|
29
|
+
reline (>= 0.3.8)
|
27
30
|
method_source (1.0.0)
|
28
31
|
multipart-post (2.3.0)
|
29
|
-
net-http (0.4.1)
|
30
|
-
uri
|
31
32
|
parallel (1.23.0)
|
32
|
-
parser (3.2.2.
|
33
|
+
parser (3.2.2.3)
|
33
34
|
ast (~> 2.4.1)
|
35
|
+
racc
|
34
36
|
pry (0.14.2)
|
35
37
|
coderay (~> 1.1)
|
36
38
|
method_source (~> 1.0)
|
37
39
|
pry-byebug (3.10.1)
|
38
40
|
byebug (~> 11.0)
|
39
41
|
pry (>= 0.13, < 0.15)
|
42
|
+
psych (5.1.0)
|
43
|
+
stringio
|
44
|
+
racc (1.7.1)
|
40
45
|
rainbow (3.1.1)
|
41
46
|
rake (13.0.6)
|
42
|
-
|
43
|
-
|
47
|
+
rdoc (6.5.0)
|
48
|
+
psych (>= 4.0.0)
|
49
|
+
regexp_parser (2.8.1)
|
50
|
+
reline (0.3.8)
|
44
51
|
io-console (~> 0.5)
|
45
|
-
rexml (3.2.
|
52
|
+
rexml (3.2.6)
|
46
53
|
rspec (3.12.0)
|
47
54
|
rspec-core (~> 3.12.0)
|
48
55
|
rspec-expectations (~> 3.12.0)
|
@@ -52,10 +59,10 @@ GEM
|
|
52
59
|
rspec-expectations (3.12.3)
|
53
60
|
diff-lcs (>= 1.2.0, < 2.0)
|
54
61
|
rspec-support (~> 3.12.0)
|
55
|
-
rspec-mocks (3.12.
|
62
|
+
rspec-mocks (3.12.6)
|
56
63
|
diff-lcs (>= 1.2.0, < 2.0)
|
57
64
|
rspec-support (~> 3.12.0)
|
58
|
-
rspec-support (3.12.
|
65
|
+
rspec-support (3.12.1)
|
59
66
|
rubocop (1.12.1)
|
60
67
|
parallel (~> 1.10)
|
61
68
|
parser (>= 3.0.0.0)
|
@@ -65,14 +72,15 @@ GEM
|
|
65
72
|
rubocop-ast (>= 1.2.0, < 2.0)
|
66
73
|
ruby-progressbar (~> 1.7)
|
67
74
|
unicode-display_width (>= 1.4.0, < 3.0)
|
68
|
-
rubocop-ast (1.
|
75
|
+
rubocop-ast (1.29.0)
|
69
76
|
parser (>= 3.2.1.0)
|
70
77
|
ruby-progressbar (1.13.0)
|
78
|
+
ruby2_keywords (0.0.5)
|
79
|
+
stringio (3.0.8)
|
71
80
|
unicode-display_width (2.4.2)
|
72
|
-
uri (0.13.0)
|
73
81
|
|
74
82
|
PLATFORMS
|
75
|
-
arm64-darwin-
|
83
|
+
arm64-darwin-22
|
76
84
|
|
77
85
|
DEPENDENCIES
|
78
86
|
debug (~> 1.8)
|
@@ -83,4 +91,4 @@ DEPENDENCIES
|
|
83
91
|
snaptrade!
|
84
92
|
|
85
93
|
BUNDLED WITH
|
86
|
-
2.
|
94
|
+
2.4.19
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ For more information, please visit [https://snaptrade.com/](https://snaptrade.co
|
|
9
9
|
Add to Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'snaptrade', '~>
|
12
|
+
gem 'snaptrade', '~> 2.0.0'
|
13
13
|
```
|
14
14
|
|
15
15
|
## Getting Started
|
@@ -72,7 +72,7 @@ Class | Method | HTTP request | Description
|
|
72
72
|
*SnapTrade::ReferenceDataApi* | [**get_security_types**](docs/ReferenceDataApi.md#get_security_types) | **GET** /securityTypes | List of all security types
|
73
73
|
*SnapTrade::ReferenceDataApi* | [**get_stock_exchanges**](docs/ReferenceDataApi.md#get_stock_exchanges) | **GET** /exchanges | List exchanges
|
74
74
|
*SnapTrade::ReferenceDataApi* | [**get_symbols**](docs/ReferenceDataApi.md#get_symbols) | **POST** /symbols | Search for symbols
|
75
|
-
*SnapTrade::ReferenceDataApi* | [**get_symbols_by_ticker**](docs/ReferenceDataApi.md#get_symbols_by_ticker) | **GET** /symbols/{
|
75
|
+
*SnapTrade::ReferenceDataApi* | [**get_symbols_by_ticker**](docs/ReferenceDataApi.md#get_symbols_by_ticker) | **GET** /symbols/{query} | Get details of a symbol by the ticker or the universal_symbol_id
|
76
76
|
*SnapTrade::ReferenceDataApi* | [**list_all_brokerage_authorization_type**](docs/ReferenceDataApi.md#list_all_brokerage_authorization_type) | **GET** /brokerageAuthorizationTypes | List of all brokerage authorization types
|
77
77
|
*SnapTrade::ReferenceDataApi* | [**list_all_brokerages**](docs/ReferenceDataApi.md#list_all_brokerages) | **GET** /brokerages | List brokerages
|
78
78
|
*SnapTrade::ReferenceDataApi* | [**list_all_currencies**](docs/ReferenceDataApi.md#list_all_currencies) | **GET** /currencies | List currencies
|
data/docs/MonthlyDividends.md
CHANGED
data/docs/NetContributions.md
CHANGED
data/docs/PastValue.md
CHANGED
data/docs/ReferenceDataApi.md
CHANGED
@@ -9,7 +9,7 @@ All URIs are relative to *https://api.snaptrade.com/api/v1*
|
|
9
9
|
| [**get_security_types**](ReferenceDataApi.md#get_security_types) | **GET** /securityTypes | List of all security types |
|
10
10
|
| [**get_stock_exchanges**](ReferenceDataApi.md#get_stock_exchanges) | **GET** /exchanges | List exchanges |
|
11
11
|
| [**get_symbols**](ReferenceDataApi.md#get_symbols) | **POST** /symbols | Search for symbols |
|
12
|
-
| [**get_symbols_by_ticker**](ReferenceDataApi.md#get_symbols_by_ticker) | **GET** /symbols/{
|
12
|
+
| [**get_symbols_by_ticker**](ReferenceDataApi.md#get_symbols_by_ticker) | **GET** /symbols/{query} | Get details of a symbol by the ticker or the universal_symbol_id |
|
13
13
|
| [**list_all_brokerage_authorization_type**](ReferenceDataApi.md#list_all_brokerage_authorization_type) | **GET** /brokerageAuthorizationTypes | List of all brokerage authorization types |
|
14
14
|
| [**list_all_brokerages**](ReferenceDataApi.md#list_all_brokerages) | **GET** /brokerages | List brokerages |
|
15
15
|
| [**list_all_currencies**](ReferenceDataApi.md#list_all_currencies) | **GET** /currencies | List currencies |
|
@@ -271,7 +271,7 @@ end
|
|
271
271
|
|
272
272
|
## get_symbols_by_ticker
|
273
273
|
|
274
|
-
Get details of a symbol by the ticker
|
274
|
+
Get details of a symbol by the ticker or the universal_symbol_id
|
275
275
|
|
276
276
|
### Example
|
277
277
|
|
@@ -281,14 +281,12 @@ require 'snaptrade'
|
|
281
281
|
SnapTrade.client_id = "YOUR_CLIENT_ID"
|
282
282
|
SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
|
283
283
|
|
284
|
-
|
285
|
-
symbol_id = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
|
284
|
+
query = "query_example"
|
286
285
|
|
287
286
|
begin
|
288
|
-
# Get details of a symbol by the ticker
|
287
|
+
# Get details of a symbol by the ticker or the universal_symbol_id
|
289
288
|
result = SnapTrade::ReferenceData.get_symbols_by_ticker(
|
290
|
-
|
291
|
-
symbol_id: symbol_id,
|
289
|
+
query: query,
|
292
290
|
)
|
293
291
|
p result
|
294
292
|
rescue SnapTrade::ApiError => e
|
@@ -301,14 +299,12 @@ end
|
|
301
299
|
This returns an Array which contains the response data, status code and headers.
|
302
300
|
|
303
301
|
```ruby
|
304
|
-
|
305
|
-
symbol_id = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
|
302
|
+
query = "query_example"
|
306
303
|
|
307
304
|
begin
|
308
|
-
# Get details of a symbol by the ticker
|
305
|
+
# Get details of a symbol by the ticker or the universal_symbol_id
|
309
306
|
data, status_code, headers, response = SnapTrade::ReferenceData.get_symbols_by_ticker_with_http_info(
|
310
|
-
|
311
|
-
symbol_id: symbol_id,
|
307
|
+
query: query,
|
312
308
|
)
|
313
309
|
p status_code # => 2xx
|
314
310
|
p headers # => { ... }
|
@@ -322,8 +318,7 @@ end
|
|
322
318
|
|
323
319
|
| Name | Type | Description | Notes |
|
324
320
|
| ---- | ---- | ----------- | ----- |
|
325
|
-
| **
|
326
|
-
| **symbol_id** | **String** | OPTIONAL IN PATH Can be used instead of the ticker ; The ID of the UniversalSymbol to get. | [optional] |
|
321
|
+
| **query** | **String** | The ticker or universal_symbol_id of the UniversalSymbol to get. | |
|
327
322
|
|
328
323
|
### Return type
|
329
324
|
|
data/docs/SubPeriodReturnRate.md
CHANGED
@@ -14,8 +14,8 @@
|
|
14
14
|
require 'snaptrade'
|
15
15
|
|
16
16
|
instance = SnapTrade::SubPeriodReturnRate.new(
|
17
|
-
period_start:
|
18
|
-
period_end:
|
17
|
+
period_start: Sun Jan 23 16:00:00 PST 2022,
|
18
|
+
period_end: Sun Jan 23 16:00:00 PST 2022,
|
19
19
|
rate_of_return: 0.012312367452
|
20
20
|
)
|
21
21
|
```
|
data/docs/TransactionsStatus.md
CHANGED
@@ -392,54 +392,47 @@ module SnapTrade
|
|
392
392
|
end
|
393
393
|
|
394
394
|
|
395
|
-
# Get details of a symbol by the ticker
|
396
|
-
# @param
|
397
|
-
# @param symbol_id [String] OPTIONAL IN PATH Can be used instead of the ticker ; The ID of the UniversalSymbol to get.
|
395
|
+
# Get details of a symbol by the ticker or the universal_symbol_id
|
396
|
+
# @param query [String] The ticker or universal_symbol_id of the UniversalSymbol to get.
|
398
397
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
399
|
-
def get_symbols_by_ticker(
|
400
|
-
|
401
|
-
data, _status_code, _headers = get_symbols_by_ticker_with_http_info_impl(ticker, extra)
|
398
|
+
def get_symbols_by_ticker(query:, extra: {})
|
399
|
+
data, _status_code, _headers = get_symbols_by_ticker_with_http_info_impl(query, extra)
|
402
400
|
data
|
403
401
|
end
|
404
402
|
|
405
|
-
# Get details of a symbol by the ticker
|
406
|
-
# @param
|
407
|
-
# @param symbol_id [String] OPTIONAL IN PATH Can be used instead of the ticker ; The ID of the UniversalSymbol to get.
|
403
|
+
# Get details of a symbol by the ticker or the universal_symbol_id
|
404
|
+
# @param query [String] The ticker or universal_symbol_id of the UniversalSymbol to get.
|
408
405
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
409
|
-
def get_symbols_by_ticker_with_http_info(
|
410
|
-
extra
|
411
|
-
get_symbols_by_ticker_with_http_info_impl(ticker, extra)
|
406
|
+
def get_symbols_by_ticker_with_http_info(query:, extra: {})
|
407
|
+
get_symbols_by_ticker_with_http_info_impl(query, extra)
|
412
408
|
end
|
413
409
|
|
414
|
-
# Get details of a symbol by the ticker
|
415
|
-
# @param
|
410
|
+
# Get details of a symbol by the ticker or the universal_symbol_id
|
411
|
+
# @param query [String] The ticker or universal_symbol_id of the UniversalSymbol to get.
|
416
412
|
# @param [Hash] opts the optional parameters
|
417
|
-
# @option opts [String] :symbol_id OPTIONAL IN PATH Can be used instead of the ticker ; The ID of the UniversalSymbol to get.
|
418
413
|
# @return [UniversalSymbol]
|
419
|
-
def get_symbols_by_ticker_impl(
|
420
|
-
data, _status_code, _headers = get_symbols_by_ticker_with_http_info(
|
414
|
+
def get_symbols_by_ticker_impl(query, opts = {})
|
415
|
+
data, _status_code, _headers = get_symbols_by_ticker_with_http_info(query, opts)
|
421
416
|
data
|
422
417
|
end
|
423
418
|
|
424
|
-
# Get details of a symbol by the ticker
|
425
|
-
# @param
|
419
|
+
# Get details of a symbol by the ticker or the universal_symbol_id
|
420
|
+
# @param query [String] The ticker or universal_symbol_id of the UniversalSymbol to get.
|
426
421
|
# @param [Hash] opts the optional parameters
|
427
|
-
# @option opts [String] :symbol_id OPTIONAL IN PATH Can be used instead of the ticker ; The ID of the UniversalSymbol to get.
|
428
422
|
# @return [Array<(UniversalSymbol, Integer, Hash)>] UniversalSymbol data, response status code and response headers
|
429
|
-
def get_symbols_by_ticker_with_http_info_impl(
|
423
|
+
def get_symbols_by_ticker_with_http_info_impl(query, opts = {})
|
430
424
|
if @api_client.config.debugging
|
431
425
|
@api_client.config.logger.debug 'Calling API: ReferenceDataApi.get_symbols_by_ticker ...'
|
432
426
|
end
|
433
|
-
# verify the required parameter '
|
434
|
-
if @api_client.config.client_side_validation &&
|
435
|
-
fail ArgumentError, "Missing the required parameter '
|
427
|
+
# verify the required parameter 'query' is set
|
428
|
+
if @api_client.config.client_side_validation && query.nil?
|
429
|
+
fail ArgumentError, "Missing the required parameter 'query' when calling ReferenceDataApi.get_symbols_by_ticker"
|
436
430
|
end
|
437
431
|
# resource path
|
438
|
-
local_var_path = '/symbols/{
|
432
|
+
local_var_path = '/symbols/{query}'.sub('{' + 'query' + '}', CGI.escape(query.to_s))
|
439
433
|
|
440
434
|
# query parameters
|
441
435
|
query_params = opts[:query_params] || {}
|
442
|
-
query_params[:'symbolId'] = opts[:'symbol_id'] if !opts[:'symbol_id'].nil?
|
443
436
|
|
444
437
|
# header parameters
|
445
438
|
header_params = opts[:header_params] || {}
|
data/lib/snaptrade/version.rb
CHANGED
@@ -82,10 +82,9 @@ describe 'ReferenceDataApi' do
|
|
82
82
|
end
|
83
83
|
|
84
84
|
# unit tests for get_symbols_by_ticker
|
85
|
-
# Get details of a symbol by the ticker
|
86
|
-
# @param
|
85
|
+
# Get details of a symbol by the ticker or the universal_symbol_id
|
86
|
+
# @param query The ticker or universal_symbol_id of the UniversalSymbol to get.
|
87
87
|
# @param [Hash] opts the optional parameters
|
88
|
-
# @option opts [String] :symbol_id OPTIONAL IN PATH Can be used instead of the ticker ; The ID of the UniversalSymbol to get.
|
89
88
|
# @return [UniversalSymbol]
|
90
89
|
describe 'get_symbols_by_ticker test' do
|
91
90
|
it 'should work' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snaptrade
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SnapTrade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -528,7 +528,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
528
528
|
- !ruby/object:Gem::Version
|
529
529
|
version: '0'
|
530
530
|
requirements: []
|
531
|
-
rubygems_version: 3.
|
531
|
+
rubygems_version: 3.4.10
|
532
532
|
signing_key:
|
533
533
|
specification_version: 4
|
534
534
|
summary: SnapTrade Ruby Gem
|