Class: SnapTrade::ExperimentalEndpointsApi
- Inherits:
-
Object
- Object
- SnapTrade::ExperimentalEndpointsApi
- Defined in:
- lib/snaptrade/api/experimental_endpoints_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#add_subscription(account_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Add a Trade Detection subscription.
-
#add_subscription_with_http_info(account_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Add a Trade Detection subscription.
-
#cancel_subscription(account_id:, extra: {}) ⇒ Object
Cancel a Trade Detection subscription.
-
#cancel_subscription_with_http_info(account_id:, extra: {}) ⇒ Object
Cancel a Trade Detection subscription.
-
#get_user_account_order_detail_v2(account_id:, brokerage_order_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Get account order detail (V2).
-
#get_user_account_order_detail_v2_with_http_info(account_id:, brokerage_order_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Get account order detail (V2).
-
#get_user_account_orders_v2(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {}) ⇒ Object
List account orders v2.
-
#get_user_account_orders_v2_with_http_info(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {}) ⇒ Object
List account orders v2.
-
#get_user_account_recent_orders_v2(user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {}) ⇒ Object
List account recent orders (V2, last 24 hours only).
-
#get_user_account_recent_orders_v2_with_http_info(user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {}) ⇒ Object
List account recent orders (V2, last 24 hours only).
-
#initialize(api_client = ApiClient.default) ⇒ ExperimentalEndpointsApi
constructor
A new instance of ExperimentalEndpointsApi.
-
#list_subscriptions(extra: {}) ⇒ Object
List active Trade Detection subscriptions.
-
#list_subscriptions_with_http_info(extra: {}) ⇒ Object
List active Trade Detection subscriptions.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ExperimentalEndpointsApi
Returns a new instance of ExperimentalEndpointsApi.
16 17 18 |
# File 'lib/snaptrade/api/experimental_endpoints_api.rb', line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
14 15 16 |
# File 'lib/snaptrade/api/experimental_endpoints_api.rb', line 14 def api_client @api_client end |
Instance Method Details
#add_subscription(account_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Add a Trade Detection subscription
Adds or restores a Trade Detection subscription for a connected brokerage account. This endpoint requires ‘userId` and `userSecret` in addition to the partner signature.
30 31 32 33 34 35 36 |
# File 'lib/snaptrade/api/experimental_endpoints_api.rb', line 30 def add_subscription(account_id:, user_id:, user_secret:, extra: {}) _body = {} _body[:account_id] = account_id if account_id != SENTINEL trade_detection_add_subscription_request = _body data, _status_code, _headers = add_subscription_with_http_info_impl(user_id, user_secret, trade_detection_add_subscription_request, extra) data end |
#add_subscription_with_http_info(account_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Add a Trade Detection subscription
Adds or restores a Trade Detection subscription for a connected brokerage account. This endpoint requires ‘userId` and `userSecret` in addition to the partner signature.
48 49 50 51 52 53 |
# File 'lib/snaptrade/api/experimental_endpoints_api.rb', line 48 def add_subscription_with_http_info(account_id:, user_id:, user_secret:, extra: {}) _body = {} _body[:account_id] = account_id if account_id != SENTINEL trade_detection_add_subscription_request = _body add_subscription_with_http_info_impl(user_id, user_secret, trade_detection_add_subscription_request, extra) end |
#cancel_subscription(account_id:, extra: {}) ⇒ Object
Cancel a Trade Detection subscription
Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require ‘userId` or `userSecret`.
146 147 148 149 150 151 152 |
# File 'lib/snaptrade/api/experimental_endpoints_api.rb', line 146 def cancel_subscription(account_id:, extra: {}) _body = {} _body[:account_id] = account_id if account_id != SENTINEL trade_detection_add_subscription_request = _body data, _status_code, _headers = cancel_subscription_with_http_info_impl(trade_detection_add_subscription_request, extra) data end |
#cancel_subscription_with_http_info(account_id:, extra: {}) ⇒ Object
Cancel a Trade Detection subscription
Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require ‘userId` or `userSecret`.
162 163 164 165 166 167 |
# File 'lib/snaptrade/api/experimental_endpoints_api.rb', line 162 def cancel_subscription_with_http_info(account_id:, extra: {}) _body = {} _body[:account_id] = account_id if account_id != SENTINEL trade_detection_add_subscription_request = _body cancel_subscription_with_http_info_impl(trade_detection_add_subscription_request, extra) end |
#get_user_account_order_detail_v2(account_id:, brokerage_order_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Get account order detail (V2)
Returns the detail of a single order using the brokerage order ID provided as a path parameter.
The V2 order response format includes all legs of the order in the ‘legs` list field. If the order is single legged, `legs` will be a list of one leg.
This endpoint is always realtime and does not rely on cached data.
This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
254 255 256 257 |
# File 'lib/snaptrade/api/experimental_endpoints_api.rb', line 254 def get_user_account_order_detail_v2(account_id:, brokerage_order_id:, user_id:, user_secret:, extra: {}) data, _status_code, _headers = get_user_account_order_detail_v2_with_http_info_impl(account_id, brokerage_order_id, user_id, user_secret, extra) data end |
#get_user_account_order_detail_v2_with_http_info(account_id:, brokerage_order_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Get account order detail (V2)
Returns the detail of a single order using the brokerage order ID provided as a path parameter.
The V2 order response format includes all legs of the order in the ‘legs` list field. If the order is single legged, `legs` will be a list of one leg.
This endpoint is always realtime and does not rely on cached data.
This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
275 276 277 |
# File 'lib/snaptrade/api/experimental_endpoints_api.rb', line 275 def get_user_account_order_detail_v2_with_http_info(account_id:, brokerage_order_id:, user_id:, user_secret:, extra: {}) get_user_account_order_detail_v2_with_http_info_impl(account_id, brokerage_order_id, user_id, user_secret, extra) end |
#get_user_account_orders_v2(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {}) ⇒ Object
List account orders v2
Returns a list of recent orders in the specified account.
The V2 order response format will include all legs of each order in the ‘legs` list field. If the order is single legged, `legs` will be a list of one leg.
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.
377 378 379 380 381 382 |
# File 'lib/snaptrade/api/experimental_endpoints_api.rb', line 377 def get_user_account_orders_v2(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {}) extra[:state] = state if state != SENTINEL extra[:days] = days if days != SENTINEL data, _status_code, _headers = get_user_account_orders_v2_with_http_info_impl(user_id, user_secret, account_id, extra) data end |
#get_user_account_orders_v2_with_http_info(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {}) ⇒ Object
List account orders v2
Returns a list of recent orders in the specified account.
The V2 order response format will include all legs of each order in the ‘legs` list field. If the order is single legged, `legs` will be a list of one leg.
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.
398 399 400 401 402 |
# File 'lib/snaptrade/api/experimental_endpoints_api.rb', line 398 def get_user_account_orders_v2_with_http_info(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {}) extra[:state] = state if state != SENTINEL extra[:days] = days if days != SENTINEL get_user_account_orders_v2_with_http_info_impl(user_id, user_secret, account_id, extra) end |
#get_user_account_recent_orders_v2(user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {}) ⇒ Object
List account recent orders (V2, last 24 hours only)
A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting only_executed to false. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](dashboard.snaptrade.com/settings/billing)**
513 514 515 516 517 |
# File 'lib/snaptrade/api/experimental_endpoints_api.rb', line 513 def get_user_account_recent_orders_v2(user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {}) extra[:only_executed] = only_executed if only_executed != SENTINEL data, _status_code, _headers = get_user_account_recent_orders_v2_with_http_info_impl(user_id, user_secret, account_id, extra) data end |
#get_user_account_recent_orders_v2_with_http_info(user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {}) ⇒ Object
List account recent orders (V2, last 24 hours only)
A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting only_executed to false. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](dashboard.snaptrade.com/settings/billing)**
532 533 534 535 |
# File 'lib/snaptrade/api/experimental_endpoints_api.rb', line 532 def get_user_account_recent_orders_v2_with_http_info(user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {}) extra[:only_executed] = only_executed if only_executed != SENTINEL get_user_account_recent_orders_v2_with_http_info_impl(user_id, user_secret, account_id, extra) end |
#list_subscriptions(extra: {}) ⇒ Object
List active Trade Detection subscriptions
Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
623 624 625 626 |
# File 'lib/snaptrade/api/experimental_endpoints_api.rb', line 623 def list_subscriptions(extra: {}) data, _status_code, _headers = list_subscriptions_with_http_info_impl(extra) data end |
#list_subscriptions_with_http_info(extra: {}) ⇒ Object
List active Trade Detection subscriptions
Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
633 634 635 |
# File 'lib/snaptrade/api/experimental_endpoints_api.rb', line 633 def list_subscriptions_with_http_info(extra: {}) list_subscriptions_with_http_info_impl(extra) end |