snaptrade 2.0.128 → 2.0.130
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/Gemfile.lock +1 -1
- data/README.md +10 -7
- data/lib/snaptrade/api/account_information_api.rb +6 -6
- data/lib/snaptrade/api/reference_data_api.rb +15 -15
- data/lib/snaptrade/models/account_information_get_user_account_order_detail_request.rb +10 -10
- data/lib/snaptrade/models/brokerage_instrument.rb +5 -0
- data/lib/snaptrade/version.rb +1 -1
- data/spec/api/reference_data_api_spec.rb +1 -1
- data/spec/models/account_information_get_user_account_order_detail_request_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dc49b67f90f5e9a28d2b8c590d8514f89457beff1df9b9cd1a75b649294fbe0
|
4
|
+
data.tar.gz: ced33e858713edc3708556e07018652933215d1baf8718135fdb67726de5b66e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 046bb0f9a485c00ea461ee3376aacaf49e9c711cd2f55283e8cae36ad1b15e3e87de95f131c3714717c14fd3c62f60fc25a01503131c6c8d1380042bf7a86d3d
|
7
|
+
data.tar.gz: f671bc8309b6787954e9a58702109c23bcbbcbafa14b2afadb6e330ba0ee5c2b13e87b81da4f76906daba8afd785c1e81f16be1bb36c5217ded91d503a898224
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
Connect brokerage accounts to your app for live positions and trading
|
8
8
|
|
9
|
-
[](https://rubygems.org/gems/snaptrade/versions/2.0.130)
|
10
10
|
[](https://snaptrade.com/)
|
11
11
|
|
12
12
|
</div>
|
@@ -81,7 +81,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
81
81
|
Add to Gemfile:
|
82
82
|
|
83
83
|
```ruby
|
84
|
-
gem 'snaptrade', '~> 2.0.
|
84
|
+
gem 'snaptrade', '~> 2.0.130'
|
85
85
|
```
|
86
86
|
|
87
87
|
## Getting Started<a id="getting-started"></a>
|
@@ -331,7 +331,7 @@ This endpoint only returns orders placed through SnapTrade. In other words, orde
|
|
331
331
|
|
332
332
|
```ruby
|
333
333
|
result = snaptrade.account_information.get_user_account_order_detail(
|
334
|
-
|
334
|
+
brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
|
335
335
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
336
336
|
user_id: "snaptrade-user-123",
|
337
337
|
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
@@ -341,7 +341,7 @@ p result
|
|
341
341
|
|
342
342
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
343
343
|
|
344
|
-
#####
|
344
|
+
##### brokerage_order_id: `String`<a id="brokerage_order_id-string"></a>
|
345
345
|
Order ID returned by brokerage. This is the unique identifier for the order in
|
346
346
|
the brokerage system.
|
347
347
|
|
@@ -1370,21 +1370,24 @@ Returns a list of all brokerage instruments available for a given brokerage. Not
|
|
1370
1370
|
|
1371
1371
|
```ruby
|
1372
1372
|
result = snaptrade.reference_data.list_all_brokerage_instruments(
|
1373
|
-
|
1373
|
+
slug: "QUESTRADE",
|
1374
1374
|
)
|
1375
1375
|
p result
|
1376
1376
|
```
|
1377
1377
|
|
1378
1378
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
1379
1379
|
|
1380
|
-
#####
|
1380
|
+
##### slug: `String`<a id="slug-string"></a>
|
1381
|
+
A short, unique identifier for the brokerage. It is usually the name of the
|
1382
|
+
brokerage in capital letters and will never change.
|
1383
|
+
|
1381
1384
|
#### 🔄 Return<a id="🔄-return"></a>
|
1382
1385
|
|
1383
1386
|
[BrokerageInstrumentsResponse](./lib/snaptrade/models/brokerage_instruments_response.rb)
|
1384
1387
|
|
1385
1388
|
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
1386
1389
|
|
1387
|
-
`/brokerages/{
|
1390
|
+
`/brokerages/{slug}/instruments` `GET`
|
1388
1391
|
|
1389
1392
|
[🔙 **Back to Table of Contents**](#table-of-contents)
|
1390
1393
|
|
@@ -505,15 +505,15 @@ module SnapTrade
|
|
505
505
|
#
|
506
506
|
# This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
507
507
|
#
|
508
|
-
# @param
|
508
|
+
# @param brokerage_order_id [String] Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
|
509
509
|
# @param account_id [String]
|
510
510
|
# @param user_id [String]
|
511
511
|
# @param user_secret [String]
|
512
512
|
# @param body [AccountInformationGetUserAccountOrderDetailRequest]
|
513
513
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
514
|
-
def get_user_account_order_detail(
|
514
|
+
def get_user_account_order_detail(brokerage_order_id:, account_id:, user_id:, user_secret:, extra: {})
|
515
515
|
_body = {}
|
516
|
-
_body[:
|
516
|
+
_body[:brokerage_order_id] = brokerage_order_id if brokerage_order_id != SENTINEL
|
517
517
|
account_information_get_user_account_order_detail_request = _body
|
518
518
|
data, _status_code, _headers = get_user_account_order_detail_with_http_info_impl(account_id, user_id, user_secret, account_information_get_user_account_order_detail_request, extra)
|
519
519
|
data
|
@@ -527,15 +527,15 @@ module SnapTrade
|
|
527
527
|
#
|
528
528
|
# This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
529
529
|
#
|
530
|
-
# @param
|
530
|
+
# @param brokerage_order_id [String] Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
|
531
531
|
# @param account_id [String]
|
532
532
|
# @param user_id [String]
|
533
533
|
# @param user_secret [String]
|
534
534
|
# @param body [AccountInformationGetUserAccountOrderDetailRequest]
|
535
535
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
536
|
-
def get_user_account_order_detail_with_http_info(
|
536
|
+
def get_user_account_order_detail_with_http_info(brokerage_order_id:, account_id:, user_id:, user_secret:, extra: {})
|
537
537
|
_body = {}
|
538
|
-
_body[:
|
538
|
+
_body[:brokerage_order_id] = brokerage_order_id if brokerage_order_id != SENTINEL
|
539
539
|
account_information_get_user_account_order_detail_request = _body
|
540
540
|
get_user_account_order_detail_with_http_info_impl(account_id, user_id, user_secret, account_information_get_user_account_order_detail_request, extra)
|
541
541
|
end
|
@@ -600,10 +600,10 @@ module SnapTrade
|
|
600
600
|
#
|
601
601
|
# Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don't will return an empty list.
|
602
602
|
#
|
603
|
-
# @param
|
603
|
+
# @param slug [String] A short, unique identifier for the brokerage. It is usually the name of the brokerage in capital letters and will never change.
|
604
604
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
605
|
-
def list_all_brokerage_instruments(
|
606
|
-
data, _status_code, _headers = list_all_brokerage_instruments_with_http_info_impl(
|
605
|
+
def list_all_brokerage_instruments(slug:, extra: {})
|
606
|
+
data, _status_code, _headers = list_all_brokerage_instruments_with_http_info_impl(slug, extra)
|
607
607
|
data
|
608
608
|
end
|
609
609
|
|
@@ -611,37 +611,37 @@ module SnapTrade
|
|
611
611
|
#
|
612
612
|
# Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don't will return an empty list.
|
613
613
|
#
|
614
|
-
# @param
|
614
|
+
# @param slug [String] A short, unique identifier for the brokerage. It is usually the name of the brokerage in capital letters and will never change.
|
615
615
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
616
|
-
def list_all_brokerage_instruments_with_http_info(
|
617
|
-
list_all_brokerage_instruments_with_http_info_impl(
|
616
|
+
def list_all_brokerage_instruments_with_http_info(slug:, extra: {})
|
617
|
+
list_all_brokerage_instruments_with_http_info_impl(slug, extra)
|
618
618
|
end
|
619
619
|
|
620
620
|
# Get brokerage instruments
|
621
621
|
# Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don't will return an empty list.
|
622
|
-
# @param
|
622
|
+
# @param slug [String] A short, unique identifier for the brokerage. It is usually the name of the brokerage in capital letters and will never change.
|
623
623
|
# @param [Hash] opts the optional parameters
|
624
624
|
# @return [BrokerageInstrumentsResponse]
|
625
|
-
private def list_all_brokerage_instruments_impl(
|
626
|
-
data, _status_code, _headers = list_all_brokerage_instruments_with_http_info(
|
625
|
+
private def list_all_brokerage_instruments_impl(slug, opts = {})
|
626
|
+
data, _status_code, _headers = list_all_brokerage_instruments_with_http_info(slug, opts)
|
627
627
|
data
|
628
628
|
end
|
629
629
|
|
630
630
|
# Get brokerage instruments
|
631
631
|
# Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don't will return an empty list.
|
632
|
-
# @param
|
632
|
+
# @param slug [String] A short, unique identifier for the brokerage. It is usually the name of the brokerage in capital letters and will never change.
|
633
633
|
# @param [Hash] opts the optional parameters
|
634
634
|
# @return [Array<(BrokerageInstrumentsResponse, Integer, Hash)>] BrokerageInstrumentsResponse data, response status code and response headers
|
635
|
-
private def list_all_brokerage_instruments_with_http_info_impl(
|
635
|
+
private def list_all_brokerage_instruments_with_http_info_impl(slug, opts = {})
|
636
636
|
if @api_client.config.debugging
|
637
637
|
@api_client.config.logger.debug 'Calling API: ReferenceDataApi.list_all_brokerage_instruments ...'
|
638
638
|
end
|
639
|
-
# verify the required parameter '
|
640
|
-
if @api_client.config.client_side_validation &&
|
641
|
-
fail ArgumentError, "Missing the required parameter '
|
639
|
+
# verify the required parameter 'slug' is set
|
640
|
+
if @api_client.config.client_side_validation && slug.nil?
|
641
|
+
fail ArgumentError, "Missing the required parameter 'slug' when calling ReferenceDataApi.list_all_brokerage_instruments"
|
642
642
|
end
|
643
643
|
# resource path
|
644
|
-
local_var_path = '/brokerages/{
|
644
|
+
local_var_path = '/brokerages/{slug}/instruments'.sub('{' + 'slug' + '}', CGI.escape(slug.to_s))
|
645
645
|
|
646
646
|
# query parameters
|
647
647
|
query_params = opts[:query_params] || {}
|
@@ -13,12 +13,12 @@ require 'time'
|
|
13
13
|
module SnapTrade
|
14
14
|
class AccountInformationGetUserAccountOrderDetailRequest
|
15
15
|
# Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
|
16
|
-
attr_accessor :
|
16
|
+
attr_accessor :brokerage_order_id
|
17
17
|
|
18
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
19
19
|
def self.attribute_map
|
20
20
|
{
|
21
|
-
:'
|
21
|
+
:'brokerage_order_id' => :'brokerage_order_id'
|
22
22
|
}
|
23
23
|
end
|
24
24
|
|
@@ -30,7 +30,7 @@ module SnapTrade
|
|
30
30
|
# Attribute type mapping.
|
31
31
|
def self.openapi_types
|
32
32
|
{
|
33
|
-
:'
|
33
|
+
:'brokerage_order_id' => :'String'
|
34
34
|
}
|
35
35
|
end
|
36
36
|
|
@@ -55,8 +55,8 @@ module SnapTrade
|
|
55
55
|
h[k.to_sym] = v
|
56
56
|
}
|
57
57
|
|
58
|
-
if attributes.key?(:'
|
59
|
-
self.
|
58
|
+
if attributes.key?(:'brokerage_order_id')
|
59
|
+
self.brokerage_order_id = attributes[:'brokerage_order_id']
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -64,8 +64,8 @@ module SnapTrade
|
|
64
64
|
# @return Array for valid properties with the reasons
|
65
65
|
def list_invalid_properties
|
66
66
|
invalid_properties = Array.new
|
67
|
-
if @
|
68
|
-
invalid_properties.push('invalid value for "
|
67
|
+
if @brokerage_order_id.nil?
|
68
|
+
invalid_properties.push('invalid value for "brokerage_order_id", brokerage_order_id cannot be nil.')
|
69
69
|
end
|
70
70
|
|
71
71
|
invalid_properties
|
@@ -74,7 +74,7 @@ module SnapTrade
|
|
74
74
|
# Check to see if the all the properties in the model are valid
|
75
75
|
# @return true if the model is valid
|
76
76
|
def valid?
|
77
|
-
return false if @
|
77
|
+
return false if @brokerage_order_id.nil?
|
78
78
|
true
|
79
79
|
end
|
80
80
|
|
@@ -83,7 +83,7 @@ module SnapTrade
|
|
83
83
|
def ==(o)
|
84
84
|
return true if self.equal?(o)
|
85
85
|
self.class == o.class &&
|
86
|
-
|
86
|
+
brokerage_order_id == o.brokerage_order_id
|
87
87
|
end
|
88
88
|
|
89
89
|
# @see the `==` method
|
@@ -95,7 +95,7 @@ module SnapTrade
|
|
95
95
|
# Calculates hash code according to all attributes.
|
96
96
|
# @return [Integer] Hash code
|
97
97
|
def hash
|
98
|
-
[
|
98
|
+
[brokerage_order_id].hash
|
99
99
|
end
|
100
100
|
|
101
101
|
# Builds the object from hash
|
@@ -104,12 +104,17 @@ module SnapTrade
|
|
104
104
|
# @return Array for valid properties with the reasons
|
105
105
|
def list_invalid_properties
|
106
106
|
invalid_properties = Array.new
|
107
|
+
if @symbol.nil?
|
108
|
+
invalid_properties.push('invalid value for "symbol", symbol cannot be nil.')
|
109
|
+
end
|
110
|
+
|
107
111
|
invalid_properties
|
108
112
|
end
|
109
113
|
|
110
114
|
# Check to see if the all the properties in the model are valid
|
111
115
|
# @return true if the model is valid
|
112
116
|
def valid?
|
117
|
+
return false if @symbol.nil?
|
113
118
|
true
|
114
119
|
end
|
115
120
|
|
data/lib/snaptrade/version.rb
CHANGED
@@ -111,7 +111,7 @@ describe 'ReferenceDataApi' do
|
|
111
111
|
# unit tests for list_all_brokerage_instruments
|
112
112
|
# Get brokerage instruments
|
113
113
|
# Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don't will return an empty list.
|
114
|
-
# @param
|
114
|
+
# @param slug A short, unique identifier for the brokerage. It is usually the name of the brokerage in capital letters and will never change.
|
115
115
|
# @param [Hash] opts the optional parameters
|
116
116
|
# @return [BrokerageInstrumentsResponse]
|
117
117
|
describe 'list_all_brokerage_instruments test' do
|
@@ -20,7 +20,7 @@ describe SnapTrade::AccountInformationGetUserAccountOrderDetailRequest do
|
|
20
20
|
expect(instance).to be_instance_of(SnapTrade::AccountInformationGetUserAccountOrderDetailRequest)
|
21
21
|
end
|
22
22
|
end
|
23
|
-
describe 'test attribute "
|
23
|
+
describe 'test attribute "brokerage_order_id"' do
|
24
24
|
it 'should work' do
|
25
25
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
26
26
|
end
|
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: 2.0.
|
4
|
+
version: 2.0.130
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SnapTrade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-09-
|
11
|
+
date: 2025-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|