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.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/snaptrade/api/account_information_api.rb +6 -6
- data/lib/snaptrade/api/connections_api.rb +4 -4
- data/lib/snaptrade/api_client_custom.rb +1 -1
- data/lib/snaptrade/models/account_position.rb +1 -1
- data/lib/snaptrade/models/brokerage_authorization.rb +1 -2
- data/lib/snaptrade/models/{line_of_credit_account_credit_details.rb → brokerage_authorization_data_freshness_mode.rb} +30 -12
- data/lib/snaptrade/models/deposit_account.rb +10 -10
- data/lib/snaptrade/models/institution.rb +37 -0
- data/lib/snaptrade/models/instrument.rb +1 -0
- data/lib/snaptrade/models/investment_account.rb +10 -10
- data/lib/snaptrade/models/line_of_credit_account.rb +17 -17
- data/lib/snaptrade/models/{line_of_credit_account_credit_details_minimum_payment_amount.rb → line_of_credit_account_minimum_payment_amount.rb} +4 -4
- data/lib/snaptrade/models/other_instrument.rb +1 -1
- data/lib/snaptrade/models/other_instrument_kind.rb +2 -1
- data/lib/snaptrade/models/snaptrade.rb +37 -0
- data/lib/snaptrade/models/underlying_cfd_instrument.rb +1 -0
- data/lib/snaptrade/models/underlying_option_instrument.rb +1 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +4 -2
- data/spec/api/account_information_api_spec.rb +1 -1
- data/spec/api/connections_api_spec.rb +1 -1
- data/spec/models/brokerage_authorization_data_freshness_mode_spec.rb +35 -0
- data/spec/models/connection_account_spec.rb +1 -1
- data/spec/models/deposit_account_spec.rb +1 -1
- data/spec/models/institution_spec.rb +23 -0
- data/spec/models/instrument_spec.rb +1 -1
- data/spec/models/investment_account_spec.rb +1 -1
- 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
- data/spec/models/line_of_credit_account_spec.rb +2 -2
- data/spec/models/snaptrade_spec.rb +23 -0
- data/spec/models/underlying_cfd_instrument_spec.rb +1 -1
- data/spec/models/underlying_option_instrument_spec.rb +1 -1
- data/spec/regression/all_account_positions_spec.rb +86 -0
- data/spec/regression/fixtures/all_account_positions.json +33 -0
- data/spec/regression/request_signing_spec.rb +46 -0
- metadata +228 -217
- data/Gemfile.lock +0 -91
- 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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6f4f6df70641bac0ea16b0095d5cc12b08b1f20d46bcf0eabe3e74d81f394284
|
|
4
|
+
data.tar.gz: 6111f68c8a76ba924318a9385a229929a99c0d78b6debbe3c2d5bd72d10f5dec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
[](https://rubygems.org/gems/snaptrade/versions/3.0.15)
|
|
10
10
|
[](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.
|
|
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
|
-
|
|
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
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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`.
|
|
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 `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`.
|
|
339
|
+
# 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.
|
|
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
|
|
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
|
|
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
|
|
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. [`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
|
|
599
|
+
# 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.**
|
|
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
|
|
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
|
|
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' => :'
|
|
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
|
-
#
|
|
15
|
-
class
|
|
16
|
-
attr_accessor :
|
|
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
|
-
:'
|
|
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
|
-
:'
|
|
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::
|
|
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::
|
|
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?(:'
|
|
60
|
-
self.
|
|
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
|
-
|
|
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
|
-
[
|
|
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 :
|
|
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
|
-
:'
|
|
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
|
-
:'
|
|
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?(:'
|
|
129
|
-
self.
|
|
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 @
|
|
174
|
-
invalid_properties.push('invalid value for "
|
|
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 @
|
|
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
|
-
|
|
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,
|
|
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
|
|
@@ -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 :
|
|
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
|
-
:'
|
|
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
|
-
:'
|
|
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?(:'
|
|
140
|
-
self.
|
|
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 @
|
|
193
|
-
invalid_properties.push('invalid value for "
|
|
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 @
|
|
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
|
-
|
|
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,
|
|
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 :
|
|
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 :
|
|
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
|
-
:'
|
|
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
|
-
:'
|
|
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
|
-
:'
|
|
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
|
-
:'
|
|
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
|
-
:'
|
|
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?(:'
|
|
134
|
-
self.
|
|
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?(:'
|
|
162
|
-
self.
|
|
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 @
|
|
183
|
-
invalid_properties.push('invalid value for "
|
|
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 @
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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
|