snaptrade 2.0.143 → 2.0.145

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65b010b4913c7e0ea2e411b6dc193e138d0d81b943a8643db10f2d23828db24c
4
- data.tar.gz: ee19782bd513cb8b552201a936fed7cdb029a3a87a8a09f012cb1913db229a57
3
+ metadata.gz: 13365dc2453757932a219383332f86c5ebddc45457ae536f1e8ab991412e539c
4
+ data.tar.gz: 1584c808c749b509edd30c72b03866f90dd39c936ea9d9714fa27b98003ba59c
5
5
  SHA512:
6
- metadata.gz: 2134c15eae825485a0258eefc04ec891a9e756b219e0b28f588dbc508005e41832447dc7588eeb508601cf3db8de904adb27b1db18cb269815fb839acfcd7453
7
- data.tar.gz: f028758a9b8ccced84885cb0c7da9b9985d6588e3677e7ed851538ccf039a8c6b3f0393a850e8e3f36ce42415acc4613c5819523aef2516bb8bde84e48ba76fb
6
+ metadata.gz: 946c5b35bdc3ce676f1ac3729c8e18ecea2a6fb411be5a351fed8dd264641b811fd1067deaf3f55947476b32bf67c96a5c199f42fc7edd1d0558ea5f98a40253
7
+ data.tar.gz: 7ce8326f502b88927ea36ebbbc96e432a9fd6c717a2c5897cb4c766dee5579478e7949a9c8475c5e789723e73247127fb1becc2d523c6abefa777c41fd3a7b55
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snaptrade (2.0.143)
4
+ snaptrade (2.0.145)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
@@ -29,7 +29,7 @@ GEM
29
29
  method_source (1.1.0)
30
30
  multipart-post (2.4.1)
31
31
  parallel (1.27.0)
32
- parser (3.3.9.0)
32
+ parser (3.3.10.0)
33
33
  ast (~> 2.4.1)
34
34
  racc
35
35
  prism (1.6.0)
@@ -55,7 +55,7 @@ GEM
55
55
  rspec-expectations (3.13.5)
56
56
  diff-lcs (>= 1.2.0, < 2.0)
57
57
  rspec-support (~> 3.13.0)
58
- rspec-mocks (3.13.6)
58
+ rspec-mocks (3.13.7)
59
59
  diff-lcs (>= 1.2.0, < 2.0)
60
60
  rspec-support (~> 3.13.0)
61
61
  rspec-support (3.13.6)
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Connect brokerage accounts to your app for live positions and trading
8
8
 
