snaptrade 3.0.13 → 3.0.15

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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/lib/snaptrade/api/account_information_api.rb +6 -6
  4. data/lib/snaptrade/api/connections_api.rb +4 -4
  5. data/lib/snaptrade/api_client_custom.rb +1 -1
  6. data/lib/snaptrade/models/account_position.rb +1 -1
  7. data/lib/snaptrade/models/brokerage_authorization.rb +1 -2
  8. data/lib/snaptrade/models/{line_of_credit_account_credit_details.rb → brokerage_authorization_data_freshness_mode.rb} +30 -12
  9. data/lib/snaptrade/models/deposit_account.rb +10 -10
  10. data/lib/snaptrade/models/institution.rb +37 -0
  11. data/lib/snaptrade/models/instrument.rb +1 -0
  12. data/lib/snaptrade/models/investment_account.rb +10 -10
  13. data/lib/snaptrade/models/line_of_credit_account.rb +17 -17
  14. data/lib/snaptrade/models/{line_of_credit_account_credit_details_minimum_payment_amount.rb → line_of_credit_account_minimum_payment_amount.rb} +4 -4
  15. data/lib/snaptrade/models/other_instrument.rb +1 -1
  16. data/lib/snaptrade/models/other_instrument_kind.rb +2 -1
  17. data/lib/snaptrade/models/snaptrade.rb +37 -0
  18. data/lib/snaptrade/models/underlying_cfd_instrument.rb +1 -0
  19. data/lib/snaptrade/models/underlying_option_instrument.rb +1 -0
  20. data/lib/snaptrade/version.rb +1 -1
  21. data/lib/snaptrade.rb +4 -2
  22. data/spec/api/account_information_api_spec.rb +1 -1
  23. data/spec/api/connections_api_spec.rb +1 -1
  24. data/spec/models/brokerage_authorization_data_freshness_mode_spec.rb +35 -0
  25. data/spec/models/connection_account_spec.rb +1 -1
  26. data/spec/models/deposit_account_spec.rb +1 -1
  27. data/spec/models/institution_spec.rb +23 -0
  28. data/spec/models/instrument_spec.rb +1 -1
  29. data/spec/models/investment_account_spec.rb +1 -1
  30. data/spec/models/{line_of_credit_account_credit_details_minimum_payment_amount_spec.rb → line_of_credit_account_minimum_payment_amount_spec.rb} +6 -6
  31. data/spec/models/line_of_credit_account_spec.rb +2 -2
  32. data/spec/models/snaptrade_spec.rb +23 -0
  33. data/spec/models/underlying_cfd_instrument_spec.rb +1 -1
  34. data/spec/models/underlying_option_instrument_spec.rb +1 -1
  35. data/spec/regression/all_account_positions_spec.rb +86 -0
  36. data/spec/regression/fixtures/all_account_positions.json +33 -0
  37. data/spec/regression/request_signing_spec.rb +46 -0
  38. metadata +228 -217
  39. data/Gemfile.lock +0 -91
  40. data/spec/models/line_of_credit_account_credit_details_spec.rb +0 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c85c26f2c50b672a1263020a906f34b2f00a6e061bf71ba6c7f9fc6cd95f0821
4
- data.tar.gz: 156237f275770b7820324468ebf95d051a9f148f27113ac2c72a4fd247252309
3
+ metadata.gz: 6f4f6df70641bac0ea16b0095d5cc12b08b1f20d46bcf0eabe3e74d81f394284
4
+ data.tar.gz: 6111f68c8a76ba924318a9385a229929a99c0d78b6debbe3c2d5bd72d10f5dec
5
5
  SHA512:
