snaptrade 3.0.6 → 3.0.8
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/Gemfile.lock +1 -1
- data/README.md +7 -7
- data/lib/snaptrade/api/experimental_endpoints_api.rb +21 -21
- data/lib/snaptrade/models/account_order_record_v2.rb +24 -43
- data/lib/snaptrade/models/account_order_record_v2_order_role.rb +38 -0
- data/lib/snaptrade/models/connection_account_sync_status.rb +1 -1
- data/lib/snaptrade/models/deposit_account.rb +16 -16
- data/lib/snaptrade/models/{deposit_account_balance.rb → deposit_account_net_value.rb} +4 -4
- data/lib/snaptrade/models/deposit_account_sync_status.rb +228 -0
- data/lib/snaptrade/models/investment_account.rb +27 -27
- data/lib/snaptrade/models/{investment_account_market_value.rb → investment_account_net_value.rb} +4 -4
- data/lib/snaptrade/models/price_effect.rb +39 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +5 -2
- data/spec/api/experimental_endpoints_api_spec.rb +2 -2
- data/spec/models/account_order_record_v2_order_role_spec.rb +23 -0
- data/spec/models/account_order_record_v2_spec.rb +7 -5
- data/spec/models/{deposit_account_balance_spec.rb → deposit_account_net_value_spec.rb} +6 -6
- data/spec/models/deposit_account_spec.rb +1 -1
- data/spec/models/deposit_account_sync_status_spec.rb +35 -0
- data/spec/models/{investment_account_market_value_spec.rb → investment_account_net_value_spec.rb} +6 -6
- data/spec/models/investment_account_spec.rb +4 -4
- data/spec/models/price_effect_spec.rb +23 -0
- metadata +225 -216
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a8a3e8aef2b0ae768708ac2981cb91b0c02adb600d348f8f69029d970b4c036d
|
|
4
|
+
data.tar.gz: 0b70248d18cb311e410095f17bfb55a84b342c2ba78caf980f7917fe425abfd0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0191bef312389e4fac47c87e2076df334c4fcf98d45ac2562a4c7703a02f7581949e4baeb7060ab498b8942269d84f656dd9b96ae07632b4023cb4a2e903243d'
|
|
7
|
+
data.tar.gz: 7e17024820295a215046d1e540e1d6c8f856e02c8096d7181ee2ed735903a34b428b80b43047358657a266949f2657990454c16c6eaa704b63a9683fc594d81e
|
data/Gemfile.lock
CHANGED
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.8)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -83,7 +83,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
83
83
|
Add to Gemfile:
|
|
84
84
|
|
|
85
85
|
```ruby
|
|
86
|
-
gem 'snaptrade', '~> 3.0.
|
|
86
|
+
gem 'snaptrade', '~> 3.0.8'
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -1445,9 +1445,9 @@ Returns the accounts that belong to the specified connection for the authenticat
|
|
|
1445
1445
|
|
|
1446
1446
|
Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema.
|
|
1447
1447
|
|
|
1448
|
-
On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total
|
|
1448
|
+
On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts.
|
|
1449
1449
|
|
|
1450
|
-
On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by
|
|
1450
|
+
On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
1451
1451
|
|
|
1452
1452
|
Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
1453
1453
|
|
|
@@ -1456,7 +1456,7 @@ Check your API key on the [Customer Dashboard billing page](https://dashboard.sn
|
|
|
1456
1456
|
|
|
1457
1457
|
```ruby
|
|
1458
1458
|
result = snaptrade.experimental_endpoints.list_connection_accounts(
|
|
1459
|
-
|
|
1459
|
+
connection_id: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
1460
1460
|
user_id: "snaptrade-user-123",
|
|
1461
1461
|
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1462
1462
|
)
|
|
@@ -1465,7 +1465,7 @@ p result
|
|
|
1465
1465
|
|
|
1466
1466
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1467
1467
|
|
|
1468
|
-
#####
|
|
1468
|
+
##### connection_id: `String`<a id="connection_id-string"></a>
|
|
1469
1469
|
##### user_id: `String`<a id="user_id-string"></a>
|
|
1470
1470
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1471
1471
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
@@ -1474,7 +1474,7 @@ p result
|
|
|
1474
1474
|
|
|
1475
1475
|
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1476
1476
|
|
|
1477
|
-
`/connections/{
|
|
1477
|
+
`/connections/{connectionId}/accounts` `GET`
|
|
1478
1478
|
|
|
1479
1479
|
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1480
1480
|
|
|
@@ -627,18 +627,18 @@ module SnapTrade
|
|
|
627
627
|
#
|
|
628
628
|
# Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema.
|
|
629
629
|
#
|
|
630
|
-
# On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total
|
|
630
|
+
# On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts.
|
|
631
631
|
#
|
|
632
|
-
# On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by
|
|
632
|
+
# On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
633
633
|
#
|
|
634
634
|
# Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
635
635
|
#
|
|
636
|
-
# @param
|
|
636
|
+
# @param connection_id [String]
|
|
637
637
|
# @param user_id [String]
|
|
638
638
|
# @param user_secret [String]
|
|
639
639
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
640
|
-
def list_connection_accounts(
|
|
641
|
-
data, _status_code, _headers = list_connection_accounts_with_http_info_impl(
|
|
640
|
+
def list_connection_accounts(connection_id:, user_id:, user_secret:, extra: {})
|
|
641
|
+
data, _status_code, _headers = list_connection_accounts_with_http_info_impl(connection_id, user_id, user_secret, extra)
|
|
642
642
|
data
|
|
643
643
|
end
|
|
644
644
|
|
|
@@ -650,46 +650,46 @@ module SnapTrade
|
|
|
650
650
|
#
|
|
651
651
|
# Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema.
|
|
652
652
|
#
|
|
653
|
-
# On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total
|
|
653
|
+
# On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts.
|
|
654
654
|
#
|
|
655
|
-
# On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by
|
|
655
|
+
# On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
656
656
|
#
|
|
657
657
|
# Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
658
658
|
#
|
|
659
|
-
# @param
|
|
659
|
+
# @param connection_id [String]
|
|
660
660
|
# @param user_id [String]
|
|
661
661
|
# @param user_secret [String]
|
|
662
662
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
663
|
-
def list_connection_accounts_with_http_info(
|
|
664
|
-
list_connection_accounts_with_http_info_impl(
|
|
663
|
+
def list_connection_accounts_with_http_info(connection_id:, user_id:, user_secret:, extra: {})
|
|
664
|
+
list_connection_accounts_with_http_info_impl(connection_id, user_id, user_secret, extra)
|
|
665
665
|
end
|
|
666
666
|
|
|
667
667
|
# List accounts for a connection (discriminated union)
|
|
668
|
-
# Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total
|
|
669
|
-
# @param
|
|
668
|
+
# Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
669
|
+
# @param connection_id [String]
|
|
670
670
|
# @param user_id [String]
|
|
671
671
|
# @param user_secret [String]
|
|
672
672
|
# @param [Hash] opts the optional parameters
|
|
673
673
|
# @return [Array<ConnectionAccount>]
|
|
674
|
-
private def list_connection_accounts_impl(
|
|
675
|
-
data, _status_code, _headers = list_connection_accounts_with_http_info(
|
|
674
|
+
private def list_connection_accounts_impl(connection_id, user_id, user_secret, opts = {})
|
|
675
|
+
data, _status_code, _headers = list_connection_accounts_with_http_info(connection_id, user_id, user_secret, opts)
|
|
676
676
|
data
|
|
677
677
|
end
|
|
678
678
|
|
|
679
679
|
# List accounts for a connection (discriminated union)
|
|
680
|
-
# Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total
|
|
681
|
-
# @param
|
|
680
|
+
# Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
681
|
+
# @param connection_id [String]
|
|
682
682
|
# @param user_id [String]
|
|
683
683
|
# @param user_secret [String]
|
|
684
684
|
# @param [Hash] opts the optional parameters
|
|
685
685
|
# @return [Array<(Array<ConnectionAccount>, Integer, Hash)>] Array<ConnectionAccount> data, response status code and response headers
|
|
686
|
-
private def list_connection_accounts_with_http_info_impl(
|
|
686
|
+
private def list_connection_accounts_with_http_info_impl(connection_id, user_id, user_secret, opts = {})
|
|
687
687
|
if @api_client.config.debugging
|
|
688
688
|
@api_client.config.logger.debug 'Calling API: ExperimentalEndpointsApi.list_connection_accounts ...'
|
|
689
689
|
end
|
|
690
|
-
# verify the required parameter '
|
|
691
|
-
if @api_client.config.client_side_validation &&
|
|
692
|
-
fail ArgumentError, "Missing the required parameter '
|
|
690
|
+
# verify the required parameter 'connection_id' is set
|
|
691
|
+
if @api_client.config.client_side_validation && connection_id.nil?
|
|
692
|
+
fail ArgumentError, "Missing the required parameter 'connection_id' when calling ExperimentalEndpointsApi.list_connection_accounts"
|
|
693
693
|
end
|
|
694
694
|
# verify the required parameter 'user_id' is set
|
|
695
695
|
if @api_client.config.client_side_validation && user_id.nil?
|
|
@@ -700,7 +700,7 @@ module SnapTrade
|
|
|
700
700
|
fail ArgumentError, "Missing the required parameter 'user_secret' when calling ExperimentalEndpointsApi.list_connection_accounts"
|
|
701
701
|
end
|
|
702
702
|
# resource path
|
|
703
|
-
local_var_path = '/connections/{
|
|
703
|
+
local_var_path = '/connections/{connectionId}/accounts'.sub('{' + 'connectionId' + '}', CGI.escape(connection_id.to_s))
|
|
704
704
|
|
|
705
705
|
# query parameters
|
|
706
706
|
query_params = opts[:query_params] || {}
|
|
@@ -37,8 +37,11 @@ module SnapTrade
|
|
|
37
37
|
# The time the order was executed in the brokerage system. This value is not always available from the brokerage.
|
|
38
38
|
attr_accessor :time_executed
|
|
39
39
|
|
|
40
|
-
#
|
|
41
|
-
attr_accessor :
|
|
40
|
+
# Price currency code for the order.
|
|
41
|
+
attr_accessor :price_currency
|
|
42
|
+
|
|
43
|
+
# Direction of the net order price. CREDIT means cash is received, DEBIT means cash is paid, EVEN means the net price is zero, and UNKNOWN means the direction could not be determined.
|
|
44
|
+
attr_accessor :price_effect
|
|
42
45
|
|
|
43
46
|
# The price at which the order was executed.
|
|
44
47
|
attr_accessor :execution_price
|
|
@@ -54,28 +57,6 @@ module SnapTrade
|
|
|
54
57
|
# List of legs that make up the order.
|
|
55
58
|
attr_accessor :legs
|
|
56
59
|
|
|
57
|
-
class EnumAttributeValidator
|
|
58
|
-
attr_reader :datatype
|
|
59
|
-
attr_reader :allowable_values
|
|
60
|
-
|
|
61
|
-
def initialize(datatype, allowable_values)
|
|
62
|
-
@allowable_values = allowable_values.map do |value|
|
|
63
|
-
case datatype.to_s
|
|
64
|
-
when /Integer/i
|
|
65
|
-
value.to_i
|
|
66
|
-
when /Float/i
|
|
67
|
-
value.to_f
|
|
68
|
-
else
|
|
69
|
-
value
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
def valid?(value)
|
|
75
|
-
!value || allowable_values.include?(value)
|
|
76
|
-
end
|
|
77
|
-
end
|
|
78
|
-
|
|
79
60
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
80
61
|
def self.attribute_map
|
|
81
62
|
{
|
|
@@ -87,7 +68,8 @@ module SnapTrade
|
|
|
87
68
|
:'time_in_force' => :'time_in_force',
|
|
88
69
|
:'time_placed' => :'time_placed',
|
|
89
70
|
:'time_executed' => :'time_executed',
|
|
90
|
-
:'
|
|
71
|
+
:'price_currency' => :'price_currency',
|
|
72
|
+
:'price_effect' => :'price_effect',
|
|
91
73
|
:'execution_price' => :'execution_price',
|
|
92
74
|
:'limit_price' => :'limit_price',
|
|
93
75
|
:'stop_price' => :'stop_price',
|
|
@@ -106,13 +88,14 @@ module SnapTrade
|
|
|
106
88
|
{
|
|
107
89
|
:'brokerage_order_id' => :'String',
|
|
108
90
|
:'brokerage_group_order_id' => :'String',
|
|
109
|
-
:'order_role' => :'
|
|
91
|
+
:'order_role' => :'AccountOrderRecordV2OrderRole',
|
|
110
92
|
:'status' => :'AccountOrderRecordStatus',
|
|
111
93
|
:'order_type' => :'String',
|
|
112
94
|
:'time_in_force' => :'String',
|
|
113
95
|
:'time_placed' => :'Time',
|
|
114
96
|
:'time_executed' => :'Time',
|
|
115
|
-
:'
|
|
97
|
+
:'price_currency' => :'String',
|
|
98
|
+
:'price_effect' => :'PriceEffect',
|
|
116
99
|
:'execution_price' => :'Float',
|
|
117
100
|
:'limit_price' => :'Float',
|
|
118
101
|
:'stop_price' => :'Float',
|
|
@@ -182,8 +165,12 @@ module SnapTrade
|
|
|
182
165
|
self.time_executed = attributes[:'time_executed']
|
|
183
166
|
end
|
|
184
167
|
|
|
185
|
-
if attributes.key?(:'
|
|
186
|
-
self.
|
|
168
|
+
if attributes.key?(:'price_currency')
|
|
169
|
+
self.price_currency = attributes[:'price_currency']
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if attributes.key?(:'price_effect')
|
|
173
|
+
self.price_effect = attributes[:'price_effect']
|
|
187
174
|
end
|
|
188
175
|
|
|
189
176
|
if attributes.key?(:'execution_price')
|
|
@@ -213,27 +200,20 @@ module SnapTrade
|
|
|
213
200
|
# @return Array for valid properties with the reasons
|
|
214
201
|
def list_invalid_properties
|
|
215
202
|
invalid_properties = Array.new
|
|
203
|
+
if @price_effect.nil?
|
|
204
|
+
invalid_properties.push('invalid value for "price_effect", price_effect cannot be nil.')
|
|
205
|
+
end
|
|
206
|
+
|
|
216
207
|
invalid_properties
|
|
217
208
|
end
|
|
218
209
|
|
|
219
210
|
# Check to see if the all the properties in the model are valid
|
|
220
211
|
# @return true if the model is valid
|
|
221
212
|
def valid?
|
|
222
|
-
|
|
223
|
-
return false unless order_role_validator.valid?(@order_role)
|
|
213
|
+
return false if @price_effect.nil?
|
|
224
214
|
true
|
|
225
215
|
end
|
|
226
216
|
|
|
227
|
-
# Custom attribute writer method checking allowed values (enum).
|
|
228
|
-
# @param [Object] order_role Object to be assigned
|
|
229
|
-
def order_role=(order_role)
|
|
230
|
-
validator = EnumAttributeValidator.new('String', ["TRIGGER", "CONDITIONAL", "PEER"])
|
|
231
|
-
unless validator.valid?(order_role)
|
|
232
|
-
fail ArgumentError, "invalid value for \"order_role\", must be one of #{validator.allowable_values}."
|
|
233
|
-
end
|
|
234
|
-
@order_role = order_role
|
|
235
|
-
end
|
|
236
|
-
|
|
237
217
|
# Checks equality by comparing each attribute.
|
|
238
218
|
# @param [Object] Object to be compared
|
|
239
219
|
def ==(o)
|
|
@@ -247,7 +227,8 @@ module SnapTrade
|
|
|
247
227
|
time_in_force == o.time_in_force &&
|
|
248
228
|
time_placed == o.time_placed &&
|
|
249
229
|
time_executed == o.time_executed &&
|
|
250
|
-
|
|
230
|
+
price_currency == o.price_currency &&
|
|
231
|
+
price_effect == o.price_effect &&
|
|
251
232
|
execution_price == o.execution_price &&
|
|
252
233
|
limit_price == o.limit_price &&
|
|
253
234
|
stop_price == o.stop_price &&
|
|
@@ -264,7 +245,7 @@ module SnapTrade
|
|
|
264
245
|
# Calculates hash code according to all attributes.
|
|
265
246
|
# @return [Integer] Hash code
|
|
266
247
|
def hash
|
|
267
|
-
[brokerage_order_id, brokerage_group_order_id, order_role, status, order_type, time_in_force, time_placed, time_executed,
|
|
248
|
+
[brokerage_order_id, brokerage_group_order_id, order_role, status, order_type, time_in_force, time_placed, time_executed, price_currency, price_effect, execution_price, limit_price, stop_price, trailing_stop, legs].hash
|
|
268
249
|
end
|
|
269
250
|
|
|
270
251
|
# Builds the object from hash
|
|
@@ -0,0 +1,38 @@
|
|
|
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 AccountOrderRecordV2OrderRole
|
|
15
|
+
TRIGGER = "TRIGGER".freeze
|
|
16
|
+
CONDITIONAL = "CONDITIONAL".freeze
|
|
17
|
+
PEER = "PEER".freeze
|
|
18
|
+
|
|
19
|
+
def self.all_vars
|
|
20
|
+
@all_vars ||= [TRIGGER, CONDITIONAL, PEER].freeze
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Builds the enum from string
|
|
24
|
+
# @param [String] The enum value in the form of the string
|
|
25
|
+
# @return [String] The enum value
|
|
26
|
+
def self.build_from_hash(value)
|
|
27
|
+
new.build_from_hash(value)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Builds the enum from string
|
|
31
|
+
# @param [String] The enum value in the form of the string
|
|
32
|
+
# @return [String] The enum value
|
|
33
|
+
def build_from_hash(value)
|
|
34
|
+
return value if AccountOrderRecordV2OrderRole.all_vars.include?(value)
|
|
35
|
+
raise "Invalid ENUM value #{value} for class #AccountOrderRecordV2OrderRole"
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module SnapTrade
|
|
14
|
-
# Contains status updates for the account sync process between SnapTrade and the
|
|
14
|
+
# Contains status updates for the account sync process between SnapTrade and the institution, used by `InvestmentAccount` in `Connections_listConnectionAccounts`. Each property is optional -- an institution may not report sync status for every data type. `orders`/`positions`/`balances` are the timestamp of the last successful sync of that data type (null if never synced). See `DepositAccountSyncStatus` for the deposit-account counterpart, which omits `orders`/`positions` since deposit accounts don't place orders or hold positions.
|
|
15
15
|
class ConnectionAccountSyncStatus
|
|
16
16
|
attr_accessor :transactions
|
|
17
17
|
|
|
@@ -16,33 +16,33 @@ module SnapTrade
|
|
|
16
16
|
# Discriminator for the account kind.
|
|
17
17
|
attr_accessor :kind
|
|
18
18
|
|
|
19
|
-
# Unique identifier for the connected
|
|
19
|
+
# Unique identifier for the connected institution account. This is the UUID used to reference the account in SnapTrade.
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
22
22
|
# Unique identifier for the connection (brokerage_authorization_id). This is the UUID used to reference the connection in SnapTrade.
|
|
23
23
|
attr_accessor :connection_id
|
|
24
24
|
|
|
25
|
-
# A display name for the account. Either assigned by the user or by the
|
|
25
|
+
# A display name for the account. Either assigned by the user or by the institution itself.
|
|
26
26
|
attr_accessor :display_name
|
|
27
27
|
|
|
28
|
-
# The account number assigned by the
|
|
28
|
+
# The account number assigned by the institution, masked to the last 4 characters (e.g. `****4821`).
|
|
29
29
|
attr_accessor :number
|
|
30
30
|
|
|
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
|
|
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
|
|
33
33
|
|
|
34
|
-
# Unique identifier for the institution
|
|
34
|
+
# Unique identifier for the institution that holds the account.
|
|
35
35
|
attr_accessor :institution_id
|
|
36
36
|
|
|
37
|
-
# Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was opened at the
|
|
37
|
+
# Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was opened at the institution. Only populated for institutions that expose this data; `null` for all other institutions.
|
|
38
38
|
attr_accessor :opening_date
|
|
39
39
|
|
|
40
40
|
attr_accessor :sync_status
|
|
41
41
|
|
|
42
|
-
# The account type as provided by the
|
|
42
|
+
# The account type as provided by the institution.
|
|
43
43
|
attr_accessor :raw_type
|
|
44
44
|
|
|
45
|
-
attr_accessor :
|
|
45
|
+
attr_accessor :net_value
|
|
46
46
|
|
|
47
47
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
48
48
|
def self.attribute_map
|
|
@@ -57,7 +57,7 @@ module SnapTrade
|
|
|
57
57
|
:'opening_date' => :'opening_date',
|
|
58
58
|
:'sync_status' => :'sync_status',
|
|
59
59
|
:'raw_type' => :'raw_type',
|
|
60
|
-
:'
|
|
60
|
+
:'net_value' => :'net_value'
|
|
61
61
|
}
|
|
62
62
|
end
|
|
63
63
|
|
|
@@ -77,9 +77,9 @@ module SnapTrade
|
|
|
77
77
|
:'institution_account_id' => :'String',
|
|
78
78
|
:'institution_id' => :'String',
|
|
79
79
|
:'opening_date' => :'Time',
|
|
80
|
-
:'sync_status' => :'
|
|
80
|
+
:'sync_status' => :'DepositAccountSyncStatus',
|
|
81
81
|
:'raw_type' => :'String',
|
|
82
|
-
:'
|
|
82
|
+
:'net_value' => :'DepositAccountNetValue'
|
|
83
83
|
}
|
|
84
84
|
end
|
|
85
85
|
|
|
@@ -90,7 +90,7 @@ module SnapTrade
|
|
|
90
90
|
:'institution_account_id',
|
|
91
91
|
:'opening_date',
|
|
92
92
|
:'raw_type',
|
|
93
|
-
:'
|
|
93
|
+
:'net_value'
|
|
94
94
|
])
|
|
95
95
|
end
|
|
96
96
|
|
|
@@ -149,8 +149,8 @@ module SnapTrade
|
|
|
149
149
|
self.raw_type = attributes[:'raw_type']
|
|
150
150
|
end
|
|
151
151
|
|
|
152
|
-
if attributes.key?(:'
|
|
153
|
-
self.
|
|
152
|
+
if attributes.key?(:'net_value')
|
|
153
|
+
self.net_value = attributes[:'net_value']
|
|
154
154
|
end
|
|
155
155
|
end
|
|
156
156
|
|
|
@@ -207,7 +207,7 @@ module SnapTrade
|
|
|
207
207
|
opening_date == o.opening_date &&
|
|
208
208
|
sync_status == o.sync_status &&
|
|
209
209
|
raw_type == o.raw_type &&
|
|
210
|
-
|
|
210
|
+
net_value == o.net_value
|
|
211
211
|
end
|
|
212
212
|
|
|
213
213
|
# @see the `==` method
|
|
@@ -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,
|
|
222
|
+
[kind, id, connection_id, display_name, 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
|
|
@@ -11,8 +11,8 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module SnapTrade
|
|
14
|
-
#
|
|
15
|
-
class
|
|
14
|
+
# Net value of the account -- cash balance for deposit accounts. Shared across all account kinds so that, e.g., a future `line_of_credit` account can report a negative net value here. Null when unknown (e.g. a real-time fetch failed and no cached value exists).
|
|
15
|
+
class DepositAccountNetValue
|
|
16
16
|
attr_accessor :amount
|
|
17
17
|
|
|
18
18
|
attr_accessor :currency
|
|
@@ -50,13 +50,13 @@ module SnapTrade
|
|
|
50
50
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
51
51
|
def initialize(attributes = {})
|
|
52
52
|
if (!attributes.is_a?(Hash))
|
|
53
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::
|
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::DepositAccountNetValue` initialize method"
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
57
57
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
58
58
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
59
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::
|
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::DepositAccountNetValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
60
60
|
end
|
|
61
61
|
h[k.to_sym] = v
|
|
62
62
|
}
|