snaptrade 2.0.33 → 2.0.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +81 -54
  4. data/lib/snaptrade/api/account_information_api.rb +74 -56
  5. data/lib/snaptrade/api/authentication_api.rb +44 -46
  6. data/lib/snaptrade/api/connections_api.rb +8 -8
  7. data/lib/snaptrade/api/options_api.rb +16 -12
  8. data/lib/snaptrade/api/transactions_and_reporting_api.rb +36 -28
  9. data/lib/snaptrade/models/account.rb +11 -2
  10. data/lib/snaptrade/models/account_balance_total.rb +1 -8
  11. data/lib/snaptrade/models/account_holdings_account.rb +1 -1
  12. data/lib/snaptrade/models/account_order_record.rb +1 -1
  13. data/lib/snaptrade/models/account_order_record_universal_symbol.rb +2 -2
  14. data/lib/snaptrade/models/account_simple.rb +4 -1
  15. data/lib/snaptrade/models/account_sync_status.rb +1 -1
  16. data/lib/snaptrade/models/balance.rb +1 -1
  17. data/lib/snaptrade/models/{snap_trade_holdings_account_account_id_balance.rb → balance_currency.rb} +33 -12
  18. data/lib/snaptrade/models/delete_user_response.rb +12 -3
  19. data/lib/snaptrade/models/holdings_status.rb +4 -4
  20. data/lib/snaptrade/models/login_redirect_uri.rb +3 -2
  21. data/lib/snaptrade/models/snap_trade_login_user_request_body.rb +10 -6
  22. data/lib/snaptrade/models/symbol.rb +16 -10
  23. data/lib/snaptrade/models/{universal_symbol_currency.rb → symbol_currency.rb} +3 -3
  24. data/lib/snaptrade/models/{universal_symbol_exchange.rb → symbol_exchange.rb} +3 -3
  25. data/lib/snaptrade/models/transactions_status.rb +4 -5
  26. data/lib/snaptrade/models/underlying_symbol.rb +1 -1
  27. data/lib/snaptrade/models/universal_activity.rb +91 -81
  28. data/lib/snaptrade/models/{amount.rb → universal_activity_currency.rb} +36 -19
  29. data/lib/snaptrade/models/{snap_trade_holdings_account_account_id.rb → universal_activity_option_symbol.rb} +83 -82
  30. data/lib/snaptrade/models/universal_activity_symbol.rb +304 -0
  31. data/lib/snaptrade/models/universal_symbol.rb +2 -2
  32. data/lib/snaptrade/models/user_i_dand_secret.rb +1 -1
  33. data/lib/snaptrade/version.rb +1 -1
  34. data/lib/snaptrade.rb +6 -5
  35. data/spec/api/account_information_api_spec.rb +13 -13
  36. data/spec/api/authentication_api_spec.rb +7 -7
  37. data/spec/api/connections_api_spec.rb +2 -2
  38. data/spec/api/options_api_spec.rb +3 -3
  39. data/spec/api/transactions_and_reporting_api_spec.rb +7 -7
  40. data/spec/models/{universal_symbol_currency_spec.rb → balance_currency_spec.rb} +6 -6
  41. data/spec/models/delete_user_response_spec.rb +6 -0
  42. data/spec/models/symbol_currency_spec.rb +41 -0
  43. data/spec/models/{universal_symbol_exchange_spec.rb → symbol_exchange_spec.rb} +6 -6
  44. data/spec/models/symbol_spec.rb +1 -1
  45. data/spec/models/universal_activity_currency_spec.rb +41 -0
  46. data/spec/models/universal_activity_option_symbol_spec.rb +65 -0
  47. data/spec/models/universal_activity_spec.rb +15 -15
  48. data/spec/models/{snap_trade_holdings_account_account_id_spec.rb → universal_activity_symbol_spec.rb} +14 -20
  49. metadata +20 -17
  50. data/spec/models/amount_spec.rb +0 -35
  51. data/spec/models/snap_trade_holdings_account_account_id_balance_spec.rb +0 -29
