snaptrade 1.17.2 → 1.17.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -3
- data/docs/AccountInformationApi.md +8 -4
- data/docs/AuthenticationApi.md +6 -4
- data/docs/Model500UnexpectedExceptionResponse.md +22 -0
- data/docs/ReferenceDataApi.md +6 -4
- data/docs/SnapTradeLoginUserRequestBody.md +4 -4
- data/docs/SnapTradeRegisterUserRequestBody.md +1 -3
- data/docs/TransactionsAndReportingApi.md +1 -1
- data/lib/snaptrade/api/account_information_api.rb +12 -4
- data/lib/snaptrade/api/authentication_api.rb +22 -14
- data/lib/snaptrade/api/reference_data_api.rb +8 -4
- data/lib/snaptrade/api/transactions_and_reporting_api.rb +4 -4
- data/lib/snaptrade/models/model500_unexpected_exception_response.rb +239 -0
- data/lib/snaptrade/models/snap_trade_login_user_request_body.rb +4 -0
- data/lib/snaptrade/models/snap_trade_register_user_request_body.rb +4 -14
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +1 -0
- data/spec/api/account_information_api_spec.rb +3 -1
- data/spec/api/authentication_api_spec.rb +3 -0
- data/spec/api/reference_data_api_spec.rb +2 -1
- data/spec/api/transactions_and_reporting_api_spec.rb +1 -1
- data/spec/models/model500_unexpected_exception_response_spec.rb +42 -0
- data/spec/models/snap_trade_register_user_request_body_spec.rb +0 -6
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc9780823d9dfda53279fb57e020586fad08fc3376e130257ff683ac8aab475d
|
4
|
+
data.tar.gz: 86b12bc58d21c07c1254d05f4a11dad2fc44ed891d056fad98ac04930a9f05d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce243da503eab37607f7c4e524c610595586c2b38222f605cb040e2599a428a99640892be4e965e23789f8b75ded0415e007522094422ba40173e3194b17777e
|
7
|
+
data.tar.gz: f5c76b6e59d65d28bdfd6de6e2a3765ea68f8669838595f1827a9df761e0bf6529f97f1bcf1c934973843b0297475088f0dcc9f710999241d63a0e5377f71193
|
data/Gemfile.lock
CHANGED
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', '~> 1.17.
|
12
|
+
gem 'snaptrade', '~> 1.17.3'
|
13
13
|
```
|
14
14
|
|
15
15
|
## Getting Started
|
@@ -48,7 +48,7 @@ Class | Method | HTTP request | Description
|
|
48
48
|
*SnapTrade::AccountInformationApi* | [**get_user_account_details**](docs/AccountInformationApi.md#get_user_account_details) | **GET** /accounts/{accountId} | Return details of a specific investment account
|
49
49
|
*SnapTrade::AccountInformationApi* | [**get_user_account_orders**](docs/AccountInformationApi.md#get_user_account_orders) | **GET** /accounts/{accountId}/orders | Get history of orders placed in account
|
50
50
|
*SnapTrade::AccountInformationApi* | [**get_user_account_positions**](docs/AccountInformationApi.md#get_user_account_positions) | **GET** /accounts/{accountId}/positions | List account positions
|
51
|
-
*SnapTrade::AccountInformationApi* | [**get_user_holdings**](docs/AccountInformationApi.md#get_user_holdings) | **GET** /accounts/{accountId}/holdings | List balances, positions and orders for the specified account
|
51
|
+
*SnapTrade::AccountInformationApi* | [**get_user_holdings**](docs/AccountInformationApi.md#get_user_holdings) | **GET** /accounts/{accountId}/holdings | List balances, positions and orders for the specified account
|
52
52
|
*SnapTrade::AccountInformationApi* | [**list_user_accounts**](docs/AccountInformationApi.md#list_user_accounts) | **GET** /accounts | List accounts
|
53
53
|
*SnapTrade::AccountInformationApi* | [**update_user_account**](docs/AccountInformationApi.md#update_user_account) | **PUT** /accounts/{accountId} | Update details of an investment account
|
54
54
|
*SnapTrade::APIStatusApi* | [**check**](docs/APIStatusApi.md#check) | **GET** / | Get API Status
|
@@ -69,7 +69,7 @@ Class | Method | HTTP request | Description
|
|
69
69
|
*SnapTrade::OptionsApi* | [**place_option_strategy**](docs/OptionsApi.md#place_option_strategy) | **POST** /accounts/{accountId}/optionStrategy/{optionStrategyId}/execute | Place an option strategy order on the brokerage
|
70
70
|
*SnapTrade::ReferenceDataApi* | [**get_currency_exchange_rate_pair**](docs/ReferenceDataApi.md#get_currency_exchange_rate_pair) | **GET** /currencies/rates/{currencyPair} | Return the exchange rate of a currency pair
|
71
71
|
*SnapTrade::ReferenceDataApi* | [**get_partner_info**](docs/ReferenceDataApi.md#get_partner_info) | **GET** /snapTrade/partners | Get metadata related to Snaptrade partner
|
72
|
-
*SnapTrade::ReferenceDataApi* | [**get_security_types**](docs/ReferenceDataApi.md#get_security_types) | **GET** /securityTypes | List of all security types
|
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
75
|
*SnapTrade::ReferenceDataApi* | [**get_symbols_by_ticker**](docs/ReferenceDataApi.md#get_symbols_by_ticker) | **GET** /symbols/{ticker} | Get details of a symbol by the ticker
|
@@ -135,6 +135,7 @@ Class | Method | HTTP request | Description
|
|
135
135
|
- [SnapTrade::Model401FailedRequestResponse](docs/Model401FailedRequestResponse.md)
|
136
136
|
- [SnapTrade::Model403FailedRequestResponse](docs/Model403FailedRequestResponse.md)
|
137
137
|
- [SnapTrade::Model404FailedRequestResponse](docs/Model404FailedRequestResponse.md)
|
138
|
+
- [SnapTrade::Model500UnexpectedExceptionResponse](docs/Model500UnexpectedExceptionResponse.md)
|
138
139
|
- [SnapTrade::ModelAssetClass](docs/ModelAssetClass.md)
|
139
140
|
- [SnapTrade::ModelAssetClassDetails](docs/ModelAssetClassDetails.md)
|
140
141
|
- [SnapTrade::ModelAssetClassTarget](docs/ModelAssetClassTarget.md)
|
@@ -9,7 +9,7 @@ All URIs are relative to *https://api.snaptrade.com/api/v1*
|
|
9
9
|
| [**get_user_account_details**](AccountInformationApi.md#get_user_account_details) | **GET** /accounts/{accountId} | Return details of a specific investment account |
|
10
10
|
| [**get_user_account_orders**](AccountInformationApi.md#get_user_account_orders) | **GET** /accounts/{accountId}/orders | Get history of orders placed in account |
|
11
11
|
| [**get_user_account_positions**](AccountInformationApi.md#get_user_account_positions) | **GET** /accounts/{accountId}/positions | List account positions |
|
12
|
-
| [**get_user_holdings**](AccountInformationApi.md#get_user_holdings) | **GET** /accounts/{accountId}/holdings | List balances, positions and orders for the specified account
|
12
|
+
| [**get_user_holdings**](AccountInformationApi.md#get_user_holdings) | **GET** /accounts/{accountId}/holdings | List balances, positions and orders for the specified account |
|
13
13
|
| [**list_user_accounts**](AccountInformationApi.md#list_user_accounts) | **GET** /accounts | List accounts |
|
14
14
|
| [**update_user_account**](AccountInformationApi.md#update_user_account) | **PUT** /accounts/{accountId} | Update details of an investment account |
|
15
15
|
|
@@ -82,6 +82,8 @@ end
|
|
82
82
|
|
83
83
|
List account balances
|
84
84
|
|
85
|
+
A list of account balances for the specified account (one per currency that the account holds).
|
86
|
+
|
85
87
|
### Example
|
86
88
|
|
87
89
|
```ruby
|
@@ -212,6 +214,8 @@ end
|
|
212
214
|
|
213
215
|
Get history of orders placed in account
|
214
216
|
|
217
|
+
Fetch all recent orders from a user's account.
|
218
|
+
|
215
219
|
### Example
|
216
220
|
|
217
221
|
```ruby
|
@@ -345,7 +349,7 @@ end
|
|
345
349
|
|
346
350
|
## get_user_holdings
|
347
351
|
|
348
|
-
List balances, positions and orders for the specified account
|
352
|
+
List balances, positions and orders for the specified account
|
349
353
|
|
350
354
|
### Example
|
351
355
|
|
@@ -360,7 +364,7 @@ user_id = "John.doe@snaptrade.com"
|
|
360
364
|
user_secret = "USERSECRET123"
|
361
365
|
|
362
366
|
begin
|
363
|
-
# List balances, positions and orders for the specified account
|
367
|
+
# List balances, positions and orders for the specified account
|
364
368
|
result = SnapTrade::AccountInformation.get_user_holdings(
|
365
369
|
account_id: account_id,
|
366
370
|
user_id: user_id,
|
@@ -382,7 +386,7 @@ user_id = "John.doe@snaptrade.com"
|
|
382
386
|
user_secret = "USERSECRET123"
|
383
387
|
|
384
388
|
begin
|
385
|
-
# List balances, positions and orders for the specified account
|
389
|
+
# List balances, positions and orders for the specified account
|
386
390
|
data, status_code, headers, response = SnapTrade::AccountInformation.get_user_holdings_with_http_info(
|
387
391
|
account_id: account_id,
|
388
392
|
user_id: user_id,
|
data/docs/AuthenticationApi.md
CHANGED
@@ -14,6 +14,8 @@ All URIs are relative to *https://api.snaptrade.com/api/v1*
|
|
14
14
|
|
15
15
|
Delete SnapTrade user
|
16
16
|
|
17
|
+
Deletes a user you've registered over the SnapTrade API, and any data associated with them or their investment accounts.
|
18
|
+
|
17
19
|
### Example
|
18
20
|
|
19
21
|
```ruby
|
@@ -129,6 +131,8 @@ end
|
|
129
131
|
|
130
132
|
List SnapTrade users
|
131
133
|
|
134
|
+
Returns a list of users you've registered over the SnapTrade API.
|
135
|
+
|
132
136
|
### Example
|
133
137
|
|
134
138
|
```ruby
|
@@ -176,6 +180,8 @@ This endpoint does not need any parameter.
|
|
176
180
|
|
177
181
|
Login user & generate connection link
|
178
182
|
|
183
|
+
Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account.
|
184
|
+
|
179
185
|
### Example
|
180
186
|
|
181
187
|
```ruby
|
@@ -266,13 +272,11 @@ SnapTrade.client_id = "YOUR_CLIENT_ID"
|
|
266
272
|
SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
|
267
273
|
|
268
274
|
user_id = "snaptrade-user-123"
|
269
|
-
rsa_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC7vbqajDw4o6gJy8UtmIbkcpnkO3Kwc4qsEnSZp/TR+fQi62F79RHWmwKOtFmwteURgLbj7D/WGuNLGOfa/2vse3G2eHnHl5CB8ruRX9fBl/KgwCVr2JaEuUm66bBQeP5XeBotdR4cvX38uPYivCDdPjJ1QWPdspTBKcxeFbccDw=="
|
270
275
|
|
271
276
|
begin
|
272
277
|
# Create SnapTrade user
|
273
278
|
result = SnapTrade::Authentication.register_snap_trade_user(
|
274
279
|
user_id: user_id,
|
275
|
-
rsa_public_key: rsa_public_key,
|
276
280
|
)
|
277
281
|
p result
|
278
282
|
rescue SnapTrade::ApiError => e
|
@@ -286,13 +290,11 @@ This returns an Array which contains the response data, status code and headers.
|
|
286
290
|
|
287
291
|
```ruby
|
288
292
|
user_id = "snaptrade-user-123"
|
289
|
-
rsa_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC7vbqajDw4o6gJy8UtmIbkcpnkO3Kwc4qsEnSZp/TR+fQi62F79RHWmwKOtFmwteURgLbj7D/WGuNLGOfa/2vse3G2eHnHl5CB8ruRX9fBl/KgwCVr2JaEuUm66bBQeP5XeBotdR4cvX38uPYivCDdPjJ1QWPdspTBKcxeFbccDw=="
|
290
293
|
|
291
294
|
begin
|
292
295
|
# Create SnapTrade user
|
293
296
|
data, status_code, headers, response = SnapTrade::Authentication.register_snap_trade_user_with_http_info(
|
294
297
|
user_id: user_id,
|
295
|
-
rsa_public_key: rsa_public_key,
|
296
298
|
)
|
297
299
|
p status_code # => 2xx
|
298
300
|
p headers # => { ... }
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# SnapTrade::Model500UnexpectedExceptionResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **detail** | **Object** | | [optional] |
|
8
|
+
| **status_code** | **Object** | | [optional] |
|
9
|
+
| **code** | **Object** | | [optional] |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'snaptrade'
|
15
|
+
|
16
|
+
instance = SnapTrade::Model500UnexpectedExceptionResponse.new(
|
17
|
+
detail: Encountered an unexpected exception.,
|
18
|
+
status_code: 500,
|
19
|
+
code: 1000
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
data/docs/ReferenceDataApi.md
CHANGED
@@ -6,7 +6,7 @@ All URIs are relative to *https://api.snaptrade.com/api/v1*
|
|
6
6
|
| ------ | ------------ | ----------- |
|
7
7
|
| [**get_currency_exchange_rate_pair**](ReferenceDataApi.md#get_currency_exchange_rate_pair) | **GET** /currencies/rates/{currencyPair} | Return the exchange rate of a currency pair |
|
8
8
|
| [**get_partner_info**](ReferenceDataApi.md#get_partner_info) | **GET** /snapTrade/partners | Get metadata related to Snaptrade partner |
|
9
|
-
| [**get_security_types**](ReferenceDataApi.md#get_security_types) | **GET** /securityTypes | List of all security types
|
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
12
|
| [**get_symbols_by_ticker**](ReferenceDataApi.md#get_symbols_by_ticker) | **GET** /symbols/{ticker} | Get details of a symbol by the ticker |
|
@@ -120,7 +120,9 @@ This endpoint does not need any parameter.
|
|
120
120
|
|
121
121
|
## get_security_types
|
122
122
|
|
123
|
-
List of all security types
|
123
|
+
List of all security types
|
124
|
+
|
125
|
+
List security types available on SnapTrade.
|
124
126
|
|
125
127
|
### Example
|
126
128
|
|
@@ -132,7 +134,7 @@ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
|
|
132
134
|
|
133
135
|
|
134
136
|
begin
|
135
|
-
# List of all security types
|
137
|
+
# List of all security types
|
136
138
|
result = SnapTrade::ReferenceData.get_security_types
|
137
139
|
p result
|
138
140
|
rescue SnapTrade::ApiError => e
|
@@ -147,7 +149,7 @@ This returns an Array which contains the response data, status code and headers.
|
|
147
149
|
```ruby
|
148
150
|
|
149
151
|
begin
|
150
|
-
# List of all security types
|
152
|
+
# List of all security types
|
151
153
|
data, status_code, headers, response = SnapTrade::ReferenceData.get_security_types_with_http_info
|
152
154
|
p status_code # => 2xx
|
153
155
|
p headers # => { ... }
|
@@ -4,10 +4,10 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **broker** | **String** |
|
8
|
-
| **immediate_redirect** | **Boolean** |
|
9
|
-
| **custom_redirect** | **String** |
|
10
|
-
| **reconnect** | **String** |
|
7
|
+
| **broker** | **String** | Slug of the brokerage to connect the user to | [optional] |
|
8
|
+
| **immediate_redirect** | **Boolean** | When set to True, user will be redirected back to the partner's site instead of the connection portal | [optional] |
|
9
|
+
| **custom_redirect** | **String** | URL to redirect the user to after the user connects their brokerage account | [optional] |
|
10
|
+
| **reconnect** | **String** | The UUID of the brokerage connection to be reconnected | [optional] |
|
11
11
|
| **connection_type** | [**ConnectionType**](ConnectionType.md) | | [optional] |
|
12
12
|
|
13
13
|
## Example
|
@@ -5,7 +5,6 @@
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **user_id** | **String** | SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user | [optional] |
|
8
|
-
| **rsa_public_key** | **String** | Open SSH RSA public key | [optional] |
|
9
8
|
|
10
9
|
## Example
|
11
10
|
|
@@ -13,8 +12,7 @@
|
|
13
12
|
require 'snaptrade'
|
14
13
|
|
15
14
|
instance = SnapTrade::SnapTradeRegisterUserRequestBody.new(
|
16
|
-
user_id: snaptrade-user-123
|
17
|
-
rsa_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC7vbqajDw4o6gJy8UtmIbkcpnkO3Kwc4qsEnSZp/TR+fQi62F79RHWmwKOtFmwteURgLbj7D/WGuNLGOfa/2vse3G2eHnHl5CB8ruRX9fBl/KgwCVr2JaEuUm66bBQeP5XeBotdR4cvX38uPYivCDdPjJ1QWPdspTBKcxeFbccDw==
|
15
|
+
user_id: snaptrade-user-123
|
18
16
|
)
|
19
17
|
```
|
20
18
|
|
@@ -11,7 +11,7 @@ All URIs are relative to *https://api.snaptrade.com/api/v1*
|
|
11
11
|
|
12
12
|
Get transaction history for a user
|
13
13
|
|
14
|
-
Returns activities (transactions) for a user. Specifing start and end date is highly recommended for
|
14
|
+
Returns activities (transactions) for a user. Specifing start and end date is highly recommended for better performance
|
15
15
|
|
16
16
|
### Example
|
17
17
|
|
@@ -113,6 +113,7 @@ module SnapTrade
|
|
113
113
|
|
114
114
|
|
115
115
|
# List account balances
|
116
|
+
# A list of account balances for the specified account (one per currency that the account holds).
|
116
117
|
# @param user_id [String]
|
117
118
|
# @param user_secret [String]
|
118
119
|
# @param account_id [String] The ID of the account to get balances.
|
@@ -123,6 +124,7 @@ module SnapTrade
|
|
123
124
|
end
|
124
125
|
|
125
126
|
# List account balances
|
127
|
+
# A list of account balances for the specified account (one per currency that the account holds).
|
126
128
|
# @param user_id [String]
|
127
129
|
# @param user_secret [String]
|
128
130
|
# @param account_id [String] The ID of the account to get balances.
|
@@ -132,6 +134,7 @@ module SnapTrade
|
|
132
134
|
end
|
133
135
|
|
134
136
|
# List account balances
|
137
|
+
# A list of account balances for the specified account (one per currency that the account holds).
|
135
138
|
# @param user_id [String]
|
136
139
|
# @param user_secret [String]
|
137
140
|
# @param account_id [String] The ID of the account to get balances.
|
@@ -143,6 +146,7 @@ module SnapTrade
|
|
143
146
|
end
|
144
147
|
|
145
148
|
# List account balances
|
149
|
+
# A list of account balances for the specified account (one per currency that the account holds).
|
146
150
|
# @param user_id [String]
|
147
151
|
# @param user_secret [String]
|
148
152
|
# @param account_id [String] The ID of the account to get balances.
|
@@ -303,6 +307,7 @@ module SnapTrade
|
|
303
307
|
|
304
308
|
|
305
309
|
# Get history of orders placed in account
|
310
|
+
# Fetch all recent orders from a user's account.
|
306
311
|
# @param user_id [String]
|
307
312
|
# @param user_secret [String]
|
308
313
|
# @param account_id [String] The ID of the account to get orders.
|
@@ -315,6 +320,7 @@ module SnapTrade
|
|
315
320
|
end
|
316
321
|
|
317
322
|
# Get history of orders placed in account
|
323
|
+
# Fetch all recent orders from a user's account.
|
318
324
|
# @param user_id [String]
|
319
325
|
# @param user_secret [String]
|
320
326
|
# @param account_id [String] The ID of the account to get orders.
|
@@ -326,6 +332,7 @@ module SnapTrade
|
|
326
332
|
end
|
327
333
|
|
328
334
|
# Get history of orders placed in account
|
335
|
+
# Fetch all recent orders from a user's account.
|
329
336
|
# @param user_id [String]
|
330
337
|
# @param user_secret [String]
|
331
338
|
# @param account_id [String] The ID of the account to get orders.
|
@@ -338,6 +345,7 @@ module SnapTrade
|
|
338
345
|
end
|
339
346
|
|
340
347
|
# Get history of orders placed in account
|
348
|
+
# Fetch all recent orders from a user's account.
|
341
349
|
# @param user_id [String]
|
342
350
|
# @param user_secret [String]
|
343
351
|
# @param account_id [String] The ID of the account to get orders.
|
@@ -503,7 +511,7 @@ module SnapTrade
|
|
503
511
|
end
|
504
512
|
|
505
513
|
|
506
|
-
# List balances, positions and orders for the specified account
|
514
|
+
# List balances, positions and orders for the specified account
|
507
515
|
# @param account_id [String] The ID of the account to fetch holdings for.
|
508
516
|
# @param user_id [String]
|
509
517
|
# @param user_secret [String]
|
@@ -513,7 +521,7 @@ module SnapTrade
|
|
513
521
|
data
|
514
522
|
end
|
515
523
|
|
516
|
-
# List balances, positions and orders for the specified account
|
524
|
+
# List balances, positions and orders for the specified account
|
517
525
|
# @param account_id [String] The ID of the account to fetch holdings for.
|
518
526
|
# @param user_id [String]
|
519
527
|
# @param user_secret [String]
|
@@ -522,7 +530,7 @@ module SnapTrade
|
|
522
530
|
get_user_holdings_with_http_info_impl(account_id, user_id, user_secret, extra)
|
523
531
|
end
|
524
532
|
|
525
|
-
# List balances, positions and orders for the specified account
|
533
|
+
# List balances, positions and orders for the specified account
|
526
534
|
# @param account_id [String] The ID of the account to fetch holdings for.
|
527
535
|
# @param user_id [String]
|
528
536
|
# @param user_secret [String]
|
@@ -533,7 +541,7 @@ module SnapTrade
|
|
533
541
|
data
|
534
542
|
end
|
535
543
|
|
536
|
-
# List balances, positions and orders for the specified account
|
544
|
+
# List balances, positions and orders for the specified account
|
537
545
|
# @param account_id [String] The ID of the account to fetch holdings for.
|
538
546
|
# @param user_id [String]
|
539
547
|
# @param user_secret [String]
|
@@ -19,6 +19,7 @@ module SnapTrade
|
|
19
19
|
end
|
20
20
|
|
21
21
|
# Delete SnapTrade user
|
22
|
+
# Deletes a user you've registered over the SnapTrade API, and any data associated with them or their investment accounts.
|
22
23
|
# @param user_id [String]
|
23
24
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
24
25
|
def delete_snap_trade_user(user_id:, extra: {})
|
@@ -27,6 +28,7 @@ module SnapTrade
|
|
27
28
|
end
|
28
29
|
|
29
30
|
# Delete SnapTrade user
|
31
|
+
# Deletes a user you've registered over the SnapTrade API, and any data associated with them or their investment accounts.
|
30
32
|
# @param user_id [String]
|
31
33
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
32
34
|
def delete_snap_trade_user_with_http_info(user_id:, extra: {})
|
@@ -34,6 +36,7 @@ module SnapTrade
|
|
34
36
|
end
|
35
37
|
|
36
38
|
# Delete SnapTrade user
|
39
|
+
# Deletes a user you've registered over the SnapTrade API, and any data associated with them or their investment accounts.
|
37
40
|
# @param user_id [String]
|
38
41
|
# @param [Hash] opts the optional parameters
|
39
42
|
# @return [DeleteUserResponse]
|
@@ -43,6 +46,7 @@ module SnapTrade
|
|
43
46
|
end
|
44
47
|
|
45
48
|
# Delete SnapTrade user
|
49
|
+
# Deletes a user you've registered over the SnapTrade API, and any data associated with them or their investment accounts.
|
46
50
|
# @param user_id [String]
|
47
51
|
# @param [Hash] opts the optional parameters
|
48
52
|
# @return [Array<(DeleteUserResponse, Integer, Hash)>] DeleteUserResponse data, response status code and response headers
|
@@ -184,6 +188,7 @@ module SnapTrade
|
|
184
188
|
|
185
189
|
|
186
190
|
# List SnapTrade users
|
191
|
+
# Returns a list of users you've registered over the SnapTrade API.
|
187
192
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
188
193
|
def list_snap_trade_users(extra: {})
|
189
194
|
data, _status_code, _headers = list_snap_trade_users_with_http_info_impl(extra)
|
@@ -191,12 +196,14 @@ module SnapTrade
|
|
191
196
|
end
|
192
197
|
|
193
198
|
# List SnapTrade users
|
199
|
+
# Returns a list of users you've registered over the SnapTrade API.
|
194
200
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
195
201
|
def list_snap_trade_users_with_http_info(extra: {})
|
196
202
|
list_snap_trade_users_with_http_info_impl(extra)
|
197
203
|
end
|
198
204
|
|
199
205
|
# List SnapTrade users
|
206
|
+
# Returns a list of users you've registered over the SnapTrade API.
|
200
207
|
# @param [Hash] opts the optional parameters
|
201
208
|
# @return [Array<String>]
|
202
209
|
def list_snap_trade_users_impl(opts = {})
|
@@ -205,6 +212,7 @@ module SnapTrade
|
|
205
212
|
end
|
206
213
|
|
207
214
|
# List SnapTrade users
|
215
|
+
# Returns a list of users you've registered over the SnapTrade API.
|
208
216
|
# @param [Hash] opts the optional parameters
|
209
217
|
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
210
218
|
def list_snap_trade_users_with_http_info_impl(opts = {})
|
@@ -253,12 +261,13 @@ module SnapTrade
|
|
253
261
|
|
254
262
|
|
255
263
|
# Login user & generate connection link
|
264
|
+
# Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account.
|
256
265
|
# @param user_id [String]
|
257
266
|
# @param user_secret [String]
|
258
|
-
# @param broker [String]
|
259
|
-
# @param immediate_redirect [Boolean]
|
260
|
-
# @param custom_redirect [String]
|
261
|
-
# @param reconnect [String]
|
267
|
+
# @param broker [String] Slug of the brokerage to connect the user to
|
268
|
+
# @param immediate_redirect [Boolean] When set to True, user will be redirected back to the partner's site instead of the connection portal
|
269
|
+
# @param custom_redirect [String] URL to redirect the user to after the user connects their brokerage account
|
270
|
+
# @param reconnect [String] The UUID of the brokerage connection to be reconnected
|
262
271
|
# @param connection_type [ConnectionType]
|
263
272
|
# @param body [SnapTradeLoginUserRequestBody]
|
264
273
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
@@ -275,12 +284,13 @@ module SnapTrade
|
|
275
284
|
end
|
276
285
|
|
277
286
|
# Login user & generate connection link
|
287
|
+
# Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account.
|
278
288
|
# @param user_id [String]
|
279
289
|
# @param user_secret [String]
|
280
|
-
# @param broker [String]
|
281
|
-
# @param immediate_redirect [Boolean]
|
282
|
-
# @param custom_redirect [String]
|
283
|
-
# @param reconnect [String]
|
290
|
+
# @param broker [String] Slug of the brokerage to connect the user to
|
291
|
+
# @param immediate_redirect [Boolean] When set to True, user will be redirected back to the partner's site instead of the connection portal
|
292
|
+
# @param custom_redirect [String] URL to redirect the user to after the user connects their brokerage account
|
293
|
+
# @param reconnect [String] The UUID of the brokerage connection to be reconnected
|
284
294
|
# @param connection_type [ConnectionType]
|
285
295
|
# @param body [SnapTradeLoginUserRequestBody]
|
286
296
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
@@ -296,6 +306,7 @@ module SnapTrade
|
|
296
306
|
end
|
297
307
|
|
298
308
|
# Login user & generate connection link
|
309
|
+
# Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account.
|
299
310
|
# @param user_id [String]
|
300
311
|
# @param user_secret [String]
|
301
312
|
# @param [Hash] opts the optional parameters
|
@@ -307,6 +318,7 @@ module SnapTrade
|
|
307
318
|
end
|
308
319
|
|
309
320
|
# Login user & generate connection link
|
321
|
+
# Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account.
|
310
322
|
# @param user_id [String]
|
311
323
|
# @param user_secret [String]
|
312
324
|
# @param [Hash] opts the optional parameters
|
@@ -374,13 +386,11 @@ module SnapTrade
|
|
374
386
|
|
375
387
|
# Create SnapTrade user
|
376
388
|
# @param user_id [String] SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user
|
377
|
-
# @param rsa_public_key [String] Open SSH RSA public key
|
378
389
|
# @param body [SnapTradeRegisterUserRequestBody]
|
379
390
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
380
|
-
def register_snap_trade_user(user_id: SENTINEL,
|
391
|
+
def register_snap_trade_user(user_id: SENTINEL, extra: {})
|
381
392
|
_body = {}
|
382
393
|
_body[:userId] = user_id if user_id != SENTINEL
|
383
|
-
_body[:rsaPublicKey] = rsa_public_key if rsa_public_key != SENTINEL
|
384
394
|
snap_trade_register_user_request_body = _body
|
385
395
|
data, _status_code, _headers = register_snap_trade_user_with_http_info_impl(snap_trade_register_user_request_body, extra)
|
386
396
|
data
|
@@ -388,13 +398,11 @@ module SnapTrade
|
|
388
398
|
|
389
399
|
# Create SnapTrade user
|
390
400
|
# @param user_id [String] SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user
|
391
|
-
# @param rsa_public_key [String] Open SSH RSA public key
|
392
401
|
# @param body [SnapTradeRegisterUserRequestBody]
|
393
402
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
394
|
-
def register_snap_trade_user_with_http_info(user_id: SENTINEL,
|
403
|
+
def register_snap_trade_user_with_http_info(user_id: SENTINEL, extra: {})
|
395
404
|
_body = {}
|
396
405
|
_body[:userId] = user_id if user_id != SENTINEL
|
397
|
-
_body[:rsaPublicKey] = rsa_public_key if rsa_public_key != SENTINEL
|
398
406
|
snap_trade_register_user_request_body = _body
|
399
407
|
register_snap_trade_user_with_http_info_impl(snap_trade_register_user_request_body, extra)
|
400
408
|
end
|
@@ -164,20 +164,23 @@ module SnapTrade
|
|
164
164
|
end
|
165
165
|
|
166
166
|
|
167
|
-
# List of all security types
|
167
|
+
# List of all security types
|
168
|
+
# List security types available on SnapTrade.
|
168
169
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
169
170
|
def get_security_types(extra: {})
|
170
171
|
data, _status_code, _headers = get_security_types_with_http_info_impl(extra)
|
171
172
|
data
|
172
173
|
end
|
173
174
|
|
174
|
-
# List of all security types
|
175
|
+
# List of all security types
|
176
|
+
# List security types available on SnapTrade.
|
175
177
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
176
178
|
def get_security_types_with_http_info(extra: {})
|
177
179
|
get_security_types_with_http_info_impl(extra)
|
178
180
|
end
|
179
181
|
|
180
|
-
# List of all security types
|
182
|
+
# List of all security types
|
183
|
+
# List security types available on SnapTrade.
|
181
184
|
# @param [Hash] opts the optional parameters
|
182
185
|
# @return [Array<SecurityType>]
|
183
186
|
def get_security_types_impl(opts = {})
|
@@ -185,7 +188,8 @@ module SnapTrade
|
|
185
188
|
data
|
186
189
|
end
|
187
190
|
|
188
|
-
# List of all security types
|
191
|
+
# List of all security types
|
192
|
+
# List security types available on SnapTrade.
|
189
193
|
# @param [Hash] opts the optional parameters
|
190
194
|
# @return [Array<(Array<SecurityType>, Integer, Hash)>] Array<SecurityType> data, response status code and response headers
|
191
195
|
def get_security_types_with_http_info_impl(opts = {})
|
@@ -19,7 +19,7 @@ module SnapTrade
|
|
19
19
|
end
|
20
20
|
|
21
21
|
# Get transaction history for a user
|
22
|
-
# Returns activities (transactions) for a user. Specifing start and end date is highly recommended for
|
22
|
+
# Returns activities (transactions) for a user. Specifing start and end date is highly recommended for better performance
|
23
23
|
# @param user_id [String]
|
24
24
|
# @param user_secret [String]
|
25
25
|
# @param start_date [Date]
|
@@ -39,7 +39,7 @@ module SnapTrade
|
|
39
39
|
end
|
40
40
|
|
41
41
|
# Get transaction history for a user
|
42
|
-
# Returns activities (transactions) for a user. Specifing start and end date is highly recommended for
|
42
|
+
# Returns activities (transactions) for a user. Specifing start and end date is highly recommended for better performance
|
43
43
|
# @param user_id [String]
|
44
44
|
# @param user_secret [String]
|
45
45
|
# @param start_date [Date]
|
@@ -58,7 +58,7 @@ module SnapTrade
|
|
58
58
|
end
|
59
59
|
|
60
60
|
# Get transaction history for a user
|
61
|
-
# Returns activities (transactions) for a user. Specifing start and end date is highly recommended for
|
61
|
+
# Returns activities (transactions) for a user. Specifing start and end date is highly recommended for better performance
|
62
62
|
# @param user_id [String]
|
63
63
|
# @param user_secret [String]
|
64
64
|
# @param [Hash] opts the optional parameters
|
@@ -74,7 +74,7 @@ module SnapTrade
|
|
74
74
|
end
|
75
75
|
|
76
76
|
# Get transaction history for a user
|
77
|
-
# Returns activities (transactions) for a user. Specifing start and end date is highly recommended for
|
77
|
+
# Returns activities (transactions) for a user. Specifing start and end date is highly recommended for better performance
|
78
78
|
# @param user_id [String]
|
79
79
|
# @param user_secret [String]
|
80
80
|
# @param [Hash] opts the optional parameters
|
@@ -0,0 +1,239 @@
|
|
1
|
+
=begin
|
2
|
+
#SnapTrade
|
3
|
+
|
4
|
+
#Connect brokerage accounts to your app for live positions and trading
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: api@snaptrade.com
|
8
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'date'
|
12
|
+
require 'time'
|
13
|
+
|
14
|
+
module SnapTrade
|
15
|
+
# Example for a response that failed for unexpected reasons
|
16
|
+
class Model500UnexpectedExceptionResponse
|
17
|
+
attr_accessor :detail
|
18
|
+
|
19
|
+
attr_accessor :status_code
|
20
|
+
|
21
|
+
attr_accessor :code
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'detail' => :'detail',
|
27
|
+
:'status_code' => :'status_code',
|
28
|
+
:'code' => :'code'
|
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
|
+
:'detail' => :'Object',
|
41
|
+
:'status_code' => :'Object',
|
42
|
+
:'code' => :'Object'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# List of attributes with nullable: true
|
47
|
+
def self.openapi_nullable
|
48
|
+
Set.new([
|
49
|
+
:'detail',
|
50
|
+
:'status_code',
|
51
|
+
:'code'
|
52
|
+
])
|
53
|
+
end
|
54
|
+
|
55
|
+
# Initializes the object
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
57
|
+
def initialize(attributes = {})
|
58
|
+
if (!attributes.is_a?(Hash))
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::Model500UnexpectedExceptionResponse` initialize method"
|
60
|
+
end
|
61
|
+
|
62
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
64
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::Model500UnexpectedExceptionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
66
|
+
end
|
67
|
+
h[k.to_sym] = v
|
68
|
+
}
|
69
|
+
|
70
|
+
if attributes.key?(:'detail')
|
71
|
+
self.detail = attributes[:'detail']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:'status_code')
|
75
|
+
self.status_code = attributes[:'status_code']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:'code')
|
79
|
+
self.code = attributes[:'code']
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
84
|
+
# @return Array for valid properties with the reasons
|
85
|
+
def list_invalid_properties
|
86
|
+
invalid_properties = Array.new
|
87
|
+
invalid_properties
|
88
|
+
end
|
89
|
+
|
90
|
+
# Check to see if the all the properties in the model are valid
|
91
|
+
# @return true if the model is valid
|
92
|
+
def valid?
|
93
|
+
true
|
94
|
+
end
|
95
|
+
|
96
|
+
# Checks equality by comparing each attribute.
|
97
|
+
# @param [Object] Object to be compared
|
98
|
+
def ==(o)
|
99
|
+
return true if self.equal?(o)
|
100
|
+
self.class == o.class &&
|
101
|
+
detail == o.detail &&
|
102
|
+
status_code == o.status_code &&
|
103
|
+
code == o.code
|
104
|
+
end
|
105
|
+
|
106
|
+
# @see the `==` method
|
107
|
+
# @param [Object] Object to be compared
|
108
|
+
def eql?(o)
|
109
|
+
self == o
|
110
|
+
end
|
111
|
+
|
112
|
+
# Calculates hash code according to all attributes.
|
113
|
+
# @return [Integer] Hash code
|
114
|
+
def hash
|
115
|
+
[detail, status_code, code].hash
|
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 self.build_from_hash(attributes)
|
122
|
+
new.build_from_hash(attributes)
|
123
|
+
end
|
124
|
+
|
125
|
+
# Builds the object from hash
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
+
# @return [Object] Returns the model itself
|
128
|
+
def build_from_hash(attributes)
|
129
|
+
return nil unless attributes.is_a?(Hash)
|
130
|
+
attributes = attributes.transform_keys(&:to_sym)
|
131
|
+
self.class.openapi_types.each_pair do |key, type|
|
132
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
133
|
+
self.send("#{key}=", nil)
|
134
|
+
elsif type =~ /\AArray<(.*)>/i
|
135
|
+
# check to ensure the input is an array given that the attribute
|
136
|
+
# is documented as an array but the input is not
|
137
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
138
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
139
|
+
end
|
140
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
141
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
self
|
146
|
+
end
|
147
|
+
|
148
|
+
# Deserializes the data based on type
|
149
|
+
# @param string type Data type
|
150
|
+
# @param string value Value to be deserialized
|
151
|
+
# @return [Object] Deserialized data
|
152
|
+
def _deserialize(type, value)
|
153
|
+
case type.to_sym
|
154
|
+
when :Time
|
155
|
+
Time.parse(value)
|
156
|
+
when :Date
|
157
|
+
Date.parse(value)
|
158
|
+
when :String
|
159
|
+
value.to_s
|
160
|
+
when :Integer
|
161
|
+
value.to_i
|
162
|
+
when :Float
|
163
|
+
value.to_f
|
164
|
+
when :Boolean
|
165
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
166
|
+
true
|
167
|
+
else
|
168
|
+
false
|
169
|
+
end
|
170
|
+
when :Object
|
171
|
+
# generic object (usually a Hash), return directly
|
172
|
+
value
|
173
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
174
|
+
inner_type = Regexp.last_match[:inner_type]
|
175
|
+
value.map { |v| _deserialize(inner_type, v) }
|
176
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
177
|
+
k_type = Regexp.last_match[:k_type]
|
178
|
+
v_type = Regexp.last_match[:v_type]
|
179
|
+
{}.tap do |hash|
|
180
|
+
value.each do |k, v|
|
181
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
182
|
+
end
|
183
|
+
end
|
184
|
+
else # model
|
185
|
+
# models (e.g. Pet) or oneOf
|
186
|
+
klass = SnapTrade.const_get(type)
|
187
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the string representation of the object
|
192
|
+
# @return [String] String presentation of the object
|
193
|
+
def to_s
|
194
|
+
to_hash.to_s
|
195
|
+
end
|
196
|
+
|
197
|
+
# to_body is an alias to to_hash (backward compatibility)
|
198
|
+
# @return [Hash] Returns the object in the form of hash
|
199
|
+
def to_body
|
200
|
+
to_hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Returns the object in the form of hash
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_hash
|
206
|
+
hash = {}
|
207
|
+
self.class.attribute_map.each_pair do |attr, param|
|
208
|
+
value = self.send(attr)
|
209
|
+
if value.nil?
|
210
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
211
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
212
|
+
end
|
213
|
+
|
214
|
+
hash[param] = _to_hash(value)
|
215
|
+
end
|
216
|
+
hash
|
217
|
+
end
|
218
|
+
|
219
|
+
# Outputs non-array value in the form of hash
|
220
|
+
# For object, use to_hash. Otherwise, just return the value
|
221
|
+
# @param [Object] value Any valid value
|
222
|
+
# @return [Hash] Returns the value in the form of hash
|
223
|
+
def _to_hash(value)
|
224
|
+
if value.is_a?(Array)
|
225
|
+
value.compact.map { |v| _to_hash(v) }
|
226
|
+
elsif value.is_a?(Hash)
|
227
|
+
{}.tap do |hash|
|
228
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
229
|
+
end
|
230
|
+
elsif value.respond_to? :to_hash
|
231
|
+
value.to_hash
|
232
|
+
else
|
233
|
+
value
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
end
|
238
|
+
|
239
|
+
end
|
@@ -14,12 +14,16 @@ require 'time'
|
|
14
14
|
module SnapTrade
|
15
15
|
# Data to login a user via SnapTrade Partner
|
16
16
|
class SnapTradeLoginUserRequestBody
|
17
|
+
# Slug of the brokerage to connect the user to
|
17
18
|
attr_accessor :broker
|
18
19
|
|
20
|
+
# When set to True, user will be redirected back to the partner's site instead of the connection portal
|
19
21
|
attr_accessor :immediate_redirect
|
20
22
|
|
23
|
+
# URL to redirect the user to after the user connects their brokerage account
|
21
24
|
attr_accessor :custom_redirect
|
22
25
|
|
26
|
+
# The UUID of the brokerage connection to be reconnected
|
23
27
|
attr_accessor :reconnect
|
24
28
|
|
25
29
|
attr_accessor :connection_type
|
@@ -17,14 +17,10 @@ module SnapTrade
|
|
17
17
|
# SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user
|
18
18
|
attr_accessor :user_id
|
19
19
|
|
20
|
-
# Open SSH RSA public key
|
21
|
-
attr_accessor :rsa_public_key
|
22
|
-
|
23
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
24
21
|
def self.attribute_map
|
25
22
|
{
|
26
|
-
:'user_id' => :'userId'
|
27
|
-
:'rsa_public_key' => :'rsaPublicKey'
|
23
|
+
:'user_id' => :'userId'
|
28
24
|
}
|
29
25
|
end
|
30
26
|
|
@@ -36,8 +32,7 @@ module SnapTrade
|
|
36
32
|
# Attribute type mapping.
|
37
33
|
def self.openapi_types
|
38
34
|
{
|
39
|
-
:'user_id' => :'String'
|
40
|
-
:'rsa_public_key' => :'String'
|
35
|
+
:'user_id' => :'String'
|
41
36
|
}
|
42
37
|
end
|
43
38
|
|
@@ -65,10 +60,6 @@ module SnapTrade
|
|
65
60
|
if attributes.key?(:'user_id')
|
66
61
|
self.user_id = attributes[:'user_id']
|
67
62
|
end
|
68
|
-
|
69
|
-
if attributes.key?(:'rsa_public_key')
|
70
|
-
self.rsa_public_key = attributes[:'rsa_public_key']
|
71
|
-
end
|
72
63
|
end
|
73
64
|
|
74
65
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -89,8 +80,7 @@ module SnapTrade
|
|
89
80
|
def ==(o)
|
90
81
|
return true if self.equal?(o)
|
91
82
|
self.class == o.class &&
|
92
|
-
user_id == o.user_id
|
93
|
-
rsa_public_key == o.rsa_public_key
|
83
|
+
user_id == o.user_id
|
94
84
|
end
|
95
85
|
|
96
86
|
# @see the `==` method
|
@@ -102,7 +92,7 @@ module SnapTrade
|
|
102
92
|
# Calculates hash code according to all attributes.
|
103
93
|
# @return [Integer] Hash code
|
104
94
|
def hash
|
105
|
-
[user_id
|
95
|
+
[user_id].hash
|
106
96
|
end
|
107
97
|
|
108
98
|
# Builds the object from hash
|
data/lib/snaptrade/version.rb
CHANGED
data/lib/snaptrade.rb
CHANGED
@@ -62,6 +62,7 @@ require 'snaptrade/models/model400_failed_request_response'
|
|
62
62
|
require 'snaptrade/models/model401_failed_request_response'
|
63
63
|
require 'snaptrade/models/model403_failed_request_response'
|
64
64
|
require 'snaptrade/models/model404_failed_request_response'
|
65
|
+
require 'snaptrade/models/model500_unexpected_exception_response'
|
65
66
|
require 'snaptrade/models/model_asset_class'
|
66
67
|
require 'snaptrade/models/model_asset_class_details'
|
67
68
|
require 'snaptrade/models/model_asset_class_target'
|
@@ -43,6 +43,7 @@ describe 'AccountInformationApi' do
|
|
43
43
|
|
44
44
|
# unit tests for get_user_account_balance
|
45
45
|
# List account balances
|
46
|
+
# A list of account balances for the specified account (one per currency that the account holds).
|
46
47
|
# @param user_id
|
47
48
|
# @param user_secret
|
48
49
|
# @param account_id The ID of the account to get balances.
|
@@ -69,6 +70,7 @@ describe 'AccountInformationApi' do
|
|
69
70
|
|
70
71
|
# unit tests for get_user_account_orders
|
71
72
|
# Get history of orders placed in account
|
73
|
+
# Fetch all recent orders from a user's account.
|
72
74
|
# @param user_id
|
73
75
|
# @param user_secret
|
74
76
|
# @param account_id The ID of the account to get orders.
|
@@ -95,7 +97,7 @@ describe 'AccountInformationApi' do
|
|
95
97
|
end
|
96
98
|
|
97
99
|
# unit tests for get_user_holdings
|
98
|
-
# List balances, positions and orders for the specified account
|
100
|
+
# List balances, positions and orders for the specified account
|
99
101
|
# @param account_id The ID of the account to fetch holdings for.
|
100
102
|
# @param user_id
|
101
103
|
# @param user_secret
|
@@ -30,6 +30,7 @@ describe 'AuthenticationApi' do
|
|
30
30
|
|
31
31
|
# unit tests for delete_snap_trade_user
|
32
32
|
# Delete SnapTrade user
|
33
|
+
# Deletes a user you've registered over the SnapTrade API, and any data associated with them or their investment accounts.
|
33
34
|
# @param user_id
|
34
35
|
# @param [Hash] opts the optional parameters
|
35
36
|
# @return [DeleteUserResponse]
|
@@ -53,6 +54,7 @@ describe 'AuthenticationApi' do
|
|
53
54
|
|
54
55
|
# unit tests for list_snap_trade_users
|
55
56
|
# List SnapTrade users
|
57
|
+
# Returns a list of users you've registered over the SnapTrade API.
|
56
58
|
# @param [Hash] opts the optional parameters
|
57
59
|
# @return [Array<String>]
|
58
60
|
describe 'list_snap_trade_users test' do
|
@@ -63,6 +65,7 @@ describe 'AuthenticationApi' do
|
|
63
65
|
|
64
66
|
# unit tests for login_snap_trade_user
|
65
67
|
# Login user & generate connection link
|
68
|
+
# Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account.
|
66
69
|
# @param user_id
|
67
70
|
# @param user_secret
|
68
71
|
# @param [Hash] opts the optional parameters
|
@@ -50,7 +50,8 @@ describe 'ReferenceDataApi' do
|
|
50
50
|
end
|
51
51
|
|
52
52
|
# unit tests for get_security_types
|
53
|
-
# List of all security types
|
53
|
+
# List of all security types
|
54
|
+
# List security types available on SnapTrade.
|
54
55
|
# @param [Hash] opts the optional parameters
|
55
56
|
# @return [Array<SecurityType>]
|
56
57
|
describe 'get_security_types test' do
|
@@ -30,7 +30,7 @@ describe 'TransactionsAndReportingApi' do
|
|
30
30
|
|
31
31
|
# unit tests for get_activities
|
32
32
|
# Get transaction history for a user
|
33
|
-
# Returns activities (transactions) for a user. Specifing start and end date is highly recommended for
|
33
|
+
# Returns activities (transactions) for a user. Specifing start and end date is highly recommended for better performance
|
34
34
|
# @param user_id
|
35
35
|
# @param user_secret
|
36
36
|
# @param [Hash] opts the optional parameters
|
@@ -0,0 +1,42 @@
|
|
1
|
+
=begin
|
2
|
+
#SnapTrade
|
3
|
+
|
4
|
+
#Connect brokerage accounts to your app for live positions and trading
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: api@snaptrade.com
|
8
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'spec_helper'
|
12
|
+
require 'json'
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
# Unit tests for SnapTrade::Model500UnexpectedExceptionResponse
|
16
|
+
describe SnapTrade::Model500UnexpectedExceptionResponse do
|
17
|
+
let(:instance) { SnapTrade::Model500UnexpectedExceptionResponse.new }
|
18
|
+
|
19
|
+
describe 'test an instance of Model500UnexpectedExceptionResponse' do
|
20
|
+
it 'should create an instance of Model500UnexpectedExceptionResponse' do
|
21
|
+
expect(instance).to be_instance_of(SnapTrade::Model500UnexpectedExceptionResponse)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
describe 'test attribute "detail"' do
|
25
|
+
it 'should work' do
|
26
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test attribute "status_code"' do
|
31
|
+
it 'should work' do
|
32
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe 'test attribute "code"' do
|
37
|
+
it 'should work' do
|
38
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -27,10 +27,4 @@ describe SnapTrade::SnapTradeRegisterUserRequestBody do
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
describe 'test attribute "rsa_public_key"' do
|
31
|
-
it 'should work' do
|
32
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
30
|
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: 1.17.
|
4
|
+
version: 1.17.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SnapTrade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -131,6 +131,7 @@ files:
|
|
131
131
|
- docs/Model401FailedRequestResponse.md
|
132
132
|
- docs/Model403FailedRequestResponse.md
|
133
133
|
- docs/Model404FailedRequestResponse.md
|
134
|
+
- docs/Model500UnexpectedExceptionResponse.md
|
134
135
|
- docs/ModelAssetClass.md
|
135
136
|
- docs/ModelAssetClassDetails.md
|
136
137
|
- docs/ModelAssetClassTarget.md
|
@@ -279,6 +280,7 @@ files:
|
|
279
280
|
- lib/snaptrade/models/model401_failed_request_response.rb
|
280
281
|
- lib/snaptrade/models/model403_failed_request_response.rb
|
281
282
|
- lib/snaptrade/models/model404_failed_request_response.rb
|
283
|
+
- lib/snaptrade/models/model500_unexpected_exception_response.rb
|
282
284
|
- lib/snaptrade/models/model_asset_class.rb
|
283
285
|
- lib/snaptrade/models/model_asset_class_details.rb
|
284
286
|
- lib/snaptrade/models/model_asset_class_target.rb
|
@@ -422,6 +424,7 @@ files:
|
|
422
424
|
- spec/models/model401_failed_request_response_spec.rb
|
423
425
|
- spec/models/model403_failed_request_response_spec.rb
|
424
426
|
- spec/models/model404_failed_request_response_spec.rb
|
427
|
+
- spec/models/model500_unexpected_exception_response_spec.rb
|
425
428
|
- spec/models/model_asset_class_details_spec.rb
|
426
429
|
- spec/models/model_asset_class_spec.rb
|
427
430
|
- spec/models/model_asset_class_target_spec.rb
|
@@ -576,6 +579,7 @@ test_files:
|
|
576
579
|
- spec/models/strategy_quotes_spec.rb
|
577
580
|
- spec/models/model_asset_class_details_spec.rb
|
578
581
|
- spec/models/manual_trade_and_impact_spec.rb
|
582
|
+
- spec/models/model500_unexpected_exception_response_spec.rb
|
579
583
|
- spec/models/brokerage_authorization_type_read_only_type_spec.rb
|
580
584
|
- spec/models/manual_trade_symbol_spec.rb
|
581
585
|
- spec/models/position_spec.rb
|