6
- metadata.gz: 2cf2d12f1df8534f43f797028d0021668e4667a51bf7596fac22704c78057f9a371005c238ee98782ad570185aa18b3d73ba5de2b8c9ae1557cb5aee7fbf428f
7
- data.tar.gz: 2bca1fa462820242afd50cdcb30c1c905bd9b846c24ebb082c1da005a8894a4f2a9eb994ebd06bdc52e9097998da974341809c22c7286e30751d0ed0e7262ec1
6
+ metadata.gz: 6b1980f6b8168d9ce003bc1d5f66bd96fbe5ccbadd75dff6fc0e9eb741f77addcc99e4073f9bc6aee6fcd1a530cf9e92c3f3e5a7a3f12875cfb9cbc11675cc1c
7
+ data.tar.gz: 361584ee67a2f7fe22f115da2ba939f78f03fa3320365e5feaa90b9ef2b4837ab4adb98e83146a6a31c0bcca759c66edcfc5e3c0b66c47161038748ee771fcfb
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.13-blue)](https://rubygems.org/gems/snaptrade/versions/3.0.13)
9
+ [![npm](https://img.shields.io/badge/gem-v3.0.15-blue)](https://rubygems.org/gems/snaptrade/versions/3.0.15)
10
10
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
11
11
 
12
12
  </div>
@@ -82,7 +82,7 @@ Connect brokerage accounts to your app for live positions and trading
82
82
  Add to Gemfile:
83
83
 
84
84
  ```ruby
85
- gem 'snaptrade', '~> 3.0.13'
85
+ gem 'snaptrade', '~> 3.0.15'
86
86
  ```
87
87
 
88
88
  ## Getting Started<a id="getting-started"></a>
@@ -250,9 +250,9 @@ p result
250
250
 
251
251
  Returns a list of all positions in the specified account.
252
252
 
253
- The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, option positions, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
253
+ The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
254
254
 
255
- `mutualfund` positions may also include `cash_equivalent`. `stock`, `etf`, and `mutualfund` positions may include `tax_lots` when tax lot data is enabled for the account. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages).
255
+ Positions counted in account cash balance or buying power include `cash_equivalent: true`. `stock`, `adr`, `etf`, `mutualfund`, and `crypto` positions may include `tax_lots` when tax lot data is enabled for the account. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages).
256
256
 
257
257
  If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
258
258
 
@@ -1084,7 +1084,7 @@ Trigger a holdings update for all accounts under this connection. Updates will b
1084
1084
  This endpoint will also trigger a transaction sync for the past day if one has not yet occurred.
1085
1085
 
1086
1086
  **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
1087
- **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless the connection is delayed. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to the `data_freshness_mode` field on a connection to determine this.**
1087
+ **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless SnapTrade uses delayed data for the connection. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to `data_freshness_mode.snaptrade` on a connection to determine this.**
1088
1088
 
1089
1089
 
1090
1090
  #### 🛠️ Usage<a id="🛠️-usage"></a>
@@ -290,9 +290,9 @@ module SnapTrade
290
290
  #
291
291
  # Returns a list of all positions in the specified account.
292
292
  #
293
- # The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, option positions, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
293
+ # The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
294
294
  #
295
- # `mutualfund` positions may also include `cash_equivalent`. `stock`, `etf`, and `mutualfund` positions may include `tax_lots` when tax lot data is enabled for the account. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages).
295
+ # Positions counted in account cash balance or buying power include `cash_equivalent: true`. `stock`, `adr`, `etf`, `mutualfund`, and `crypto` positions may include `tax_lots` when tax lot data is enabled for the account. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages).
296
296
  #
297
297
  # If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
298
298
  #
@@ -309,9 +309,9 @@ module SnapTrade
309
309
  #
310
310
  # Returns a list of all positions in the specified account.
311
311
  #
312
- # The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, option positions, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
312
+ # The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
313
313
  #
314
- # `mutualfund` positions may also include `cash_equivalent`. `stock`, `etf`, and `mutualfund` positions may include `tax_lots` when tax lot data is enabled for the account. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages).
314
+ # Positions counted in account cash balance or buying power include `cash_equivalent: true`. `stock`, `adr`, `etf`, `mutualfund`, and `crypto` positions may include `tax_lots` when tax lot data is enabled for the account. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages).
315
315
  #
316
316
  # If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
317
317
  #
@@ -324,7 +324,7 @@ module SnapTrade
324
324
  end
325
325
 
326
326
  # List all account positions
327
- # Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, option positions, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. `mutualfund` positions may also include `cash_equivalent`. `stock`, `etf`, and `mutualfund` positions may include `tax_lots` when tax lot data is enabled for the account. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
327
+ # Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. Positions counted in account cash balance or buying power include `cash_equivalent: true`. `stock`, `adr`, `etf`, `mutualfund`, and `crypto` positions may include `tax_lots` when tax lot data is enabled for the account. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
328
328
  # @param user_id [String]
329
329
  # @param user_secret [String]
330
330
  # @param account_id [String]
@@ -336,7 +336,7 @@ module SnapTrade
336
336
  end
337
337
 
338
338
  # List all account positions
339
- # Returns a list of all positions in the specified account. The &#x60;results&#x60; list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, option positions, and CFD positions. Use the &#x60;instrument.kind&#x60; discriminator to determine the schema for each position&#39;s &#x60;instrument&#x60;. &#x60;mutualfund&#x60; positions may also include &#x60;cash_equivalent&#x60;. &#x60;stock&#x60;, &#x60;etf&#x60;, and &#x60;mutualfund&#x60; positions may include &#x60;tax_lots&#x60; when tax lot data is enabled for the account. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
339
+ # Returns a list of all positions in the specified account. The &#x60;results&#x60; list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, and CFD positions. Use the &#x60;instrument.kind&#x60; discriminator to determine the schema for each position&#39;s &#x60;instrument&#x60;. Positions counted in account cash balance or buying power include &#x60;cash_equivalent: true&#x60;. &#x60;stock&#x60;, &#x60;adr&#x60;, &#x60;etf&#x60;, &#x60;mutualfund&#x60;, and &#x60;crypto&#x60; positions may include &#x60;tax_lots&#x60; when tax lot data is enabled for the account. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
340
340
  # @param user_id [String]
341
341
  # @param user_secret [String]
342
342
  # @param account_id [String]
@@ -556,7 +556,7 @@ module SnapTrade
556
556
  # This endpoint will also trigger a transaction sync for the past day if one has not yet occurred.
557
557
  #
558
558
  # **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
559
- # **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless the connection is delayed. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to the `data_freshness_mode` field on a connection to determine this.**
559
+ # **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless SnapTrade uses delayed data for the connection. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to `data_freshness_mode.snaptrade` on a connection to determine this.**
560
560
  #
561
561
  # @param authorization_id [String]
562
562
  # @param user_id [String]
@@ -573,7 +573,7 @@ module SnapTrade
573
573
  # This endpoint will also trigger a transaction sync for the past day if one has not yet occurred.
574
574
  #
575
575
  # **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
576
- # **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless the connection is delayed. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to the `data_freshness_mode` field on a connection to determine this.**
576
+ # **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless SnapTrade uses delayed data for the connection. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to `data_freshness_mode.snaptrade` on a connection to determine this.**
577
577
  #
578
578
  # @param authorization_id [String]
579
579
  # @param user_id [String]
@@ -584,7 +584,7 @@ module SnapTrade
584
584
  end
585
585
 
586
586
  # Refresh holdings for a connection
587
- # Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless the connection is delayed. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to the `data_freshness_mode` field on a connection to determine this.**
587
+ # Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless SnapTrade uses delayed data for the connection. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to `data_freshness_mode.snaptrade` on a connection to determine this.**
588
588
  # @param authorization_id [String]
589
589
  # @param user_id [String]
590
590
  # @param user_secret [String]
@@ -596,7 +596,7 @@ module SnapTrade
596
596
  end
597
597
 
598
598
  # Refresh holdings for a connection
599
- # Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [&#x60;ACCOUNT_HOLDINGS_UPDATED&#x60; webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless the connection is delayed. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to the &#x60;data_freshness_mode&#x60; field on a connection to determine this.**
599
+ # Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [&#x60;ACCOUNT_HOLDINGS_UPDATED&#x60; webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless SnapTrade uses delayed data for the connection. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to &#x60;data_freshness_mode.snaptrade&#x60; on a connection to determine this.**
600
600
  # @param authorization_id [String]
601
601
  # @param user_id [String]
602
602
  # @param user_secret [String]
@@ -23,7 +23,7 @@ module SnapTrade
23
23
  "path" => path,
24
24
  "query" => query
25
25
  }
