snaptrade 2.0.37 → 2.0.39
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/Gemfile.lock +2 -2
- data/README.md +115 -77
- data/lib/snaptrade/api/account_information_api.rb +4 -4
- data/lib/snaptrade/api/authentication_api.rb +4 -4
- data/lib/snaptrade/api/connections_api.rb +70 -52
- data/lib/snaptrade/api/options_api.rb +4 -4
- data/lib/snaptrade/api/trading_api.rb +106 -106
- data/lib/snaptrade/models/account.rb +2 -2
- data/lib/snaptrade/models/brokerage.rb +25 -40
- data/lib/snaptrade/models/brokerage_authorization.rb +12 -8
- data/lib/snaptrade/models/brokerage_authorization_disabled_confirmation.rb +1 -0
- data/lib/snaptrade/models/brokerage_authorization_refresh_confirmation.rb +1 -0
- data/lib/snaptrade/models/brokerage_type.rb +1 -1
- data/lib/snaptrade/models/manual_trade.rb +7 -5
- data/lib/snaptrade/models/manual_trade_and_impact.rb +2 -2
- data/lib/snaptrade/models/manual_trade_balance.rb +3 -3
- data/lib/snaptrade/models/manual_trade_form.rb +52 -25
- data/lib/snaptrade/models/manual_trade_impact.rb +260 -0
- data/lib/snaptrade/models/manual_trade_symbol.rb +6 -1
- data/lib/snaptrade/models/notional_value.rb +1 -1
- data/lib/snaptrade/models/options_place_option_strategy_request.rb +2 -2
- data/lib/snaptrade/models/symbols_quotes_inner.rb +15 -10
- data/lib/snaptrade/models/trading_cancel_user_account_order_request.rb +1 -0
- data/lib/snaptrade/models/validated_trade_body.rb +1 -2
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +1 -0
- data/spec/api/account_information_api_spec.rb +1 -1
- data/spec/api/authentication_api_spec.rb +1 -1
- data/spec/api/connections_api_spec.rb +13 -13
- data/spec/api/trading_api_spec.rb +15 -15
- data/spec/models/brokerage_spec.rb +6 -24
- data/spec/models/manual_trade_form_spec.rb +6 -6
- data/spec/models/manual_trade_impact_spec.rb +53 -0
- data/spec/models/symbols_quotes_inner_spec.rb +3 -3
- metadata +5 -2
@@ -17,11 +17,11 @@ module SnapTrade
|
|
17
17
|
@api_client = api_client
|
18
18
|
end
|
19
19
|
|
20
|
-
# Get
|
20
|
+
# Get connection detail
|
21
21
|
#
|
22
|
-
# Returns a single
|
22
|
+
# Returns a single connection for the specified ID.
|
23
23
|
#
|
24
|
-
# @param authorization_id [String]
|
24
|
+
# @param authorization_id [String]
|
25
25
|
# @param user_id [String]
|
26
26
|
# @param user_secret [String]
|
27
27
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
@@ -30,11 +30,11 @@ module SnapTrade
|
|
30
30
|
data
|
31
31
|
end
|
32
32
|
|
33
|
-
# Get
|
33
|
+
# Get connection detail
|
34
34
|
#
|
35
|
-
# Returns a single
|
35
|
+
# Returns a single connection for the specified ID.
|
36
36
|
#
|
37
|
-
# @param authorization_id [String]
|
37
|
+
# @param authorization_id [String]
|
38
38
|
# @param user_id [String]
|
39
39
|
# @param user_secret [String]
|
40
40
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
@@ -42,9 +42,9 @@ module SnapTrade
|
|
42
42
|
detail_brokerage_authorization_with_http_info_impl(authorization_id, user_id, user_secret, extra)
|
43
43
|
end
|
44
44
|
|
45
|
-
# Get
|
46
|
-
# Returns a single
|
47
|
-
# @param authorization_id [String]
|
45
|
+
# Get connection detail
|
46
|
+
# Returns a single connection for the specified ID.
|
47
|
+
# @param authorization_id [String]
|
48
48
|
# @param user_id [String]
|
49
49
|
# @param user_secret [String]
|
50
50
|
# @param [Hash] opts the optional parameters
|
@@ -54,9 +54,9 @@ module SnapTrade
|
|
54
54
|
data
|
55
55
|
end
|
56
56
|
|
57
|
-
# Get
|
58
|
-
# Returns a single
|
59
|
-
# @param authorization_id [String]
|
57
|
+
# Get connection detail
|
58
|
+
# Returns a single connection for the specified ID.
|
59
|
+
# @param authorization_id [String]
|
60
60
|
# @param user_id [String]
|
61
61
|
# @param user_secret [String]
|
62
62
|
# @param [Hash] opts the optional parameters
|
@@ -120,11 +120,14 @@ module SnapTrade
|
|
120
120
|
end
|
121
121
|
|
122
122
|
|
123
|
-
#
|
123
|
+
# Force disable connection
|
124
124
|
#
|
125
|
-
# Manually
|
125
|
+
# Manually force the specified connection to become disabled. This should only be used for testing a reconnect flow, and never used on production connections.
|
126
|
+
# Will trigger a disconnect as if it happened naturally, and send a [`CONNECTION_BROKEN` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_broken) for the connection.
|
127
|
+
#
|
128
|
+
# *Please contact us in order to use this endpoint as it is disabled by default.*
|
126
129
|
#
|
127
|
-
# @param authorization_id [String]
|
130
|
+
# @param authorization_id [String]
|
128
131
|
# @param user_id [String]
|
129
132
|
# @param user_secret [String]
|
130
133
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
@@ -133,11 +136,14 @@ module SnapTrade
|
|
133
136
|
data
|
134
137
|
end
|
135
138
|
|
136
|
-
#
|
139
|
+
# Force disable connection
|
137
140
|
#
|
138
|
-
# Manually
|
141
|
+
# Manually force the specified connection to become disabled. This should only be used for testing a reconnect flow, and never used on production connections.
|
142
|
+
# Will trigger a disconnect as if it happened naturally, and send a [`CONNECTION_BROKEN` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_broken) for the connection.
|
143
|
+
#
|
144
|
+
# *Please contact us in order to use this endpoint as it is disabled by default.*
|
139
145
|
#
|
140
|
-
# @param authorization_id [String]
|
146
|
+
# @param authorization_id [String]
|
141
147
|
# @param user_id [String]
|
142
148
|
# @param user_secret [String]
|
143
149
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
@@ -145,9 +151,9 @@ module SnapTrade
|
|
145
151
|
disable_brokerage_authorization_with_http_info_impl(authorization_id, user_id, user_secret, extra)
|
146
152
|
end
|
147
153
|
|
148
|
-
#
|
149
|
-
# Manually
|
150
|
-
# @param authorization_id [String]
|
154
|
+
# Force disable connection
|
155
|
+
# Manually force the specified connection to become disabled. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a [`CONNECTION_BROKEN` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_broken) for the connection. *Please contact us in order to use this endpoint as it is disabled by default.*
|
156
|
+
# @param authorization_id [String]
|
151
157
|
# @param user_id [String]
|
152
158
|
# @param user_secret [String]
|
153
159
|
# @param [Hash] opts the optional parameters
|
@@ -157,9 +163,9 @@ module SnapTrade
|
|
157
163
|
data
|
158
164
|
end
|
159
165
|
|
160
|
-
#
|
161
|
-
# Manually
|
162
|
-
# @param authorization_id [String]
|
166
|
+
# Force disable connection
|
167
|
+
# Manually force the specified connection to become disabled. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a [`CONNECTION_BROKEN` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_broken) for the connection. *Please contact us in order to use this endpoint as it is disabled by default.*
|
168
|
+
# @param authorization_id [String]
|
163
169
|
# @param user_id [String]
|
164
170
|
# @param user_secret [String]
|
165
171
|
# @param [Hash] opts the optional parameters
|
@@ -223,9 +229,13 @@ module SnapTrade
|
|
223
229
|
end
|
224
230
|
|
225
231
|
|
226
|
-
# List all
|
232
|
+
# List all connections
|
227
233
|
#
|
228
|
-
# Returns a list of Brokerage Authorization
|
234
|
+
# Returns a list of all connections for the specified user. Note that `Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency.
|
235
|
+
#
|
236
|
+
# A connection is usually tied to a single login at a brokerage. A single connection can contain multiple brokerage accounts.
|
237
|
+
#
|
238
|
+
# SnapTrade performs de-duping on connections for a given user. If the user has an existing connection with the brokerage, when connecting the brokerage with the same credentials, SnapTrade will return the existing connection instead of creating a new one.
|
229
239
|
#
|
230
240
|
# @param user_id [String]
|
231
241
|
# @param user_secret [String]
|
@@ -235,9 +245,13 @@ module SnapTrade
|
|
235
245
|
data
|
236
246
|
end
|
237
247
|
|
238
|
-
# List all
|
248
|
+
# List all connections
|
239
249
|
#
|
240
|
-
# Returns a list of Brokerage Authorization
|
250
|
+
# Returns a list of all connections for the specified user. Note that `Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency.
|
251
|
+
#
|
252
|
+
# A connection is usually tied to a single login at a brokerage. A single connection can contain multiple brokerage accounts.
|
253
|
+
#
|
254
|
+
# SnapTrade performs de-duping on connections for a given user. If the user has an existing connection with the brokerage, when connecting the brokerage with the same credentials, SnapTrade will return the existing connection instead of creating a new one.
|
241
255
|
#
|
242
256
|
# @param user_id [String]
|
243
257
|
# @param user_secret [String]
|
@@ -246,8 +260,8 @@ module SnapTrade
|
|
246
260
|
list_brokerage_authorizations_with_http_info_impl(user_id, user_secret, extra)
|
247
261
|
end
|
248
262
|
|
249
|
-
# List all
|
250
|
-
# Returns a list of Brokerage Authorization
|
263
|
+
# List all connections
|
264
|
+
# Returns a list of all connections for the specified user. Note that `Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency. A connection is usually tied to a single login at a brokerage. A single connection can contain multiple brokerage accounts. SnapTrade performs de-duping on connections for a given user. If the user has an existing connection with the brokerage, when connecting the brokerage with the same credentials, SnapTrade will return the existing connection instead of creating a new one.
|
251
265
|
# @param user_id [String]
|
252
266
|
# @param user_secret [String]
|
253
267
|
# @param [Hash] opts the optional parameters
|
@@ -257,8 +271,8 @@ module SnapTrade
|
|
257
271
|
data
|
258
272
|
end
|
259
273
|
|
260
|
-
# List all
|
261
|
-
# Returns a list of Brokerage Authorization
|
274
|
+
# List all connections
|
275
|
+
# Returns a list of all connections for the specified user. Note that `Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency. A connection is usually tied to a single login at a brokerage. A single connection can contain multiple brokerage accounts. SnapTrade performs de-duping on connections for a given user. If the user has an existing connection with the brokerage, when connecting the brokerage with the same credentials, SnapTrade will return the existing connection instead of creating a new one.
|
262
276
|
# @param user_id [String]
|
263
277
|
# @param user_secret [String]
|
264
278
|
# @param [Hash] opts the optional parameters
|
@@ -320,9 +334,11 @@ module SnapTrade
|
|
320
334
|
|
321
335
|
# Refresh holdings for a connection
|
322
336
|
#
|
323
|
-
# Trigger a holdings update for all accounts under this
|
337
|
+
# Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection.
|
338
|
+
#
|
339
|
+
# *Please contact support for access as this endpoint is not enabled by default.*
|
324
340
|
#
|
325
|
-
# @param authorization_id [String]
|
341
|
+
# @param authorization_id [String]
|
326
342
|
# @param user_id [String]
|
327
343
|
# @param user_secret [String]
|
328
344
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
@@ -333,9 +349,11 @@ module SnapTrade
|
|
333
349
|
|
334
350
|
# Refresh holdings for a connection
|
335
351
|
#
|
336
|
-
# Trigger a holdings update for all accounts under this
|
352
|
+
# Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection.
|
353
|
+
#
|
354
|
+
# *Please contact support for access as this endpoint is not enabled by default.*
|
337
355
|
#
|
338
|
-
# @param authorization_id [String]
|
356
|
+
# @param authorization_id [String]
|
339
357
|
# @param user_id [String]
|
340
358
|
# @param user_secret [String]
|
341
359
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
@@ -344,8 +362,8 @@ module SnapTrade
|
|
344
362
|
end
|
345
363
|
|
346
364
|
# Refresh holdings for a connection
|
347
|
-
# Trigger a holdings update for all accounts under this
|
348
|
-
# @param authorization_id [String]
|
365
|
+
# Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. *Please contact support for access as this endpoint is not enabled by default.*
|
366
|
+
# @param authorization_id [String]
|
349
367
|
# @param user_id [String]
|
350
368
|
# @param user_secret [String]
|
351
369
|
# @param [Hash] opts the optional parameters
|
@@ -356,8 +374,8 @@ module SnapTrade
|
|
356
374
|
end
|
357
375
|
|
358
376
|
# Refresh holdings for a connection
|
359
|
-
# Trigger a holdings update for all accounts under this
|
360
|
-
# @param authorization_id [String]
|
377
|
+
# Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. *Please contact support for access as this endpoint is not enabled by default.*
|
378
|
+
# @param authorization_id [String]
|
361
379
|
# @param user_id [String]
|
362
380
|
# @param user_secret [String]
|
363
381
|
# @param [Hash] opts the optional parameters
|
@@ -421,11 +439,11 @@ module SnapTrade
|
|
421
439
|
end
|
422
440
|
|
423
441
|
|
424
|
-
# Delete
|
442
|
+
# Delete connection
|
425
443
|
#
|
426
|
-
# Deletes
|
444
|
+
# Deletes the connection specified by the ID. This will also delete all accounts and holdings associated with the connection. This action is irreversible. This endpoint is synchronous, a 204 response indicates that the connection has been successfully deleted.
|
427
445
|
#
|
428
|
-
# @param authorization_id [String]
|
446
|
+
# @param authorization_id [String]
|
429
447
|
# @param user_id [String]
|
430
448
|
# @param user_secret [String]
|
431
449
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
@@ -434,11 +452,11 @@ module SnapTrade
|
|
434
452
|
nil
|
435
453
|
end
|
436
454
|
|
437
|
-
# Delete
|
455
|
+
# Delete connection
|
438
456
|
#
|
439
|
-
# Deletes
|
457
|
+
# Deletes the connection specified by the ID. This will also delete all accounts and holdings associated with the connection. This action is irreversible. This endpoint is synchronous, a 204 response indicates that the connection has been successfully deleted.
|
440
458
|
#
|
441
|
-
# @param authorization_id [String]
|
459
|
+
# @param authorization_id [String]
|
442
460
|
# @param user_id [String]
|
443
461
|
# @param user_secret [String]
|
444
462
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
@@ -446,9 +464,9 @@ module SnapTrade
|
|
446
464
|
remove_brokerage_authorization_with_http_info_impl(authorization_id, user_id, user_secret, extra)
|
447
465
|
end
|
448
466
|
|
449
|
-
# Delete
|
450
|
-
# Deletes
|
451
|
-
# @param authorization_id [String]
|
467
|
+
# Delete connection
|
468
|
+
# Deletes the connection specified by the ID. This will also delete all accounts and holdings associated with the connection. This action is irreversible. This endpoint is synchronous, a 204 response indicates that the connection has been successfully deleted.
|
469
|
+
# @param authorization_id [String]
|
452
470
|
# @param user_id [String]
|
453
471
|
# @param user_secret [String]
|
454
472
|
# @param [Hash] opts the optional parameters
|
@@ -458,9 +476,9 @@ module SnapTrade
|
|
458
476
|
nil
|
459
477
|
end
|
460
478
|
|
461
|
-
# Delete
|
462
|
-
# Deletes
|
463
|
-
# @param authorization_id [String]
|
479
|
+
# Delete connection
|
480
|
+
# Deletes the connection specified by the ID. This will also delete all accounts and holdings associated with the connection. This action is irreversible. This endpoint is synchronous, a 204 response indicates that the connection has been successfully deleted.
|
481
|
+
# @param authorization_id [String]
|
464
482
|
# @param user_id [String]
|
465
483
|
# @param user_secret [String]
|
466
484
|
# @param [Hash] opts the optional parameters
|
@@ -483,8 +483,8 @@ module SnapTrade
|
|
483
483
|
#
|
484
484
|
# Places the option strategy order and returns the order record received from the brokerage.
|
485
485
|
#
|
486
|
-
# @param order_type [OrderTypeStrict]
|
487
|
-
# @param time_in_force [TimeInForceStrict]
|
486
|
+
# @param order_type [OrderTypeStrict] The type of order to place. - For `Limit` and `StopLimit` orders, the `price` field is required. - For `Stop` and `StopLimit` orders, the `stop` field is required.
|
487
|
+
# @param time_in_force [TimeInForceStrict] The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
|
488
488
|
# @param user_id [String]
|
489
489
|
# @param user_secret [String]
|
490
490
|
# @param account_id [String] The ID of the account to execute the strategy in.
|
@@ -506,8 +506,8 @@ module SnapTrade
|
|
506
506
|
#
|
507
507
|
# Places the option strategy order and returns the order record received from the brokerage.
|
508
508
|
#
|
509
|
-
# @param order_type [OrderTypeStrict]
|
510
|
-
# @param time_in_force [TimeInForceStrict]
|
509
|
+
# @param order_type [OrderTypeStrict] The type of order to place. - For `Limit` and `StopLimit` orders, the `price` field is required. - For `Stop` and `StopLimit` orders, the `stop` field is required.
|
510
|
+
# @param time_in_force [TimeInForceStrict] The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
|
511
511
|
# @param user_id [String]
|
512
512
|
# @param user_secret [String]
|
513
513
|
# @param account_id [String] The ID of the account to execute the strategy in.
|