snaptrade 3.0.44 → 3.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +54 -2
- data/lib/snaptrade/api/account_information_api.rb +4 -4
- data/lib/snaptrade/api/experimental_endpoints_api.rb +145 -0
- data/lib/snaptrade/models/account_order.rb +438 -0
- data/lib/snaptrade/models/account_order_group.rb +241 -0
- data/lib/snaptrade/models/account_order_leg.rb +302 -0
- data/lib/snaptrade/models/account_order_record_v2.rb +35 -1
- data/lib/snaptrade/models/account_order_time_in_force.rb +44 -0
- data/lib/snaptrade/models/all_account_orders_response.rb +239 -0
- data/lib/snaptrade/models/all_account_orders_response_data_freshness.rb +223 -0
- data/lib/snaptrade/models/limit_order_type.rb +237 -0
- data/lib/snaptrade/models/limit_order_type_kind.rb +36 -0
- data/lib/snaptrade/models/market_order_type.rb +222 -0
- data/lib/snaptrade/models/market_order_type_kind.rb +36 -0
- data/lib/snaptrade/models/order_type_configuration.rb +63 -0
- data/lib/snaptrade/models/other_order_type.rb +257 -0
- data/lib/snaptrade/models/other_order_type_kind.rb +36 -0
- data/lib/snaptrade/models/stop_limit_order_type.rb +252 -0
- data/lib/snaptrade/models/stop_limit_order_type_kind.rb +36 -0
- data/lib/snaptrade/models/stop_order_type.rb +237 -0
- data/lib/snaptrade/models/stop_order_type_kind.rb +36 -0
- data/lib/snaptrade/models/trailing_stop_limit_order_type.rb +262 -0
- data/lib/snaptrade/models/trailing_stop_limit_order_type_kind.rb +36 -0
- data/lib/snaptrade/models/trailing_stop_order_type.rb +247 -0
- data/lib/snaptrade/models/trailing_stop_order_type_kind.rb +36 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +21 -0
- data/spec/api/account_information_api_spec.rb +1 -1
- data/spec/api/experimental_endpoints_api_spec.rb +16 -0
- data/spec/models/account_order_group_spec.rb +35 -0
- data/spec/models/account_order_leg_spec.rb +71 -0
- data/spec/models/account_order_record_v2_spec.rb +4 -0
- data/spec/models/account_order_spec.rb +125 -0
- data/spec/models/account_order_time_in_force_spec.rb +23 -0
- data/spec/models/all_account_orders_response_data_freshness_spec.rb +29 -0
- data/spec/models/all_account_orders_response_spec.rb +35 -0
- data/spec/models/limit_order_type_kind_spec.rb +23 -0
- data/spec/models/limit_order_type_spec.rb +35 -0
- data/spec/models/market_order_type_kind_spec.rb +23 -0
- data/spec/models/market_order_type_spec.rb +29 -0
- data/spec/models/order_type_configuration_spec.rb +38 -0
- data/spec/models/other_order_type_kind_spec.rb +23 -0
- data/spec/models/other_order_type_spec.rb +47 -0
- data/spec/models/stop_limit_order_type_kind_spec.rb +23 -0
- data/spec/models/stop_limit_order_type_spec.rb +41 -0
- data/spec/models/stop_order_type_kind_spec.rb +23 -0
- data/spec/models/stop_order_type_spec.rb +35 -0
- data/spec/models/trailing_stop_limit_order_type_kind_spec.rb +23 -0
- data/spec/models/trailing_stop_limit_order_type_spec.rb +47 -0
- data/spec/models/trailing_stop_order_type_kind_spec.rb +23 -0
- data/spec/models/trailing_stop_order_type_spec.rb +41 -0
- metadata +316 -253
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8aeb28db29a1d166e74cfca90c7f4adc608b655f83384c3f77acfecdf093c30b
|
|
4
|
+
data.tar.gz: 6a081257f56c4e7bfc47823e8f65497344dd4aa1b20534d1cc06c0312b1c985b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f1041927d890a4165be1d40eea8e50700ad3e44eab156f5c86e09c95cf5e32b32e7c8b4e22ea0cb6d278fcd8775a74bc09feb5e00ca38820c7d8e0db43316481
|
|
7
|
+
data.tar.gz: b2725b26a4e6f3b6c02977b0b67c222651db730027b3bccc75c809501beefb194e1eef6da0331af4162bc29662588bc715a57f3ae9f5035ff905b73556ba92df
|
data/README.md
CHANGED
|
@@ -63,7 +63,7 @@ backoff with jitter rather than from the headers.
|
|
|
63
63
|
See https://docs.snaptrade.com/docs/ratelimiting.
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
[](https://rubygems.org/gems/snaptrade/versions/3.0.46)
|
|
67
67
|
[](https://snaptrade.com/)
|
|
68
68
|
|
|
69
69
|
</div>
|
|
@@ -108,6 +108,7 @@ See https://docs.snaptrade.com/docs/ratelimiting.
|
|
|
108
108
|
* [`snaptrade.connections.sync_brokerage_authorization_transactions`](#snaptradeconnectionssync_brokerage_authorization_transactions)
|
|
109
109
|
* [`snaptrade.experimental_endpoints.add_subscription`](#snaptradeexperimental_endpointsadd_subscription)
|
|
110
110
|
* [`snaptrade.experimental_endpoints.cancel_subscription`](#snaptradeexperimental_endpointscancel_subscription)
|
|
111
|
+
* [`snaptrade.experimental_endpoints.get_all_account_orders`](#snaptradeexperimental_endpointsget_all_account_orders)
|
|
111
112
|
* [`snaptrade.experimental_endpoints.get_user_account_order_detail_v2`](#snaptradeexperimental_endpointsget_user_account_order_detail_v2)
|
|
112
113
|
* [`snaptrade.experimental_endpoints.get_user_account_orders_v2`](#snaptradeexperimental_endpointsget_user_account_orders_v2)
|
|
113
114
|
* [`snaptrade.experimental_endpoints.get_user_account_recent_orders_v2`](#snaptradeexperimental_endpointsget_user_account_recent_orders_v2)
|
|
@@ -146,7 +147,7 @@ See https://docs.snaptrade.com/docs/ratelimiting.
|
|
|
146
147
|
Add to Gemfile:
|
|
147
148
|
|
|
148
149
|
```ruby
|
|
149
|
-
gem 'snaptrade', '~> 3.0.
|
|
150
|
+
gem 'snaptrade', '~> 3.0.46'
|
|
150
151
|
```
|
|
151
152
|
|
|
152
153
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -1507,6 +1508,57 @@ reference the account in SnapTrade.
|
|
|
1507
1508
|
---
|
|
1508
1509
|
|
|
1509
1510
|
|
|
1511
|
+
### `snaptrade.experimental_endpoints.get_all_account_orders`<a id="snaptradeexperimental_endpointsget_all_account_orders"></a>
|
|
1512
|
+
|
|
1513
|
+
Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`.
|
|
1514
|
+
|
|
1515
|
+
Every order carries a `legs` list with at least one leg. Each leg's `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`.
|
|
1516
|
+
|
|
1517
|
+
`order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage's own label is in `raw_type`.
|
|
1518
|
+
|
|
1519
|
+
**Experimental:** this endpoint may change without notice.
|
|
1520
|
+
|
|
1521
|
+
If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
1522
|
+
|
|
1523
|
+
|
|
1524
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1525
|
+
|
|
1526
|
+
```ruby
|
|
1527
|
+
result = snaptrade.experimental_endpoints.get_all_account_orders(
|
|
1528
|
+
user_id: "snaptrade-user-123",
|
|
1529
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1530
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1531
|
+
state: "all",
|
|
1532
|
+
days: 30,
|
|
1533
|
+
)
|
|
1534
|
+
p result
|
|
1535
|
+
```
|
|
1536
|
+
|
|
1537
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1538
|
+
|
|
1539
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
|
1540
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1541
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
|
1542
|
+
##### state: `String`<a id="state-string"></a>
|
|
1543
|
+
defaults to \"all\"
|
|
1544
|
+
|
|
1545
|
+
##### days: `Integer`<a id="days-integer"></a>
|
|
1546
|
+
Number of days in the past to fetch the most recent orders. Defaults to the last
|
|
1547
|
+
30 days if no value is passed in. Values greater than 90 will be capped at 90.
|
|
1548
|
+
|
|
1549
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1550
|
+
|
|
1551
|
+
[AllAccountOrdersResponse](./lib/snaptrade/models/all_account_orders_response.rb)
|
|
1552
|
+
|
|
1553
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1554
|
+
|
|
1555
|
+
`/accounts/{accountId}/orders/all` `GET`
|
|
1556
|
+
|
|
1557
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1558
|
+
|
|
1559
|
+
---
|
|
1560
|
+
|
|
1561
|
+
|
|
1510
1562
|
### `snaptrade.experimental_endpoints.get_user_account_order_detail_v2`<a id="snaptradeexperimental_endpointsget_user_account_order_detail_v2"></a>
|
|
1511
1563
|
|
|
1512
1564
|
Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|
|
@@ -290,7 +290,7 @@ module SnapTrade
|
|
|
290
290
|
end
|
|
291
291
|
|
|
292
292
|
|
|
293
|
-
#
|
|
293
|
+
# List account balances (V2)
|
|
294
294
|
#
|
|
295
295
|
# Returns the account's balances in a single snapshot: total net value, cash per currency, buying power, and margin details for margin accounts. Every field is always present and is `null` when the institution doesn't report it.
|
|
296
296
|
#
|
|
@@ -313,7 +313,7 @@ module SnapTrade
|
|
|
313
313
|
data
|
|
314
314
|
end
|
|
315
315
|
|
|
316
|
-
#
|
|
316
|
+
# List account balances (V2)
|
|
317
317
|
#
|
|
318
318
|
# Returns the account's balances in a single snapshot: total net value, cash per currency, buying power, and margin details for margin accounts. Every field is always present and is `null` when the institution doesn't report it.
|
|
319
319
|
#
|
|
@@ -335,7 +335,7 @@ module SnapTrade
|
|
|
335
335
|
get_account_balances_v2_with_http_info_impl(user_id, user_secret, account_id, extra)
|
|
336
336
|
end
|
|
337
337
|
|
|
338
|
-
#
|
|
338
|
+
# List account balances (V2)
|
|
339
339
|
# Returns the account's balances in a single snapshot: total net value, cash per currency, buying power, and margin details for margin accounts. Every field is always present and is `null` when the institution doesn't report it. **Beta:** this endpoint is only available for partners it has been enabled for. Please contact the SnapTrade team to enable it. The response schema may change. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don't, Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. `data_freshness.as_of` is the time the returned data was fetched from the institution. If the connection has become disabled, it can no longer access the latest data from the institution, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
340
340
|
# @param user_id [String]
|
|
341
341
|
# @param user_secret [String]
|
|
@@ -347,7 +347,7 @@ module SnapTrade
|
|
|
347
347
|
data
|
|
348
348
|
end
|
|
349
349
|
|
|
350
|
-
#
|
|
350
|
+
# List account balances (V2)
|
|
351
351
|
# Returns the account's balances in a single snapshot: total net value, cash per currency, buying power, and margin details for margin accounts. Every field is always present and is `null` when the institution doesn't report it. **Beta:** this endpoint is only available for partners it has been enabled for. Please contact the SnapTrade team to enable it. The response schema may change. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don't, Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. `data_freshness.as_of` is the time the returned data was fetched from the institution. If the connection has become disabled, it can no longer access the latest data from the institution, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
352
352
|
# @param user_id [String]
|
|
353
353
|
# @param user_secret [String]
|
|
@@ -239,6 +239,151 @@ module SnapTrade
|
|
|
239
239
|
end
|
|
240
240
|
|
|
241
241
|
|
|
242
|
+
# List all account orders
|
|
243
|
+
#
|
|
244
|
+
# Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`.
|
|
245
|
+
#
|
|
246
|
+
# Every order carries a `legs` list with at least one leg. Each leg's `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`.
|
|
247
|
+
#
|
|
248
|
+
# `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage's own label is in `raw_type`.
|
|
249
|
+
#
|
|
250
|
+
# **Experimental:** this endpoint may change without notice.
|
|
251
|
+
#
|
|
252
|
+
# If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
253
|
+
#
|
|
254
|
+
# @param user_id [String]
|
|
255
|
+
# @param user_secret [String]
|
|
256
|
+
# @param account_id [String]
|
|
257
|
+
# @param state [String] defaults to \"all\"
|
|
258
|
+
# @param days [Integer] Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90.
|
|
259
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
260
|
+
def get_all_account_orders(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {})
|
|
261
|
+
extra[:state] = state if state != SENTINEL
|
|
262
|
+
extra[:days] = days if days != SENTINEL
|
|
263
|
+
data, _status_code, _headers = get_all_account_orders_with_http_info_impl(user_id, user_secret, account_id, extra)
|
|
264
|
+
data
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# List all account orders
|
|
268
|
+
#
|
|
269
|
+
# Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`.
|
|
270
|
+
#
|
|
271
|
+
# Every order carries a `legs` list with at least one leg. Each leg's `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`.
|
|
272
|
+
#
|
|
273
|
+
# `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage's own label is in `raw_type`.
|
|
274
|
+
#
|
|
275
|
+
# **Experimental:** this endpoint may change without notice.
|
|
276
|
+
#
|
|
277
|
+
# If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
278
|
+
#
|
|
279
|
+
# @param user_id [String]
|
|
280
|
+
# @param user_secret [String]
|
|
281
|
+
# @param account_id [String]
|
|
282
|
+
# @param state [String] defaults to \"all\"
|
|
283
|
+
# @param days [Integer] Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90.
|
|
284
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
285
|
+
def get_all_account_orders_with_http_info(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {})
|
|
286
|
+
extra[:state] = state if state != SENTINEL
|
|
287
|
+
extra[:days] = days if days != SENTINEL
|
|
288
|
+
get_all_account_orders_with_http_info_impl(user_id, user_secret, account_id, extra)
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# List all account orders
|
|
292
|
+
# Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg's `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage's own label is in `raw_type`. **Experimental:** this endpoint may change without notice. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
293
|
+
# @param user_id [String]
|
|
294
|
+
# @param user_secret [String]
|
|
295
|
+
# @param account_id [String]
|
|
296
|
+
# @param [Hash] opts the optional parameters
|
|
297
|
+
# @option opts [String] :state defaults to \"all\"
|
|
298
|
+
# @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90.
|
|
299
|
+
# @return [AllAccountOrdersResponse]
|
|
300
|
+
private def get_all_account_orders_impl(user_id, user_secret, account_id, opts = {})
|
|
301
|
+
data, _status_code, _headers = get_all_account_orders_with_http_info(user_id, user_secret, account_id, opts)
|
|
302
|
+
data
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
# List all account orders
|
|
306
|
+
# Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg's `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage's own label is in `raw_type`. **Experimental:** this endpoint may change without notice. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
307
|
+
# @param user_id [String]
|
|
308
|
+
# @param user_secret [String]
|
|
309
|
+
# @param account_id [String]
|
|
310
|
+
# @param [Hash] opts the optional parameters
|
|
311
|
+
# @option opts [String] :state defaults to \"all\"
|
|
312
|
+
# @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90.
|
|
313
|
+
# @return [Array<(AllAccountOrdersResponse, Integer, Hash)>] AllAccountOrdersResponse data, response status code and response headers
|
|
314
|
+
private def get_all_account_orders_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|
|
315
|
+
if @api_client.config.debugging
|
|
316
|
+
@api_client.config.logger.debug 'Calling API: ExperimentalEndpointsApi.get_all_account_orders ...'
|
|
317
|
+
end
|
|
318
|
+
# verify the required parameter 'user_id' is set
|
|
319
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
320
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ExperimentalEndpointsApi.get_all_account_orders"
|
|
321
|
+
end
|
|
322
|
+
# verify the required parameter 'user_secret' is set
|
|
323
|
+
if @api_client.config.client_side_validation && user_secret.nil?
|
|
324
|
+
fail ArgumentError, "Missing the required parameter 'user_secret' when calling ExperimentalEndpointsApi.get_all_account_orders"
|
|
325
|
+
end
|
|
326
|
+
# verify the required parameter 'account_id' is set
|
|
327
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
328
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling ExperimentalEndpointsApi.get_all_account_orders"
|
|
329
|
+
end
|
|
330
|
+
allowable_values = ["all", "open", "executed"]
|
|
331
|
+
if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
|
|
332
|
+
fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
|
|
333
|
+
end
|
|
334
|
+
if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] > 90
|
|
335
|
+
fail ArgumentError, 'invalid value for "opts[:"days"]" when calling ExperimentalEndpointsApi.get_all_account_orders, must be smaller than or equal to 90.'
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] < 1
|
|
339
|
+
fail ArgumentError, 'invalid value for "opts[:"days"]" when calling ExperimentalEndpointsApi.get_all_account_orders, must be greater than or equal to 1.'
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
# resource path
|
|
343
|
+
local_var_path = '/accounts/{accountId}/orders/all'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
|
344
|
+
|
|
345
|
+
# query parameters
|
|
346
|
+
query_params = opts[:query_params] || {}
|
|
347
|
+
query_params[:'userId'] = user_id
|
|
348
|
+
query_params[:'userSecret'] = user_secret
|
|
349
|
+
query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
|
|
350
|
+
query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
|
|
351
|
+
|
|
352
|
+
# header parameters
|
|
353
|
+
header_params = opts[:header_params] || {}
|
|
354
|
+
# HTTP header 'Accept' (if needed)
|
|
355
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
356
|
+
|
|
357
|
+
# form parameters
|
|
358
|
+
form_params = opts[:form_params] || {}
|
|
359
|
+
|
|
360
|
+
# http body (model)
|
|
361
|
+
post_body = opts[:debug_body]
|
|
362
|
+
|
|
363
|
+
# return_type
|
|
364
|
+
return_type = opts[:debug_return_type] || 'AllAccountOrdersResponse'
|
|
365
|
+
|
|
366
|
+
# auth_names
|
|
367
|
+
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
|
368
|
+
|
|
369
|
+
new_options = opts.merge(
|
|
370
|
+
:operation => :"ExperimentalEndpointsApi.get_all_account_orders",
|
|
371
|
+
:header_params => header_params,
|
|
372
|
+
:query_params => query_params,
|
|
373
|
+
:form_params => form_params,
|
|
374
|
+
:body => post_body,
|
|
375
|
+
:auth_names => auth_names,
|
|
376
|
+
:return_type => return_type
|
|
377
|
+
)
|
|
378
|
+
|
|
379
|
+
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
|
380
|
+
if @api_client.config.debugging
|
|
381
|
+
@api_client.config.logger.debug "API called: ExperimentalEndpointsApi#get_all_account_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
382
|
+
end
|
|
383
|
+
return data, status_code, headers, response
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
|
|
242
387
|
# Get account order detail (V2)
|
|
243
388
|
#
|
|
244
389
|
# Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|