26
- sig_content = JSON.generate(sig_object, sort_by: :to_s)
26
+ sig_content = JSON.generate(sig_object)
27
27
  sig_digest = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, configuration.consumer_key, sig_content)
28
28
  signature = Base64.encode64(sig_digest).strip()
29
29
  request.headers[:Signature] = signature
@@ -27,7 +27,7 @@ module SnapTrade
27
27
  # ISO-4217 currency code for the position `price` and `cost_basis`.
28
28
  attr_accessor :currency
29
29
 
30
- # Present for mutual fund positions that are also counted in cash balance or buying power.
30
+ # Present for mutual fund positions and for other instrument kinds when true. A true value means the position is also counted in cash balance or buying power.
31
31
  attr_accessor :cash_equivalent
32
32
 
33
33
  # List of tax lots for the given position (disabled by default, only available on paid plans, contact support if needed)
@@ -42,7 +42,6 @@ module SnapTrade
42
42
  # Whether the connection is eligible for a payout. This is an experimental field that is NOT generally available for all partners. Do not use in production without speaking to the SnapTrade team.
43
43
  attr_accessor :is_eligible_for_payout
44
44
 
45
- # Possible values include: - realtime - delayed Indicates whether SnapTrade will provide delayed or realtime data for this connection. `delayed` means SnapTrade uses cached data for the connection because of the customer's plan, or because of brokerage limitations. `realtime` means SnapTrade retrieves current data from the brokerage during API calls. See the \"Data freshness\" column on the \"Positions & recent orders\" tab at https://support.snaptrade.com/brokerages.
46
45
  attr_accessor :data_freshness_mode