@@ -527,8 +527,8 @@ module SnapTrade
527
527
  # Returns a list of session events associated with a user.
528
528
  #
529
529
  # @param partner_client_id [String]
530
- # @param user_id [String] Optional comma seperated list of user IDs used to filter the request on specific users
531
- # @param session_id [String] Optional comma seperated list of session IDs used to filter the request on specific users
530
+ # @param user_id [String] Optional comma separated list of user IDs used to filter the request on specific users
531
+ # @param session_id [String] Optional comma separated list of session IDs used to filter the request on specific users
532
532
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
533
533
  def session_events(partner_client_id:, user_id: SENTINEL, session_id: SENTINEL, extra: {})
534
534
  extra[:user_id] = user_id if user_id != SENTINEL
@@ -542,8 +542,8 @@ module SnapTrade
542
542
  # Returns a list of session events associated with a user.
543
543
  #
544
544
  # @param partner_client_id [String]
545
- # @param user_id [String] Optional comma seperated list of user IDs used to filter the request on specific users
546
- # @param session_id [String] Optional comma seperated list of session IDs used to filter the request on specific users
545
+ # @param user_id [String] Optional comma separated list of user IDs used to filter the request on specific users
546
+ # @param session_id [String] Optional comma separated list of session IDs used to filter the request on specific users
547
547
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
548
548
  def session_events_with_http_info(partner_client_id:, user_id: SENTINEL, session_id: SENTINEL, extra: {})
549
549
  extra[:user_id] = user_id if user_id != SENTINEL
@@ -555,8 +555,8 @@ module SnapTrade
555
555
  # Returns a list of session events associated with a user.
556
556
  # @param partner_client_id [String]
557
557
  # @param [Hash] opts the optional parameters
558
- # @option opts [String] :user_id Optional comma seperated list of user IDs used to filter the request on specific users
559
- # @option opts [String] :session_id Optional comma seperated list of session IDs used to filter the request on specific users
558
+ # @option opts [String] :user_id Optional comma separated list of user IDs used to filter the request on specific users
559
+ # @option opts [String] :session_id Optional comma separated list of session IDs used to filter the request on specific users
560
560
  # @return [Array<ConnectionsSessionEvents200ResponseInner>]
561
561
  private def session_events_impl(partner_client_id, opts = {})
562
562
  data, _status_code, _headers = session_events_with_http_info(partner_client_id, opts)
@@ -567,8 +567,8 @@ module SnapTrade
567
567
  # Returns a list of session events associated with a user.
568
568
  # @param partner_client_id [String]
569
569
  # @param [Hash] opts the optional parameters
570
- # @option opts [String] :user_id Optional comma seperated list of user IDs used to filter the request on specific users
571
- # @option opts [String] :session_id Optional comma seperated list of session IDs used to filter the request on specific users
570
+ # @option opts [String] :user_id Optional comma separated list of user IDs used to filter the request on specific users
571
+ # @option opts [String] :session_id Optional comma separated list of session IDs used to filter the request on specific users
572
572
  # @return [Array<(Array<ConnectionsSessionEvents200ResponseInner>, Integer, Hash)>] Array<ConnectionsSessionEvents200ResponseInner> data, response status code and response headers
573
573
  private def session_events_with_http_info_impl(partner_client_id, opts = {})
574
574
  if @api_client.config.debugging
@@ -372,36 +372,40 @@ module SnapTrade
372
372
  end
373
373
 
374
374
 
375
- # Get account option holdings
375
+ # List account option positions
376
376
  #
377
- # Returns a list of Options Positions.
377
+ # Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions).
378
+ #
379
+ # The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
378
380
  #
379
381
  # @param user_id [String]
380
382
  # @param user_secret [String]
381
- # @param account_id [String] The ID of the account to fetch options holdings for.
383
+ # @param account_id [String]
382
384
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
383
385
  def list_option_holdings(user_id:, user_secret:, account_id:, extra: {})
