snaptrade 1.17.4 → 1.17.5
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 +2 -2
- data/docs/AccountInformationApi.md +9 -4
- data/lib/snaptrade/api/account_information_api.rb +17 -6
- data/lib/snaptrade/version.rb +1 -1
- data/spec/api/account_information_api_spec.rb +2 -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: a1819cd355ee52f0df86d45d381e9eb2c4fac4db67e1f387077217b6292a7ce4
|
4
|
+
data.tar.gz: 6098b1f89a59f9665eefbbc26cb13f697eb84b918ccdd82d49a11a5efd9270fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66cca49a69c1157dfa9f6f0578cb1a6900e2f1e0b28e7918756c10fdfc4ec231d0ce637c31acf1d4e35e4cf40ed57444c95f4534cbee8a06250a9b0f731605ee
|
7
|
+
data.tar.gz: 77b5bf192f667d6613ecc530a3e06a9422d85a88f14ce728165bd352fc1f456caf3068aa0b5aec772f9d3fe1095b145e881eab0b0564ac7ffd2482b8b9a4488f
|
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.5'
|
13
13
|
```
|
14
14
|
|
15
15
|
## Getting Started
|
@@ -46,7 +46,7 @@ Class | Method | HTTP request | Description
|
|
46
46
|
*SnapTrade::AccountInformationApi* | [**get_all_user_holdings**](docs/AccountInformationApi.md#get_all_user_holdings) | **GET** /holdings | List all accounts for the user, plus balances, positions, and orders for each account.
|
47
47
|
*SnapTrade::AccountInformationApi* | [**get_user_account_balance**](docs/AccountInformationApi.md#get_user_account_balance) | **GET** /accounts/{accountId}/balances | List account balances
|
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
|
-
*SnapTrade::AccountInformationApi* | [**get_user_account_orders**](docs/AccountInformationApi.md#get_user_account_orders) | **GET** /accounts/{accountId}/orders |
|
49
|
+
*SnapTrade::AccountInformationApi* | [**get_user_account_orders**](docs/AccountInformationApi.md#get_user_account_orders) | **GET** /accounts/{accountId}/orders | List account orders
|
50
50
|
*SnapTrade::AccountInformationApi* | [**get_user_account_positions**](docs/AccountInformationApi.md#get_user_account_positions) | **GET** /accounts/{accountId}/positions | List account positions
|
51
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
|
@@ -7,7 +7,7 @@ All URIs are relative to *https://api.snaptrade.com/api/v1*
|
|
7
7
|
| [**get_all_user_holdings**](AccountInformationApi.md#get_all_user_holdings) | **GET** /holdings | List all accounts for the user, plus balances, positions, and orders for each account. |
|
8
8
|
| [**get_user_account_balance**](AccountInformationApi.md#get_user_account_balance) | **GET** /accounts/{accountId}/balances | List account balances |
|
9
9
|
| [**get_user_account_details**](AccountInformationApi.md#get_user_account_details) | **GET** /accounts/{accountId} | Return details of a specific investment account |
|
10
|
-
| [**get_user_account_orders**](AccountInformationApi.md#get_user_account_orders) | **GET** /accounts/{accountId}/orders |
|
10
|
+
| [**get_user_account_orders**](AccountInformationApi.md#get_user_account_orders) | **GET** /accounts/{accountId}/orders | List account orders |
|
11
11
|
| [**get_user_account_positions**](AccountInformationApi.md#get_user_account_positions) | **GET** /accounts/{accountId}/positions | List account positions |
|
12
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 |
|
@@ -212,7 +212,7 @@ end
|
|
212
212
|
|
213
213
|
## get_user_account_orders
|
214
214
|
|
215
|
-
|
215
|
+
List account orders
|
216
216
|
|
217
217
|
Fetch all recent orders from a user's account.
|
218
218
|
|
@@ -228,14 +228,16 @@ user_id = "John.doe@snaptrade.com"
|
|
228
228
|
user_secret = "USERSECRET123"
|
229
229
|
account_id = "accountId_example"
|
230
230
|
state = "all"
|
231
|
+
days = 30
|
231
232
|
|
232
233
|
begin
|
233
|
-
#
|
234
|
+
# List account orders
|
234
235
|
result = SnapTrade::AccountInformation.get_user_account_orders(
|
235
236
|
user_id: user_id,
|
236
237
|
user_secret: user_secret,
|
237
238
|
account_id: account_id,
|
238
239
|
state: state,
|
240
|
+
days: days,
|
239
241
|
)
|
240
242
|
p result
|
241
243
|
rescue SnapTrade::ApiError => e
|
@@ -252,14 +254,16 @@ user_id = "John.doe@snaptrade.com"
|
|
252
254
|
user_secret = "USERSECRET123"
|
253
255
|
account_id = "accountId_example"
|
254
256
|
state = "all"
|
257
|
+
days = 30
|
255
258
|
|
256
259
|
begin
|
257
|
-
#
|
260
|
+
# List account orders
|
258
261
|
data, status_code, headers, response = SnapTrade::AccountInformation.get_user_account_orders_with_http_info(
|
259
262
|
user_id: user_id,
|
260
263
|
user_secret: user_secret,
|
261
264
|
account_id: account_id,
|
262
265
|
state: state,
|
266
|
+
days: days,
|
263
267
|
)
|
264
268
|
p status_code # => 2xx
|
265
269
|
p headers # => { ... }
|
@@ -277,6 +281,7 @@ end
|
|
277
281
|
| **user_secret** | **String** | | |
|
278
282
|
| **account_id** | **String** | The ID of the account to get orders. | |
|
279
283
|
| **state** | **String** | defaults value is set to \"all\" | [optional] |
|
284
|
+
| **days** | **Integer** | Number of days in the past to fetch the most recent orders. Defaults to the last 90 days if no value is passed in. | [optional] |
|
280
285
|
|
281
286
|
### Return type
|
282
287
|
|
@@ -306,51 +306,57 @@ module SnapTrade
|
|
306
306
|
end
|
307
307
|
|
308
308
|
|
309
|
-
#
|
309
|
+
# List account orders
|
310
310
|
# Fetch all recent orders from a user's account.
|
311
311
|
# @param user_id [String]
|
312
312
|
# @param user_secret [String]
|
313
313
|
# @param account_id [String] The ID of the account to get orders.
|
314
314
|
# @param state [String] defaults value is set to \"all\"
|
315
|
+
# @param days [Integer] Number of days in the past to fetch the most recent orders. Defaults to the last 90 days if no value is passed in.
|
315
316
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
316
|
-
def get_user_account_orders(user_id:, user_secret:, account_id:, state: SENTINEL, extra: {})
|
317
|
+
def get_user_account_orders(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {})
|
317
318
|
extra[:state] = state if state != SENTINEL
|
319
|
+
extra[:days] = days if days != SENTINEL
|
318
320
|
data, _status_code, _headers = get_user_account_orders_with_http_info_impl(user_id, user_secret, account_id, extra)
|
319
321
|
data
|
320
322
|
end
|
321
323
|
|
322
|
-
#
|
324
|
+
# List account orders
|
323
325
|
# Fetch all recent orders from a user's account.
|
324
326
|
# @param user_id [String]
|
325
327
|
# @param user_secret [String]
|
326
328
|
# @param account_id [String] The ID of the account to get orders.
|
327
329
|
# @param state [String] defaults value is set to \"all\"
|
330
|
+
# @param days [Integer] Number of days in the past to fetch the most recent orders. Defaults to the last 90 days if no value is passed in.
|
328
331
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
329
|
-
def get_user_account_orders_with_http_info(user_id:, user_secret:, account_id:, state: SENTINEL, extra: {})
|
332
|
+
def get_user_account_orders_with_http_info(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {})
|
330
333
|
extra[:state] = state if state != SENTINEL
|
334
|
+
extra[:days] = days if days != SENTINEL
|
331
335
|
get_user_account_orders_with_http_info_impl(user_id, user_secret, account_id, extra)
|
332
336
|
end
|
333
337
|
|
334
|
-
#
|
338
|
+
# List account orders
|
335
339
|
# Fetch all recent orders from a user's account.
|
336
340
|
# @param user_id [String]
|
337
341
|
# @param user_secret [String]
|
338
342
|
# @param account_id [String] The ID of the account to get orders.
|
339
343
|
# @param [Hash] opts the optional parameters
|
340
344
|
# @option opts [String] :state defaults value is set to \"all\"
|
345
|
+
# @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 90 days if no value is passed in.
|
341
346
|
# @return [Array<AccountOrderRecord>]
|
342
347
|
def get_user_account_orders_impl(user_id, user_secret, account_id, opts = {})
|
343
348
|
data, _status_code, _headers = get_user_account_orders_with_http_info(user_id, user_secret, account_id, opts)
|
344
349
|
data
|
345
350
|
end
|
346
351
|
|
347
|
-
#
|
352
|
+
# List account orders
|
348
353
|
# Fetch all recent orders from a user's account.
|
349
354
|
# @param user_id [String]
|
350
355
|
# @param user_secret [String]
|
351
356
|
# @param account_id [String] The ID of the account to get orders.
|
352
357
|
# @param [Hash] opts the optional parameters
|
353
358
|
# @option opts [String] :state defaults value is set to \"all\"
|
359
|
+
# @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 90 days if no value is passed in.
|
354
360
|
# @return [Array<(Array<AccountOrderRecord>, Integer, Hash)>] Array<AccountOrderRecord> data, response status code and response headers
|
355
361
|
def get_user_account_orders_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|
356
362
|
if @api_client.config.debugging
|
@@ -372,6 +378,10 @@ module SnapTrade
|
|
372
378
|
if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
|
373
379
|
fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
|
374
380
|
end
|
381
|
+
if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] < 1
|
382
|
+
fail ArgumentError, 'invalid value for "opts[:"days"]" when calling AccountInformationApi.get_user_account_orders, must be greater than or equal to 1.'
|
383
|
+
end
|
384
|
+
|
375
385
|
# resource path
|
376
386
|
local_var_path = '/accounts/{accountId}/orders'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
377
387
|
|
@@ -380,6 +390,7 @@ module SnapTrade
|
|
380
390
|
query_params[:'userId'] = user_id
|
381
391
|
query_params[:'userSecret'] = user_secret
|
382
392
|
query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
|
393
|
+
query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
|
383
394
|
|
384
395
|
# header parameters
|
385
396
|
header_params = opts[:header_params] || {}
|
data/lib/snaptrade/version.rb
CHANGED
@@ -69,13 +69,14 @@ describe 'AccountInformationApi' do
|
|
69
69
|
end
|
70
70
|
|
71
71
|
# unit tests for get_user_account_orders
|
72
|
-
#
|
72
|
+
# List account orders
|
73
73
|
# Fetch all recent orders from a user's account.
|
74
74
|
# @param user_id
|
75
75
|
# @param user_secret
|
76
76
|
# @param account_id The ID of the account to get orders.
|
77
77
|
# @param [Hash] opts the optional parameters
|
78
78
|
# @option opts [String] :state defaults value is set to \"all\"
|
79
|
+
# @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 90 days if no value is passed in.
|
79
80
|
# @return [Array<AccountOrderRecord>]
|
80
81
|
describe 'get_user_account_orders test' do
|
81
82
|
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: 1.17.
|
4
|
+
version: 1.17.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SnapTrade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|