47
46
 
48
47
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -80,7 +79,7 @@ module SnapTrade
80
79
  :'meta' => :'Hash<String, Object>',
81
80
  :'updated_date' => :'Time',
82
81
  :'is_eligible_for_payout' => :'Boolean',
83
- :'data_freshness_mode' => :'String'
82
+ :'data_freshness_mode' => :'BrokerageAuthorizationDataFreshnessMode'
84
83
  }
85
84
  end
86
85
 
@@ -11,14 +11,17 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Additional line-of-credit details. Currently only `minimum_payment_amount`; more properties (e.g. credit limit) may be added later without a breaking change. Omitted when no such data is available.
15
- class LineOfCreditAccountCreditDetails
16
- attr_accessor :minimum_payment_amount
14
+ # Indicates the data freshness provided by the brokerage institution and by SnapTrade for this connection. `institution` is `delayed` when the brokerage itself provides delayed data. See the \"Data freshness\" column on the \"Positions & recent orders\" tab at https://support.snaptrade.com/brokerages. `snaptrade` is `delayed` when SnapTrade uses cached data for the connection because of the customer's plan or the integration. Otherwise, it is `realtime` and SnapTrade retrieves current data from the brokerage during API calls.
15
+ class BrokerageAuthorizationDataFreshnessMode
16
+ attr_accessor :institution
17
+
18
+ attr_accessor :snaptrade
17
19
 
18
20
  # Attribute mapping from ruby-style variable name to JSON key.
19
21
  def self.attribute_map
20
22
  {
21
- :'minimum_payment_amount' => :'minimum_payment_amount'
23
+ :'institution' => :'institution',
24
+ :'snaptrade' => :'snaptrade'
22
25
  }
23
26
  end
24
27
 
@@ -30,14 +33,14 @@ module SnapTrade
30
33
  # Attribute type mapping.
31
34
  def self.openapi_types
32
35
  {
33
- :'minimum_payment_amount' => :'LineOfCreditAccountCreditDetailsMinimumPaymentAmount'
36
+ :'institution' => :'Institution',
37
+ :'snaptrade' => :'Snaptrade'
34
38
  }
35
39
  end
36
40
 
37
41
  # List of attributes with nullable: true
38
42
  def self.openapi_nullable
39
43
  Set.new([
40
- :'minimum_payment_amount'
41
44
  ])
42
45
  end
43
46
 
@@ -45,19 +48,23 @@ module SnapTrade
45
48
  # @param [Hash] attributes Model attributes in the form of hash
46
49
  def initialize(attributes = {})
47
50
  if (!attributes.is_a?(Hash))
48
- fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::LineOfCreditAccountCreditDetails` initialize method"
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::BrokerageAuthorizationDataFreshnessMode` initialize method"
49
52
  end