384
386
  data, _status_code, _headers = list_option_holdings_with_http_info_impl(user_id, user_secret, account_id, extra)
385
387
  data
386
388
  end
387
389
 
388
- # Get account option holdings
390
+ # List account option positions
389
391
  #
390
- # Returns a list of Options Positions.
392
+ # Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions).
393
+ #
394
+ # The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
391
395
  #
392
396
  # @param user_id [String]
393
397
  # @param user_secret [String]
394
- # @param account_id [String] The ID of the account to fetch options holdings for.
398
+ # @param account_id [String]
395
399
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
396
400
  def list_option_holdings_with_http_info(user_id:, user_secret:, account_id:, extra: {})
397
401
  list_option_holdings_with_http_info_impl(user_id, user_secret, account_id, extra)
398
402
  end
399
403
 
400
- # Get account option holdings
401
- # Returns a list of Options Positions.
404
+ # List account option positions
405
+ # Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
402
406
  # @param user_id [String]
403
407
  # @param user_secret [String]
404
- # @param account_id [String] The ID of the account to fetch options holdings for.
408
+ # @param account_id [String]
405
409
  # @param [Hash] opts the optional parameters
406
410
  # @return [Array<OptionsPosition>]
407
411
  private def list_option_holdings_impl(user_id, user_secret, account_id, opts = {})
@@ -409,11 +413,11 @@ module SnapTrade
409
413
  data
410
414
  end
411
415
 
412
- # Get account option holdings
413
- # Returns a list of Options Positions.
416
+ # List account option positions
417
+ # Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v&#x3D;d16c4c97b8d5438bbb2d8581ac53b11e) and look for \&quot;Cache Expiry Time\&quot; to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
414
418
  # @param user_id [String]
415
419
  # @param user_secret [String]
416
- # @param account_id [String] The ID of the account to fetch options holdings for.
420
+ # @param account_id [String]
417
421
  # @param [Hash] opts the optional parameters
418
422
  # @return [Array<(Array<OptionsPosition>, Integer, Hash)>] Array<OptionsPosition> data, response status code and response headers
419
423
  private def list_option_holdings_with_http_info_impl(user_id, user_secret, account_id, opts = {})
@@ -19,15 +19,19 @@ module SnapTrade
19
19
 
20
20
  # Get transaction history for a user
21
21
  #
22
- # Returns activities (transactions) for a user. Specifying start and end date is highly recommended for better performance
22
+ # Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request.
23
+ #
24
+ # There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order.
25
+ #
26
+ # The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
23
27
  #
24
28
  # @param user_id [String]
25
29
  # @param user_secret [String]
26
- # @param start_date [Date]
27
- # @param end_date [Date]
28
- # @param accounts [String] Optional comma seperated list of account IDs used to filter the request on specific accounts
29
- # @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
30
- # @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
+ # @param start_date [Date] The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`.
31
+ # @param end_date [Date] The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
32
+ # @param accounts [String] Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The `brokerageAuthorizations` parameter takes precedence over this parameter.
33
+ # @param brokerage_authorizations [String] Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the `accounts` parameter.
34
+ # @param type [String] Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - BUY - SELL - DIVIDEND - CONTRIBUTION - WITHDRAWAL - REI - INTEREST - FEE
31
35
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
32
36
  def get_activities(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {})
33
37
  extra[:start_date] = start_date if start_date != SENTINEL
@@ -41,15 +45,19 @@ module SnapTrade
41
45
 
42
46
  # Get transaction history for a user
43
47
  #
44
- # Returns activities (transactions) for a user. Specifying start and end date is highly recommended for better performance
48
+ # Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request.
49
+ #
50
+ # There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order.
51
+ #
52
+ # The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
45
53
  #
46
54
  # @param user_id [String]
47
55
  # @param user_secret [String]
