snaptrade 2.0.34 → 2.0.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +57 -35
  4. data/lib/snaptrade/api/account_information_api.rb +4 -4
  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/transactions_and_reporting_api.rb +36 -28
  8. data/lib/snaptrade/models/account.rb +7 -7
  9. data/lib/snaptrade/models/account_order_record.rb +1 -1
  10. data/lib/snaptrade/models/account_order_record_universal_symbol.rb +2 -2
  11. data/lib/snaptrade/models/account_simple.rb +4 -1
  12. data/lib/snaptrade/models/delete_user_response.rb +12 -3
  13. data/lib/snaptrade/models/login_redirect_uri.rb +3 -2
  14. data/lib/snaptrade/models/snap_trade_login_user_request_body.rb +10 -6
  15. data/lib/snaptrade/models/symbol.rb +16 -10
  16. data/lib/snaptrade/models/{universal_symbol_currency.rb → symbol_currency.rb} +3 -3
  17. data/lib/snaptrade/models/{universal_symbol_exchange.rb → symbol_exchange.rb} +3 -3
  18. data/lib/snaptrade/models/underlying_symbol.rb +1 -1
  19. data/lib/snaptrade/models/universal_activity.rb +91 -81
  20. data/lib/snaptrade/models/universal_activity_currency.rb +245 -0
  21. data/lib/snaptrade/models/universal_activity_option_symbol.rb +314 -0
  22. data/lib/snaptrade/models/universal_activity_symbol.rb +304 -0
  23. data/lib/snaptrade/models/universal_symbol.rb +2 -2
  24. data/lib/snaptrade/models/user_i_dand_secret.rb +1 -1
  25. data/lib/snaptrade/version.rb +1 -1
  26. data/lib/snaptrade.rb +5 -2
  27. data/spec/api/account_information_api_spec.rb +1 -1
  28. data/spec/api/authentication_api_spec.rb +7 -7
  29. data/spec/api/connections_api_spec.rb +2 -2
  30. data/spec/api/transactions_and_reporting_api_spec.rb +7 -7
  31. data/spec/models/delete_user_response_spec.rb +6 -0
  32. data/spec/models/{universal_symbol_currency_spec.rb → symbol_currency_spec.rb} +6 -6
  33. data/spec/models/{universal_symbol_exchange_spec.rb → symbol_exchange_spec.rb} +6 -6
  34. data/spec/models/symbol_spec.rb +1 -1
  35. data/spec/models/universal_activity_currency_spec.rb +41 -0
  36. data/spec/models/universal_activity_option_symbol_spec.rb +65 -0
  37. data/spec/models/universal_activity_spec.rb +15 -15
  38. data/spec/models/universal_activity_symbol_spec.rb +77 -0
  39. metadata +17 -8
@@ -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,9 +11,9 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # A single brokerage account at a financial institution.
14
+ # A single account at a brokerage.
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
+ # 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.
17
17
  attr_accessor :id
18
18
 
19
19
  # Unique identifier for the connection (brokerage authorization). This is the UUID used to reference the connection in SnapTrade.
@@ -22,19 +22,19 @@ module SnapTrade
22
22
  # Portfolio Group ID. Portfolio Groups have been deprecated. Please contact support if you have a usecase for it.
23
23
  attr_accessor :portfolio_group
24
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.
25
+ # A display name for the account. Either assigned by the user or by the brokerage itself. For certain brokerages, SnapTrade appends the brokerage name to the account name for clarity.
26
26
  attr_accessor :name
27
27
 
28
- # The account number assigned by the financial institution.
28
+ # The account number assigned by the brokerage. For some brokerages, this field may be masked for security reasons.
29
29
  attr_accessor :number
30
30
 
31
- # The name of the financial institution that holds the account.
31
+ # The name of the brokerage that holds the account.
32
32
  attr_accessor :institution_name
33
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.
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
- # 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.
37
+ # Additional information about the account, such as account type, status, etc. This information is specific to the brokerage and there's no standard format for this data. Please use at your own risk.
38
38
  attr_accessor :meta
39
39
 
40
40
  # This field is deprecated.
@@ -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 account at a brokerage.
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 brokerage itself. For certain brokerages, SnapTrade appends the brokerage name to the account name for clarity.
18
20
  attr_accessor :name
19
21
 
22
+ # The account number assigned by the brokerage. For some brokerages, this field may be masked for security reasons.
20
23
  attr_accessor :number
21
24
 
22
25
  attr_accessor :sync_status
