snaptrade 3.0.2 → 3.0.4
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 +1 -1
- data/README.md +50 -2
- data/lib/snaptrade/api/account_information_api.rb +103 -0
- data/lib/snaptrade/api/authentication_api.rb +6 -2
- data/lib/snaptrade/models/account.rb +2 -2
- data/lib/snaptrade/models/bucket.rb +41 -0
- data/lib/snaptrade/models/investment_account.rb +2 -2
- data/lib/snaptrade/models/snap_trade_login_user_request_body.rb +13 -1
- data/lib/snaptrade/models/user_aum_percentile_object.rb +282 -0
- data/lib/snaptrade/models/user_aum_percentile_response.rb +218 -0
- data/lib/snaptrade/models/user_aum_percentile_response_data.rb +288 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +4 -0
- data/spec/api/account_information_api_spec.rb +13 -0
- data/spec/models/bucket_spec.rb +23 -0
- data/spec/models/snap_trade_login_user_request_body_spec.rb +6 -0
- data/spec/models/user_aum_percentile_object_spec.rb +53 -0
- data/spec/models/user_aum_percentile_response_data_spec.rb +53 -0
- data/spec/models/user_aum_percentile_response_spec.rb +29 -0
- metadata +210 -198
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 42c6cbd8d70b68fbeaaec9a26b5a4de57bf2439e2c745084657e48ed2b62ecb4
|
|
4
|
+
data.tar.gz: 86de1c293648872d90ba719e82609fbe77a0b626437255f6312e1b3976721272
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 35e1dbe18c59245ffd5c4235054957ce92e17fdbc78ca34b2e1fa7f6fa7857cf2b7c1d92170fe7089e38bbfccd14c05a563a33fda615f311438dfe3e332ab136
|
|
7
|
+
data.tar.gz: b2e5526daa65b2c159d6692ab4a1141c4e56031d0640c9d16b113d1672b544c3f9a3031048c8f580a70a04f26fcc065be80f67cd1b2abdcffd23ec85ef56001e
|
data/Gemfile.lock
CHANGED
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
|
-
[](https://rubygems.org/gems/snaptrade/versions/3.0.4)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -28,6 +28,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
28
28
|
* [`snaptrade.account_information.get_user_account_orders`](#snaptradeaccount_informationget_user_account_orders)
|
|
29
29
|
* [`snaptrade.account_information.get_user_account_recent_orders`](#snaptradeaccount_informationget_user_account_recent_orders)
|
|
30
30
|
* [`snaptrade.account_information.get_user_account_return_rates`](#snaptradeaccount_informationget_user_account_return_rates)
|
|
31
|
+
* [`snaptrade.account_information.get_user_aum_percentile`](#snaptradeaccount_informationget_user_aum_percentile)
|
|
31
32
|
* [`snaptrade.account_information.get_user_holdings`](#snaptradeaccount_informationget_user_holdings)
|
|
32
33
|
* [`snaptrade.account_information.list_user_accounts`](#snaptradeaccount_informationlist_user_accounts)
|
|
33
34
|
* [`snaptrade.account_information.update_user_account`](#snaptradeaccount_informationupdate_user_account)
|
|
@@ -82,7 +83,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
82
83
|
Add to Gemfile:
|
|
83
84
|
|
|
84
85
|
```ruby
|
|
85
|
-
gem 'snaptrade', '~> 3.0.
|
|
86
|
+
gem 'snaptrade', '~> 3.0.4'
|
|
86
87
|
```
|
|
87
88
|
|
|
88
89
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -542,6 +543,42 @@ returns all six supported timeframes.
|
|
|
542
543
|
---
|
|
543
544
|
|
|
544
545
|
|
|
546
|
+
### `snaptrade.account_information.get_user_aum_percentile`<a id="snaptradeaccount_informationget_user_aum_percentile"></a>
|
|
547
|
+
|
|
548
|
+
Returns where the user's total assets sit within the distribution of a cohort of comparable users, as a coarse bucket plus an integer percentile.
|
|
549
|
+
|
|
550
|
+
The cohort is scoped to your own book: a user is only ever compared against your other users, never across SnapTrade customers. (Users on personal-use keys are the exception — they are compared against all other personal-use users, since a personal key has a single user and cannot form a distribution of its own.) The distribution is recomputed monthly, and `as_of` reports which month's distribution the placement came from.
|
|
551
|
+
|
|
552
|
+
`data` is `null` — a 200, not an error — when SnapTrade declines to place the user. That happens when the cohort is too small to publish a distribution, or when the user's own holdings are incomplete or stale (for example they hold a disabled connection). A placement computed from a partial view of a user's assets would understate them, so none is returned.
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
556
|
+
|
|
557
|
+
```ruby
|
|
558
|
+
result = snaptrade.account_information.get_user_aum_percentile(
|
|
559
|
+
user_id: "snaptrade-user-123",
|
|
560
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
561
|
+
)
|
|
562
|
+
p result
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
566
|
+
|
|
567
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
|
568
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
569
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
570
|
+
|
|
571
|
+
[UserAumPercentileResponse](./lib/snaptrade/models/user_aum_percentile_response.rb)
|
|
572
|
+
|
|
573
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
574
|
+
|
|
575
|
+
`/aumPercentile` `GET`
|
|
576
|
+
|
|
577
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
578
|
+
|
|
579
|
+
---
|
|
580
|
+
|
|
581
|
+
|
|
545
582
|
### `snaptrade.account_information.get_user_holdings`<a id="snaptradeaccount_informationget_user_holdings"></a>
|
|
546
583
|

|
|
547
584
|
|
|
@@ -749,6 +786,7 @@ result = snaptrade.authentication.login_snap_trade_user(
|
|
|
749
786
|
connection_type: "read",
|
|
750
787
|
show_close_button: true,
|
|
751
788
|
dark_mode: true,
|
|
789
|
+
locale: "pt-BR",
|
|
752
790
|
connection_portal_version: "v4",
|
|
753
791
|
)
|
|
754
792
|
p result
|
|
@@ -793,6 +831,16 @@ When false, you control closing behavior from your app. Defaults to true.
|
|
|
793
831
|
##### darkMode: `Boolean`<a id="darkmode-boolean"></a>
|
|
794
832
|
Enable dark mode for the connection portal. Defaults to false.
|
|
795
833
|
|
|
834
|
+
##### locale: `String`<a id="locale-string"></a>
|
|
835
|
+
Language the connection portal renders in. `en` and `pt-BR` are the languages we
|
|
836
|
+
ship; any other language is rejected with a 400. Matching is case- and
|
|
837
|
+
separator-insensitive, so `pt-br`, `pt-BR` and `pt_BR` are equivalent, and a
|
|
838
|
+
regional tag resolves to the language when we ship it, so `en-US` renders `en`.
|
|
839
|
+
Deliberately not an enum: those equivalent spellings are all accepted by the
|
|
840
|
+
API, and an enum would have generated SDKs reject them before the request is
|
|
841
|
+
sent. Screens without translated copy fall back to English individually.
|
|
842
|
+
Defaults to `en`.
|
|
843
|
+
|
|
796
844
|
##### connectionPortalVersion: [`ConnectionPortalVersion`](./lib/snaptrade/models/connection_portal_version.rb)<a id="connectionportalversion-connectionportalversionlibsnaptrademodelsconnection_portal_versionrb"></a>
|
|
797
845
|
Sets the connection portal version to render. Currently only `v4` is supported
|
|
798
846
|
and is the default. All other versions are deprecated and will automatically be
|
|
@@ -1134,6 +1134,109 @@ module SnapTrade
|
|
|
1134
1134
|
end
|
|
1135
1135
|
|
|
1136
1136
|
|
|
1137
|
+
# Get the user's AUM percentile
|
|
1138
|
+
#
|
|
1139
|
+
# Returns where the user's total assets sit within the distribution of a cohort of comparable users, as a coarse bucket plus an integer percentile.
|
|
1140
|
+
#
|
|
1141
|
+
# The cohort is scoped to your own book: a user is only ever compared against your other users, never across SnapTrade customers. (Users on personal-use keys are the exception — they are compared against all other personal-use users, since a personal key has a single user and cannot form a distribution of its own.) The distribution is recomputed monthly, and `as_of` reports which month's distribution the placement came from.
|
|
1142
|
+
#
|
|
1143
|
+
# `data` is `null` — a 200, not an error — when SnapTrade declines to place the user. That happens when the cohort is too small to publish a distribution, or when the user's own holdings are incomplete or stale (for example they hold a disabled connection). A placement computed from a partial view of a user's assets would understate them, so none is returned.
|
|
1144
|
+
#
|
|
1145
|
+
# @param user_id [String]
|
|
1146
|
+
# @param user_secret [String]
|
|
1147
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
1148
|
+
def get_user_aum_percentile(user_id:, user_secret:, extra: {})
|
|
1149
|
+
data, _status_code, _headers = get_user_aum_percentile_with_http_info_impl(user_id, user_secret, extra)
|
|
1150
|
+
data
|
|
1151
|
+
end
|
|
1152
|
+
|
|
1153
|
+
# Get the user's AUM percentile
|
|
1154
|
+
#
|
|
1155
|
+
# Returns where the user's total assets sit within the distribution of a cohort of comparable users, as a coarse bucket plus an integer percentile.
|
|
1156
|
+
#
|
|
1157
|
+
# The cohort is scoped to your own book: a user is only ever compared against your other users, never across SnapTrade customers. (Users on personal-use keys are the exception — they are compared against all other personal-use users, since a personal key has a single user and cannot form a distribution of its own.) The distribution is recomputed monthly, and `as_of` reports which month's distribution the placement came from.
|
|
1158
|
+
#
|
|
1159
|
+
# `data` is `null` — a 200, not an error — when SnapTrade declines to place the user. That happens when the cohort is too small to publish a distribution, or when the user's own holdings are incomplete or stale (for example they hold a disabled connection). A placement computed from a partial view of a user's assets would understate them, so none is returned.
|
|
1160
|
+
#
|
|
1161
|
+
# @param user_id [String]
|
|
1162
|
+
# @param user_secret [String]
|
|
1163
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
1164
|
+
def get_user_aum_percentile_with_http_info(user_id:, user_secret:, extra: {})
|
|
1165
|
+
get_user_aum_percentile_with_http_info_impl(user_id, user_secret, extra)
|
|
1166
|
+
end
|
|
1167
|
+
|
|
1168
|
+
# Get the user's AUM percentile
|
|
1169
|
+
# Returns where the user's total assets sit within the distribution of a cohort of comparable users, as a coarse bucket plus an integer percentile. The cohort is scoped to your own book: a user is only ever compared against your other users, never across SnapTrade customers. (Users on personal-use keys are the exception — they are compared against all other personal-use users, since a personal key has a single user and cannot form a distribution of its own.) The distribution is recomputed monthly, and `as_of` reports which month's distribution the placement came from. `data` is `null` — a 200, not an error — when SnapTrade declines to place the user. That happens when the cohort is too small to publish a distribution, or when the user's own holdings are incomplete or stale (for example they hold a disabled connection). A placement computed from a partial view of a user's assets would understate them, so none is returned.
|
|
1170
|
+
# @param user_id [String]
|
|
1171
|
+
# @param user_secret [String]
|
|
1172
|
+
# @param [Hash] opts the optional parameters
|
|
1173
|
+
# @return [UserAumPercentileResponse]
|
|
1174
|
+
private def get_user_aum_percentile_impl(user_id, user_secret, opts = {})
|
|
1175
|
+
data, _status_code, _headers = get_user_aum_percentile_with_http_info(user_id, user_secret, opts)
|
|
1176
|
+
data
|
|
1177
|
+
end
|
|
1178
|
+
|
|
1179
|
+
# Get the user's AUM percentile
|
|
1180
|
+
# Returns where the user's total assets sit within the distribution of a cohort of comparable users, as a coarse bucket plus an integer percentile. The cohort is scoped to your own book: a user is only ever compared against your other users, never across SnapTrade customers. (Users on personal-use keys are the exception — they are compared against all other personal-use users, since a personal key has a single user and cannot form a distribution of its own.) The distribution is recomputed monthly, and `as_of` reports which month's distribution the placement came from. `data` is `null` — a 200, not an error — when SnapTrade declines to place the user. That happens when the cohort is too small to publish a distribution, or when the user's own holdings are incomplete or stale (for example they hold a disabled connection). A placement computed from a partial view of a user's assets would understate them, so none is returned.
|
|
1181
|
+
# @param user_id [String]
|
|
1182
|
+
# @param user_secret [String]
|
|
1183
|
+
# @param [Hash] opts the optional parameters
|
|
1184
|
+
# @return [Array<(UserAumPercentileResponse, Integer, Hash)>] UserAumPercentileResponse data, response status code and response headers
|
|
1185
|
+
private def get_user_aum_percentile_with_http_info_impl(user_id, user_secret, opts = {})
|
|
1186
|
+
if @api_client.config.debugging
|
|
1187
|
+
@api_client.config.logger.debug 'Calling API: AccountInformationApi.get_user_aum_percentile ...'
|
|
1188
|
+
end
|
|
1189
|
+
# verify the required parameter 'user_id' is set
|
|
1190
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
1191
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AccountInformationApi.get_user_aum_percentile"
|
|
1192
|
+
end
|
|
1193
|
+
# verify the required parameter 'user_secret' is set
|
|
1194
|
+
if @api_client.config.client_side_validation && user_secret.nil?
|
|
1195
|
+
fail ArgumentError, "Missing the required parameter 'user_secret' when calling AccountInformationApi.get_user_aum_percentile"
|
|
1196
|
+
end
|
|
1197
|
+
# resource path
|
|
1198
|
+
local_var_path = '/aumPercentile'
|
|
1199
|
+
|
|
1200
|
+
# query parameters
|
|
1201
|
+
query_params = opts[:query_params] || {}
|
|
1202
|
+
query_params[:'userId'] = user_id
|
|
1203
|
+
query_params[:'userSecret'] = user_secret
|
|
1204
|
+
|
|
1205
|
+
# header parameters
|
|
1206
|
+
header_params = opts[:header_params] || {}
|
|
1207
|
+
# HTTP header 'Accept' (if needed)
|
|
1208
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1209
|
+
|
|
1210
|
+
# form parameters
|
|
1211
|
+
form_params = opts[:form_params] || {}
|
|
1212
|
+
|
|
1213
|
+
# http body (model)
|
|
1214
|
+
post_body = opts[:debug_body]
|
|
1215
|
+
|
|
1216
|
+
# return_type
|
|
1217
|
+
return_type = opts[:debug_return_type] || 'UserAumPercentileResponse'
|
|
1218
|
+
|
|
1219
|
+
# auth_names
|
|
1220
|
+
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
|
1221
|
+
|
|
1222
|
+
new_options = opts.merge(
|
|
1223
|
+
:operation => :"AccountInformationApi.get_user_aum_percentile",
|
|
1224
|
+
:header_params => header_params,
|
|
1225
|
+
:query_params => query_params,
|
|
1226
|
+
:form_params => form_params,
|
|
1227
|
+
:body => post_body,
|
|
1228
|
+
:auth_names => auth_names,
|
|
1229
|
+
:return_type => return_type
|
|
1230
|
+
)
|
|
1231
|
+
|
|
1232
|
+
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1233
|
+
if @api_client.config.debugging
|
|
1234
|
+
@api_client.config.logger.debug "API called: AccountInformationApi#get_user_aum_percentile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1235
|
+
end
|
|
1236
|
+
return data, status_code, headers, response
|
|
1237
|
+
end
|
|
1238
|
+
|
|
1239
|
+
|
|
1137
1240
|
# List account holdings
|
|
1138
1241
|
#
|
|
1139
1242
|
# **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders).
|
|
@@ -195,10 +195,11 @@ module SnapTrade
|
|
|
195
195
|
# @param connection_type [ConnectionType] Determines connection permissions (default: read) - `read`: Data access only. - `trade`: Data and trading access. - `trade-if-available`: Attempts to establish a trading connection if the brokerage supports it, otherwise falls back to read-only access automatically.
|
|
196
196
|
# @param show_close_button [Boolean] Controls whether the close (X) button is displayed in the connection portal. When false, you control closing behavior from your app. Defaults to true.
|
|
197
197
|
# @param dark_mode [Boolean] Enable dark mode for the connection portal. Defaults to false.
|
|
198
|
+
# @param locale [String] Language the connection portal renders in. `en` and `pt-BR` are the languages we ship; any other language is rejected with a 400. Matching is case- and separator-insensitive, so `pt-br`, `pt-BR` and `pt_BR` are equivalent, and a regional tag resolves to the language when we ship it, so `en-US` renders `en`. Deliberately not an enum: those equivalent spellings are all accepted by the API, and an enum would have generated SDKs reject them before the request is sent. Screens without translated copy fall back to English individually. Defaults to `en`.
|
|
198
199
|
# @param connection_portal_version [ConnectionPortalVersion] Sets the connection portal version to render. Currently only `v4` is supported and is the default. All other versions are deprecated and will automatically be set to v4.
|
|
199
200
|
# @param body [SnapTradeLoginUserRequestBody]
|
|
200
201
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
201
|
-
def login_snap_trade_user(user_id:, user_secret:, broker: SENTINEL, immediate_redirect: SENTINEL, custom_redirect: SENTINEL, reconnect: SENTINEL, connection_type: 'read', show_close_button: SENTINEL, dark_mode: SENTINEL, connection_portal_version: 'v4', extra: {})
|
|
202
|
+
def login_snap_trade_user(user_id:, user_secret:, broker: SENTINEL, immediate_redirect: SENTINEL, custom_redirect: SENTINEL, reconnect: SENTINEL, connection_type: 'read', show_close_button: SENTINEL, dark_mode: SENTINEL, locale: 'en', connection_portal_version: 'v4', extra: {})
|
|
202
203
|
_body = {}
|
|
203
204
|
_body[:broker] = broker if broker != SENTINEL
|
|
204
205
|
_body[:immediateRedirect] = immediate_redirect if immediate_redirect != SENTINEL
|
|
@@ -207,6 +208,7 @@ module SnapTrade
|
|
|
207
208
|
_body[:connectionType] = connection_type if connection_type != SENTINEL
|
|
208
209
|
_body[:showCloseButton] = show_close_button if show_close_button != SENTINEL
|
|
209
210
|
_body[:darkMode] = dark_mode if dark_mode != SENTINEL
|
|
211
|
+
_body[:locale] = locale if locale != SENTINEL
|
|
210
212
|
_body[:connectionPortalVersion] = connection_portal_version if connection_portal_version != SENTINEL
|
|
211
213
|
extra[:snap_trade_login_user_request_body] = _body if !_body.empty?
|
|
212
214
|
data, _status_code, _headers = login_snap_trade_user_with_http_info_impl(user_id, user_secret, extra)
|
|
@@ -228,10 +230,11 @@ module SnapTrade
|
|
|
228
230
|
# @param connection_type [ConnectionType] Determines connection permissions (default: read) - `read`: Data access only. - `trade`: Data and trading access. - `trade-if-available`: Attempts to establish a trading connection if the brokerage supports it, otherwise falls back to read-only access automatically.
|
|
229
231
|
# @param show_close_button [Boolean] Controls whether the close (X) button is displayed in the connection portal. When false, you control closing behavior from your app. Defaults to true.
|
|
230
232
|
# @param dark_mode [Boolean] Enable dark mode for the connection portal. Defaults to false.
|
|
233
|
+
# @param locale [String] Language the connection portal renders in. `en` and `pt-BR` are the languages we ship; any other language is rejected with a 400. Matching is case- and separator-insensitive, so `pt-br`, `pt-BR` and `pt_BR` are equivalent, and a regional tag resolves to the language when we ship it, so `en-US` renders `en`. Deliberately not an enum: those equivalent spellings are all accepted by the API, and an enum would have generated SDKs reject them before the request is sent. Screens without translated copy fall back to English individually. Defaults to `en`.
|
|
231
234
|
# @param connection_portal_version [ConnectionPortalVersion] Sets the connection portal version to render. Currently only `v4` is supported and is the default. All other versions are deprecated and will automatically be set to v4.
|
|
232
235
|
# @param body [SnapTradeLoginUserRequestBody]
|
|
233
236
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
234
|
-
def login_snap_trade_user_with_http_info(user_id:, user_secret:, broker: SENTINEL, immediate_redirect: SENTINEL, custom_redirect: SENTINEL, reconnect: SENTINEL, connection_type: 'read', show_close_button: SENTINEL, dark_mode: SENTINEL, connection_portal_version: 'v4', extra: {})
|
|
237
|
+
def login_snap_trade_user_with_http_info(user_id:, user_secret:, broker: SENTINEL, immediate_redirect: SENTINEL, custom_redirect: SENTINEL, reconnect: SENTINEL, connection_type: 'read', show_close_button: SENTINEL, dark_mode: SENTINEL, locale: 'en', connection_portal_version: 'v4', extra: {})
|
|
235
238
|
_body = {}
|
|
236
239
|
_body[:broker] = broker if broker != SENTINEL
|
|
237
240
|
_body[:immediateRedirect] = immediate_redirect if immediate_redirect != SENTINEL
|
|
@@ -240,6 +243,7 @@ module SnapTrade
|
|
|
240
243
|
_body[:connectionType] = connection_type if connection_type != SENTINEL
|
|
241
244
|
_body[:showCloseButton] = show_close_button if show_close_button != SENTINEL
|
|
242
245
|
_body[:darkMode] = dark_mode if dark_mode != SENTINEL
|
|
246
|
+
_body[:locale] = locale if locale != SENTINEL
|
|
243
247
|
_body[:connectionPortalVersion] = connection_portal_version if connection_portal_version != SENTINEL
|
|
244
248
|
extra[:snap_trade_login_user_request_body] = _body if !_body.empty?
|
|
245
249
|
login_snap_trade_user_with_http_info_impl(user_id, user_secret, extra)
|
|
@@ -34,10 +34,10 @@ module SnapTrade
|
|
|
34
34
|
# Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was created in SnapTrade. This is _not_ the account opening date at the brokerage.
|
|
35
35
|
attr_accessor :created_date
|
|
36
36
|
|
|
37
|
-
# Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was funded.
|
|
37
|
+
# Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was funded. Only populated for brokerages that expose this data (Tastytrade, eToro, moomoo, Public, and Unlok); `null` for all other brokerages.
|
|
38
38
|
attr_accessor :funding_date
|
|
39
39
|
|
|
40
|
-
# Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was opened at the brokerage.
|
|
40
|
+
# Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was opened at the brokerage. Only populated for brokerages that expose this data (Tastytrade, eToro, moomoo, Public, and Unlok); `null` for all other brokerages.
|
|
41
41
|
attr_accessor :opening_date
|
|
42
42
|
|
|
43
43
|
attr_accessor :sync_status
|
|
@@ -0,0 +1,41 @@
|
|
|
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 'date'
|
|
11
|
+
require 'time'
|
|
12
|
+
|
|
13
|
+
module SnapTrade
|
|
14
|
+
class Bucket
|
|
15
|
+
TOP_1_PERCENT = "TOP_1_PERCENT".freeze
|
|
16
|
+
TOP_5_PERCENT = "TOP_5_PERCENT".freeze
|
|
17
|
+
TOP_10_PERCENT = "TOP_10_PERCENT".freeze
|
|
18
|
+
TOP_25_PERCENT = "TOP_25_PERCENT".freeze
|
|
19
|
+
TOP_50_PERCENT = "TOP_50_PERCENT".freeze
|
|
20
|
+
BOTTOM_50_PERCENT = "BOTTOM_50_PERCENT".freeze
|
|
21
|
+
|
|
22
|
+
def self.all_vars
|
|
23
|
+
@all_vars ||= [TOP_1_PERCENT, TOP_5_PERCENT, TOP_10_PERCENT, TOP_25_PERCENT, TOP_50_PERCENT, BOTTOM_50_PERCENT].freeze
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Builds the enum from string
|
|
27
|
+
# @param [String] The enum value in the form of the string
|
|
28
|
+
# @return [String] The enum value
|
|
29
|
+
def self.build_from_hash(value)
|
|
30
|
+
new.build_from_hash(value)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Builds the enum from string
|
|
34
|
+
# @param [String] The enum value in the form of the string
|
|
35
|
+
# @return [String] The enum value
|
|
36
|
+
def build_from_hash(value)
|
|
37
|
+
return value if Bucket.all_vars.include?(value)
|
|
38
|
+
raise "Invalid ENUM value #{value} for class #Bucket"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -34,7 +34,7 @@ module SnapTrade
|
|
|
34
34
|
# Unique identifier for the institution (brokerage) that holds the account.
|
|
35
35
|
attr_accessor :institution_id
|
|
36
36
|
|
|
37
|
-
# Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was opened at the brokerage.
|
|
37
|
+
# Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was opened at the brokerage. Only populated for brokerages that expose this data (Tastytrade, eToro, moomoo, Public, and Unlok); `null` for all other brokerages.
|
|
38
38
|
attr_accessor :opening_date
|
|
39
39
|
|
|
40
40
|
attr_accessor :sync_status
|
|
@@ -42,7 +42,7 @@ module SnapTrade
|
|
|
42
42
|
# The account type as provided by the brokerage.
|
|
43
43
|
attr_accessor :raw_type
|
|
44
44
|
|
|
45
|
-
# Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was funded.
|
|
45
|
+
# Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was funded. Only populated for brokerages that expose this data (Tastytrade, eToro, moomoo, Public, and Unlok); `null` for all other brokerages.
|
|
46
46
|
attr_accessor :funding_date
|
|
47
47
|
|
|
48
48
|
# Indicates whether the account is a paper (simulated) trading account.
|
|
@@ -34,6 +34,9 @@ module SnapTrade
|
|
|
34
34
|
# Enable dark mode for the connection portal. Defaults to false.
|
|
35
35
|
attr_accessor :dark_mode
|
|
36
36
|
|
|
37
|
+
# Language the connection portal renders in. `en` and `pt-BR` are the languages we ship; any other language is rejected with a 400. Matching is case- and separator-insensitive, so `pt-br`, `pt-BR` and `pt_BR` are equivalent, and a regional tag resolves to the language when we ship it, so `en-US` renders `en`. Deliberately not an enum: those equivalent spellings are all accepted by the API, and an enum would have generated SDKs reject them before the request is sent. Screens without translated copy fall back to English individually. Defaults to `en`.
|
|
38
|
+
attr_accessor :locale
|
|
39
|
+
|
|
37
40
|
# Sets the connection portal version to render. Currently only `v4` is supported and is the default. All other versions are deprecated and will automatically be set to v4.
|
|
38
41
|
attr_accessor :connection_portal_version
|
|
39
42
|
|
|
@@ -47,6 +50,7 @@ module SnapTrade
|
|
|
47
50
|
:'connection_type' => :'connectionType',
|
|
48
51
|
:'show_close_button' => :'showCloseButton',
|
|
49
52
|
:'dark_mode' => :'darkMode',
|
|
53
|
+
:'locale' => :'locale',
|
|
50
54
|
:'connection_portal_version' => :'connectionPortalVersion'
|
|
51
55
|
}
|
|
52
56
|
end
|
|
@@ -66,6 +70,7 @@ module SnapTrade
|
|
|
66
70
|
:'connection_type' => :'ConnectionType',
|
|
67
71
|
:'show_close_button' => :'Boolean',
|
|
68
72
|
:'dark_mode' => :'Boolean',
|
|
73
|
+
:'locale' => :'String',
|
|
69
74
|
:'connection_portal_version' => :'ConnectionPortalVersion'
|
|
70
75
|
}
|
|
71
76
|
end
|
|
@@ -121,6 +126,12 @@ module SnapTrade
|
|
|
121
126
|
self.dark_mode = attributes[:'dark_mode']
|
|
122
127
|
end
|
|
123
128
|
|
|
129
|
+
if attributes.key?(:'locale')
|
|
130
|
+
self.locale = attributes[:'locale']
|
|
131
|
+
else
|
|
132
|
+
self.locale = 'en'
|
|
133
|
+
end
|
|
134
|
+
|
|
124
135
|
if attributes.key?(:'connection_portal_version')
|
|
125
136
|
self.connection_portal_version = attributes[:'connection_portal_version']
|
|
126
137
|
else
|
|
@@ -153,6 +164,7 @@ module SnapTrade
|
|
|
153
164
|
connection_type == o.connection_type &&
|
|
154
165
|
show_close_button == o.show_close_button &&
|
|
155
166
|
dark_mode == o.dark_mode &&
|
|
167
|
+
locale == o.locale &&
|
|
156
168
|
connection_portal_version == o.connection_portal_version
|
|
157
169
|
end
|
|
158
170
|
|
|
@@ -165,7 +177,7 @@ module SnapTrade
|
|
|
165
177
|
# Calculates hash code according to all attributes.
|
|
166
178
|
# @return [Integer] Hash code
|
|
167
179
|
def hash
|
|
168
|
-
[broker, immediate_redirect, custom_redirect, reconnect, connection_type, show_close_button, dark_mode, connection_portal_version].hash
|
|
180
|
+
[broker, immediate_redirect, custom_redirect, reconnect, connection_type, show_close_button, dark_mode, locale, connection_portal_version].hash
|
|
169
181
|
end
|
|
170
182
|
|
|
171
183
|
# Builds the object from hash
|