snaptrade 3.0.3 → 3.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9eb41837fba388ae89f7ab2fa9aa827af8d8c794f3c73a55e844af9610f580cb
4
- data.tar.gz: 34b4dbe47256bf59ba913962e86c6ff93c9549398a303e9de5ab3150463c51be
3
+ metadata.gz: 299076f004ce4e90bc238b5505a36074a6a703ee9acf7f5a8720fc3ca2c1ebfe
4
+ data.tar.gz: 7e4f84b92935077ec52465b78a9a76c8259d7c82f820db014f30bb1e378b8396
5
5
  SHA512:
6
- metadata.gz: dae2772d34c712eb5849f2f67d604f0a1a71c92bbdda4c2ff8639ccbb344bd07a778683a98d7b1145af06b5de2411464b8603272db4387ff72395ef4f94b7b6f
7
- data.tar.gz: b12fd9fe328d9ff3f8a590caa0d9bfbbad10e979db80552d640e90613b5894ee218b39a153dd000e9ffa14ff1d0070ce398743526d72465f662c3f64231b1f0e
6
+ metadata.gz: 2f656f0da56bef5976f248ead89d83add40cbde3dd7b5d835d26493505ec133c3a9ddb4fbfd9e975489b66fe19d6e9b106c3e83fe0723d65a9248d98cbf54ff0
7
+ data.tar.gz: e05af09d7c4593e800ab02d5c6c616a2336baf43f9212f781b2cc019405686ee97cb330abacccf6e17d3ce0b196c2e0c6fe81c77f61f9ebf1e6c02c2785d197f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snaptrade (3.0.3)
4
+ snaptrade (3.0.5)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
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-v3.0.3-blue)](https://rubygems.org/gems/snaptrade/versions/3.0.3)
9
+ [![npm](https://img.shields.io/badge/gem-v3.0.5-blue)](https://rubygems.org/gems/snaptrade/versions/3.0.5)
10
10
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](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.3'
86
+ gem 'snaptrade', '~> 3.0.5'
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
  ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
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
@@ -1395,9 +1443,9 @@ Experimental and subject to change without notice.
1395
1443
 
1396
1444
  Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape.
1397
1445
 
1398
- Each item in the response carries a `kind` field (currently only `investment` is implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema.
1446
+ Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema.
1399
1447
 
1400
- On Pay as you Go / Real-time, this endpoint refreshes each account's opening date, funding date, and market value live from the brokerage on each call.
1448
+ On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total balance (`market_value` for `investment`, `balance` for `deposit`) live from the brokerage on each call, along with funding date for `investment` accounts.
1401
1449
 
1402
1450
  On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
1403
1451
 
@@ -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&#39;s AUM percentile
1180
+ # Returns where the user&#39;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 &#x60;as_of&#x60; reports which month&#39;s distribution the placement came from. &#x60;data&#x60; is &#x60;null&#x60; — 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&#39;s own holdings are incomplete or stale (for example they hold a disabled connection). A placement computed from a partial view of a user&#39;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)
@@ -625,9 +625,9 @@ module SnapTrade
625
625
  #
626
626
  # Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape.
627
627
  #
628
- # Each item in the response carries a `kind` field (currently only `investment` is implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema.
628
+ # Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema.
629
629
  #
630
- # On Pay as you Go / Real-time, this endpoint refreshes each account's opening date, funding date, and market value live from the brokerage on each call.
630
+ # On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total balance (`market_value` for `investment`, `balance` for `deposit`) live from the brokerage on each call, along with funding date for `investment` accounts.
631
631
  #
632
632
  # On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
633
633
  #
@@ -648,9 +648,9 @@ module SnapTrade
648
648
  #
649
649
  # Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape.
650
650
  #
651
- # Each item in the response carries a `kind` field (currently only `investment` is implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema.
651
+ # Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema.
652
652
  #
653
- # On Pay as you Go / Real-time, this endpoint refreshes each account's opening date, funding date, and market value live from the brokerage on each call.
653
+ # On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total balance (`market_value` for `investment`, `balance` for `deposit`) live from the brokerage on each call, along with funding date for `investment` accounts.
654
654
  #
655
655
  # On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
656
656
  #
@@ -665,7 +665,7 @@ module SnapTrade
665
665
  end
666
666
 
667
667
  # List accounts for a connection (discriminated union)
668
- # Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently only `investment` is implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account's opening date, funding date, and market value live from the brokerage on each call. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
668
+ # Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total balance (`market_value` for `investment`, `balance` for `deposit`) live from the brokerage on each call, along with funding date for `investment` accounts. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
669
669
  # @param authorization_id [String]
670
670
  # @param user_id [String]
671
671
  # @param user_secret [String]
@@ -677,7 +677,7 @@ module SnapTrade
677
677
  end
678
678
 
679
679
  # List accounts for a connection (discriminated union)
680
- # Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the &#x60;kind&#x60;-discriminated account shape. Each item in the response carries a &#x60;kind&#x60; field (currently only &#x60;investment&#x60; is implemented) that determines which additional fields are present -- see the &#x60;ConnectionAccount&#x60; schema. On Pay as you Go / Real-time, this endpoint refreshes each account&#39;s opening date, funding date, and market value live from the brokerage on each call. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
680
+ # Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the &#x60;kind&#x60;-discriminated account shape. Each item in the response carries a &#x60;kind&#x60; field (currently &#x60;investment&#x60; and &#x60;deposit&#x60; are implemented) that determines which additional fields are present -- see the &#x60;ConnectionAccount&#x60; schema. On Pay as you Go / Real-time, this endpoint refreshes each account&#39;s opening date and total balance (&#x60;market_value&#x60; for &#x60;investment&#x60;, &#x60;balance&#x60; for &#x60;deposit&#x60;) live from the brokerage on each call, along with funding date for &#x60;investment&#x60; accounts. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
681
681
  # @param authorization_id [String]
682
682
  # @param user_id [String]
683
683
  # @param user_secret [String]
@@ -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
@@ -11,12 +11,13 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # A single account under a connection, from the `kind`-discriminated union used by `Connections_listConnectionAccounts`. Use `kind` to determine which schema is present. Only `investment` is implemented today; `deposit` and `line_of_credit` will be added as additional variants in a future release.
14
+ # A single account under a connection, from the `kind`-discriminated union used by `Connections_listConnectionAccounts`. Use `kind` to determine which schema is present. `investment` and `deposit` are implemented today; `line_of_credit` will be added as an additional variant in a future release.
15
15
  module ConnectionAccount
16
16
  class << self
17
17
  # List of class defined in oneOf (OpenAPI v3)
18
18
  def openapi_one_of
19
19
  [
20
+ :'DepositAccount',
20
21
  :'InvestmentAccount'
21
22
  ]
22
23
  end
@@ -29,6 +30,7 @@ module SnapTrade
29
30
  # Discriminator's mapping (OpenAPI v3)
30
31
  def openapi_discriminator_mapping
31
32
  {
33
+ :'deposit' => :'DepositAccount',
32
34
  :'investment' => :'InvestmentAccount'
33
35
  }
34
36
  end