@@ -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
@@ -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
 
@@ -13,22 +13,22 @@ require 'time'
13
13
  module SnapTrade
14
14
  # Data to login a user via SnapTrade Partner
15
15
  class SnapTradeLoginUserRequestBody
16
- # Slug of the brokerage to connect the user to. See [this document](https://snaptrade.notion.site/SnapTrade-Brokerage-Integrations-f83946a714a84c3caf599f6a945f0ead) for a list of supported brokerages and their slugs.
16
+ # Slug of the brokerage to connect the user to. See [the integrations page](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=3cfea70ef4254afc89704e47275a7a9a&pvs=4) for a list of supported brokerages and their slugs.
17
17
  attr_accessor :broker
18
18
 
19
- # When set to True, user will be redirected back to the partner's site instead of the connection portal
19
+ # When set to `true`, user will be redirected back to the partner's site instead of the connection portal. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](https://docs.snaptrade.com/docs/implement-connection-portal) for more information.
20
20
  attr_accessor :immediate_redirect
21
21
 
22
- # URL to redirect the user to after the user connects their brokerage account
22
+ # URL to redirect the user to after the user connects their brokerage account. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](https://docs.snaptrade.com/docs/implement-connection-portal) for more information.
23
23
  attr_accessor :custom_redirect
24
24
 
25
- # The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See ‘Reconnecting Accounts’ for more information.
25
+ # The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See the [guide on fixing broken connections](https://docs.snaptrade.com/docs/fix-broken-connections) for more information.
26
26
  attr_accessor :reconnect
27
27
 
28
- # Sets whether the connection should be read or trade
28
+ # Sets whether the connection should be read-only or trade-enabled.
29
29
  attr_accessor :connection_type
30
30
 
31
- # Sets the version of the connection portal to render, with a default to 'v3'
31
+ # Sets the version of the connection portal to render.
32
32
  attr_accessor :connection_portal_version
33
33
 
34
34
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -99,10 +99,14 @@ module SnapTrade
99
99
 
100
100
  if attributes.key?(:'connection_type')
101
101
  self.connection_type = attributes[:'connection_type']
102
+ else
103
+ self.connection_type = 'read'
102
104
  end
103
105
 
104
106
  if attributes.key?(:'connection_portal_version')
105
107
  self.connection_portal_version = attributes[:'connection_portal_version']
108
+ else
109
+ self.connection_portal_version = 'v3'
106
110
  end
107
111
  end
108
112
 
@@ -11,15 +11,19 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Symbol
14
+ # Uniquely describes a single security + exchange combination across all brokerages.
15
15
  class Symbol
16
+ # Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
16
17
  attr_accessor :id
17
18
 
19
+ # The security's trading ticker symbol. For example \"AAPL\" for Apple Inc. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on \"Yahoo Finance Market Coverage and Data Delays\"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix.
18
20
  attr_accessor :symbol
19
21
 
22
+ # The raw symbol is `symbol` with the exchange suffix removed. For example, if `symbol` is \"VAB.TO\", then `raw_symbol` is \"VAB\".
20
23
  attr_accessor :raw_symbol
21
24
 
22
- attr_accessor :name
25
+ # A human-readable description of the security. This is usually the company name or ETF name.
26
+ attr_accessor :description
23
27
 
24
28
  attr_accessor :currency
25
29
 
@@ -27,6 +31,7 @@ module SnapTrade
27
31
 
28
32
  attr_accessor :type
29
33
 
34
+ # This identifier is unique per security per trading venue. See section 1.4.1 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information. This value should be the same as the `figi_code` in the `figi_instrument` child property.
30
35
  attr_accessor :figi_code
31
36
 
32
37
  attr_accessor :figi_instrument
@@ -37,7 +42,7 @@ module SnapTrade
37
42
  :'id' => :'id',
38
43
  :'symbol' => :'symbol',
39
44
  :'raw_symbol' => :'raw_symbol',
40
- :'name' => :'name',
45
+ :'description' => :'description',
41
46
  :'currency' => :'currency',
42
47
  :'exchange' => :'exchange',
43
48
  :'type' => :'type',
@@ -57,9 +62,9 @@ module SnapTrade
57
62
  :'id' => :'String',
58
63
  :'symbol' => :'String',
59
64
  :'raw_symbol' => :'String',
60
- :'name' => :'String',
61
- :'currency' => :'Currency',
62
- :'exchange' => :'Exchange',
65
+ :'description' => :'String',
66
+ :'currency' => :'SymbolCurrency',
67
+ :'exchange' => :'SymbolExchange',
63
68
  :'type' => :'SecurityType',