50
53
 
51
54
  # check to see if the attribute exists and convert string to symbol for hash key
52
55
  attributes = attributes.each_with_object({}) { |(k, v), h|
53
56
  if (!self.class.attribute_map.key?(k.to_sym))
54
- fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::LineOfCreditAccountCreditDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::BrokerageAuthorizationDataFreshnessMode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
58
  end
56
59
  h[k.to_sym] = v
57
60
  }
58
61
 
59
- if attributes.key?(:'minimum_payment_amount')
60
- self.minimum_payment_amount = attributes[:'minimum_payment_amount']
62
+ if attributes.key?(:'institution')
63
+ self.institution = attributes[:'institution']
64
+ end
65
+
66
+ if attributes.key?(:'snaptrade')
67
+ self.snaptrade = attributes[:'snaptrade']
61
68
  end
62
69
  end
63
70
 
@@ -65,12 +72,22 @@ module SnapTrade
65
72
  # @return Array for valid properties with the reasons
66
73
  def list_invalid_properties
67
74
  invalid_properties = Array.new
75
+ if @institution.nil?
76
+ invalid_properties.push('invalid value for "institution", institution cannot be nil.')
77
+ end
78
+
79
+ if @snaptrade.nil?
80
+ invalid_properties.push('invalid value for "snaptrade", snaptrade cannot be nil.')
81
+ end
82
+
68
83
  invalid_properties
69
84
  end
70
85
 
71
86
  # Check to see if the all the properties in the model are valid
72
87
  # @return true if the model is valid
73
88
  def valid?
89
+ return false if @institution.nil?
90
+ return false if @snaptrade.nil?
74
91
  true
75
92
  end
76
93
 
@@ -79,7 +96,8 @@ module SnapTrade
79
96
  def ==(o)
80
97
  return true if self.equal?(o)
81
98
  self.class == o.class &&
82
- minimum_payment_amount == o.minimum_payment_amount
99
+ institution == o.institution &&
100
+ snaptrade == o.snaptrade
83
101
  end
84
102
 
85
103
  # @see the `==` method
@@ -91,7 +109,7 @@ module SnapTrade
91
109
  # Calculates hash code according to all attributes.
92
110
  # @return [Integer] Hash code
93
111
  def hash
94
- [minimum_payment_amount].hash
112
+ [institution, snaptrade].hash
95
113
  end
96
114
 
97
115
  # Builds the object from hash
@@ -26,7 +26,7 @@ module SnapTrade
26
26
  attr_accessor :display_name
27
27
 
28
28
  # The account number assigned by the institution, masked to the last 4 characters (e.g. `****4821`).
29
- attr_accessor :number
29
+ attr_accessor :masked_account_number
30
30
 
31
31
  # A stable and unique account identifier provided by the institution. Will be set to null if not provided. When present, can be used to check if a user has connected the same institution account across multiple connections.
32
32
  attr_accessor :institution_account_id
@@ -51,7 +51,7 @@ module SnapTrade
51
51
  :'id' => :'id',
52
52
  :'connection_id' => :'connection_id',
53
53
  :'display_name' => :'display_name',
54
- :'number' => :'number',
54
+ :'masked_account_number' => :'masked_account_number',
55
55
  :'institution_account_id' => :'institution_account_id',
56
56
  :'institution_id' => :'institution_id',
57
57
  :'opening_date' => :'opening_date',
@@ -73,7 +73,7 @@ module SnapTrade
73
73
  :'id' => :'String',
74
74
  :'connection_id' => :'String',
75
75
  :'display_name' => :'String',
76
- :'number' => :'String',
76
+ :'masked_account_number' => :'String',
77
77
  :'institution_account_id' => :'String',
78
78
  :'institution_id' => :'String',
79
79
  :'opening_date' => :'Time',
@@ -125,8 +125,8 @@ module SnapTrade
125
125
  self.display_name = attributes[:'display_name']
126
126
  end
127
127
 
128
- if attributes.key?(:'number')
129
- self.number = attributes[:'number']
128
+ if attributes.key?(:'masked_account_number')
129
+ self.masked_account_number = attributes[:'masked_account_number']
130
130
  end
