snaptrade 1.7.0 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +16 -52
- data/docs/AccountInformationApi.md +18 -18
- data/docs/AuthenticationApi.md +20 -20
- data/docs/OptionsApi.md +2 -2
- data/docs/ReferenceDataApi.md +20 -20
- data/docs/TradingApi.md +0 -321
- data/docs/TransactionsAndReportingApi.md +1 -1
- data/lib/snaptrade/api/account_information_api.rb +19 -19
- data/lib/snaptrade/api/authentication_api.rb +20 -20
- data/lib/snaptrade/api/options_api.rb +3 -3
- data/lib/snaptrade/api/reference_data_api.rb +20 -20
- data/lib/snaptrade/api/trading_api.rb +0 -409
- data/lib/snaptrade/api/transactions_and_reporting_api.rb +4 -4
- data/lib/snaptrade/models/account_holdings.rb +2 -0
- data/lib/snaptrade/models/account_holdings_account.rb +3 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +0 -3
- data/spec/api/account_information_api_spec.rb +5 -5
- data/spec/api/authentication_api_spec.rb +5 -5
- data/spec/api/options_api_spec.rb +1 -1
- data/spec/api/reference_data_api_spec.rb +5 -5
- data/spec/api/trading_api_spec.rb +0 -51
- data/spec/api/transactions_and_reporting_api_spec.rb +1 -1
- data/spec/getting_started_spec.rb +0 -36
- metadata +2 -6
- data/docs/PortfolioManagementApi.md +0 -2064
- data/lib/snaptrade/api/portfolio_management_api.rb +0 -2867
- data/spec/api/portfolio_management_api_spec.rb +0 -403
@@ -381,7 +381,7 @@ module SnapTrade
|
|
381
381
|
# @param user_secret [String]
|
382
382
|
# @param account_id [String] The ID of the account get positions.
|
383
383
|
# @param [Hash] opts the optional parameters
|
384
|
-
# @return [
|
384
|
+
# @return [Array<OptionsPosition>]
|
385
385
|
def list_option_holdings_impl(user_id, user_secret, account_id, opts = {})
|
386
386
|
data, _status_code, _headers = list_option_holdings_with_http_info(user_id, user_secret, account_id, opts)
|
387
387
|
data
|
@@ -392,7 +392,7 @@ module SnapTrade
|
|
392
392
|
# @param user_secret [String]
|
393
393
|
# @param account_id [String] The ID of the account get positions.
|
394
394
|
# @param [Hash] opts the optional parameters
|
395
|
-
# @return [Array<(
|
395
|
+
# @return [Array<(Array<OptionsPosition>, Integer, Hash)>] Array<OptionsPosition> data, response status code and response headers
|
396
396
|
def list_option_holdings_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|
397
397
|
if @api_client.config.debugging
|
398
398
|
@api_client.config.logger.debug 'Calling API: OptionsApi.list_option_holdings ...'
|
@@ -429,7 +429,7 @@ module SnapTrade
|
|
429
429
|
post_body = opts[:debug_body]
|
430
430
|
|
431
431
|
# return_type
|
432
|
-
return_type = opts[:debug_return_type] || '
|
432
|
+
return_type = opts[:debug_return_type] || 'Array<OptionsPosition>'
|
433
433
|
|
434
434
|
# auth_names
|
435
435
|
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
@@ -239,7 +239,7 @@ module SnapTrade
|
|
239
239
|
end
|
240
240
|
|
241
241
|
|
242
|
-
#
|
242
|
+
# List exchanges
|
243
243
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
244
244
|
def get_stock_exchanges(extra: {})
|
245
245
|
|
@@ -247,14 +247,14 @@ module SnapTrade
|
|
247
247
|
data
|
248
248
|
end
|
249
249
|
|
250
|
-
#
|
250
|
+
# List exchanges
|
251
251
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
252
252
|
def get_stock_exchanges_with_http_info(extra: {})
|
253
253
|
|
254
254
|
get_stock_exchanges_with_http_info_impl(extra)
|
255
255
|
end
|
256
256
|
|
257
|
-
#
|
257
|
+
# List exchanges
|
258
258
|
# @param [Hash] opts the optional parameters
|
259
259
|
# @return [Array<Exchange>]
|
260
260
|
def get_stock_exchanges_impl(opts = {})
|
@@ -262,7 +262,7 @@ module SnapTrade
|
|
262
262
|
data
|
263
263
|
end
|
264
264
|
|
265
|
-
#
|
265
|
+
# List exchanges
|
266
266
|
# @param [Hash] opts the optional parameters
|
267
267
|
# @return [Array<(Array<Exchange>, Integer, Hash)>] Array<Exchange> data, response status code and response headers
|
268
268
|
def get_stock_exchanges_with_http_info_impl(opts = {})
|
@@ -562,7 +562,7 @@ module SnapTrade
|
|
562
562
|
end
|
563
563
|
|
564
564
|
|
565
|
-
# List
|
565
|
+
# List brokerages
|
566
566
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
567
567
|
def list_all_brokerages(extra: {})
|
568
568
|
|
@@ -570,14 +570,14 @@ module SnapTrade
|
|
570
570
|
data
|
571
571
|
end
|
572
572
|
|
573
|
-
# List
|
573
|
+
# List brokerages
|
574
574
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
575
575
|
def list_all_brokerages_with_http_info(extra: {})
|
576
576
|
|
577
577
|
list_all_brokerages_with_http_info_impl(extra)
|
578
578
|
end
|
579
579
|
|
580
|
-
# List
|
580
|
+
# List brokerages
|
581
581
|
# @param [Hash] opts the optional parameters
|
582
582
|
# @return [Array<Brokerage>]
|
583
583
|
def list_all_brokerages_impl(opts = {})
|
@@ -585,7 +585,7 @@ module SnapTrade
|
|
585
585
|
data
|
586
586
|
end
|
587
587
|
|
588
|
-
# List
|
588
|
+
# List brokerages
|
589
589
|
# @param [Hash] opts the optional parameters
|
590
590
|
# @return [Array<(Array<Brokerage>, Integer, Hash)>] Array<Brokerage> data, response status code and response headers
|
591
591
|
def list_all_brokerages_with_http_info_impl(opts = {})
|
@@ -633,7 +633,7 @@ module SnapTrade
|
|
633
633
|
end
|
634
634
|
|
635
635
|
|
636
|
-
# List
|
636
|
+
# List currencies
|
637
637
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
638
638
|
def list_all_currencies(extra: {})
|
639
639
|
|
@@ -641,14 +641,14 @@ module SnapTrade
|
|
641
641
|
data
|
642
642
|
end
|
643
643
|
|
644
|
-
# List
|
644
|
+
# List currencies
|
645
645
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
646
646
|
def list_all_currencies_with_http_info(extra: {})
|
647
647
|
|
648
648
|
list_all_currencies_with_http_info_impl(extra)
|
649
649
|
end
|
650
650
|
|
651
|
-
# List
|
651
|
+
# List currencies
|
652
652
|
# @param [Hash] opts the optional parameters
|
653
653
|
# @return [Array<Currency>]
|
654
654
|
def list_all_currencies_impl(opts = {})
|
@@ -656,7 +656,7 @@ module SnapTrade
|
|
656
656
|
data
|
657
657
|
end
|
658
658
|
|
659
|
-
# List
|
659
|
+
# List currencies
|
660
660
|
# @param [Hash] opts the optional parameters
|
661
661
|
# @return [Array<(Array<Currency>, Integer, Hash)>] Array<Currency> data, response status code and response headers
|
662
662
|
def list_all_currencies_with_http_info_impl(opts = {})
|
@@ -704,7 +704,7 @@ module SnapTrade
|
|
704
704
|
end
|
705
705
|
|
706
706
|
|
707
|
-
#
|
707
|
+
# List currency exchange rates
|
708
708
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
709
709
|
def list_all_currencies_rates(extra: {})
|
710
710
|
|
@@ -712,14 +712,14 @@ module SnapTrade
|
|
712
712
|
data
|
713
713
|
end
|
714
714
|
|
715
|
-
#
|
715
|
+
# List currency exchange rates
|
716
716
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
717
717
|
def list_all_currencies_rates_with_http_info(extra: {})
|
718
718
|
|
719
719
|
list_all_currencies_rates_with_http_info_impl(extra)
|
720
720
|
end
|
721
721
|
|
722
|
-
#
|
722
|
+
# List currency exchange rates
|
723
723
|
# @param [Hash] opts the optional parameters
|
724
724
|
# @return [Array<ExchangeRatePairs>]
|
725
725
|
def list_all_currencies_rates_impl(opts = {})
|
@@ -727,7 +727,7 @@ module SnapTrade
|
|
727
727
|
data
|
728
728
|
end
|
729
729
|
|
730
|
-
#
|
730
|
+
# List currency exchange rates
|
731
731
|
# @param [Hash] opts the optional parameters
|
732
732
|
# @return [Array<(Array<ExchangeRatePairs>, Integer, Hash)>] Array<ExchangeRatePairs> data, response status code and response headers
|
733
733
|
def list_all_currencies_rates_with_http_info_impl(opts = {})
|
@@ -775,7 +775,7 @@ module SnapTrade
|
|
775
775
|
end
|
776
776
|
|
777
777
|
|
778
|
-
# Search for symbols
|
778
|
+
# Search for symbols available in an account
|
779
779
|
# @param user_id [String]
|
780
780
|
# @param user_secret [String]
|
781
781
|
# @param account_id [String] The ID of the account get positions.
|
@@ -791,7 +791,7 @@ module SnapTrade
|
|
791
791
|
data
|
792
792
|
end
|
793
793
|
|
794
|
-
# Search for symbols
|
794
|
+
# Search for symbols available in an account
|
795
795
|
# @param user_id [String]
|
796
796
|
# @param user_secret [String]
|
797
797
|
# @param account_id [String] The ID of the account get positions.
|
@@ -806,7 +806,7 @@ module SnapTrade
|
|
806
806
|
symbol_search_user_account_with_http_info_impl(user_id, user_secret, account_id, extra)
|
807
807
|
end
|
808
808
|
|
809
|
-
# Search for symbols
|
809
|
+
# Search for symbols available in an account
|
810
810
|
# @param user_id [String]
|
811
811
|
# @param user_secret [String]
|
812
812
|
# @param account_id [String] The ID of the account get positions.
|
@@ -818,7 +818,7 @@ module SnapTrade
|
|
818
818
|
data
|
819
819
|
end
|
820
820
|
|
821
|
-
# Search for symbols
|
821
|
+
# Search for symbols available in an account
|
822
822
|
# @param user_id [String]
|
823
823
|
# @param user_secret [String]
|
824
824
|
# @param account_id [String] The ID of the account get positions.
|
@@ -136,188 +136,6 @@ module SnapTrade
|
|
136
136
|
end
|
137
137
|
|
138
138
|
|
139
|
-
# Return details of a specific trade before it's placed
|
140
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
141
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
142
|
-
# @param trade_id [String] The ID of trade object
|
143
|
-
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
144
|
-
def get_calculated_trade_impact_by_id(portfolio_group_id:, calculated_trade_id:, trade_id:, extra: {})
|
145
|
-
|
146
|
-
data, _status_code, _headers = get_calculated_trade_impact_by_id_with_http_info_impl(portfolio_group_id, calculated_trade_id, trade_id, extra)
|
147
|
-
data
|
148
|
-
end
|
149
|
-
|
150
|
-
# Return details of a specific trade before it's placed
|
151
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
152
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
153
|
-
# @param trade_id [String] The ID of trade object
|
154
|
-
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
155
|
-
def get_calculated_trade_impact_by_id_with_http_info(portfolio_group_id:, calculated_trade_id:, trade_id:, extra: {})
|
156
|
-
|
157
|
-
get_calculated_trade_impact_by_id_with_http_info_impl(portfolio_group_id, calculated_trade_id, trade_id, extra)
|
158
|
-
end
|
159
|
-
|
160
|
-
# Return details of a specific trade before it's placed
|
161
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
162
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
163
|
-
# @param trade_id [String] The ID of trade object
|
164
|
-
# @param [Hash] opts the optional parameters
|
165
|
-
# @return [Trade]
|
166
|
-
def get_calculated_trade_impact_by_id_impl(portfolio_group_id, calculated_trade_id, trade_id, opts = {})
|
167
|
-
data, _status_code, _headers = get_calculated_trade_impact_by_id_with_http_info(portfolio_group_id, calculated_trade_id, trade_id, opts)
|
168
|
-
data
|
169
|
-
end
|
170
|
-
|
171
|
-
# Return details of a specific trade before it's placed
|
172
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
173
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
174
|
-
# @param trade_id [String] The ID of trade object
|
175
|
-
# @param [Hash] opts the optional parameters
|
176
|
-
# @return [Array<(Trade, Integer, Hash)>] Trade data, response status code and response headers
|
177
|
-
def get_calculated_trade_impact_by_id_with_http_info_impl(portfolio_group_id, calculated_trade_id, trade_id, opts = {})
|
178
|
-
if @api_client.config.debugging
|
179
|
-
@api_client.config.logger.debug 'Calling API: TradingApi.get_calculated_trade_impact_by_id ...'
|
180
|
-
end
|
181
|
-
# verify the required parameter 'portfolio_group_id' is set
|
182
|
-
if @api_client.config.client_side_validation && portfolio_group_id.nil?
|
183
|
-
fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling TradingApi.get_calculated_trade_impact_by_id"
|
184
|
-
end
|
185
|
-
# verify the required parameter 'calculated_trade_id' is set
|
186
|
-
if @api_client.config.client_side_validation && calculated_trade_id.nil?
|
187
|
-
fail ArgumentError, "Missing the required parameter 'calculated_trade_id' when calling TradingApi.get_calculated_trade_impact_by_id"
|
188
|
-
end
|
189
|
-
# verify the required parameter 'trade_id' is set
|
190
|
-
if @api_client.config.client_side_validation && trade_id.nil?
|
191
|
-
fail ArgumentError, "Missing the required parameter 'trade_id' when calling TradingApi.get_calculated_trade_impact_by_id"
|
192
|
-
end
|
193
|
-
# resource path
|
194
|
-
local_var_path = '/portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/modify/{tradeId}'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s)).sub('{' + 'calculatedTradeId' + '}', CGI.escape(calculated_trade_id.to_s)).sub('{' + 'tradeId' + '}', CGI.escape(trade_id.to_s))
|
195
|
-
|
196
|
-
# query parameters
|
197
|
-
query_params = opts[:query_params] || {}
|
198
|
-
|
199
|
-
# header parameters
|
200
|
-
header_params = opts[:header_params] || {}
|
201
|
-
# HTTP header 'Accept' (if needed)
|
202
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
203
|
-
|
204
|
-
# form parameters
|
205
|
-
form_params = opts[:form_params] || {}
|
206
|
-
|
207
|
-
# http body (model)
|
208
|
-
post_body = opts[:debug_body]
|
209
|
-
|
210
|
-
# return_type
|
211
|
-
return_type = opts[:debug_return_type] || 'Trade'
|
212
|
-
|
213
|
-
# auth_names
|
214
|
-
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
215
|
-
|
216
|
-
new_options = opts.merge(
|
217
|
-
:operation => :"TradingApi.get_calculated_trade_impact_by_id",
|
218
|
-
:header_params => header_params,
|
219
|
-
:query_params => query_params,
|
220
|
-
:form_params => form_params,
|
221
|
-
:body => post_body,
|
222
|
-
:auth_names => auth_names,
|
223
|
-
:return_type => return_type
|
224
|
-
)
|
225
|
-
|
226
|
-
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
227
|
-
if @api_client.config.debugging
|
228
|
-
@api_client.config.logger.debug "API called: TradingApi#get_calculated_trade_impact_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
229
|
-
end
|
230
|
-
return data, status_code, headers, response
|
231
|
-
end
|
232
|
-
|
233
|
-
|
234
|
-
# Return the impact of placing a series of trades on the portfolio
|
235
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
236
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
237
|
-
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
238
|
-
def get_calculated_trades_impact(portfolio_group_id:, calculated_trade_id:, extra: {})
|
239
|
-
|
240
|
-
data, _status_code, _headers = get_calculated_trades_impact_with_http_info_impl(portfolio_group_id, calculated_trade_id, extra)
|
241
|
-
data
|
242
|
-
end
|
243
|
-
|
244
|
-
# Return the impact of placing a series of trades on the portfolio
|
245
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
246
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
247
|
-
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
248
|
-
def get_calculated_trades_impact_with_http_info(portfolio_group_id:, calculated_trade_id:, extra: {})
|
249
|
-
|
250
|
-
get_calculated_trades_impact_with_http_info_impl(portfolio_group_id, calculated_trade_id, extra)
|
251
|
-
end
|
252
|
-
|
253
|
-
# Return the impact of placing a series of trades on the portfolio
|
254
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
255
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
256
|
-
# @param [Hash] opts the optional parameters
|
257
|
-
# @return [Array<TradeImpact>]
|
258
|
-
def get_calculated_trades_impact_impl(portfolio_group_id, calculated_trade_id, opts = {})
|
259
|
-
data, _status_code, _headers = get_calculated_trades_impact_with_http_info(portfolio_group_id, calculated_trade_id, opts)
|
260
|
-
data
|
261
|
-
end
|
262
|
-
|
263
|
-
# Return the impact of placing a series of trades on the portfolio
|
264
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
265
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
266
|
-
# @param [Hash] opts the optional parameters
|
267
|
-
# @return [Array<(Array<TradeImpact>, Integer, Hash)>] Array<TradeImpact> data, response status code and response headers
|
268
|
-
def get_calculated_trades_impact_with_http_info_impl(portfolio_group_id, calculated_trade_id, opts = {})
|
269
|
-
if @api_client.config.debugging
|
270
|
-
@api_client.config.logger.debug 'Calling API: TradingApi.get_calculated_trades_impact ...'
|
271
|
-
end
|
272
|
-
# verify the required parameter 'portfolio_group_id' is set
|
273
|
-
if @api_client.config.client_side_validation && portfolio_group_id.nil?
|
274
|
-
fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling TradingApi.get_calculated_trades_impact"
|
275
|
-
end
|
276
|
-
# verify the required parameter 'calculated_trade_id' is set
|
277
|
-
if @api_client.config.client_side_validation && calculated_trade_id.nil?
|
278
|
-
fail ArgumentError, "Missing the required parameter 'calculated_trade_id' when calling TradingApi.get_calculated_trades_impact"
|
279
|
-
end
|
280
|
-
# resource path
|
281
|
-
local_var_path = '/portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/impact'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s)).sub('{' + 'calculatedTradeId' + '}', CGI.escape(calculated_trade_id.to_s))
|
282
|
-
|
283
|
-
# query parameters
|
284
|
-
query_params = opts[:query_params] || {}
|
285
|
-
|
286
|
-
# header parameters
|
287
|
-
header_params = opts[:header_params] || {}
|
288
|
-
# HTTP header 'Accept' (if needed)
|
289
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
290
|
-
|
291
|
-
# form parameters
|
292
|
-
form_params = opts[:form_params] || {}
|
293
|
-
|
294
|
-
# http body (model)
|
295
|
-
post_body = opts[:debug_body]
|
296
|
-
|
297
|
-
# return_type
|
298
|
-
return_type = opts[:debug_return_type] || 'Array<TradeImpact>'
|
299
|
-
|
300
|
-
# auth_names
|
301
|
-
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
302
|
-
|
303
|
-
new_options = opts.merge(
|
304
|
-
:operation => :"TradingApi.get_calculated_trades_impact",
|
305
|
-
:header_params => header_params,
|
306
|
-
:query_params => query_params,
|
307
|
-
:form_params => form_params,
|
308
|
-
:body => post_body,
|
309
|
-
:auth_names => auth_names,
|
310
|
-
:return_type => return_type
|
311
|
-
)
|
312
|
-
|
313
|
-
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
314
|
-
if @api_client.config.debugging
|
315
|
-
@api_client.config.logger.debug "API called: TradingApi#get_calculated_trades_impact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
316
|
-
end
|
317
|
-
return data, status_code, headers, response
|
318
|
-
end
|
319
|
-
|
320
|
-
|
321
139
|
# Check impact of trades on account.
|
322
140
|
# @param user_id [String]
|
323
141
|
# @param user_secret [String]
|
@@ -569,233 +387,6 @@ module SnapTrade
|
|
569
387
|
end
|
570
388
|
|
571
389
|
|
572
|
-
# Modify units of a trade before it is placed
|
573
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
574
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
575
|
-
# @param trade_id [String] The ID of trade object
|
576
|
-
# @param id [String]
|
577
|
-
# @param account [Account]
|
578
|
-
# @param symbol [BrokerageSymbol]
|
579
|
-
# @param universal_symbol [UniversalSymbol]
|
580
|
-
# @param action [TradeAction]
|
581
|
-
# @param units [Integer]
|
582
|
-
# @param price [Float]
|
583
|
-
# @param sequence [Integer]
|
584
|
-
# @param body [Trade]
|
585
|
-
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
586
|
-
def modify_calculated_trade_by_id(portfolio_group_id:, calculated_trade_id:, trade_id:, id: SENTINEL, account: SENTINEL, symbol: SENTINEL, universal_symbol: SENTINEL, action: SENTINEL, units: SENTINEL, price: SENTINEL, sequence: SENTINEL, extra: {})
|
587
|
-
_body = {}
|
588
|
-
_body[:id] = id if id != SENTINEL
|
589
|
-
_body[:account] = account if account != SENTINEL
|
590
|
-
_body[:symbol] = symbol if symbol != SENTINEL
|
591
|
-
_body[:universal_symbol] = universal_symbol if universal_symbol != SENTINEL
|
592
|
-
_body[:action] = action if action != SENTINEL
|
593
|
-
_body[:units] = units if units != SENTINEL
|
594
|
-
_body[:price] = price if price != SENTINEL
|
595
|
-
_body[:sequence] = sequence if sequence != SENTINEL
|
596
|
-
extra[:trade] = _body if !_body.empty?
|
597
|
-
|
598
|
-
data, _status_code, _headers = modify_calculated_trade_by_id_with_http_info_impl(portfolio_group_id, calculated_trade_id, trade_id, extra)
|
599
|
-
data
|
600
|
-
end
|
601
|
-
|
602
|
-
# Modify units of a trade before it is placed
|
603
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
604
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
605
|
-
# @param trade_id [String] The ID of trade object
|
606
|
-
# @param id [String]
|
607
|
-
# @param account [Account]
|
608
|
-
# @param symbol [BrokerageSymbol]
|
609
|
-
# @param universal_symbol [UniversalSymbol]
|
610
|
-
# @param action [TradeAction]
|
611
|
-
# @param units [Integer]
|
612
|
-
# @param price [Float]
|
613
|
-
# @param sequence [Integer]
|
614
|
-
# @param body [Trade]
|
615
|
-
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
616
|
-
def modify_calculated_trade_by_id_with_http_info(portfolio_group_id:, calculated_trade_id:, trade_id:, id: SENTINEL, account: SENTINEL, symbol: SENTINEL, universal_symbol: SENTINEL, action: SENTINEL, units: SENTINEL, price: SENTINEL, sequence: SENTINEL, extra: {})
|
617
|
-
_body = {}
|
618
|
-
_body[:id] = id if id != SENTINEL
|
619
|
-
_body[:account] = account if account != SENTINEL
|
620
|
-
_body[:symbol] = symbol if symbol != SENTINEL
|
621
|
-
_body[:universal_symbol] = universal_symbol if universal_symbol != SENTINEL
|
622
|
-
_body[:action] = action if action != SENTINEL
|
623
|
-
_body[:units] = units if units != SENTINEL
|
624
|
-
_body[:price] = price if price != SENTINEL
|
625
|
-
_body[:sequence] = sequence if sequence != SENTINEL
|
626
|
-
extra[:trade] = _body if !_body.empty?
|
627
|
-
|
628
|
-
modify_calculated_trade_by_id_with_http_info_impl(portfolio_group_id, calculated_trade_id, trade_id, extra)
|
629
|
-
end
|
630
|
-
|
631
|
-
# Modify units of a trade before it is placed
|
632
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
633
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
634
|
-
# @param trade_id [String] The ID of trade object
|
635
|
-
# @param [Hash] opts the optional parameters
|
636
|
-
# @option opts [Trade] :trade
|
637
|
-
# @return [Trade]
|
638
|
-
def modify_calculated_trade_by_id_impl(portfolio_group_id, calculated_trade_id, trade_id, opts = {})
|
639
|
-
data, _status_code, _headers = modify_calculated_trade_by_id_with_http_info(portfolio_group_id, calculated_trade_id, trade_id, opts)
|
640
|
-
data
|
641
|
-
end
|
642
|
-
|
643
|
-
# Modify units of a trade before it is placed
|
644
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
645
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
646
|
-
# @param trade_id [String] The ID of trade object
|
647
|
-
# @param [Hash] opts the optional parameters
|
648
|
-
# @option opts [Trade] :trade
|
649
|
-
# @return [Array<(Trade, Integer, Hash)>] Trade data, response status code and response headers
|
650
|
-
def modify_calculated_trade_by_id_with_http_info_impl(portfolio_group_id, calculated_trade_id, trade_id, opts = {})
|
651
|
-
if @api_client.config.debugging
|
652
|
-
@api_client.config.logger.debug 'Calling API: TradingApi.modify_calculated_trade_by_id ...'
|
653
|
-
end
|
654
|
-
# verify the required parameter 'portfolio_group_id' is set
|
655
|
-
if @api_client.config.client_side_validation && portfolio_group_id.nil?
|
656
|
-
fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling TradingApi.modify_calculated_trade_by_id"
|
657
|
-
end
|
658
|
-
# verify the required parameter 'calculated_trade_id' is set
|
659
|
-
if @api_client.config.client_side_validation && calculated_trade_id.nil?
|
660
|
-
fail ArgumentError, "Missing the required parameter 'calculated_trade_id' when calling TradingApi.modify_calculated_trade_by_id"
|
661
|
-
end
|
662
|
-
# verify the required parameter 'trade_id' is set
|
663
|
-
if @api_client.config.client_side_validation && trade_id.nil?
|
664
|
-
fail ArgumentError, "Missing the required parameter 'trade_id' when calling TradingApi.modify_calculated_trade_by_id"
|
665
|
-
end
|
666
|
-
# resource path
|
667
|
-
local_var_path = '/portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/modify/{tradeId}'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s)).sub('{' + 'calculatedTradeId' + '}', CGI.escape(calculated_trade_id.to_s)).sub('{' + 'tradeId' + '}', CGI.escape(trade_id.to_s))
|
668
|
-
|
669
|
-
# query parameters
|
670
|
-
query_params = opts[:query_params] || {}
|
671
|
-
|
672
|
-
# header parameters
|
673
|
-
header_params = opts[:header_params] || {}
|
674
|
-
# HTTP header 'Accept' (if needed)
|
675
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
676
|
-
# HTTP header 'Content-Type'
|
677
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
678
|
-
if !content_type.nil?
|
679
|
-
header_params['Content-Type'] = content_type
|
680
|
-
end
|
681
|
-
|
682
|
-
# form parameters
|
683
|
-
form_params = opts[:form_params] || {}
|
684
|
-
|
685
|
-
# http body (model)
|
686
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'trade'])
|
687
|
-
|
688
|
-
# return_type
|
689
|
-
return_type = opts[:debug_return_type] || 'Trade'
|
690
|
-
|
691
|
-
# auth_names
|
692
|
-
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
693
|
-
|
694
|
-
new_options = opts.merge(
|
695
|
-
:operation => :"TradingApi.modify_calculated_trade_by_id",
|
696
|
-
:header_params => header_params,
|
697
|
-
:query_params => query_params,
|
698
|
-
:form_params => form_params,
|
699
|
-
:body => post_body,
|
700
|
-
:auth_names => auth_names,
|
701
|
-
:return_type => return_type
|
702
|
-
)
|
703
|
-
|
704
|
-
data, status_code, headers, response = @api_client.call_api(:PATCH, local_var_path, new_options)
|
705
|
-
if @api_client.config.debugging
|
706
|
-
@api_client.config.logger.debug "API called: TradingApi#modify_calculated_trade_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
707
|
-
end
|
708
|
-
return data, status_code, headers, response
|
709
|
-
end
|
710
|
-
|
711
|
-
|
712
|
-
# Place orders for the CalculatedTrades in series
|
713
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
714
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
715
|
-
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
716
|
-
def place_calculated_trades(portfolio_group_id:, calculated_trade_id:, extra: {})
|
717
|
-
|
718
|
-
data, _status_code, _headers = place_calculated_trades_with_http_info_impl(portfolio_group_id, calculated_trade_id, extra)
|
719
|
-
data
|
720
|
-
end
|
721
|
-
|
722
|
-
# Place orders for the CalculatedTrades in series
|
723
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
724
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
725
|
-
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
726
|
-
def place_calculated_trades_with_http_info(portfolio_group_id:, calculated_trade_id:, extra: {})
|
727
|
-
|
728
|
-
place_calculated_trades_with_http_info_impl(portfolio_group_id, calculated_trade_id, extra)
|
729
|
-
end
|
730
|
-
|
731
|
-
# Place orders for the CalculatedTrades in series
|
732
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
733
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
734
|
-
# @param [Hash] opts the optional parameters
|
735
|
-
# @return [Array<TradeExecutionStatus>]
|
736
|
-
def place_calculated_trades_impl(portfolio_group_id, calculated_trade_id, opts = {})
|
737
|
-
data, _status_code, _headers = place_calculated_trades_with_http_info(portfolio_group_id, calculated_trade_id, opts)
|
738
|
-
data
|
739
|
-
end
|
740
|
-
|
741
|
-
# Place orders for the CalculatedTrades in series
|
742
|
-
# @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
|
743
|
-
# @param calculated_trade_id [String] The ID of calculated trade to get account impact
|
744
|
-
# @param [Hash] opts the optional parameters
|
745
|
-
# @return [Array<(Array<TradeExecutionStatus>, Integer, Hash)>] Array<TradeExecutionStatus> data, response status code and response headers
|
746
|
-
def place_calculated_trades_with_http_info_impl(portfolio_group_id, calculated_trade_id, opts = {})
|
747
|
-
if @api_client.config.debugging
|
748
|
-
@api_client.config.logger.debug 'Calling API: TradingApi.place_calculated_trades ...'
|
749
|
-
end
|
750
|
-
# verify the required parameter 'portfolio_group_id' is set
|
751
|
-
if @api_client.config.client_side_validation && portfolio_group_id.nil?
|
752
|
-
fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling TradingApi.place_calculated_trades"
|
753
|
-
end
|
754
|
-
# verify the required parameter 'calculated_trade_id' is set
|
755
|
-
if @api_client.config.client_side_validation && calculated_trade_id.nil?
|
756
|
-
fail ArgumentError, "Missing the required parameter 'calculated_trade_id' when calling TradingApi.place_calculated_trades"
|
757
|
-
end
|
758
|
-
# resource path
|
759
|
-
local_var_path = '/portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/placeOrders'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s)).sub('{' + 'calculatedTradeId' + '}', CGI.escape(calculated_trade_id.to_s))
|
760
|
-
|
761
|
-
# query parameters
|
762
|
-
query_params = opts[:query_params] || {}
|
763
|
-
|
764
|
-
# header parameters
|
765
|
-
header_params = opts[:header_params] || {}
|
766
|
-
# HTTP header 'Accept' (if needed)
|
767
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
768
|
-
|
769
|
-
# form parameters
|
770
|
-
form_params = opts[:form_params] || {}
|
771
|
-
|
772
|
-
# http body (model)
|
773
|
-
post_body = opts[:debug_body]
|
774
|
-
|
775
|
-
# return_type
|
776
|
-
return_type = opts[:debug_return_type] || 'Array<TradeExecutionStatus>'
|
777
|
-
|
778
|
-
# auth_names
|
779
|
-
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
780
|
-
|
781
|
-
new_options = opts.merge(
|
782
|
-
:operation => :"TradingApi.place_calculated_trades",
|
783
|
-
:header_params => header_params,
|
784
|
-
:query_params => query_params,
|
785
|
-
:form_params => form_params,
|
786
|
-
:body => post_body,
|
787
|
-
:auth_names => auth_names,
|
788
|
-
:return_type => return_type
|
789
|
-
)
|
790
|
-
|
791
|
-
data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
|
792
|
-
if @api_client.config.debugging
|
793
|
-
@api_client.config.logger.debug "API called: TradingApi#place_calculated_trades\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
794
|
-
end
|
795
|
-
return data, status_code, headers, response
|
796
|
-
end
|
797
|
-
|
798
|
-
|
799
390
|
# Place a trade with NO validation.
|
800
391
|
# @param user_id [String]
|
801
392
|
# @param user_secret [String]
|
@@ -26,7 +26,7 @@ module SnapTrade
|
|
26
26
|
# @param end_date [Date]
|
27
27
|
# @param accounts [String] Optional comma seperated list of account IDs used to filter the request on specific accounts
|
28
28
|
# @param brokerage_authorizations [String] Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations
|
29
|
-
# @param type [String] Optional comma seperated list of types to filter activities by. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT
|
29
|
+
# @param type [String] Optional comma seperated list of types to filter activities by. This is not an exhaustive list, if we fail to match to these types, we will return the raw description from the brokerage. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT
|
30
30
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
31
31
|
def get_activities(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {})
|
32
32
|
extra[:start_date] = start_date if start_date != SENTINEL
|
@@ -47,7 +47,7 @@ module SnapTrade
|
|
47
47
|
# @param end_date [Date]
|
48
48
|
# @param accounts [String] Optional comma seperated list of account IDs used to filter the request on specific accounts
|
49
49
|
# @param brokerage_authorizations [String] Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations
|
50
|
-
# @param type [String] Optional comma seperated list of types to filter activities by. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT
|
50
|
+
# @param type [String] Optional comma seperated list of types to filter activities by. This is not an exhaustive list, if we fail to match to these types, we will return the raw description from the brokerage. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT
|
51
51
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
52
52
|
def get_activities_with_http_info(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {})
|
53
53
|
extra[:start_date] = start_date if start_date != SENTINEL
|
@@ -68,7 +68,7 @@ module SnapTrade
|
|
68
68
|
# @option opts [Date] :end_date
|
69
69
|
# @option opts [String] :accounts Optional comma seperated list of account IDs used to filter the request on specific accounts
|
70
70
|
# @option opts [String] :brokerage_authorizations Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations
|
71
|
-
# @option opts [String] :type Optional comma seperated list of types to filter activities by. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT
|
71
|
+
# @option opts [String] :type Optional comma seperated list of types to filter activities by. This is not an exhaustive list, if we fail to match to these types, we will return the raw description from the brokerage. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT
|
72
72
|
# @return [Array<UniversalActivity>]
|
73
73
|
def get_activities_impl(user_id, user_secret, opts = {})
|
74
74
|
data, _status_code, _headers = get_activities_with_http_info(user_id, user_secret, opts)
|
@@ -84,7 +84,7 @@ module SnapTrade
|
|
84
84
|
# @option opts [Date] :end_date
|
85
85
|
# @option opts [String] :accounts Optional comma seperated list of account IDs used to filter the request on specific accounts
|
86
86
|
# @option opts [String] :brokerage_authorizations Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations
|
87
|
-
# @option opts [String] :type Optional comma seperated list of types to filter activities by. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT
|
87
|
+
# @option opts [String] :type Optional comma seperated list of types to filter activities by. This is not an exhaustive list, if we fail to match to these types, we will return the raw description from the brokerage. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT
|
88
88
|
# @return [Array<(Array<UniversalActivity>, Integer, Hash)>] Array<UniversalActivity> data, response status code and response headers
|
89
89
|
def get_activities_with_http_info_impl(user_id, user_secret, opts = {})
|
90
90
|
if @api_client.config.debugging
|