48
- # @param start_date [Date]
49
- # @param end_date [Date]
50
- # @param accounts [String] Optional comma seperated list of account IDs used to filter the request on specific accounts
51
- # @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
52
- # @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
56
+ # @param start_date [Date] The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`.
57
+ # @param end_date [Date] The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
58
+ # @param accounts [String] Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The `brokerageAuthorizations` parameter takes precedence over this parameter.
59
+ # @param brokerage_authorizations [String] Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the `accounts` parameter.
60
+ # @param type [String] Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - BUY - SELL - DIVIDEND - CONTRIBUTION - WITHDRAWAL - REI - INTEREST - FEE
53
61
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
54
62
  def get_activities_with_http_info(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {})
55
63
  extra[:start_date] = start_date if start_date != SENTINEL
@@ -61,15 +69,15 @@ module SnapTrade
61
69
  end
62
70
 
63
71
  # Get transaction history for a user
64
- # Returns activities (transactions) for a user. Specifying start and end date is highly recommended for better performance
72
+ # Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
65
73
  # @param user_id [String]
66
74
  # @param user_secret [String]
67
75
  # @param [Hash] opts the optional parameters
68
- # @option opts [Date] :start_date
69
- # @option opts [Date] :end_date
70
- # @option opts [String] :accounts Optional comma seperated list of account IDs used to filter the request on specific accounts
71
- # @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
72
- # @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
76
+ # @option opts [Date] :start_date The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`.
77
+ # @option opts [Date] :end_date The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
78
+ # @option opts [String] :accounts Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The `brokerageAuthorizations` parameter takes precedence over this parameter.
79
+ # @option opts [String] :brokerage_authorizations Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the `accounts` parameter.
80
+ # @option opts [String] :type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - BUY - SELL - DIVIDEND - CONTRIBUTION - WITHDRAWAL - REI - INTEREST - FEE
73
81
  # @return [Array<UniversalActivity>]
74
82
  private def get_activities_impl(user_id, user_secret, opts = {})
75
83
  data, _status_code, _headers = get_activities_with_http_info(user_id, user_secret, opts)
@@ -77,15 +85,15 @@ module SnapTrade
77
85
  end
78
86
 
79
87
  # Get transaction history for a user
80
- # Returns activities (transactions) for a user. Specifying start and end date is highly recommended for better performance
88
+ # Returns all historical transactions for the specified user and filtering criteria. It&#39;s recommended to use &#x60;startDate&#x60; and &#x60;endDate&#x60; to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There&#39;s a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the &#x60;trade_date&#x60; field if you need them in a specific order. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
81
89
  # @param user_id [String]
82
90
  # @param user_secret [String]
83
91
  # @param [Hash] opts the optional parameters
84
- # @option opts [Date] :start_date
85
- # @option opts [Date] :end_date
86
- # @option opts [String] :accounts Optional comma seperated list of account IDs used to filter the request on specific accounts
87
- # @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
88
- # @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
92
+ # @option opts [Date] :start_date The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`.
93
+ # @option opts [Date] :end_date The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
94
+ # @option opts [String] :accounts Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The `brokerageAuthorizations` parameter takes precedence over this parameter.
95
+ # @option opts [String] :brokerage_authorizations Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the `accounts` parameter.
96
+ # @option opts [String] :type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - BUY - SELL - DIVIDEND - CONTRIBUTION - WITHDRAWAL - REI - INTEREST - FEE
89
97
  # @return [Array<(Array<UniversalActivity>, Integer, Hash)>] Array<UniversalActivity> data, response status code and response headers
90
98
  private def get_activities_with_http_info_impl(user_id, user_secret, opts = {})
91
99
  if @api_client.config.debugging
@@ -155,7 +163,7 @@ module SnapTrade
155
163
  # @param end_date [Date]
156
164
  # @param user_id [String]
157
165
  # @param user_secret [String]
158
- # @param accounts [String] Optional comma seperated list of account IDs used to filter the request on specific accounts
166
+ # @param accounts [String] Optional comma separated list of account IDs used to filter the request on specific accounts
159
167
  # @param detailed [Boolean] Optional, increases frequency of data points for the total value and contribution charts if set to true
160
168
  # @param frequency [String] Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly.
