snaptrade 2.0.204 → 2.0.205
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 +4 -4
- data/lib/snaptrade/api/connections_api.rb +4 -4
- data/lib/snaptrade/api/trading_api.rb +4 -4
- data/lib/snaptrade/models/account_position.rb +1 -1
- data/lib/snaptrade/models/account_universal_activity.rb +12 -1
- data/lib/snaptrade/models/account_universal_activity_currency.rb +1 -1
- data/lib/snaptrade/models/account_universal_activity_currency_universal_symbol.rb +304 -0
- data/lib/snaptrade/models/brokerage_authorization.rb +14 -4
- data/lib/snaptrade/models/model429_too_many_requests_response.rb +238 -0
- data/lib/snaptrade/models/position.rb +1 -1
- data/lib/snaptrade/models/universal_activity.rb +12 -1
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +2 -0
- data/spec/api/connections_api_spec.rb +1 -1
- data/spec/api/trading_api_spec.rb +1 -1
- data/spec/models/account_universal_activity_currency_universal_symbol_spec.rb +77 -0
- data/spec/models/account_universal_activity_spec.rb +6 -0
- data/spec/models/brokerage_authorization_spec.rb +6 -0
- data/spec/models/model429_too_many_requests_response_spec.rb +41 -0
- data/spec/models/universal_activity_spec.rb +6 -0
- metadata +198 -192
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7b7926d475d4e1b1af8898e963c1b07ce00658ac7f1418831c1570422ef8b38a
|
|
4
|
+
data.tar.gz: ede2fd0b777d2969fd4041f7566d2cc8c3c73d837ce5a214b8c3f646bebb382b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a16d2f0e181121bce08f92b2a49b2c6fbb4351dcb08eae60935b1264c30b34ca304c275046ab576e142067b1d412885031d1ce7ffe09ff264ae529868a28b76
|
|
7
|
+
data.tar.gz: 463f516bea91940bfa5315c0acbd891461b1dcbd0c9e3887ada9b6ad78895a31f15cc40499b300c8882e08b104adb547d92c488251143605e97c0751c0d43145
|
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/2.0.205)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -94,7 +94,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
94
94
|
Add to Gemfile:
|
|
95
95
|
|
|
96
96
|
```ruby
|
|
97
|
-
gem 'snaptrade', '~> 2.0.
|
|
97
|
+
gem 'snaptrade', '~> 2.0.205'
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -1165,7 +1165,7 @@ Trigger a holdings update for all accounts under this connection. Updates will b
|
|
|
1165
1165
|
This endpoint will also trigger a transaction sync for the past day if one has not yet occurred.
|
|
1166
1166
|
|
|
1167
1167
|
**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)**
|
|
1168
|
-
**Please note this endpoint is disabled for Personal and Pay as you
|
|
1168
|
+
**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.**
|
|
1169
1169
|
|
|
1170
1170
|
|
|
1171
1171
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
@@ -2400,7 +2400,7 @@ Must be `null` if `notional_value` is provided.
|
|
|
2400
2400
|
|
|
2401
2401
|
### `snaptrade.trading.place_complex_order`<a id="snaptradetradingplace_complex_order"></a>
|
|
2402
2402
|
|
|
2403
|
-
Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
2403
|
+
Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
2404
2404
|
Only supported on certain brokerages.
|
|
2405
2405
|
Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support.
|
|
2406
2406
|
|
|
@@ -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 Personal and Pay as you
|
|
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.**
|
|
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 Personal and Pay as you
|
|
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.**
|
|
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 Personal and Pay as you
|
|
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.**
|
|
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 Personal and Pay as you
|
|
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 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.**
|
|
600
600
|
# @param authorization_id [String]
|
|
601
601
|
# @param user_id [String]
|
|
602
602
|
# @param user_secret [String]
|
|
@@ -1083,7 +1083,7 @@ module SnapTrade
|
|
|
1083
1083
|
|
|
1084
1084
|
# Place complex order
|
|
1085
1085
|
#
|
|
1086
|
-
# Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
1086
|
+
# Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
1087
1087
|
# Only supported on certain brokerages.
|
|
1088
1088
|
# Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support.
|
|
1089
1089
|
#
|
|
@@ -1111,7 +1111,7 @@ module SnapTrade
|
|
|
1111
1111
|
|
|
1112
1112
|
# Place complex order
|
|
1113
1113
|
#
|
|
1114
|
-
# Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
1114
|
+
# Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
1115
1115
|
# Only supported on certain brokerages.
|
|
1116
1116
|
# Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support.
|
|
1117
1117
|
#
|
|
@@ -1137,7 +1137,7 @@ module SnapTrade
|
|
|
1137
1137
|
end
|
|
1138
1138
|
|
|
1139
1139
|
# Place complex order
|
|
1140
|
-
# Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
1140
|
+
# Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
1141
1141
|
# @param account_id [String] The ID of the account to execute the trade on.
|
|
1142
1142
|
# @param user_id [String]
|
|
1143
1143
|
# @param user_secret [String]
|
|
@@ -1150,7 +1150,7 @@ module SnapTrade
|
|
|
1150
1150
|
end
|
|
1151
1151
|
|
|
1152
1152
|
# Place complex order
|
|
1153
|
-
# Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
1153
|
+
# Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
1154
1154
|
# @param account_id [String] The ID of the account to execute the trade on.
|
|
1155
1155
|
# @param user_id [String]
|
|
1156
1156
|
# @param user_secret [String]
|
|
@@ -30,7 +30,7 @@ module SnapTrade
|
|
|
30
30
|
# Present for mutual fund positions that are 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)
|
|
34
34
|
attr_accessor :tax_lots
|
|
35
35
|
|
|
36
36
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -18,6 +18,8 @@ module SnapTrade
|
|
|
18
18
|
|
|
19
19
|
attr_accessor :symbol
|
|
20
20
|
|
|
21
|
+
attr_accessor :currency_universal_symbol
|
|
22
|
+
|
|
21
23
|
attr_accessor :option_symbol
|
|
22
24
|
|
|
23
25
|
# The price of the security for the transaction. This is mostly applicable to `BUY`, `SELL`, and `DIVIDEND` transactions. For option transactions, this represents the price per share of the option contract.
|
|
@@ -63,6 +65,7 @@ module SnapTrade
|
|
|
63
65
|
{
|
|
64
66
|
:'id' => :'id',
|
|
65
67
|
:'symbol' => :'symbol',
|
|
68
|
+
:'currency_universal_symbol' => :'currency_universal_symbol',
|
|
66
69
|
:'option_symbol' => :'option_symbol',
|
|
67
70
|
:'price' => :'price',
|
|
68
71
|
:'units' => :'units',
|
|
@@ -90,6 +93,7 @@ module SnapTrade
|
|
|
90
93
|
{
|
|
91
94
|
:'id' => :'String',
|
|
92
95
|
:'symbol' => :'AccountUniversalActivitySymbol',
|
|
96
|
+
:'currency_universal_symbol' => :'AccountUniversalActivityCurrencyUniversalSymbol',
|
|
93
97
|
:'option_symbol' => :'AccountUniversalActivityOptionSymbol',
|
|
94
98
|
:'price' => :'Float',
|
|
95
99
|
:'units' => :'Float',
|
|
@@ -111,8 +115,10 @@ module SnapTrade
|
|
|
111
115
|
def self.openapi_nullable
|
|
112
116
|
Set.new([
|
|
113
117
|
:'symbol',
|
|
118
|
+
:'currency_universal_symbol',
|
|
114
119
|
:'option_symbol',
|
|
115
120
|
:'amount',
|
|
121
|
+
:'currency',
|
|
116
122
|
:'trade_date',
|
|
117
123
|
:'fx_rate',
|
|
118
124
|
:'external_reference_id'
|
|
@@ -142,6 +148,10 @@ module SnapTrade
|
|
|
142
148
|
self.symbol = attributes[:'symbol']
|
|
143
149
|
end
|
|
144
150
|
|
|
151
|
+
if attributes.key?(:'currency_universal_symbol')
|
|
152
|
+
self.currency_universal_symbol = attributes[:'currency_universal_symbol']
|
|
153
|
+
end
|
|
154
|
+
|
|
145
155
|
if attributes.key?(:'option_symbol')
|
|
146
156
|
self.option_symbol = attributes[:'option_symbol']
|
|
147
157
|
end
|
|
@@ -219,6 +229,7 @@ module SnapTrade
|
|
|
219
229
|
self.class == o.class &&
|
|
220
230
|
id == o.id &&
|
|
221
231
|
symbol == o.symbol &&
|
|
232
|
+
currency_universal_symbol == o.currency_universal_symbol &&
|
|
222
233
|
option_symbol == o.option_symbol &&
|
|
223
234
|
price == o.price &&
|
|
224
235
|
units == o.units &&
|
|
@@ -244,7 +255,7 @@ module SnapTrade
|
|
|
244
255
|
# Calculates hash code according to all attributes.
|
|
245
256
|
# @return [Integer] Hash code
|
|
246
257
|
def hash
|
|
247
|
-
[id, symbol, option_symbol, price, units, amount, currency, type, option_type, description, trade_date, settlement_date, fee, fx_rate, institution, external_reference_id].hash
|
|
258
|
+
[id, symbol, currency_universal_symbol, option_symbol, price, units, amount, currency, type, option_type, description, trade_date, settlement_date, fee, fx_rate, institution, external_reference_id].hash
|
|
248
259
|
end
|
|
249
260
|
|
|
250
261
|
# Builds the object from hash
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module SnapTrade
|
|
14
|
-
# The currency in which the transaction `price` and `
|
|
14
|
+
# The currency in which the transaction `price`, `amount`, and `fee` are denominated. This is `null` when those values are denominated in `currency_universal_symbol`.
|
|
15
15
|
class AccountUniversalActivityCurrency
|
|
16
16
|
# Unique identifier for the currency. This is the UUID used to reference the currency in SnapTrade.
|
|
17
17
|
attr_accessor :id
|
|
@@ -0,0 +1,304 @@
|
|
|
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
|
+
# The quote security for the transaction when `price`, `amount`, and `fee` are denominated in a security instead of a fiat currency. This is most common for cryptocurrency trades. The field is `null` when the transaction is denominated in `currency`.
|
|
15
|
+
class AccountUniversalActivityCurrencyUniversalSymbol
|
|
16
|
+
# Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
|
|
17
|
+
attr_accessor :id
|
|
18
|
+
|
|
19
|
+
# The security's trading ticker symbol. For example \"AAPL\" for Apple Inc. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on \"Yahoo Finance Market Coverage and Data Delays\"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix.
|
|
20
|
+
attr_accessor :symbol
|
|
21
|
+
|
|
22
|
+
# The raw symbol is `symbol` with the exchange suffix removed. For example, if `symbol` is \"VAB.TO\", then `raw_symbol` is \"VAB\".
|
|
23
|
+
attr_accessor :raw_symbol
|
|
24
|
+
|
|
25
|
+
# A human-readable description of the security. This is usually the company name or ETF name.
|
|
26
|
+
attr_accessor :description
|
|
27
|
+
|
|
28
|
+
attr_accessor :currency
|
|
29
|
+
|
|
30
|
+
attr_accessor :exchange
|
|
31
|
+
|
|
32
|
+
attr_accessor :type
|
|
33
|
+
|
|
34
|
+
# This identifier is unique per security per trading venue. See section 1.4.1 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information. This value should be the same as the `figi_code` in the `figi_instrument` child property.
|
|
35
|
+
attr_accessor :figi_code
|
|
36
|
+
|
|
37
|
+
attr_accessor :figi_instrument
|
|
38
|
+
|
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
40
|
+
def self.attribute_map
|
|
41
|
+
{
|
|
42
|
+
:'id' => :'id',
|
|
43
|
+
:'symbol' => :'symbol',
|
|
44
|
+
:'raw_symbol' => :'raw_symbol',
|
|
45
|
+
:'description' => :'description',
|
|
46
|
+
:'currency' => :'currency',
|
|
47
|
+
:'exchange' => :'exchange',
|
|
48
|
+
:'type' => :'type',
|
|
49
|
+
:'figi_code' => :'figi_code',
|
|
50
|
+
:'figi_instrument' => :'figi_instrument'
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Returns all the JSON keys this model knows about
|
|
55
|
+
def self.acceptable_attributes
|
|
56
|
+
attribute_map.values
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Attribute type mapping.
|
|
60
|
+
def self.openapi_types
|
|
61
|
+
{
|
|
62
|
+
:'id' => :'String',
|
|
63
|
+
:'symbol' => :'String',
|
|
64
|
+
:'raw_symbol' => :'String',
|
|
65
|
+
:'description' => :'String',
|
|
66
|
+
:'currency' => :'SymbolCurrency',
|
|
67
|
+
:'exchange' => :'SymbolExchange',
|
|
68
|
+
:'type' => :'SecurityType',
|
|
69
|
+
:'figi_code' => :'String',
|
|
70
|
+
:'figi_instrument' => :'StockInstrumentFigiInstrument'
|
|
71
|
+
}
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# List of attributes with nullable: true
|
|
75
|
+
def self.openapi_nullable
|
|
76
|
+
Set.new([
|
|
77
|
+
:'description',
|
|
78
|
+
:'figi_code',
|
|
79
|
+
:'figi_instrument'
|
|
80
|
+
])
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# List of class defined in allOf (OpenAPI v3)
|
|
84
|
+
def self.openapi_all_of
|
|
85
|
+
[
|
|
86
|
+
:'Symbol'
|
|
87
|
+
]
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Initializes the object
|
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
92
|
+
def initialize(attributes = {})
|
|
93
|
+
if (!attributes.is_a?(Hash))
|
|
94
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::AccountUniversalActivityCurrencyUniversalSymbol` initialize method"
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
98
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
99
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
100
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::AccountUniversalActivityCurrencyUniversalSymbol`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
101
|
+
end
|
|
102
|
+
h[k.to_sym] = v
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'id')
|
|
106
|
+
self.id = attributes[:'id']
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'symbol')
|
|
110
|
+
self.symbol = attributes[:'symbol']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'raw_symbol')
|
|
114
|
+
self.raw_symbol = attributes[:'raw_symbol']
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'description')
|
|
118
|
+
self.description = attributes[:'description']
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.key?(:'currency')
|
|
122
|
+
self.currency = attributes[:'currency']
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if attributes.key?(:'exchange')
|
|
126
|
+
self.exchange = attributes[:'exchange']
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.key?(:'type')
|
|
130
|
+
self.type = attributes[:'type']
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'figi_code')
|
|
134
|
+
self.figi_code = attributes[:'figi_code']
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if attributes.key?(:'figi_instrument')
|
|
138
|
+
self.figi_instrument = attributes[:'figi_instrument']
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
143
|
+
# @return Array for valid properties with the reasons
|
|
144
|
+
def list_invalid_properties
|
|
145
|
+
invalid_properties = Array.new
|
|
146
|
+
invalid_properties
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Check to see if the all the properties in the model are valid
|
|
150
|
+
# @return true if the model is valid
|
|
151
|
+
def valid?
|
|
152
|
+
true
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Checks equality by comparing each attribute.
|
|
156
|
+
# @param [Object] Object to be compared
|
|
157
|
+
def ==(o)
|
|
158
|
+
return true if self.equal?(o)
|
|
159
|
+
self.class == o.class &&
|
|
160
|
+
id == o.id &&
|
|
161
|
+
symbol == o.symbol &&
|
|
162
|
+
raw_symbol == o.raw_symbol &&
|
|
163
|
+
description == o.description &&
|
|
164
|
+
currency == o.currency &&
|
|
165
|
+
exchange == o.exchange &&
|
|
166
|
+
type == o.type &&
|
|
167
|
+
figi_code == o.figi_code &&
|
|
168
|
+
figi_instrument == o.figi_instrument
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# @see the `==` method
|
|
172
|
+
# @param [Object] Object to be compared
|
|
173
|
+
def eql?(o)
|
|
174
|
+
self == o
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Calculates hash code according to all attributes.
|
|
178
|
+
# @return [Integer] Hash code
|
|
179
|
+
def hash
|
|
180
|
+
[id, symbol, raw_symbol, description, currency, exchange, type, figi_code, figi_instrument].hash
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Builds the object from hash
|
|
184
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
185
|
+
# @return [Object] Returns the model itself
|
|
186
|
+
def self.build_from_hash(attributes)
|
|
187
|
+
new.build_from_hash(attributes)
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Builds the object from hash
|
|
191
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
192
|
+
# @return [Object] Returns the model itself
|
|
193
|
+
def build_from_hash(attributes)
|
|
194
|
+
return nil unless attributes.is_a?(Hash)
|
|
195
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
196
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
197
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
198
|
+
self.send("#{key}=", nil)
|
|
199
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
200
|
+
# check to ensure the input is an array given that the attribute
|
|
201
|
+
# is documented as an array but the input is not
|
|
202
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
203
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
204
|
+
end
|
|
205
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
206
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
self
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Deserializes the data based on type
|
|
214
|
+
# @param string type Data type
|
|
215
|
+
# @param string value Value to be deserialized
|
|
216
|
+
# @return [Object] Deserialized data
|
|
217
|
+
def _deserialize(type, value)
|
|
218
|
+
case type.to_sym
|
|
219
|
+
when :Time
|
|
220
|
+
Time.parse(value)
|
|
221
|
+
when :Date
|
|
222
|
+
Date.parse(value)
|
|
223
|
+
when :String
|
|
224
|
+
value.to_s
|
|
225
|
+
when :Integer
|
|
226
|
+
value.to_i
|
|
227
|
+
when :Float
|
|
228
|
+
value.to_f
|
|
229
|
+
when :Boolean
|
|
230
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
231
|
+
true
|
|
232
|
+
else
|
|
233
|
+
false
|
|
234
|
+
end
|
|
235
|
+
when :Object
|
|
236
|
+
# generic object (usually a Hash), return directly
|
|
237
|
+
value
|
|
238
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
239
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
240
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
241
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
242
|
+
k_type = Regexp.last_match[:k_type]
|
|
243
|
+
v_type = Regexp.last_match[:v_type]
|
|
244
|
+
{}.tap do |hash|
|
|
245
|
+
value.each do |k, v|
|
|
246
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
else # model
|
|
250
|
+
# models (e.g. Pet) or oneOf
|
|
251
|
+
klass = SnapTrade.const_get(type)
|
|
252
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
253
|
+
end
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Returns the string representation of the object
|
|
257
|
+
# @return [String] String presentation of the object
|
|
258
|
+
def to_s
|
|
259
|
+
to_hash.to_s
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
263
|
+
# @return [Hash] Returns the object in the form of hash
|
|
264
|
+
def to_body
|
|
265
|
+
to_hash
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Returns the object in the form of hash
|
|
269
|
+
# @return [Hash] Returns the object in the form of hash
|
|
270
|
+
def to_hash
|
|
271
|
+
hash = {}
|
|
272
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
273
|
+
value = self.send(attr)
|
|
274
|
+
if value.nil?
|
|
275
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
276
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
hash[param] = _to_hash(value)
|
|
280
|
+
end
|
|
281
|
+
hash
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# Outputs non-array value in the form of hash
|
|
285
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
286
|
+
# @param [Object] value Any valid value
|
|
287
|
+
# @return [Hash] Returns the value in the form of hash
|
|
288
|
+
def _to_hash(value)
|
|
289
|
+
if value.is_a?(Array)
|
|
290
|
+
value.compact.map { |v| _to_hash(v) }
|
|
291
|
+
elsif value.is_a?(Hash)
|
|
292
|
+
{}.tap do |hash|
|
|
293
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
294
|
+
end
|
|
295
|
+
elsif value.respond_to? :to_hash
|
|
296
|
+
value.to_hash
|
|
297
|
+
else
|
|
298
|
+
value
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
end
|
|
@@ -42,6 +42,9 @@ 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.
|
|
46
|
+
attr_accessor :data_freshness_mode
|
|
47
|
+
|
|
45
48
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
46
49
|
def self.attribute_map
|
|
47
50
|
{
|
|
@@ -54,7 +57,8 @@ module SnapTrade
|
|
|
54
57
|
:'disabled_date' => :'disabled_date',
|
|
55
58
|
:'meta' => :'meta',
|
|
56
59
|
:'updated_date' => :'updated_date',
|
|
57
|
-
:'is_eligible_for_payout' => :'is_eligible_for_payout'
|
|
60
|
+
:'is_eligible_for_payout' => :'is_eligible_for_payout',
|
|
61
|
+
:'data_freshness_mode' => :'data_freshness_mode'
|
|
58
62
|
}
|
|
59
63
|
end
|
|
60
64
|
|
|
@@ -75,7 +79,8 @@ module SnapTrade
|
|
|
75
79
|
:'disabled_date' => :'Time',
|
|
76
80
|
:'meta' => :'Hash<String, Object>',
|
|
77
81
|
:'updated_date' => :'Time',
|
|
78
|
-
:'is_eligible_for_payout' => :'Boolean'
|
|
82
|
+
:'is_eligible_for_payout' => :'Boolean',
|
|
83
|
+
:'data_freshness_mode' => :'String'
|
|
79
84
|
}
|
|
80
85
|
end
|
|
81
86
|
|
|
@@ -142,6 +147,10 @@ module SnapTrade
|
|
|
142
147
|
if attributes.key?(:'is_eligible_for_payout')
|
|
143
148
|
self.is_eligible_for_payout = attributes[:'is_eligible_for_payout']
|
|
144
149
|
end
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'data_freshness_mode')
|
|
152
|
+
self.data_freshness_mode = attributes[:'data_freshness_mode']
|
|
153
|
+
end
|
|
145
154
|
end
|
|
146
155
|
|
|
147
156
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -171,7 +180,8 @@ module SnapTrade
|
|
|
171
180
|
disabled_date == o.disabled_date &&
|
|
172
181
|
meta == o.meta &&
|
|
173
182
|
updated_date == o.updated_date &&
|
|
174
|
-
is_eligible_for_payout == o.is_eligible_for_payout
|
|
183
|
+
is_eligible_for_payout == o.is_eligible_for_payout &&
|
|
184
|
+
data_freshness_mode == o.data_freshness_mode
|
|
175
185
|
end
|
|
176
186
|
|
|
177
187
|
# @see the `==` method
|
|
@@ -183,7 +193,7 @@ module SnapTrade
|
|
|
183
193
|
# Calculates hash code according to all attributes.
|
|
184
194
|
# @return [Integer] Hash code
|
|
185
195
|
def hash
|
|
186
|
-
[id, created_date, brokerage, name, type, disabled, disabled_date, meta, updated_date, is_eligible_for_payout].hash
|
|
196
|
+
[id, created_date, brokerage, name, type, disabled, disabled_date, meta, updated_date, is_eligible_for_payout, data_freshness_mode].hash
|
|
187
197
|
end
|
|
188
198
|
|
|
189
199
|
# Builds the object from hash
|