64
69
  :'figi_code' => :'String',
65
70
  :'figi_instrument' => :'SymbolFigiInstrument'
@@ -69,6 +74,7 @@ module SnapTrade
69
74
  # List of attributes with nullable: true
70
75
  def self.openapi_nullable
71
76
  Set.new([
77
+ :'description',
72
78
  :'figi_code',
73
79
  :'figi_instrument'
74
80
  ])
@@ -101,8 +107,8 @@ module SnapTrade
101
107
  self.raw_symbol = attributes[:'raw_symbol']
102
108
  end
103
109
 
104
- if attributes.key?(:'name')
105
- self.name = attributes[:'name']
110
+ if attributes.key?(:'description')
111
+ self.description = attributes[:'description']
106
112
  end
107
113
 
108
114
  if attributes.key?(:'currency')
@@ -147,7 +153,7 @@ module SnapTrade
147
153
  id == o.id &&
148
154
  symbol == o.symbol &&
149
155
  raw_symbol == o.raw_symbol &&
150
- name == o.name &&
156
+ description == o.description &&
151
157
  currency == o.currency &&
152
158
  exchange == o.exchange &&
153
159
  type == o.type &&
@@ -164,7 +170,7 @@ module SnapTrade
164
170
  # Calculates hash code according to all attributes.
165
171
  # @return [Integer] Hash code
166
172
  def hash
167
- [id, symbol, raw_symbol, name, currency, exchange, type, figi_code, figi_instrument].hash
173
+ [id, symbol, raw_symbol, description, currency, exchange, type, figi_code, figi_instrument].hash
168
174
  end
169
175
 
170
176
  # Builds the object from hash
@@ -12,7 +12,7 @@ require 'time'
12
12
 
13
13
  module SnapTrade
14
14
  # The currency in which the security is traded.
15
- class UniversalSymbolCurrency
15
+ class SymbolCurrency
16
16
  # Unique identifier for the currency. This is the UUID used to reference the currency in SnapTrade.
17
17
  attr_accessor :id
18
18
 
@@ -62,13 +62,13 @@ module SnapTrade
62
62
  # @param [Hash] attributes Model attributes in the form of hash
63
63
  def initialize(attributes = {})
64
64
  if (!attributes.is_a?(Hash))
65
- fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::UniversalSymbolCurrency` initialize method"
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::SymbolCurrency` initialize method"
66
66
  end
67
67
 
68
68
  # check to see if the attribute exists and convert string to symbol for hash key
69
69
  attributes = attributes.each_with_object({}) { |(k, v), h|
70
70
  if (!self.class.attribute_map.key?(k.to_sym))
71
- fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::UniversalSymbolCurrency`. 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::SymbolCurrency`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
72
  end
73
73
  h[k.to_sym] = v
74
74
  }
@@ -12,7 +12,7 @@ require 'time'
12
12
 
13
13
  module SnapTrade
14
14
  # The exchange on which the security is listed and traded.
15
- class UniversalSymbolExchange
15
+ class SymbolExchange
16
16
  # Unique ID for the exchange in SnapTrade.
17
17
  attr_accessor :id
18
18
 
@@ -88,13 +88,13 @@ module SnapTrade
88
88
  # @param [Hash] attributes Model attributes in the form of hash
89
89
  def initialize(attributes = {})
90
90
  if (!attributes.is_a?(Hash))
91
- fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::UniversalSymbolExchange` initialize method"
91
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::SymbolExchange` initialize method"
92
92
  end
93
93
 
94
94
  # check to see if the attribute exists and convert string to symbol for hash key
95
95
  attributes = attributes.each_with_object({}) { |(k, v), h|
96
96
  if (!self.class.attribute_map.key?(k.to_sym))
97
- fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::UniversalSymbolExchange`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::SymbolExchange`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
98
98
  end
99
99
  h[k.to_sym] = v
100
100
  }
@@ -67,7 +67,7 @@ module SnapTrade
67
67
  :'symbol' => :'String',
68
68
  :'raw_symbol' => :'String',
69
69
  :'description' => :'String',
70
- :'currency' => :'UniversalSymbolCurrency',
70
+ :'currency' => :'SymbolCurrency',
71
71
  :'exchange' => :'UnderlyingSymbolExchange',
72
72
  :'type' => :'UnderlyingSymbolType',
73
73
  :'currencies' => :'Array<Currency>',