161
169
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
@@ -175,7 +183,7 @@ module SnapTrade
175
183
  # @param end_date [Date]
176
184
  # @param user_id [String]
177
185
  # @param user_secret [String]
178
- # @param accounts [String] Optional comma seperated list of account IDs used to filter the request on specific accounts
186
+ # @param accounts [String] Optional comma separated list of account IDs used to filter the request on specific accounts
179
187
  # @param detailed [Boolean] Optional, increases frequency of data points for the total value and contribution charts if set to true
180
188
  # @param frequency [String] Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly.
181
189
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
@@ -193,7 +201,7 @@ module SnapTrade
193
201
  # @param user_id [String]
194
202
  # @param user_secret [String]
195
203
  # @param [Hash] opts the optional parameters
196
- # @option opts [String] :accounts Optional comma seperated list of account IDs used to filter the request on specific accounts
204
+ # @option opts [String] :accounts Optional comma separated list of account IDs used to filter the request on specific accounts
197
205
  # @option opts [Boolean] :detailed Optional, increases frequency of data points for the total value and contribution charts if set to true
198
206
  # @option opts [String] :frequency Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly.
199
207
  # @return [PerformanceCustom]
@@ -209,7 +217,7 @@ module SnapTrade
209
217
  # @param user_id [String]
210
218
  # @param user_secret [String]
211
219
  # @param [Hash] opts the optional parameters
212
- # @option opts [String] :accounts Optional comma seperated list of account IDs used to filter the request on specific accounts
220
+ # @option opts [String] :accounts Optional comma separated list of account IDs used to filter the request on specific accounts
213
221
  # @option opts [Boolean] :detailed Optional, increases frequency of data points for the total value and contribution charts if set to true
214
222
  # @option opts [String] :frequency Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly.
215
223
  # @return [Array<(PerformanceCustom, Integer, Hash)>] PerformanceCustom data, response status code and response headers
@@ -11,22 +11,30 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # SnapTradeUser Investment Account
14
+ # A single brokerage account at a financial institution.
15
15
  class Account
16
+ # Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade. This ID should not change for as long as the connection stays active. If the connection is deleted and re-added, a new account ID will be generated. If you want a stable identifier for the account, use the `number` field.
16
17
  attr_accessor :id
17
18
 
19
+ # Unique identifier for the connection (brokerage authorization). This is the UUID used to reference the connection in SnapTrade.
18
20
  attr_accessor :brokerage_authorization
19
21
 
22
+ # Portfolio Group ID. Portfolio Groups have been deprecated. Please contact support if you have a usecase for it.
20
23
  attr_accessor :portfolio_group
21
24
 
25
+ # A display name for the account. Either assigned by the user or by the financial institution itself. For certain institutions, SnapTrade appends the institution name to the account name for clarity.
22
26
  attr_accessor :name
23
27
 
28
+ # The account number assigned by the financial institution.
24
29
  attr_accessor :number
25
30
 
31
+ # The name of the financial institution that holds the account.
26
32
  attr_accessor :institution_name
27
33
 
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 financial institution.
28
35
  attr_accessor :created_date
29
36
 
37
+ # Additional information about the account, such as account type, status, etc. This information is specific to the financial institution and there's no standard format for this data. Please use at your own risk.
30
38
  attr_accessor :meta
31
39
 
32
40
  # This field is deprecated.
@@ -67,7 +75,7 @@ module SnapTrade
67
75
  :'name' => :'String',
68
76
  :'number' => :'String',
69
77
  :'institution_name' => :'String',
70
- :'created_date' => :'String',
78
+ :'created_date' => :'Time',
71
79
  :'meta' => :'Hash<String, Object>',
72
80
  :'cash_restrictions' => :'Array<String>',
73
81
  :'sync_status' => :'AccountSyncStatus',
@@ -78,6 +86,7 @@ module SnapTrade
78
86
  # List of attributes with nullable: true
79
87
  def self.openapi_nullable
80
88
  Set.new([
89
+ :'name',
81
90
  ])