131
131
 
132
132
  if attributes.key?(:'institution_account_id')
@@ -170,8 +170,8 @@ module SnapTrade
170
170
  invalid_properties.push('invalid value for "connection_id", connection_id cannot be nil.')
171
171
  end
172
172
 
173
- if @number.nil?
174
- invalid_properties.push('invalid value for "number", number cannot be nil.')
173
+ if @masked_account_number.nil?
174
+ invalid_properties.push('invalid value for "masked_account_number", masked_account_number cannot be nil.')
175
175
  end
176
176
 
177
177
  if @sync_status.nil?
@@ -187,7 +187,7 @@ module SnapTrade
187
187
  return false if @kind.nil?
188
188
  return false if @id.nil?
189
189
  return false if @connection_id.nil?
190
- return false if @number.nil?
190
+ return false if @masked_account_number.nil?
191
191
  return false if @sync_status.nil?
192
192
  true
193
193
  end
@@ -201,7 +201,7 @@ module SnapTrade
201
201
  id == o.id &&
202
202
  connection_id == o.connection_id &&
203
203
  display_name == o.display_name &&
204
- number == o.number &&
204
+ masked_account_number == o.masked_account_number &&
205
205
  institution_account_id == o.institution_account_id &&
206
206
  institution_id == o.institution_id &&
207
207
  opening_date == o.opening_date &&
@@ -219,7 +219,7 @@ module SnapTrade
219
219
  # Calculates hash code according to all attributes.
220
220
  # @return [Integer] Hash code
221
221
  def hash
222
- [kind, id, connection_id, display_name, number, institution_account_id, institution_id, opening_date, sync_status, raw_type, net_value].hash
222
+ [kind, id, connection_id, display_name, masked_account_number, institution_account_id, institution_id, opening_date, sync_status, raw_type, net_value].hash
223
223
  end
224
224
 
225
225
  # Builds the object from hash
@@ -0,0 +1,37 @@
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 Institution
15
+ REALTIME = "realtime".freeze
16
+ DELAYED = "delayed".freeze
17
+
18
+ def self.all_vars
19
+ @all_vars ||= [REALTIME, DELAYED].freeze
20
+ end
21
+
22
+ # Builds the enum from string
23
+ # @param [String] The enum value in the form of the string
24
+ # @return [String] The enum value
25
+ def self.build_from_hash(value)
26
+ new.build_from_hash(value)
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def build_from_hash(value)
33
+ return value if Institution.all_vars.include?(value)
34
+ raise "Invalid ENUM value #{value} for class #Institution"
35
+ end
36
+ end
37
+ end
@@ -39,6 +39,7 @@ module SnapTrade
39
39
  def openapi_discriminator_mapping