9
- [![npm](https://img.shields.io/badge/gem-v2.0.143-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.143)
9
+ [![npm](https://img.shields.io/badge/gem-v2.0.145-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.145)
10
10
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
11
11
 
12
12
  </div>
@@ -44,6 +44,8 @@ Connect brokerage accounts to your app for live positions and trading
44
44
  * [`snaptrade.connections.remove_brokerage_authorization`](#snaptradeconnectionsremove_brokerage_authorization)
45
45
  * [`snaptrade.connections.return_rates`](#snaptradeconnectionsreturn_rates)
46
46
  * [`snaptrade.connections.session_events`](#snaptradeconnectionssession_events)
47
+ * [`snaptrade.experimental_endpoints.get_user_account_orders_v2`](#snaptradeexperimental_endpointsget_user_account_orders_v2)
48
+ * [`snaptrade.experimental_endpoints.get_user_account_recent_orders_v2`](#snaptradeexperimental_endpointsget_user_account_recent_orders_v2)
47
49
  * [`snaptrade.options.get_options_chain`](#snaptradeoptionsget_options_chain)
48
50
  * [`snaptrade.options.list_option_holdings`](#snaptradeoptionslist_option_holdings)
49
51
  * [`snaptrade.reference_data.get_currency_exchange_rate_pair`](#snaptradereference_dataget_currency_exchange_rate_pair)
@@ -81,7 +83,7 @@ Connect brokerage accounts to your app for live positions and trading
81
83
  Add to Gemfile:
82
84
 
83
85
  ```ruby
84
- gem 'snaptrade', '~> 2.0.143'
86
+ gem 'snaptrade', '~> 2.0.145'
85
87
  ```
86
88
 
87
89
  ## Getting Started<a id="getting-started"></a>
@@ -190,9 +192,10 @@ values. Here are some of the most popular values: - `BUY` - Asset bought. -
190
192
  contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment.
191
193
  - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares
192
194
  instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` -
193
- Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event.
194
- - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option
195
- exercise event. - `TRANSFER` - Transfer of assets from one account to another
195
+ Fee withdrawn from the account. - `TAX`` - A tax related fee. -
196
+ `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option
197
+ assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` -
198
+ Transfer of assets from one account to another. - `SPLIT` - A stock share split.
196
199
 
197
200
  #### 🔄 Return<a id="🔄-return"></a>
198
201
 
@@ -1110,6 +1113,96 @@ specific users
1110
1113
  ---
1111
1114
 
1112
1115
 
1116
+ ### `snaptrade.experimental_endpoints.get_user_account_orders_v2`<a id="snaptradeexperimental_endpointsget_user_account_orders_v2"></a>
1117
+
1118
+ Returns a list of recent orders in the specified account.
1119
+
1120
+ 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.
1121
+
1122
+ 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.
1123
+
1124
+
1125
+ #### 🛠️ Usage<a id="🛠️-usage"></a>
1126
+
1127
+ ```ruby
1128
+ result = snaptrade.experimental_endpoints.get_user_account_orders_v2(
1129
+ user_id: "snaptrade-user-123",
1130
+ user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
1131
+ account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
1132
+ state: "all",
1133
+ days: 30,
1134
+ )
1135
+ p result
1136
+ ```
1137
+
1138
+ #### ⚙️ Parameters<a id="⚙️-parameters"></a>
1139
+
1140
+ ##### user_id: `String`<a id="user_id-string"></a>
1141
+ ##### user_secret: `String`<a id="user_secret-string"></a>
1142
+ ##### account_id: `String`<a id="account_id-string"></a>
1143
+ ##### state: `String`<a id="state-string"></a>
1144
+ defaults value is set to \"all\"
1145
+
1146
+ ##### days: `Integer`<a id="days-integer"></a>
1147
+ Number of days in the past to fetch the most recent orders. Defaults to the last
1148
+ 30 days if no value is passed in.
1149
+
1150
+ #### 🔄 Return<a id="🔄-return"></a>
1151
+
1152
+ [AccountOrdersV2Response](./lib/snaptrade/models/account_orders_v2_response.rb)
1153
+
1154
+ #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1155
+
1156
+ `/accounts/{accountId}/orders/v2` `GET`
1157
+
1158
+ [🔙 **Back to Table of Contents**](#table-of-contents)
1159
+
1160
+ ---
1161
+
1162
+
1163
+ ### `snaptrade.experimental_endpoints.get_user_account_recent_orders_v2`<a id="snaptradeexperimental_endpointsget_user_account_recent_orders_v2"></a>
1164
+
1165
+ A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format.
1166
+ 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.
1167
+ Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days.
1168
+ By default only returns executed orders, but that can be changed by setting *only_executed* to false.
1169
+ **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](https://dashboard.snaptrade.com/settings/billing)**
1170
+
1171
+
1172
+ #### 🛠️ Usage<a id="🛠️-usage"></a>
1173
+
1174
+ ```ruby
1175
+ result = snaptrade.experimental_endpoints.get_user_account_recent_orders_v2(
1176
+ user_id: "snaptrade-user-123",
1177
+ user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
1178
+ account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
1179
+ only_executed: true,
1180
+ )
1181
+ p result
1182
+ ```
1183
+
1184
+ #### ⚙️ Parameters<a id="⚙️-parameters"></a>
1185
+
1186
+ ##### user_id: `String`<a id="user_id-string"></a>
1187
+ ##### user_secret: `String`<a id="user_secret-string"></a>
1188
+ ##### account_id: `String`<a id="account_id-string"></a>
1189
+ ##### only_executed: `Boolean`<a id="only_executed-boolean"></a>
1190
+ Defaults to true. Indicates if request should fetch only executed orders. Set to
1191
+ false to retrieve non executed orders as well
1192
+
1193
+ #### 🔄 Return<a id="🔄-return"></a>
1194
+
1195
+ [AccountOrdersV2Response](./lib/snaptrade/models/account_orders_v2_response.rb)
1196
+
1197
+ #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1198
+
1199
+ `/accounts/{accountId}/recentOrders/v2` `GET`
1200
+
1201
+ [🔙 **Back to Table of Contents**](#table-of-contents)
1202
+
1203
+ ---
1204
+
1205
+
1113
1206
  ### `snaptrade.options.get_options_chain`<a id="snaptradeoptionsget_options_chain"></a>
1114
1207
 
1115
1208
  Returns the option chain for the specified symbol in the specified account.
@@ -36,7 +36,7 @@ module SnapTrade
36
36
  # @param end_date [Date] The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
37
37
  # @param offset [Integer] An integer that specifies the starting point of the paginated results. Default is 0.
38
38
  # @param limit [Integer] An integer that specifies the maximum number of transactions to return. Default of 1000.
39
- # @param type [String] Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another
39
+ # @param type [String] Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `TAX`` - A tax related fee. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another. - `SPLIT` - A stock share split.
40
40
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
41
41
  def get_account_activities(account_id:, user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, offset: SENTINEL, limit: SENTINEL, type: SENTINEL, extra: {})
42
42
  extra[:start_date] = start_date if start_date != SENTINEL
@@ -67,7 +67,7 @@ module SnapTrade
67
67
  # @param end_date [Date] The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
68
68
  # @param offset [Integer] An integer that specifies the starting point of the paginated results. Default is 0.
69
69
  # @param limit [Integer] An integer that specifies the maximum number of transactions to return. Default of 1000.
70
- # @param type [String] Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another
70
+ # @param type [String] Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `TAX`` - A tax related fee. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another. - `SPLIT` - A stock share split.
71
71
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
72
72
  def get_account_activities_with_http_info(account_id:, user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, offset: SENTINEL, limit: SENTINEL, type: SENTINEL, extra: {})
73
73
  extra[:start_date] = start_date if start_date != SENTINEL
@@ -88,7 +88,7 @@ module SnapTrade
88
88
  # @option opts [Date] :end_date The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
89
89
  # @option opts [Integer] :offset An integer that specifies the starting point of the paginated results. Default is 0.
90
90
  # @option opts [Integer] :limit An integer that specifies the maximum number of transactions to return. Default of 1000.
91
- # @option opts [String] :type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another
91
+ # @option opts [String] :type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `TAX`` - A tax related fee. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another. - `SPLIT` - A stock share split.
92
92
  # @return [PaginatedUniversalActivity]
93
93
  private def get_account_activities_impl(account_id, user_id, user_secret, opts = {})
94
94
  data, _status_code, _headers = get_account_activities_with_http_info(account_id, user_id, user_secret, opts)
@@ -105,7 +105,7 @@ module SnapTrade
105
105
  # @option opts [Date] :end_date The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
106
106
  # @option opts [Integer] :offset An integer that specifies the starting point of the paginated results. Default is 0.
107
107
  # @option opts [Integer] :limit An integer that specifies the maximum number of transactions to return. Default of 1000.
108
- # @option opts [String] :type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another
108
+ # @option opts [String] :type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `TAX`` - A tax related fee. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another. - `SPLIT` - A stock share split.
109
109
  # @return [Array<(PaginatedUniversalActivity, Integer, Hash)>] PaginatedUniversalActivity data, response status code and response headers
110
110
  private def get_account_activities_with_http_info_impl(account_id, user_id, user_secret, opts = {})
111
111
  if @api_client.config.debugging
@@ -0,0 +1,273 @@
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
+ =end
9
+
10
+ require 'cgi'
11
+
12
+ module SnapTrade
13
+ class ExperimentalEndpointsApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(api_client = ApiClient.default)
17
+ @api_client = api_client
18
+ end
19
+
20
+ # List account orders v2
21
+ #
22
+ # Returns a list of recent orders in the specified account.
23
+ #
24
+ # 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.
25
+ #
26
+ # 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.
27
+ #
28
+ # @param user_id [String]
29
+ # @param user_secret [String]
30
+ # @param account_id [String]
31
+ # @param state [String] defaults value is set to \"all\"
32
+ # @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.
33
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
34
+ def get_user_account_orders_v2(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {})
35
+ extra[:state] = state if state != SENTINEL
36
+ extra[:days] = days if days != SENTINEL
37
+ data, _status_code, _headers = get_user_account_orders_v2_with_http_info_impl(user_id, user_secret, account_id, extra)
38
+ data
39
+ end
40
+
41
+ # List account orders v2
42
+ #
43
+ # Returns a list of recent orders in the specified account.
44
+ #
45
+ # 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.
46
+ #
47
+ # 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.
48
+ #
49
+ # @param user_id [String]
50
+ # @param user_secret [String]
51
+ # @param account_id [String]
52
+ # @param state [String] defaults value is set to \"all\"
53
+ # @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.
54
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
55
+ def get_user_account_orders_v2_with_http_info(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {})
56
+ extra[:state] = state if state != SENTINEL
57
+ extra[:days] = days if days != SENTINEL
58
+ get_user_account_orders_v2_with_http_info_impl(user_id, user_secret, account_id, extra)
59
+ end
60
+
61
+ # List account orders v2
62
+ # 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.
63
+ # @param user_id [String]
64
+ # @param user_secret [String]
65
+ # @param account_id [String]
66
+ # @param [Hash] opts the optional parameters
67
+ # @option opts [String] :state defaults value is set to \"all\"
68
+ # @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.
69
+ # @return [AccountOrdersV2Response]
70
+ private def get_user_account_orders_v2_impl(user_id, user_secret, account_id, opts = {})
71
+ data, _status_code, _headers = get_user_account_orders_v2_with_http_info(user_id, user_secret, account_id, opts)
72
+ data
73
+ end
74
+
75
+ # List account orders v2
76
+ # Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the &#x60;legs&#x60; list field. If the order is single legged, &#x60;legs&#x60; 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.
77
+ # @param user_id [String]
78
+ # @param user_secret [String]
79
+ # @param account_id [String]
80
+ # @param [Hash] opts the optional parameters
81
+ # @option opts [String] :state defaults value is set to \"all\"
82
+ # @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.
83
+ # @return [Array<(AccountOrdersV2Response, Integer, Hash)>] AccountOrdersV2Response data, response status code and response headers
84
+ private def get_user_account_orders_v2_with_http_info_impl(user_id, user_secret, account_id, opts = {})
85
+ if @api_client.config.debugging
86
+ @api_client.config.logger.debug 'Calling API: ExperimentalEndpointsApi.get_user_account_orders_v2 ...'
87
+ end
88
+ # verify the required parameter 'user_id' is set
89
+ if @api_client.config.client_side_validation && user_id.nil?
90
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ExperimentalEndpointsApi.get_user_account_orders_v2"
91
+ end
92
+ # verify the required parameter 'user_secret' is set
93
+ if @api_client.config.client_side_validation && user_secret.nil?
94
+ fail ArgumentError, "Missing the required parameter 'user_secret' when calling ExperimentalEndpointsApi.get_user_account_orders_v2"
95
+ end
96
+ # verify the required parameter 'account_id' is set
97
+ if @api_client.config.client_side_validation && account_id.nil?
98
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling ExperimentalEndpointsApi.get_user_account_orders_v2"
99
+ end
100
+ allowable_values = ["all", "open", "executed"]
101
+ if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
102
+ fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
103
+ end
104
+ if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] < 1
105
+ fail ArgumentError, 'invalid value for "opts[:"days"]" when calling ExperimentalEndpointsApi.get_user_account_orders_v2, must be greater than or equal to 1.'
106
+ end
107
+
108
+ # resource path
109
+ local_var_path = '/accounts/{accountId}/orders/v2'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
110
+
111
+ # query parameters
112
+ query_params = opts[:query_params] || {}
113
+ query_params[:'userId'] = user_id
114
+ query_params[:'userSecret'] = user_secret
115
+ query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
116
+ query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
117
+
118
+ # header parameters
119
+ header_params = opts[:header_params] || {}
120
+ # HTTP header 'Accept' (if needed)
121
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
122
+
123
+ # form parameters
124
+ form_params = opts[:form_params] || {}
125
+
126
+ # http body (model)
127
+ post_body = opts[:debug_body]
128
+
129
+ # return_type
130
+ return_type = opts[:debug_return_type] || 'AccountOrdersV2Response'
131
+
132
+ # auth_names
133
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
134
+
135
+ new_options = opts.merge(
136
+ :operation => :"ExperimentalEndpointsApi.get_user_account_orders_v2",
137
+ :header_params => header_params,
138
+ :query_params => query_params,
139
+ :form_params => form_params,
140
+ :body => post_body,
141
+ :auth_names => auth_names,
142
+ :return_type => return_type
143
+ )
144
+
145
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
146
+ if @api_client.config.debugging
147
+ @api_client.config.logger.debug "API called: ExperimentalEndpointsApi#get_user_account_orders_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
148
+ end
149
+ return data, status_code, headers, response
150
+ end
151
+
152
+
153
+ # List account recent orders (V2, last 24 hours only)
154
+ #
155
+ # A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format.
156
+ # 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.
157
+ # Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days.
158
+ # By default only returns executed orders, but that can be changed by setting *only_executed* to false.
159
+ # **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](https://dashboard.snaptrade.com/settings/billing)**
160
+ #
161
+ # @param user_id [String]
162
+ # @param user_secret [String]
163
+ # @param account_id [String]
164
+ # @param only_executed [Boolean] Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
165
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
166
+ def get_user_account_recent_orders_v2(user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {})
167
+ extra[:only_executed] = only_executed if only_executed != SENTINEL
168
+ data, _status_code, _headers = get_user_account_recent_orders_v2_with_http_info_impl(user_id, user_secret, account_id, extra)
169
+ data
170
+ end
171
+
172
+ # List account recent orders (V2, last 24 hours only)
173
+ #
174
+ # A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format.
175
+ # 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.
176
+ # Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days.
177
+ # By default only returns executed orders, but that can be changed by setting *only_executed* to false.
178
+ # **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](https://dashboard.snaptrade.com/settings/billing)**
179
+ #
180
+ # @param user_id [String]
181
+ # @param user_secret [String]
182
+ # @param account_id [String]
183
+ # @param only_executed [Boolean] Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
184
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
185
+ def get_user_account_recent_orders_v2_with_http_info(user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {})
186
+ extra[:only_executed] = only_executed if only_executed != SENTINEL
187
+ get_user_account_recent_orders_v2_with_http_info_impl(user_id, user_secret, account_id, extra)
188
+ end
189
+
190
+ # List account recent orders (V2, last 24 hours only)
191
+ # 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](https://dashboard.snaptrade.com/settings/billing)**
192
+ # @param user_id [String]
193
+ # @param user_secret [String]
194
+ # @param account_id [String]
195
+ # @param [Hash] opts the optional parameters
196
+ # @option opts [Boolean] :only_executed Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
197
+ # @return [AccountOrdersV2Response]
198
+ private def get_user_account_recent_orders_v2_impl(user_id, user_secret, account_id, opts = {})
199
+ data, _status_code, _headers = get_user_account_recent_orders_v2_with_http_info(user_id, user_secret, account_id, opts)
200
+ data
201
+ end
202
+
203
+ # List account recent orders (V2, last 24 hours only)
204
+ # 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](https://dashboard.snaptrade.com/settings/billing)**
205
+ # @param user_id [String]
206
+ # @param user_secret [String]
207
+ # @param account_id [String]
208
+ # @param [Hash] opts the optional parameters
209
+ # @option opts [Boolean] :only_executed Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
210
+ # @return [Array<(AccountOrdersV2Response, Integer, Hash)>] AccountOrdersV2Response data, response status code and response headers
211
+ private def get_user_account_recent_orders_v2_with_http_info_impl(user_id, user_secret, account_id, opts = {})
212
+ if @api_client.config.debugging
213
+ @api_client.config.logger.debug 'Calling API: ExperimentalEndpointsApi.get_user_account_recent_orders_v2 ...'
214
+ end
215
+ # verify the required parameter 'user_id' is set
216
+ if @api_client.config.client_side_validation && user_id.nil?
217
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ExperimentalEndpointsApi.get_user_account_recent_orders_v2"
218
+ end
219
+ # verify the required parameter 'user_secret' is set
220
+ if @api_client.config.client_side_validation && user_secret.nil?
221
+ fail ArgumentError, "Missing the required parameter 'user_secret' when calling ExperimentalEndpointsApi.get_user_account_recent_orders_v2"
222
+ end
223
+ # verify the required parameter 'account_id' is set
224
+ if @api_client.config.client_side_validation && account_id.nil?
225
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling ExperimentalEndpointsApi.get_user_account_recent_orders_v2"
226
+ end
227
+ # resource path
228
+ local_var_path = '/accounts/{accountId}/recentOrders/v2'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
229
+
230
+ # query parameters
231
+ query_params = opts[:query_params] || {}
232
+ query_params[:'userId'] = user_id
233
+ query_params[:'userSecret'] = user_secret
234
+ query_params[:'only_executed'] = opts[:'only_executed'] if !opts[:'only_executed'].nil?
235
+
236
+ # header parameters
237
+ header_params = opts[:header_params] || {}
238
+ # HTTP header 'Accept' (if needed)
239
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
240
+
241
+ # form parameters
242
+ form_params = opts[:form_params] || {}
243
+
244
+ # http body (model)
245
+ post_body = opts[:debug_body]
246
+
247
+ # return_type
248
+ return_type = opts[:debug_return_type] || 'AccountOrdersV2Response'
249
+
250
+ # auth_names
251
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
252
+
253
+ new_options = opts.merge(
254
+ :operation => :"ExperimentalEndpointsApi.get_user_account_recent_orders_v2",
255
+ :header_params => header_params,
256
+ :query_params => query_params,
257
+ :form_params => form_params,
258
+ :body => post_body,
259
+ :auth_names => auth_names,
260
+ :return_type => return_type
261
+ )
262
+
263
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
264
+ if @api_client.config.debugging
265
+ @api_client.config.logger.debug "API called: ExperimentalEndpointsApi#get_user_account_recent_orders_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
266
+ end
267
+ return data, status_code, headers, response
268
+ end
269
+ end
270
+
271
+ # top-level client access to avoid having the user to insantiate their own API instances
272
+ ExperimentalEndpoints = ExperimentalEndpointsApi::new
273
+ end
@@ -16,7 +16,7 @@ module SnapTrade
16
16
  # Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
17
17
  attr_accessor :brokerage_order_id
18
18
 
19
- # Indicates the status of an order. SnapTrade does a best effort to map brokerage statuses to statuses in this enum.
19
+ # Indicates the status of an order. SnapTrade does a best effort to map brokerage statuses to statuses in this enum. Possible values include: - NONE - PENDING - ACCEPTED - FAILED - REJECTED - CANCELED - PARTIAL_CANCELED - CANCEL_PENDING - EXECUTED - PARTIAL - REPLACE_PENDING - REPLACED - EXPIRED - QUEUED - TRIGGERED - ACTIVATED
20
20
  attr_accessor :status
21
21
 
22
22
  attr_accessor :universal_symbol