82
91
  end
83
92
 
@@ -11,7 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Total value of this account (includes cash, equity, fixed income, etc)
14
+ # Total market value of this account (includes cash, equity, fixed income, etc). This value is directly obtained from the brokerage and should reflect the most accurate value of the account.
15
15
  class AccountBalanceTotal
16
16
  # Total value denominated in the currency of the `currency` field.
17
17
  attr_accessor :amount
@@ -46,13 +46,6 @@ module SnapTrade
46
46
  ])
47
47
  end
48
48
 
49
- # List of class defined in allOf (OpenAPI v3)
50
- def self.openapi_all_of
51
- [
52
- :'Amount'
53
- ]
54
- end
55
-
56
49
  # Initializes the object
57
50
  # @param [Hash] attributes Model attributes in the form of hash
58
51
  def initialize(attributes = {})
@@ -49,7 +49,7 @@ module SnapTrade
49
49
  # Attribute type mapping.
50
50
  def self.openapi_types
51
51
  {
52
- :'account' => :'SnapTradeHoldingsAccountAccountId',
52
+ :'account' => :'Account',
53
53
  :'balances' => :'Array<Balance>',
54
54
  :'positions' => :'Array<Position>',
55
55
  :'option_positions' => :'Array<OptionsPosition>',
@@ -53,7 +53,7 @@ module SnapTrade
53
53
  # The type of order placed. The most common values are `Market`, `Limit`, `Stop`, and `StopLimit`. We try our best to map brokerage order types to these values. When mapping fails, we will return the brokerage's order type value.
54
54
  attr_accessor :order_type
55
55
 
56
- # The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. We try our best to map brokerage time in force values to the following. When mapping fails, we will return the brokerage's time in force value. - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled. - `GTD` - Good Til Date. The order is valid until the specified date.
56
+ # The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. We try our best to map brokerage time in force values to the following. When mapping fails, we will return the brokerage's time in force value. - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled. - `GTD` - Good Til Date. The order is valid until the specified date. - `MOO` - Market On Open. The order is to be executed at the day's opening price. - `EHP` - Extended Hours P.M. The order is to be placed during extended hour trading, after markets close.
57
57
  attr_accessor :time_in_force
58
58
 
59
59
  # The time the order was placed. This is the time the order was submitted to the brokerage.
@@ -67,8 +67,8 @@ module SnapTrade
67
67
  :'symbol' => :'String',
68
68
  :'raw_symbol' => :'String',
69
69
  :'description' => :'String',
70
- :'currency' => :'UniversalSymbolCurrency',
71
- :'exchange' => :'UniversalSymbolExchange',
70
+ :'currency' => :'SymbolCurrency',
71
+ :'exchange' => :'SymbolExchange',
72
72
  :'type' => :'SecurityType',
73
73
  :'currencies' => :'Array<Currency>',
74
74
  :'figi_code' => :'String',
@@ -11,12 +11,15 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # SnapTradeUser Investment Account
14
+ # A single brokerage account at a financial institution.
15
15
  class AccountSimple
16
+ # Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
16
17
  attr_accessor :id
17
18
 
19
+ # A display name for the account. Either assigned by the user or by the financial institution itself. For certain institutions, SnapTrade appends the institution name to the account name for clarity.
18
20
  attr_accessor :name
19
21
 
22
+ # The account number assigned by the financial institution.
20
23
  attr_accessor :number
21
24
 
22
25
  attr_accessor :sync_status
@@ -11,7 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Status of account
14
+ # Contains status update for the account sync process between SnapTrade and the brokerage.
15
15
  class AccountSyncStatus
16
16
  attr_accessor :transactions
17
17
 
@@ -38,7 +38,7 @@ module SnapTrade
38
38
  # Attribute type mapping.
39
39
  def self.openapi_types
40
40
  {
41
- :'currency' => :'Currency',
41
+ :'currency' => :'BalanceCurrency',
42
42
  :'cash' => :'Float',
43
43
  :'buying_power' => :'Float'
44
44
  }
@@ -11,13 +11,23 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- class SnapTradeHoldingsAccountAccountIdBalance
15
- attr_accessor :total
14
+ # The currency of the balance. This applies to both `cash` and `buying_power`.
15
+ class BalanceCurrency
16
+ # Unique identifier for the currency. This is the UUID used to reference the currency in SnapTrade.
17
+ attr_accessor :id
18
+
19
+ # The ISO-4217 currency code for the currency.
20
+ attr_accessor :code
21
+
22
+ # A human-friendly name of the currency.
23
+ attr_accessor :name
16
24
 
17
25
  # Attribute mapping from ruby-style variable name to JSON key.
18
26
  def self.attribute_map
19
27
  {
20
- :'total' => :'total'
28
+ :'id' => :'id',
29
+ :'code' => :'code',
30
+ :'name' => :'name'
21
31
  }
22
32
  end
23
33
 
@@ -29,21 +39,22 @@ module SnapTrade
29
39
  # Attribute type mapping.
30
40
  def self.openapi_types
31
41
  {
32
- :'total' => :'AccountBalanceTotal'
42
+ :'id' => :'String',
43
+ :'code' => :'String',
44
+ :'name' => :'String'
33
45
  }
34
46
  end
35
47
 
36
48
  # List of attributes with nullable: true
37
49
  def self.openapi_nullable
38
50
  Set.new([
39
- :'total'
40
51
  ])
41
52
  end
42
53
 
43
54
  # List of class defined in allOf (OpenAPI v3)
44
55
  def self.openapi_all_of
45
56
  [
46
- :'AccountBalance'
57
+ :'Currency'
47
58
  ]
48
59
  end
49
60
 
@@ -51,19 +62,27 @@ module SnapTrade
51
62
  # @param [Hash] attributes Model attributes in the form of hash
52
63
  def initialize(attributes = {})
53
64
  if (!attributes.is_a?(Hash))
54
- fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::SnapTradeHoldingsAccountAccountIdBalance` initialize method"
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::BalanceCurrency` initialize method"
55
66
  end
56
67
 
57
68
  # check to see if the attribute exists and convert string to symbol for hash key
58
69
  attributes = attributes.each_with_object({}) { |(k, v), h|
59
70
  if (!self.class.attribute_map.key?(k.to_sym))
60
- fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::SnapTradeHoldingsAccountAccountIdBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::BalanceCurrency`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
72
  end
62
73
  h[k.to_sym] = v
63
74
  }
64
75
 
65
- if attributes.key?(:'total')
66
- self.total = attributes[:'total']
76
+ if attributes.key?(:'id')
77
+ self.id = attributes[:'id']
78
+ end
79
+
80
+ if attributes.key?(:'code')
81
+ self.code = attributes[:'code']
82
+ end
83
+
84
+ if attributes.key?(:'name')
85
+ self.name = attributes[:'name']
67
86
  end
68
87
  end
69
88
 
@@ -85,7 +104,9 @@ module SnapTrade
85
104
  def ==(o)
86
105
  return true if self.equal?(o)
87
106
  self.class == o.class &&
88
- total == o.total
107
+ id == o.id &&
108
+ code == o.code &&
109
+ name == o.name
89
110
  end
90
111
 
91
112
  # @see the `==` method
@@ -97,7 +118,7 @@ module SnapTrade
97
118
  # Calculates hash code according to all attributes.
98
119
  # @return [Integer] Hash code
99
120
  def hash
100
- [total].hash
121
+ [id, code, name].hash
101
122
  end
102
123
 
103
124
  # Builds the object from hash
@@ -11,11 +11,13 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Response when delete user is successful
15
14
  class DeleteUserResponse
16
- # Delete status
15
+ # This is always `deleted` when a user is queued for deletion.
17
16
  attr_accessor :status
18
17
 
18
+ # Human friendly message about the deletion status.
19
+ attr_accessor :detail
20
+
19
21
  # SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
20
22
  attr_accessor :user_id
21
23
 
@@ -23,6 +25,7 @@ module SnapTrade
23
25
  def self.attribute_map
24
26
  {
25
27
  :'status' => :'status',
28
+ :'detail' => :'detail',
26
29
  :'user_id' => :'userId'
27
30
  }
28
31
  end
@@ -36,6 +39,7 @@ module SnapTrade
36
39
  def self.openapi_types
37
40
  {
38
41
  :'status' => :'String',
42
+ :'detail' => :'String',
39
43
  :'user_id' => :'String'
40
44
  }
41
45
  end
@@ -65,6 +69,10 @@ module SnapTrade
65
69
  self.status = attributes[:'status']
66
70
  end
67
71
 
72
+ if attributes.key?(:'detail')
73
+ self.detail = attributes[:'detail']
74
+ end
75
+
68
76
  if attributes.key?(:'user_id')
69
77
  self.user_id = attributes[:'user_id']
70
78
  end
@@ -89,6 +97,7 @@ module SnapTrade
89
97
  return true if self.equal?(o)
90
98
  self.class == o.class &&
91
99
  status == o.status &&
100
+ detail == o.detail &&
92
101
  user_id == o.user_id
93
102
  end
94
103
 
@@ -101,7 +110,7 @@ module SnapTrade
101
110
  # Calculates hash code according to all attributes.
102
111
  # @return [Integer] Hash code
103
112
  def hash
104
- [status, user_id].hash
113
+ [status, detail, user_id].hash
105
114
  end
106
115
 
107
116
  # Builds the object from hash
@@ -11,11 +11,12 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Status of account holdings sync
14
+ # Status of account holdings sync. SnapTrade syncs holdings from the brokerage under the following conditions: 1. Initial connection - SnapTrade syncs all holdings (positions, balances, recent orders, and transactions) immediately after the connection is established. 2. Daily sync - Once a day SnapTrade refreshes all holdings from the brokerage. 3. Manual sync - You can trigger a refresh of holdings with the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
15
15
  class HoldingsStatus
16
+ # Indicates if the initial sync of holdings has been completed. For accounts with a large number of positions/orders/transactions, the initial sync may take a while to complete.
16
17
  attr_accessor :initial_sync_completed
17
18
 
18
- # Date in ISO 8601 format or null (YYYY-MM-DD HH:MM:SS.mmmmmmTZ)
19
+ # The last time holdings were successfully synced by SnapTrade.
19
20
  attr_accessor :last_successful_sync
20
21
 
21
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -35,14 +36,13 @@ module SnapTrade
35
36
  def self.openapi_types
36
37
  {
37
38
  :'initial_sync_completed' => :'Boolean',
38
- :'last_successful_sync' => :'String'
39
+ :'last_successful_sync' => :'Time'
39
40
  }
40
41
  end
41
42
 
42
43
  # List of attributes with nullable: true
43
44
  def self.openapi_nullable
44
45
  Set.new([
45
- :'last_successful_sync'
46
46
  ])
47
47
  end
48
48
 
@@ -13,8 +13,10 @@ require 'time'
13
13
  module SnapTrade
14
14
  # Redirect uri upon successful login
15
15
  class LoginRedirectURI
16
+ # Connection Portal link to redirect user to connect a brokerage account.
16
17
  attr_accessor :redirect_uri
17
18
 
19
+ # ID to identify the connection portal session.
18
20
  attr_accessor :session_id
19
21
 
20
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -33,7 +35,7 @@ module SnapTrade
33
35
  # Attribute type mapping.
34
36
  def self.openapi_types
35
37
  {
36
- :'redirect_uri' => :'Object',
38
+ :'redirect_uri' => :'String',
37
39
  :'session_id' => :'String'
38
40
  }
39
41
  end
@@ -41,7 +43,6 @@ module SnapTrade
41
43
  # List of attributes with nullable: true
42
44
  def self.openapi_nullable
43
45
  Set.new([
44
- :'redirect_uri',
45
46
  ])
46
47
  end
47
48