40
40
  {
41
41
  :'adr' => :'AdrInstrument',
42
+ :'bond' => :'OtherInstrument',
42
43
  :'cef' => :'CefInstrument',
43
44
  :'cfd' => :'CfdInstrument',
44
45
  :'crypto' => :'CryptoInstrument',
@@ -26,7 +26,7 @@ module SnapTrade
26
26
  attr_accessor :display_name
27
27
 
28
28
  # The account number assigned by the institution, masked to the last 4 characters (e.g. `****8443`).
29
- attr_accessor :number
29
+ attr_accessor :masked_account_number
30
30
 
31
31
  # A stable and unique account identifier provided by the institution. Will be set to null if not provided. When present, can be used to check if a user has connected the same institution account across multiple connections.
32
32
  attr_accessor :institution_account_id
@@ -57,7 +57,7 @@ module SnapTrade
57
57
  :'id' => :'id',
58
58
  :'connection_id' => :'connection_id',
59
59
  :'display_name' => :'display_name',
60
- :'number' => :'number',
60
+ :'masked_account_number' => :'masked_account_number',
61
61
  :'institution_account_id' => :'institution_account_id',
62
62
  :'institution_id' => :'institution_id',
63
63
  :'opening_date' => :'opening_date',
@@ -81,7 +81,7 @@ module SnapTrade
81
81
  :'id' => :'String',
82
82
  :'connection_id' => :'String',
83
83
  :'display_name' => :'String',
84
- :'number' => :'String',
84
+ :'masked_account_number' => :'String',
85
85
  :'institution_account_id' => :'String',
86
86
  :'institution_id' => :'String',
87
87
  :'opening_date' => :'Time',
@@ -136,8 +136,8 @@ module SnapTrade
136
136
  self.display_name = attributes[:'display_name']
137
137
  end
138
138
 
139
- if attributes.key?(:'number')
140
- self.number = attributes[:'number']
139
+ if attributes.key?(:'masked_account_number')
140
+ self.masked_account_number = attributes[:'masked_account_number']
141
141
  end
142
142
 
143
143
  if attributes.key?(:'institution_account_id')
@@ -189,8 +189,8 @@ module SnapTrade
189
189
  invalid_properties.push('invalid value for "connection_id", connection_id cannot be nil.')
190
190
  end
191
191
 
192
- if @number.nil?
193
- invalid_properties.push('invalid value for "number", number cannot be nil.')
192
+ if @masked_account_number.nil?
193
+ invalid_properties.push('invalid value for "masked_account_number", masked_account_number cannot be nil.')
194
194
  end
195
195
 
196
196
  if @sync_status.nil?
@@ -210,7 +210,7 @@ module SnapTrade
210
210
  return false if @kind.nil?
211
211
  return false if @id.nil?
212
212
  return false if @connection_id.nil?
213
- return false if @number.nil?
213
+ return false if @masked_account_number.nil?
214
214
  return false if @sync_status.nil?
215
215
  return false if @is_paper.nil?
216
216
  true
@@ -225,7 +225,7 @@ module SnapTrade
225
225
  id == o.id &&
226
226
  connection_id == o.connection_id &&
227
227
  display_name == o.display_name &&
228
- number == o.number &&
228
+ masked_account_number == o.masked_account_number &&
229
229
  institution_account_id == o.institution_account_id &&
230
230
  institution_id == o.institution_id &&
231
231
  opening_date == o.opening_date &&
@@ -245,7 +245,7 @@ module SnapTrade
245
245
  # Calculates hash code according to all attributes.
246
246
  # @return [Integer] Hash code
247
247
  def hash
248
- [kind, id, connection_id, display_name, number, institution_account_id, institution_id, opening_date, funding_date, sync_status, raw_type, is_paper, net_value].hash
248
+ [kind, id, connection_id, display_name, masked_account_number, institution_account_id, institution_id, opening_date, funding_date, sync_status, raw_type, is_paper, net_value].hash
249
249
  end
250
250
 
251
251
  # Builds the object from hash
@@ -26,7 +26,7 @@ module SnapTrade
26
26
  attr_accessor :display_name
27
27
 
28
28
  # The account number assigned by the institution, masked to the last 4 characters (e.g. `****1881`).
29
- attr_accessor :number
29
+ attr_accessor :masked_account_number
30
30
 
31
31
  # A stable and unique account identifier provided by the institution. Will be set to null if not provided. When present, can be used to check if a user has connected the same institution account across multiple connections.
32
32
  attr_accessor :institution_account_id
@@ -44,7 +44,7 @@ module SnapTrade
44
44
 
45
45
  attr_accessor :net_value
46
46
 
47
- attr_accessor :credit_details
47
+ attr_accessor :minimum_payment_amount
48
48
 
49
49
  # Attribute mapping from ruby-style variable name to JSON key.
50
50
  def self.attribute_map
@@ -53,14 +53,14 @@ module SnapTrade
53
53
  :'id' => :'id',
54
54
  :'connection_id' => :'connection_id',
55
55
  :'display_name' => :'display_name',
56
- :'number' => :'number',
56
+ :'masked_account_number' => :'masked_account_number',
57
57
  :'institution_account_id' => :'institution_account_id',
58
58
  :'institution_id' => :'institution_id',
59
59
  :'opening_date' => :'opening_date',
60
60
  :'sync_status' => :'sync_status',
61
61
  :'raw_type' => :'raw_type',
62
62
  :'net_value' => :'net_value',
63
- :'credit_details' => :'credit_details'
63
+ :'minimum_payment_amount' => :'minimum_payment_amount'
64
64
  }
65
65
  end
66
66
 
