snaptrade 2.0.53 → 2.0.55
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +110 -2
- data/lib/snaptrade/api/account_information_api.rb +212 -0
- data/lib/snaptrade/api/connections_api.rb +103 -0
- data/lib/snaptrade/models/rate_of_return_object.rb +238 -0
- data/lib/snaptrade/models/rate_of_return_response.rb +220 -0
- data/lib/snaptrade/models/recent_orders_response.rb +220 -0
- data/lib/snaptrade/models/timeframe.rb +40 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +4 -0
- data/spec/api/account_information_api_spec.rb +28 -0
- data/spec/api/connections_api_spec.rb +14 -0
- data/spec/models/rate_of_return_object_spec.rb +41 -0
- data/spec/models/rate_of_return_response_spec.rb +29 -0
- data/spec/models/recent_orders_response_spec.rb +29 -0
- data/spec/models/timeframe_spec.rb +23 -0
- metadata +14 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94eee44f6564f4e2b0f344fcbb97c338db8e9c0d81eb7b36cade1ddbcbf50de6
|
4
|
+
data.tar.gz: d612e500e00019da2862e9e3836244d6fd0f2e777787e00c7d115f605df29244
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a1071497224bbaa98f85100c1f4eade117f0c1e729d4ae035c96eda3b44cfdebea58995510a55b729e4f54d2bc52f685615a1fd31bbb2b476455eeae3ab5379
|
7
|
+
data.tar.gz: 35b0d624b6d4e803b93aa342f0c96d7f9fef32f17f23d40103de298e38eaa4edc3f64c7fe877a682ff956899294fb54ef06c7e8be37c9075c6054826cc7b4a1b
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
snaptrade (2.0.
|
4
|
+
snaptrade (2.0.55)
|
5
5
|
faraday (>= 1.0.1, < 3.0)
|
6
6
|
faraday-multipart (~> 1.0, >= 1.0.4)
|
7
7
|
|
@@ -42,7 +42,7 @@ GEM
|
|
42
42
|
rainbow (3.1.1)
|
43
43
|
rake (13.0.6)
|
44
44
|
regexp_parser (2.9.2)
|
45
|
-
reline (0.5.
|
45
|
+
reline (0.5.11)
|
46
46
|
io-console (~> 0.5)
|
47
47
|
rexml (3.3.9)
|
48
48
|
rspec (3.13.0)
|
@@ -67,7 +67,7 @@ GEM
|
|
67
67
|
rubocop-ast (>= 1.2.0, < 2.0)
|
68
68
|
ruby-progressbar (~> 1.7)
|
69
69
|
unicode-display_width (>= 1.4.0, < 3.0)
|
70
|
-
rubocop-ast (1.
|
70
|
+
rubocop-ast (1.36.1)
|
71
71
|
parser (>= 3.3.1.0)
|
72
72
|
ruby-progressbar (1.13.0)
|
73
73
|
ruby2_keywords (0.0.5)
|
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.
|
9
|
+
[![npm](https://img.shields.io/badge/gem-v2.0.55-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.55)
|
10
10
|
[![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
|
11
11
|
|
12
12
|
</div>
|
@@ -24,6 +24,8 @@ Connect brokerage accounts to your app for live positions and trading
|
|
24
24
|
* [`snaptrade.account_information.get_user_account_details`](#snaptradeaccount_informationget_user_account_details)
|
25
25
|
* [`snaptrade.account_information.get_user_account_orders`](#snaptradeaccount_informationget_user_account_orders)
|
26
26
|
* [`snaptrade.account_information.get_user_account_positions`](#snaptradeaccount_informationget_user_account_positions)
|
27
|
+
* [`snaptrade.account_information.get_user_account_recent_orders`](#snaptradeaccount_informationget_user_account_recent_orders)
|
28
|
+
* [`snaptrade.account_information.get_user_account_return_rates`](#snaptradeaccount_informationget_user_account_return_rates)
|
27
29
|
* [`snaptrade.account_information.get_user_holdings`](#snaptradeaccount_informationget_user_holdings)
|
28
30
|
* [`snaptrade.account_information.list_user_accounts`](#snaptradeaccount_informationlist_user_accounts)
|
29
31
|
* [`snaptrade.account_information.update_user_account`](#snaptradeaccount_informationupdate_user_account)
|
@@ -38,6 +40,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
38
40
|
* [`snaptrade.connections.list_brokerage_authorizations`](#snaptradeconnectionslist_brokerage_authorizations)
|
39
41
|
* [`snaptrade.connections.refresh_brokerage_authorization`](#snaptradeconnectionsrefresh_brokerage_authorization)
|
40
42
|
* [`snaptrade.connections.remove_brokerage_authorization`](#snaptradeconnectionsremove_brokerage_authorization)
|
43
|
+
* [`snaptrade.connections.return_rates`](#snaptradeconnectionsreturn_rates)
|
41
44
|
* [`snaptrade.connections.session_events`](#snaptradeconnectionssession_events)
|
42
45
|
* [`snaptrade.options.get_option_strategy`](#snaptradeoptionsget_option_strategy)
|
43
46
|
* [`snaptrade.options.get_options_chain`](#snaptradeoptionsget_options_chain)
|
@@ -70,7 +73,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
70
73
|
Add to Gemfile:
|
71
74
|
|
72
75
|
```ruby
|
73
|
-
gem 'snaptrade', '~> 2.0.
|
76
|
+
gem 'snaptrade', '~> 2.0.55'
|
74
77
|
```
|
75
78
|
|
76
79
|
## Getting Started<a id="getting-started"></a>
|
@@ -303,6 +306,77 @@ p result
|
|
303
306
|
---
|
304
307
|
|
305
308
|
|
309
|
+
### `snaptrade.account_information.get_user_account_recent_orders`<a id="snaptradeaccount_informationget_user_account_recent_orders"></a>
|
310
|
+
|
311
|
+
Returns a list of orders executed in the last 24 hours in the specified account.
|
312
|
+
This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution
|
313
|
+
Differs from /orders in that it only returns orders that have been *executed* in the last 24 hours as opposed to pending or cancelled orders up to 30 days old
|
314
|
+
*Please contact support for access as this endpoint is not enabled by default.*
|
315
|
+
|
316
|
+
|
317
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
318
|
+
|
319
|
+
```ruby
|
320
|
+
result = snaptrade.account_information.get_user_account_recent_orders(
|
321
|
+
user_id: "snaptrade-user-123",
|
322
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
323
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
324
|
+
)
|
325
|
+
p result
|
326
|
+
```
|
327
|
+
|
328
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
329
|
+
|
330
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
331
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
332
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
333
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
334
|
+
|
335
|
+
[RecentOrdersResponse](./lib/snaptrade/models/recent_orders_response.rb)
|
336
|
+
|
337
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
338
|
+
|
339
|
+
`/accounts/{accountId}/recentOrders` `GET`
|
340
|
+
|
341
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
342
|
+
|
343
|
+
---
|
344
|
+
|
345
|
+
|
346
|
+
### `snaptrade.account_information.get_user_account_return_rates`<a id="snaptradeaccount_informationget_user_account_return_rates"></a>
|
347
|
+
|
348
|
+
Returns a list of rate of return percents for a given account. Will include timeframes available from the brokerage, for example "ALL", "1Y", "6M", "3M", "1M"
|
349
|
+
|
350
|
+
|
351
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
352
|
+
|
353
|
+
```ruby
|
354
|
+
result = snaptrade.account_information.get_user_account_return_rates(
|
355
|
+
user_id: "snaptrade-user-123",
|
356
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
357
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
358
|
+
)
|
359
|
+
p result
|
360
|
+
```
|
361
|
+
|
362
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
363
|
+
|
364
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
365
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
366
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
367
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
368
|
+
|
369
|
+
[RateOfReturnResponse](./lib/snaptrade/models/rate_of_return_response.rb)
|
370
|
+
|
371
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
372
|
+
|
373
|
+
`/accounts/{accountId}/returnRates` `GET`
|
374
|
+
|
375
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
376
|
+
|
377
|
+
---
|
378
|
+
|
379
|
+
|
306
380
|
### `snaptrade.account_information.get_user_holdings`<a id="snaptradeaccount_informationget_user_holdings"></a>
|
307
381
|
|
308
382
|
Returns a list of balances, positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__
|
@@ -799,6 +873,40 @@ snaptrade.connections.remove_brokerage_authorization(
|
|
799
873
|
---
|
800
874
|
|
801
875
|
|
876
|
+
### `snaptrade.connections.return_rates`<a id="snaptradeconnectionsreturn_rates"></a>
|
877
|
+
|
878
|
+
Returns a list of rate of return percents for a given connection. Will include timeframes available from the brokerage, for example "ALL", "1Y", "6M", "3M", "1M"
|
879
|
+
|
880
|
+
|
881
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
882
|
+
|
883
|
+
```ruby
|
884
|
+
result = snaptrade.connections.return_rates(
|
885
|
+
user_id: "snaptrade-user-123",
|
886
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
887
|
+
authorization_id: "87b24961-b51e-4db8-9226-f198f6518a89",
|
888
|
+
)
|
889
|
+
p result
|
890
|
+
```
|
891
|
+
|
892
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
893
|
+
|
894
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
895
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
896
|
+
##### authorization_id: `String`<a id="authorization_id-string"></a>
|
897
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
898
|
+
|
899
|
+
[RateOfReturnResponse](./lib/snaptrade/models/rate_of_return_response.rb)
|
900
|
+
|
901
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
902
|
+
|
903
|
+
`/authorizations/{authorizationId}/returnRates` `GET`
|
904
|
+
|
905
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
906
|
+
|
907
|
+
---
|
908
|
+
|
909
|
+
|
802
910
|
### `snaptrade.connections.session_events`<a id="snaptradeconnectionssession_events"></a>
|
803
911
|
|
804
912
|
Returns a list of session events associated with a user.
|
@@ -575,6 +575,218 @@ module SnapTrade
|
|
575
575
|
end
|
576
576
|
|
577
577
|
|
578
|
+
# List account recent executed orders
|
579
|
+
#
|
580
|
+
# Returns a list of orders executed in the last 24 hours in the specified account.
|
581
|
+
# This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution
|
582
|
+
# Differs from /orders in that it only returns orders that have been *executed* in the last 24 hours as opposed to pending or cancelled orders up to 30 days old
|
583
|
+
# *Please contact support for access as this endpoint is not enabled by default.*
|
584
|
+
#
|
585
|
+
# @param user_id [String]
|
586
|
+
# @param user_secret [String]
|
587
|
+
# @param account_id [String]
|
588
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
589
|
+
def get_user_account_recent_orders(user_id:, user_secret:, account_id:, extra: {})
|
590
|
+
data, _status_code, _headers = get_user_account_recent_orders_with_http_info_impl(user_id, user_secret, account_id, extra)
|
591
|
+
data
|
592
|
+
end
|
593
|
+
|
594
|
+
# List account recent executed orders
|
595
|
+
#
|
596
|
+
# Returns a list of orders executed in the last 24 hours in the specified account.
|
597
|
+
# This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution
|
598
|
+
# Differs from /orders in that it only returns orders that have been *executed* in the last 24 hours as opposed to pending or cancelled orders up to 30 days old
|
599
|
+
# *Please contact support for access as this endpoint is not enabled by default.*
|
600
|
+
#
|
601
|
+
# @param user_id [String]
|
602
|
+
# @param user_secret [String]
|
603
|
+
# @param account_id [String]
|
604
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
605
|
+
def get_user_account_recent_orders_with_http_info(user_id:, user_secret:, account_id:, extra: {})
|
606
|
+
get_user_account_recent_orders_with_http_info_impl(user_id, user_secret, account_id, extra)
|
607
|
+
end
|
608
|
+
|
609
|
+
# List account recent executed orders
|
610
|
+
# Returns a list of orders executed in the last 24 hours in the specified account. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution Differs from /orders in that it only returns orders that have been *executed* in the last 24 hours as opposed to pending or cancelled orders up to 30 days old *Please contact support for access as this endpoint is not enabled by default.*
|
611
|
+
# @param user_id [String]
|
612
|
+
# @param user_secret [String]
|
613
|
+
# @param account_id [String]
|
614
|
+
# @param [Hash] opts the optional parameters
|
615
|
+
# @return [RecentOrdersResponse]
|
616
|
+
private def get_user_account_recent_orders_impl(user_id, user_secret, account_id, opts = {})
|
617
|
+
data, _status_code, _headers = get_user_account_recent_orders_with_http_info(user_id, user_secret, account_id, opts)
|
618
|
+
data
|
619
|
+
end
|
620
|
+
|
621
|
+
# List account recent executed orders
|
622
|
+
# Returns a list of orders executed in the last 24 hours in the specified account. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution Differs from /orders in that it only returns orders that have been *executed* in the last 24 hours as opposed to pending or cancelled orders up to 30 days old *Please contact support for access as this endpoint is not enabled by default.*
|
623
|
+
# @param user_id [String]
|
624
|
+
# @param user_secret [String]
|
625
|
+
# @param account_id [String]
|
626
|
+
# @param [Hash] opts the optional parameters
|
627
|
+
# @return [Array<(RecentOrdersResponse, Integer, Hash)>] RecentOrdersResponse data, response status code and response headers
|
628
|
+
private def get_user_account_recent_orders_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|
629
|
+
if @api_client.config.debugging
|
630
|
+
@api_client.config.logger.debug 'Calling API: AccountInformationApi.get_user_account_recent_orders ...'
|
631
|
+
end
|
632
|
+
# verify the required parameter 'user_id' is set
|
633
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
634
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AccountInformationApi.get_user_account_recent_orders"
|
635
|
+
end
|
636
|
+
# verify the required parameter 'user_secret' is set
|
637
|
+
if @api_client.config.client_side_validation && user_secret.nil?
|
638
|
+
fail ArgumentError, "Missing the required parameter 'user_secret' when calling AccountInformationApi.get_user_account_recent_orders"
|
639
|
+
end
|
640
|
+
# verify the required parameter 'account_id' is set
|
641
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
642
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountInformationApi.get_user_account_recent_orders"
|
643
|
+
end
|
644
|
+
# resource path
|
645
|
+
local_var_path = '/accounts/{accountId}/recentOrders'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
646
|
+
|
647
|
+
# query parameters
|
648
|
+
query_params = opts[:query_params] || {}
|
649
|
+
query_params[:'userId'] = user_id
|
650
|
+
query_params[:'userSecret'] = user_secret
|
651
|
+
|
652
|
+
# header parameters
|
653
|
+
header_params = opts[:header_params] || {}
|
654
|
+
# HTTP header 'Accept' (if needed)
|
655
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
656
|
+
|
657
|
+
# form parameters
|
658
|
+
form_params = opts[:form_params] || {}
|
659
|
+
|
660
|
+
# http body (model)
|
661
|
+
post_body = opts[:debug_body]
|
662
|
+
|
663
|
+
# return_type
|
664
|
+
return_type = opts[:debug_return_type] || 'RecentOrdersResponse'
|
665
|
+
|
666
|
+
# auth_names
|
667
|
+
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
668
|
+
|
669
|
+
new_options = opts.merge(
|
670
|
+
:operation => :"AccountInformationApi.get_user_account_recent_orders",
|
671
|
+
:header_params => header_params,
|
672
|
+
:query_params => query_params,
|
673
|
+
:form_params => form_params,
|
674
|
+
:body => post_body,
|
675
|
+
:auth_names => auth_names,
|
676
|
+
:return_type => return_type
|
677
|
+
)
|
678
|
+
|
679
|
+
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
680
|
+
if @api_client.config.debugging
|
681
|
+
@api_client.config.logger.debug "API called: AccountInformationApi#get_user_account_recent_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
682
|
+
end
|
683
|
+
return data, status_code, headers, response
|
684
|
+
end
|
685
|
+
|
686
|
+
|
687
|
+
# List account rate of returns
|
688
|
+
#
|
689
|
+
# Returns a list of rate of return percents for a given account. Will include timeframes available from the brokerage, for example "ALL", "1Y", "6M", "3M", "1M"
|
690
|
+
#
|
691
|
+
# @param user_id [String]
|
692
|
+
# @param user_secret [String]
|
693
|
+
# @param account_id [String]
|
694
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
695
|
+
def get_user_account_return_rates(user_id:, user_secret:, account_id:, extra: {})
|
696
|
+
data, _status_code, _headers = get_user_account_return_rates_with_http_info_impl(user_id, user_secret, account_id, extra)
|
697
|
+
data
|
698
|
+
end
|
699
|
+
|
700
|
+
# List account rate of returns
|
701
|
+
#
|
702
|
+
# Returns a list of rate of return percents for a given account. Will include timeframes available from the brokerage, for example "ALL", "1Y", "6M", "3M", "1M"
|
703
|
+
#
|
704
|
+
# @param user_id [String]
|
705
|
+
# @param user_secret [String]
|
706
|
+
# @param account_id [String]
|
707
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
708
|
+
def get_user_account_return_rates_with_http_info(user_id:, user_secret:, account_id:, extra: {})
|
709
|
+
get_user_account_return_rates_with_http_info_impl(user_id, user_secret, account_id, extra)
|
710
|
+
end
|
711
|
+
|
712
|
+
# List account rate of returns
|
713
|
+
# Returns a list of rate of return percents for a given account. Will include timeframes available from the brokerage, for example \"ALL\", \"1Y\", \"6M\", \"3M\", \"1M\"
|
714
|
+
# @param user_id [String]
|
715
|
+
# @param user_secret [String]
|
716
|
+
# @param account_id [String]
|
717
|
+
# @param [Hash] opts the optional parameters
|
718
|
+
# @return [RateOfReturnResponse]
|
719
|
+
private def get_user_account_return_rates_impl(user_id, user_secret, account_id, opts = {})
|
720
|
+
data, _status_code, _headers = get_user_account_return_rates_with_http_info(user_id, user_secret, account_id, opts)
|
721
|
+
data
|
722
|
+
end
|
723
|
+
|
724
|
+
# List account rate of returns
|
725
|
+
# Returns a list of rate of return percents for a given account. Will include timeframes available from the brokerage, for example \"ALL\", \"1Y\", \"6M\", \"3M\", \"1M\"
|
726
|
+
# @param user_id [String]
|
727
|
+
# @param user_secret [String]
|
728
|
+
# @param account_id [String]
|
729
|
+
# @param [Hash] opts the optional parameters
|
730
|
+
# @return [Array<(RateOfReturnResponse, Integer, Hash)>] RateOfReturnResponse data, response status code and response headers
|
731
|
+
private def get_user_account_return_rates_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|
732
|
+
if @api_client.config.debugging
|
733
|
+
@api_client.config.logger.debug 'Calling API: AccountInformationApi.get_user_account_return_rates ...'
|
734
|
+
end
|
735
|
+
# verify the required parameter 'user_id' is set
|
736
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
737
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AccountInformationApi.get_user_account_return_rates"
|
738
|
+
end
|
739
|
+
# verify the required parameter 'user_secret' is set
|
740
|
+
if @api_client.config.client_side_validation && user_secret.nil?
|
741
|
+
fail ArgumentError, "Missing the required parameter 'user_secret' when calling AccountInformationApi.get_user_account_return_rates"
|
742
|
+
end
|
743
|
+
# verify the required parameter 'account_id' is set
|
744
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
745
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountInformationApi.get_user_account_return_rates"
|
746
|
+
end
|
747
|
+
# resource path
|
748
|
+
local_var_path = '/accounts/{accountId}/returnRates'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
749
|
+
|
750
|
+
# query parameters
|
751
|
+
query_params = opts[:query_params] || {}
|
752
|
+
query_params[:'userId'] = user_id
|
753
|
+
query_params[:'userSecret'] = user_secret
|
754
|
+
|
755
|
+
# header parameters
|
756
|
+
header_params = opts[:header_params] || {}
|
757
|
+
# HTTP header 'Accept' (if needed)
|
758
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
759
|
+
|
760
|
+
# form parameters
|
761
|
+
form_params = opts[:form_params] || {}
|
762
|
+
|
763
|
+
# http body (model)
|
764
|
+
post_body = opts[:debug_body]
|
765
|
+
|
766
|
+
# return_type
|
767
|
+
return_type = opts[:debug_return_type] || 'RateOfReturnResponse'
|
768
|
+
|
769
|
+
# auth_names
|
770
|
+
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
771
|
+
|
772
|
+
new_options = opts.merge(
|
773
|
+
:operation => :"AccountInformationApi.get_user_account_return_rates",
|
774
|
+
:header_params => header_params,
|
775
|
+
:query_params => query_params,
|
776
|
+
:form_params => form_params,
|
777
|
+
:body => post_body,
|
778
|
+
:auth_names => auth_names,
|
779
|
+
:return_type => return_type
|
780
|
+
)
|
781
|
+
|
782
|
+
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
783
|
+
if @api_client.config.debugging
|
784
|
+
@api_client.config.logger.debug "API called: AccountInformationApi#get_user_account_return_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
785
|
+
end
|
786
|
+
return data, status_code, headers, response
|
787
|
+
end
|
788
|
+
|
789
|
+
|
578
790
|
# List account holdings
|
579
791
|
#
|
580
792
|
# Returns a list of balances, positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__
|
@@ -540,6 +540,109 @@ module SnapTrade
|
|
540
540
|
end
|
541
541
|
|
542
542
|
|
543
|
+
# List connection rate of returns
|
544
|
+
#
|
545
|
+
# Returns a list of rate of return percents for a given connection. Will include timeframes available from the brokerage, for example "ALL", "1Y", "6M", "3M", "1M"
|
546
|
+
#
|
547
|
+
# @param user_id [String]
|
548
|
+
# @param user_secret [String]
|
549
|
+
# @param authorization_id [String]
|
550
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
551
|
+
def return_rates(user_id:, user_secret:, authorization_id:, extra: {})
|
552
|
+
data, _status_code, _headers = return_rates_with_http_info_impl(user_id, user_secret, authorization_id, extra)
|
553
|
+
data
|
554
|
+
end
|
555
|
+
|
556
|
+
# List connection rate of returns
|
557
|
+
#
|
558
|
+
# Returns a list of rate of return percents for a given connection. Will include timeframes available from the brokerage, for example "ALL", "1Y", "6M", "3M", "1M"
|
559
|
+
#
|
560
|
+
# @param user_id [String]
|
561
|
+
# @param user_secret [String]
|
562
|
+
# @param authorization_id [String]
|
563
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
564
|
+
def return_rates_with_http_info(user_id:, user_secret:, authorization_id:, extra: {})
|
565
|
+
return_rates_with_http_info_impl(user_id, user_secret, authorization_id, extra)
|
566
|
+
end
|
567
|
+
|
568
|
+
# List connection rate of returns
|
569
|
+
# Returns a list of rate of return percents for a given connection. Will include timeframes available from the brokerage, for example \"ALL\", \"1Y\", \"6M\", \"3M\", \"1M\"
|
570
|
+
# @param user_id [String]
|
571
|
+
# @param user_secret [String]
|
572
|
+
# @param authorization_id [String]
|
573
|
+
# @param [Hash] opts the optional parameters
|
574
|
+
# @return [RateOfReturnResponse]
|
575
|
+
private def return_rates_impl(user_id, user_secret, authorization_id, opts = {})
|
576
|
+
data, _status_code, _headers = return_rates_with_http_info(user_id, user_secret, authorization_id, opts)
|
577
|
+
data
|
578
|
+
end
|
579
|
+
|
580
|
+
# List connection rate of returns
|
581
|
+
# Returns a list of rate of return percents for a given connection. Will include timeframes available from the brokerage, for example \"ALL\", \"1Y\", \"6M\", \"3M\", \"1M\"
|
582
|
+
# @param user_id [String]
|
583
|
+
# @param user_secret [String]
|
584
|
+
# @param authorization_id [String]
|
585
|
+
# @param [Hash] opts the optional parameters
|
586
|
+
# @return [Array<(RateOfReturnResponse, Integer, Hash)>] RateOfReturnResponse data, response status code and response headers
|
587
|
+
private def return_rates_with_http_info_impl(user_id, user_secret, authorization_id, opts = {})
|
588
|
+
if @api_client.config.debugging
|
589
|
+
@api_client.config.logger.debug 'Calling API: ConnectionsApi.return_rates ...'
|
590
|
+
end
|
591
|
+
# verify the required parameter 'user_id' is set
|
592
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
593
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ConnectionsApi.return_rates"
|
594
|
+
end
|
595
|
+
# verify the required parameter 'user_secret' is set
|
596
|
+
if @api_client.config.client_side_validation && user_secret.nil?
|
597
|
+
fail ArgumentError, "Missing the required parameter 'user_secret' when calling ConnectionsApi.return_rates"
|
598
|
+
end
|
599
|
+
# verify the required parameter 'authorization_id' is set
|
600
|
+
if @api_client.config.client_side_validation && authorization_id.nil?
|
601
|
+
fail ArgumentError, "Missing the required parameter 'authorization_id' when calling ConnectionsApi.return_rates"
|
602
|
+
end
|
603
|
+
# resource path
|
604
|
+
local_var_path = '/authorizations/{authorizationId}/returnRates'.sub('{' + 'authorizationId' + '}', CGI.escape(authorization_id.to_s))
|
605
|
+
|
606
|
+
# query parameters
|
607
|
+
query_params = opts[:query_params] || {}
|
608
|
+
query_params[:'userId'] = user_id
|
609
|
+
query_params[:'userSecret'] = user_secret
|
610
|
+
|
611
|
+
# header parameters
|
612
|
+
header_params = opts[:header_params] || {}
|
613
|
+
# HTTP header 'Accept' (if needed)
|
614
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
615
|
+
|
616
|
+
# form parameters
|
617
|
+
form_params = opts[:form_params] || {}
|
618
|
+
|
619
|
+
# http body (model)
|
620
|
+
post_body = opts[:debug_body]
|
621
|
+
|
622
|
+
# return_type
|
623
|
+
return_type = opts[:debug_return_type] || 'RateOfReturnResponse'
|
624
|
+
|
625
|
+
# auth_names
|
626
|
+
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
627
|
+
|
628
|
+
new_options = opts.merge(
|
629
|
+
:operation => :"ConnectionsApi.return_rates",
|
630
|
+
:header_params => header_params,
|
631
|
+
:query_params => query_params,
|
632
|
+
:form_params => form_params,
|
633
|
+
:body => post_body,
|
634
|
+
:auth_names => auth_names,
|
635
|
+
:return_type => return_type
|
636
|
+
)
|
637
|
+
|
638
|
+
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
639
|
+
if @api_client.config.debugging
|
640
|
+
@api_client.config.logger.debug "API called: ConnectionsApi#return_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
641
|
+
end
|
642
|
+
return data, status_code, headers, response
|
643
|
+
end
|
644
|
+
|
645
|
+
|
543
646
|
# Get all session events for a user
|
544
647
|
#
|
545
648
|
# Returns a list of session events associated with a user.
|