@@ -76,14 +76,14 @@ module SnapTrade
76
76
  :'id' => :'String',
77
77
  :'connection_id' => :'String',
78
78
  :'display_name' => :'String',
79
- :'number' => :'String',
79
+ :'masked_account_number' => :'String',
80
80
  :'institution_account_id' => :'String',
81
81
  :'institution_id' => :'String',
82
82
  :'opening_date' => :'Time',
83
83
  :'sync_status' => :'LineOfCreditAccountSyncStatus',
84
84
  :'raw_type' => :'String',
85
85
  :'net_value' => :'LineOfCreditAccountNetValue',
86
- :'credit_details' => :'LineOfCreditAccountCreditDetails'
86
+ :'minimum_payment_amount' => :'LineOfCreditAccountMinimumPaymentAmount'
87
87
  }
88
88
  end
89
89
 
@@ -95,7 +95,7 @@ module SnapTrade
95
95
  :'opening_date',
96
96
  :'raw_type',
97
97
  :'net_value',
98
- :'credit_details'
98
+ :'minimum_payment_amount'
99
99
  ])
100
100
  end
101
101
 
@@ -130,8 +130,8 @@ module SnapTrade
130
130
  self.display_name = attributes[:'display_name']
131
131
  end
132
132
 
133
- if attributes.key?(:'number')
134
- self.number = attributes[:'number']
133
+ if attributes.key?(:'masked_account_number')
134
+ self.masked_account_number = attributes[:'masked_account_number']
135
135
  end
136
136
 
137
137
  if attributes.key?(:'institution_account_id')
@@ -158,8 +158,8 @@ module SnapTrade
158
158
  self.net_value = attributes[:'net_value']
159
159
  end
160
160
 
161
- if attributes.key?(:'credit_details')
162
- self.credit_details = attributes[:'credit_details']
161
+ if attributes.key?(:'minimum_payment_amount')
162
+ self.minimum_payment_amount = attributes[:'minimum_payment_amount']
163
163
  end
164
164
  end
165
165
 
@@ -179,8 +179,8 @@ module SnapTrade
179
179
  invalid_properties.push('invalid value for "connection_id", connection_id cannot be nil.')
180
180
  end
181
181
 
182
- if @number.nil?
183
- invalid_properties.push('invalid value for "number", number cannot be nil.')
182
+ if @masked_account_number.nil?
183
+ invalid_properties.push('invalid value for "masked_account_number", masked_account_number cannot be nil.')
184
184
  end
185
185
 
186
186
  if @sync_status.nil?
@@ -196,7 +196,7 @@ module SnapTrade
196
196
  return false if @kind.nil?
197
197
  return false if @id.nil?
198
198
  return false if @connection_id.nil?
199
- return false if @number.nil?
199
+ return false if @masked_account_number.nil?
200
200
  return false if @sync_status.nil?
201
201
  true
202
202
  end
@@ -210,14 +210,14 @@ module SnapTrade
210
210
  id == o.id &&
211
211
  connection_id == o.connection_id &&
212
212
  display_name == o.display_name &&
213
- number == o.number &&
213
+ masked_account_number == o.masked_account_number &&
214
214
  institution_account_id == o.institution_account_id &&
215
215
  institution_id == o.institution_id &&
216
216
  opening_date == o.opening_date &&
217
217
  sync_status == o.sync_status &&
218
218
  raw_type == o.raw_type &&
219
219
  net_value == o.net_value &&
220
- credit_details == o.credit_details
220
+ minimum_payment_amount == o.minimum_payment_amount
221
221
  end
222
222
 
223
223
  # @see the `==` method
@@ -229,7 +229,7 @@ module SnapTrade
229
229
  # Calculates hash code according to all attributes.
230
230
  # @return [Integer] Hash code
231
231
  def hash
232
- [kind, id, connection_id, display_name, number, institution_account_id, institution_id, opening_date, sync_status, raw_type, net_value, credit_details].hash
232
+ [kind, id, connection_id, display_name, masked_account_number, institution_account_id, institution_id, opening_date, sync_status, raw_type, net_value, minimum_payment_amount].hash
233
233
  end
234
234
 
235
235
  # Builds the object from hash