snaptrade 2.0.30 → 2.0.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +31 -29
- data/README.md +5 -7
- data/lib/snaptrade/api/account_information_api.rb +16 -16
- data/lib/snaptrade/models/account_balance.rb +1 -1
- data/lib/snaptrade/models/account_balance_total.rb +2 -0
- data/lib/snaptrade/models/account_holdings_account.rb +5 -1
- data/lib/snaptrade/models/account_order_record.rb +4 -2
- data/lib/snaptrade/models/amount.rb +2 -0
- data/lib/snaptrade/models/balance.rb +3 -1
- data/lib/snaptrade/models/currency.rb +4 -1
- data/lib/snaptrade/models/exchange.rb +9 -1
- data/lib/snaptrade/models/figi_instrument.rb +3 -1
- data/lib/snaptrade/models/option_brokerage_symbol.rb +3 -1
- data/lib/snaptrade/models/options_position.rb +4 -3
- data/lib/snaptrade/models/options_position_currency.rb +4 -0
- data/lib/snaptrade/models/options_symbol.rb +12 -24
- data/lib/snaptrade/models/position.rb +6 -4
- data/lib/snaptrade/models/position_symbol.rb +6 -1
- data/lib/snaptrade/models/security_type.rb +5 -1
- data/lib/snaptrade/models/snap_trade_holdings_account_account_id.rb +11 -3
- data/lib/snaptrade/models/snap_trade_holdings_total_value.rb +3 -1
- data/lib/snaptrade/models/symbol_figi_instrument.rb +2 -0
- data/lib/snaptrade/models/underlying_symbol.rb +20 -5
- data/lib/snaptrade/models/{model_portfolio.rb → underlying_symbol_exchange.rb} +73 -12
- data/lib/snaptrade/models/{brokerage_symbol.rb → underlying_symbol_type.rb} +28 -38
- data/lib/snaptrade/models/universal_symbol.rb +9 -3
- data/lib/snaptrade/models/{model_asset_class.rb → universal_symbol_currency.rb} +24 -4
- data/lib/snaptrade/models/{portfolio_group.rb → universal_symbol_exchange.rb} +78 -7
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +4 -37
- data/spec/api/account_information_api_spec.rb +3 -3
- data/spec/models/options_symbol_spec.rb +0 -12
- data/spec/models/{brokerage_symbol_option_symbol_spec.rb → underlying_symbol_exchange_spec.rb} +14 -14
- data/spec/models/underlying_symbol_spec.rb +6 -0
- data/spec/models/{trade_impact_spec.rb → underlying_symbol_type_spec.rb} +10 -16
- data/spec/models/{model_portfolio_spec.rb → universal_symbol_currency_spec.rb} +8 -8
- data/spec/models/{trade_spec.rb → universal_symbol_exchange_spec.rb} +13 -13
- metadata +113 -212
- data/lib/snaptrade/models/brokerage_authorization_type.rb +0 -216
- data/lib/snaptrade/models/brokerage_authorization_type_type.rb +0 -37
- data/lib/snaptrade/models/brokerage_symbol_option_symbol.rb +0 -325
- data/lib/snaptrade/models/brokerage_symbol_symbol.rb +0 -339
- data/lib/snaptrade/models/calculated_trade.rb +0 -228
- data/lib/snaptrade/models/excluded_asset.rb +0 -217
- data/lib/snaptrade/models/jwt.rb +0 -217
- data/lib/snaptrade/models/model_asset_class_details.rb +0 -227
- data/lib/snaptrade/models/model_asset_class_target.rb +0 -216
- data/lib/snaptrade/models/model_portfolio_asset_class.rb +0 -249
- data/lib/snaptrade/models/model_portfolio_details.rb +0 -238
- data/lib/snaptrade/models/model_portfolio_security.rb +0 -249
- data/lib/snaptrade/models/model_type.rb +0 -38
- data/lib/snaptrade/models/options_holdings.rb +0 -267
- data/lib/snaptrade/models/portfolio_group_info.rb +0 -325
- data/lib/snaptrade/models/portfolio_group_position.rb +0 -237
- data/lib/snaptrade/models/portfolio_group_settings.rb +0 -276
- data/lib/snaptrade/models/redirect_tokenand_pin.rb +0 -226
- data/lib/snaptrade/models/snap_trade_api_disclaimer_accept_status.rb +0 -226
- data/lib/snaptrade/models/state.rb +0 -40
- data/lib/snaptrade/models/strategy_impact.rb +0 -309
- data/lib/snaptrade/models/strategy_impact_legs_inner.rb +0 -270
- data/lib/snaptrade/models/strategy_order_place.rb +0 -228
- data/lib/snaptrade/models/strategy_order_place_orders_inner.rb +0 -596
- data/lib/snaptrade/models/strategy_order_place_orders_inner_legs_inner.rb +0 -270
- data/lib/snaptrade/models/target_asset.rb +0 -289
- data/lib/snaptrade/models/trade.rb +0 -280
- data/lib/snaptrade/models/trade_action.rb +0 -37
- data/lib/snaptrade/models/trade_execution_status.rb +0 -297
- data/lib/snaptrade/models/trade_execution_status_action.rb +0 -37
- data/lib/snaptrade/models/trade_impact.rb +0 -256
- data/lib/snaptrade/models/user_error_log.rb +0 -262
- data/lib/snaptrade/models/user_settings.rb +0 -298
- data/spec/models/brokerage_authorization_type_spec.rb +0 -29
- data/spec/models/brokerage_authorization_type_type_spec.rb +0 -23
- data/spec/models/brokerage_symbol_spec.rb +0 -59
- data/spec/models/brokerage_symbol_symbol_spec.rb +0 -83
- data/spec/models/calculated_trade_spec.rb +0 -35
- data/spec/models/excluded_asset_spec.rb +0 -29
- data/spec/models/jwt_spec.rb +0 -29
- data/spec/models/model_asset_class_details_spec.rb +0 -35
- data/spec/models/model_asset_class_spec.rb +0 -35
- data/spec/models/model_asset_class_target_spec.rb +0 -29
- data/spec/models/model_portfolio_asset_class_spec.rb +0 -35
- data/spec/models/model_portfolio_details_spec.rb +0 -41
- data/spec/models/model_portfolio_security_spec.rb +0 -35
- data/spec/models/model_type_spec.rb +0 -23
- data/spec/models/options_holdings_spec.rb +0 -59
- data/spec/models/portfolio_group_info_spec.rb +0 -89
- data/spec/models/portfolio_group_position_spec.rb +0 -41
- data/spec/models/portfolio_group_settings_spec.rb +0 -53
- data/spec/models/portfolio_group_spec.rb +0 -35
- data/spec/models/redirect_tokenand_pin_spec.rb +0 -35
- data/spec/models/snap_trade_api_disclaimer_accept_status_spec.rb +0 -35
- data/spec/models/state_spec.rb +0 -23
- data/spec/models/strategy_impact_legs_inner_spec.rb +0 -65
- data/spec/models/strategy_impact_spec.rb +0 -89
- data/spec/models/strategy_order_place_orders_inner_legs_inner_spec.rb +0 -65
- data/spec/models/strategy_order_place_orders_inner_spec.rb +0 -281
- data/spec/models/strategy_order_place_spec.rb +0 -35
- data/spec/models/target_asset_spec.rb +0 -59
- data/spec/models/trade_action_spec.rb +0 -23
- data/spec/models/trade_execution_status_action_spec.rb +0 -23
- data/spec/models/trade_execution_status_spec.rb +0 -77
- data/spec/models/user_error_log_spec.rb +0 -59
- data/spec/models/user_settings_spec.rb +0 -83
@@ -11,27 +11,35 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
14
|
+
# A single brokerage account at a financial institution.
|
15
15
|
class SnapTradeHoldingsAccountAccountId
|
16
|
+
# Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
|
16
17
|
attr_accessor :id
|
17
18
|
|
19
|
+
# Unique identifier for the connection (brokerage authorization). This is the UUID used to reference the connection in SnapTrade.
|
18
20
|
attr_accessor :brokerage_authorization
|
19
21
|
|
22
|
+
# Portfolio Group ID. Portfolio Groups have been deprecated. Please contact support if you have a usecase for it.
|
20
23
|
attr_accessor :portfolio_group
|
21
24
|
|
25
|
+
# A display name for the account. Either assigned by the user or by the financial institution itself. For certain institutions, SnapTrade appends the institution name to the account name for clarity.
|
22
26
|
attr_accessor :name
|
23
27
|
|
28
|
+
# The account number assigned by the financial institution.
|
24
29
|
attr_accessor :number
|
25
30
|
|
31
|
+
# The name of the financial institution that holds the account.
|
26
32
|
attr_accessor :institution_name
|
27
33
|
|
28
34
|
attr_accessor :balance
|
29
35
|
|
36
|
+
# Additional information about the account, such as account type, status, etc. This information is specific to the financial institution and there's no standard format for this data. Please use at your own risk.
|
30
37
|
attr_accessor :meta
|
31
38
|
|
39
|
+
# This field is deprecated.
|
32
40
|
attr_accessor :cash_restrictions
|
33
41
|
|
34
|
-
#
|
42
|
+
# Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was created in SnapTrade. This is _not_ the account opening date at the financial institution.
|
35
43
|
attr_accessor :created_date
|
36
44
|
|
37
45
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -67,7 +75,7 @@ module SnapTrade
|
|
67
75
|
:'balance' => :'SnapTradeHoldingsAccountAccountIdBalance',
|
68
76
|
:'meta' => :'Hash<String, Object>',
|
69
77
|
:'cash_restrictions' => :'Array<CashRestriction>',
|
70
|
-
:'created_date' => :'
|
78
|
+
:'created_date' => :'Time'
|
71
79
|
}
|
72
80
|
end
|
73
81
|
|
@@ -11,10 +11,12 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
14
|
+
# The total market value of the account. Note that this field is calculated based on the sum of the values of account positions and cash balances known to SnapTrade. It may not be accurate if the brokerage account has holdings that SnapTrade is not aware of. For example, if the brokerage account holds assets that SnapTrade does not support, the total value may be underreported. To get the brokerage reported total market value of the account, refer to `account.balance.total`.
|
15
15
|
class SnapTradeHoldingsTotalValue
|
16
|
+
# Total value denominated in the currency of the `currency` field.
|
16
17
|
attr_accessor :value
|
17
18
|
|
19
|
+
# The ISO-4217 currency code for the amount.
|
18
20
|
attr_accessor :currency
|
19
21
|
|
20
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -12,8 +12,10 @@ require 'time'
|
|
12
12
|
|
13
13
|
module SnapTrade
|
14
14
|
class SymbolFigiInstrument
|
15
|
+
# 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.
|
15
16
|
attr_accessor :figi_code
|
16
17
|
|
18
|
+
# This enables users to link multiple FIGIs for the same security in order to obtain an aggregated view across all countries and all exchanges. For example, `AAPL` has a different FIGI for each exchange/trading venue it is traded on. The `figi_share_class` is the same for all of these FIGIs. See section 1.4.3 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information.
|
17
19
|
attr_accessor :figi_share_class
|
18
20
|
|
19
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -11,12 +11,18 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
14
|
+
# Symbol object for the underlying security of an option.
|
15
15
|
class UnderlyingSymbol
|
16
|
+
# Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
|
16
17
|
attr_accessor :id
|
17
18
|
|
19
|
+
# The security's trading ticker symbol. For example \"AAPL\" for Apple Inc. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on \"Yahoo Finance Market Coverage and Data Delays\"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix.
|
18
20
|
attr_accessor :symbol
|
19
21
|
|
22
|
+
# The raw symbol is `symbol` with the exchange suffix removed. For example, if `symbol` is \"VAB.TO\", then `raw_symbol` is \"VAB\".
|
23
|
+
attr_accessor :raw_symbol
|
24
|
+
|
25
|
+
# A human-readable description of the security. This is usually the company name or ETF name.
|
20
26
|
attr_accessor :description
|
21
27
|
|
22
28
|
attr_accessor :currency
|
@@ -25,8 +31,10 @@ module SnapTrade
|
|
25
31
|
|
26
32
|
attr_accessor :type
|
27
33
|
|
34
|
+
# This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
|
28
35
|
attr_accessor :currencies
|
29
36
|
|
37
|
+
# This identifier is unique per security per trading venue. See section 1.4.1 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information. This value should be the same as the `figi_code` in the `figi_instrument` child property.
|
30
38
|
attr_accessor :figi_code
|
31
39
|
|
32
40
|
attr_accessor :figi_instrument
|
@@ -36,6 +44,7 @@ module SnapTrade
|
|
36
44
|
{
|
37
45
|
:'id' => :'id',
|
38
46
|
:'symbol' => :'symbol',
|
47
|
+
:'raw_symbol' => :'raw_symbol',
|
39
48
|
:'description' => :'description',
|
40
49
|
:'currency' => :'currency',
|
41
50
|
:'exchange' => :'exchange',
|
@@ -56,10 +65,11 @@ module SnapTrade
|
|
56
65
|
{
|
57
66
|
:'id' => :'String',
|
58
67
|
:'symbol' => :'String',
|
68
|
+
:'raw_symbol' => :'String',
|
59
69
|
:'description' => :'String',
|
60
|
-
:'currency' => :'
|
61
|
-
:'exchange' => :'
|
62
|
-
:'type' => :'
|
70
|
+
:'currency' => :'UniversalSymbolCurrency',
|
71
|
+
:'exchange' => :'UnderlyingSymbolExchange',
|
72
|
+
:'type' => :'UnderlyingSymbolType',
|
63
73
|
:'currencies' => :'Array<Currency>',
|
64
74
|
:'figi_code' => :'String',
|
65
75
|
:'figi_instrument' => :'SymbolFigiInstrument'
|
@@ -98,6 +108,10 @@ module SnapTrade
|
|
98
108
|
self.symbol = attributes[:'symbol']
|
99
109
|
end
|
100
110
|
|
111
|
+
if attributes.key?(:'raw_symbol')
|
112
|
+
self.raw_symbol = attributes[:'raw_symbol']
|
113
|
+
end
|
114
|
+
|
101
115
|
if attributes.key?(:'description')
|
102
116
|
self.description = attributes[:'description']
|
103
117
|
end
|
@@ -149,6 +163,7 @@ module SnapTrade
|
|
149
163
|
self.class == o.class &&
|
150
164
|
id == o.id &&
|
151
165
|
symbol == o.symbol &&
|
166
|
+
raw_symbol == o.raw_symbol &&
|
152
167
|
description == o.description &&
|
153
168
|
currency == o.currency &&
|
154
169
|
exchange == o.exchange &&
|
@@ -167,7 +182,7 @@ module SnapTrade
|
|
167
182
|
# Calculates hash code according to all attributes.
|
168
183
|
# @return [Integer] Hash code
|
169
184
|
def hash
|
170
|
-
[id, symbol, description, currency, exchange, type, currencies, figi_code, figi_instrument].hash
|
185
|
+
[id, symbol, raw_symbol, description, currency, exchange, type, currencies, figi_code, figi_instrument].hash
|
171
186
|
end
|
172
187
|
|
173
188
|
# Builds the object from hash
|
@@ -11,19 +11,38 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
|
14
|
+
# The exchange on which the security is listed and traded.
|
15
|
+
class UnderlyingSymbolExchange
|
15
16
|
attr_accessor :id
|
16
17
|
|
18
|
+
attr_accessor :code
|
19
|
+
|
20
|
+
attr_accessor :mic_code
|
21
|
+
|
17
22
|
attr_accessor :name
|
18
23
|
|
19
|
-
attr_accessor :
|
24
|
+
attr_accessor :timezone
|
25
|
+
|
26
|
+
attr_accessor :start_time
|
27
|
+
|
28
|
+
attr_accessor :close_time
|
29
|
+
|
30
|
+
attr_accessor :suffix
|
31
|
+
|
32
|
+
attr_accessor :allows_cryptocurrency_symbols
|
20
33
|
|
21
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
22
35
|
def self.attribute_map
|
23
36
|
{
|
24
37
|
:'id' => :'id',
|
38
|
+
:'code' => :'code',
|
39
|
+
:'mic_code' => :'mic_code',
|
25
40
|
:'name' => :'name',
|
26
|
-
:'
|
41
|
+
:'timezone' => :'timezone',
|
42
|
+
:'start_time' => :'start_time',
|
43
|
+
:'close_time' => :'close_time',
|
44
|
+
:'suffix' => :'suffix',
|
45
|
+
:'allows_cryptocurrency_symbols' => :'allows_cryptocurrency_symbols'
|
27
46
|
}
|
28
47
|
end
|
29
48
|
|
@@ -36,28 +55,42 @@ module SnapTrade
|
|
36
55
|
def self.openapi_types
|
37
56
|
{
|
38
57
|
:'id' => :'String',
|
58
|
+
:'code' => :'String',
|
59
|
+
:'mic_code' => :'String',
|
39
60
|
:'name' => :'String',
|
40
|
-
:'
|
61
|
+
:'timezone' => :'String',
|
62
|
+
:'start_time' => :'String',
|
63
|
+
:'close_time' => :'String',
|
64
|
+
:'suffix' => :'String',
|
65
|
+
:'allows_cryptocurrency_symbols' => :'Boolean'
|
41
66
|
}
|
42
67
|
end
|
43
68
|
|
44
69
|
# List of attributes with nullable: true
|
45
70
|
def self.openapi_nullable
|
46
71
|
Set.new([
|
72
|
+
:'suffix',
|
47
73
|
])
|
48
74
|
end
|
49
75
|
|
76
|
+
# List of class defined in allOf (OpenAPI v3)
|
77
|
+
def self.openapi_all_of
|
78
|
+
[
|
79
|
+
:'USExchange'
|
80
|
+
]
|
81
|
+
end
|
82
|
+
|
50
83
|
# Initializes the object
|
51
84
|
# @param [Hash] attributes Model attributes in the form of hash
|
52
85
|
def initialize(attributes = {})
|
53
86
|
if (!attributes.is_a?(Hash))
|
54
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::
|
87
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::UnderlyingSymbolExchange` initialize method"
|
55
88
|
end
|
56
89
|
|
57
90
|
# check to see if the attribute exists and convert string to symbol for hash key
|
58
91
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
92
|
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::
|
93
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::UnderlyingSymbolExchange`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
94
|
end
|
62
95
|
h[k.to_sym] = v
|
63
96
|
}
|
@@ -66,14 +99,36 @@ module SnapTrade
|
|
66
99
|
self.id = attributes[:'id']
|
67
100
|
end
|
68
101
|
|
102
|
+
if attributes.key?(:'code')
|
103
|
+
self.code = attributes[:'code']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'mic_code')
|
107
|
+
self.mic_code = attributes[:'mic_code']
|
108
|
+
end
|
109
|
+
|
69
110
|
if attributes.key?(:'name')
|
70
111
|
self.name = attributes[:'name']
|
71
112
|
end
|
72
113
|
|
73
|
-
if attributes.key?(:'
|
74
|
-
self.
|
75
|
-
|
76
|
-
|
114
|
+
if attributes.key?(:'timezone')
|
115
|
+
self.timezone = attributes[:'timezone']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'start_time')
|
119
|
+
self.start_time = attributes[:'start_time']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'close_time')
|
123
|
+
self.close_time = attributes[:'close_time']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.key?(:'suffix')
|
127
|
+
self.suffix = attributes[:'suffix']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'allows_cryptocurrency_symbols')
|
131
|
+
self.allows_cryptocurrency_symbols = attributes[:'allows_cryptocurrency_symbols']
|
77
132
|
end
|
78
133
|
end
|
79
134
|
|
@@ -96,8 +151,14 @@ module SnapTrade
|
|
96
151
|
return true if self.equal?(o)
|
97
152
|
self.class == o.class &&
|
98
153
|
id == o.id &&
|
154
|
+
code == o.code &&
|
155
|
+
mic_code == o.mic_code &&
|
99
156
|
name == o.name &&
|
100
|
-
|
157
|
+
timezone == o.timezone &&
|
158
|
+
start_time == o.start_time &&
|
159
|
+
close_time == o.close_time &&
|
160
|
+
suffix == o.suffix &&
|
161
|
+
allows_cryptocurrency_symbols == o.allows_cryptocurrency_symbols
|
101
162
|
end
|
102
163
|
|
103
164
|
# @see the `==` method
|
@@ -109,7 +170,7 @@ module SnapTrade
|
|
109
170
|
# Calculates hash code according to all attributes.
|
110
171
|
# @return [Integer] Hash code
|
111
172
|
def hash
|
112
|
-
[id, name,
|
173
|
+
[id, code, mic_code, name, timezone, start_time, close_time, suffix, allows_cryptocurrency_symbols].hash
|
113
174
|
end
|
114
175
|
|
115
176
|
# Builds the object from hash
|
@@ -11,29 +11,27 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
15
|
-
class
|
14
|
+
# The type of security. For example, \"Common Stock\" or \"ETF\".
|
15
|
+
class UnderlyingSymbolType
|
16
|
+
# Unique identifier for the security type within SnapTrade. This is the ID used to reference the security type in SnapTrade API calls.
|
16
17
|
attr_accessor :id
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
attr_accessor :brokerage_authorization
|
19
|
+
# A short code representing the security type. For example, \"cs\" for Common Stock. Here are some common values: ad - ADR bnd - Bond cs - Common Stock cef - Closed End Fund et - ETF oef - Open Ended Fund ps - Preferred Stock rt - Right struct - Structured Product ut - Unit wi - When Issued wt - Warrant
|
20
|
+
attr_accessor :code
|
21
21
|
|
22
|
+
# A human-readable description of the security type. For example, \"Common Stock\" or \"ETF\".
|
22
23
|
attr_accessor :description
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
attr_accessor :option_symbol
|
25
|
+
# This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
|
26
|
+
attr_accessor :is_supported
|
27
27
|
|
28
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
29
29
|
def self.attribute_map
|
30
30
|
{
|
31
31
|
:'id' => :'id',
|
32
|
-
:'
|
33
|
-
:'brokerage_authorization' => :'brokerage_authorization',
|
32
|
+
:'code' => :'code',
|
34
33
|
:'description' => :'description',
|
35
|
-
:'
|
36
|
-
:'option_symbol' => :'option_symbol'
|
34
|
+
:'is_supported' => :'is_supported'
|
37
35
|
}
|
38
36
|
end
|
39
37
|
|
@@ -46,34 +44,36 @@ module SnapTrade
|
|
46
44
|
def self.openapi_types
|
47
45
|
{
|
48
46
|
:'id' => :'String',
|
49
|
-
:'
|
50
|
-
:'brokerage_authorization' => :'BrokerageAuthorization',
|
47
|
+
:'code' => :'String',
|
51
48
|
:'description' => :'String',
|
52
|
-
:'
|
53
|
-
:'option_symbol' => :'BrokerageSymbolOptionSymbol'
|
49
|
+
:'is_supported' => :'Boolean'
|
54
50
|
}
|
55
51
|
end
|
56
52
|
|
57
53
|
# List of attributes with nullable: true
|
58
54
|
def self.openapi_nullable
|
59
55
|
Set.new([
|
60
|
-
:'symbol',
|
61
|
-
:'allows_fractional_units',
|
62
|
-
:'option_symbol'
|
63
56
|
])
|
64
57
|
end
|
65
58
|
|
59
|
+
# List of class defined in allOf (OpenAPI v3)
|
60
|
+
def self.openapi_all_of
|
61
|
+
[
|
62
|
+
:'SecurityType'
|
63
|
+
]
|
64
|
+
end
|
65
|
+
|
66
66
|
# Initializes the object
|
67
67
|
# @param [Hash] attributes Model attributes in the form of hash
|
68
68
|
def initialize(attributes = {})
|
69
69
|
if (!attributes.is_a?(Hash))
|
70
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::UnderlyingSymbolType` initialize method"
|
71
71
|
end
|
72
72
|
|
73
73
|
# check to see if the attribute exists and convert string to symbol for hash key
|
74
74
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
75
75
|
if (!self.class.attribute_map.key?(k.to_sym))
|
76
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::
|
76
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::UnderlyingSymbolType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
77
77
|
end
|
78
78
|
h[k.to_sym] = v
|
79
79
|
}
|
@@ -82,24 +82,16 @@ module SnapTrade
|
|
82
82
|
self.id = attributes[:'id']
|
83
83
|
end
|
84
84
|
|
85
|
-
if attributes.key?(:'
|
86
|
-
self.
|
87
|
-
end
|
88
|
-
|
89
|
-
if attributes.key?(:'brokerage_authorization')
|
90
|
-
self.brokerage_authorization = attributes[:'brokerage_authorization']
|
85
|
+
if attributes.key?(:'code')
|
86
|
+
self.code = attributes[:'code']
|
91
87
|
end
|
92
88
|
|
93
89
|
if attributes.key?(:'description')
|
94
90
|
self.description = attributes[:'description']
|
95
91
|
end
|
96
92
|
|
97
|
-
if attributes.key?(:'
|
98
|
-
self.
|
99
|
-
end
|
100
|
-
|
101
|
-
if attributes.key?(:'option_symbol')
|
102
|
-
self.option_symbol = attributes[:'option_symbol']
|
93
|
+
if attributes.key?(:'is_supported')
|
94
|
+
self.is_supported = attributes[:'is_supported']
|
103
95
|
end
|
104
96
|
end
|
105
97
|
|
@@ -122,11 +114,9 @@ module SnapTrade
|
|
122
114
|
return true if self.equal?(o)
|
123
115
|
self.class == o.class &&
|
124
116
|
id == o.id &&
|
125
|
-
|
126
|
-
brokerage_authorization == o.brokerage_authorization &&
|
117
|
+
code == o.code &&
|
127
118
|
description == o.description &&
|
128
|
-
|
129
|
-
option_symbol == o.option_symbol
|
119
|
+
is_supported == o.is_supported
|
130
120
|
end
|
131
121
|
|
132
122
|
# @see the `==` method
|
@@ -138,7 +128,7 @@ module SnapTrade
|
|
138
128
|
# Calculates hash code according to all attributes.
|
139
129
|
# @return [Integer] Hash code
|
140
130
|
def hash
|
141
|
-
[id,
|
131
|
+
[id, code, description, is_supported].hash
|
142
132
|
end
|
143
133
|
|
144
134
|
# Builds the object from hash
|
@@ -11,14 +11,18 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
14
|
+
# Uniquely describes a single security + exchange combination across all brokerages.
|
15
15
|
class UniversalSymbol
|
16
|
+
# Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
|
16
17
|
attr_accessor :id
|
17
18
|
|
19
|
+
# The security's trading ticker symbol. For example \"AAPL\" for Apple Inc. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on \"Yahoo Finance Market Coverage and Data Delays\"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix.
|
18
20
|
attr_accessor :symbol
|
19
21
|
|
22
|
+
# The raw symbol is `symbol` with the exchange suffix removed. For example, if `symbol` is \"VAB.TO\", then `raw_symbol` is \"VAB\".
|
20
23
|
attr_accessor :raw_symbol
|
21
24
|
|
25
|
+
# A human-readable description of the security. This is usually the company name or ETF name.
|
22
26
|
attr_accessor :description
|
23
27
|
|
24
28
|
attr_accessor :currency
|
@@ -27,8 +31,10 @@ module SnapTrade
|
|
27
31
|
|
28
32
|
attr_accessor :type
|
29
33
|
|
34
|
+
# This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
|
30
35
|
attr_accessor :currencies
|
31
36
|
|
37
|
+
# 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.
|
32
38
|
attr_accessor :figi_code
|
33
39
|
|
34
40
|
attr_accessor :figi_instrument
|
@@ -61,8 +67,8 @@ module SnapTrade
|
|
61
67
|
:'symbol' => :'String',
|
62
68
|
:'raw_symbol' => :'String',
|
63
69
|
:'description' => :'String',
|
64
|
-
:'currency' => :'
|
65
|
-
:'exchange' => :'
|
70
|
+
:'currency' => :'UniversalSymbolCurrency',
|
71
|
+
:'exchange' => :'UniversalSymbolExchange',
|
66
72
|
:'type' => :'SecurityType',
|
67
73
|
:'currencies' => :'Array<Currency>',
|
68
74
|
:'figi_code' => :'String',
|
@@ -11,15 +11,22 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
|
14
|
+
# The currency in which the security is traded.
|
15
|
+
class UniversalSymbolCurrency
|
16
|
+
# Unique identifier for the currency. This is the UUID used to reference the currency in SnapTrade.
|
15
17
|
attr_accessor :id
|
16
18
|
|
19
|
+
# The ISO-4217 currency code for the currency.
|
20
|
+
attr_accessor :code
|
21
|
+
|
22
|
+
# A human-friendly name of the currency.
|
17
23
|
attr_accessor :name
|
18
24
|
|
19
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
20
26
|
def self.attribute_map
|
21
27
|
{
|
22
28
|
:'id' => :'id',
|
29
|
+
:'code' => :'code',
|
23
30
|
:'name' => :'name'
|
24
31
|
}
|
25
32
|
end
|
@@ -33,6 +40,7 @@ module SnapTrade
|
|
33
40
|
def self.openapi_types
|
34
41
|
{
|
35
42
|
:'id' => :'String',
|
43
|
+
:'code' => :'String',
|
36
44
|
:'name' => :'String'
|
37
45
|
}
|
38
46
|
end
|
@@ -43,17 +51,24 @@ module SnapTrade
|
|
43
51
|
])
|
44
52
|
end
|
45
53
|
|
54
|
+
# List of class defined in allOf (OpenAPI v3)
|
55
|
+
def self.openapi_all_of
|
56
|
+
[
|
57
|
+
:'Currency'
|
58
|
+
]
|
59
|
+
end
|
60
|
+
|
46
61
|
# Initializes the object
|
47
62
|
# @param [Hash] attributes Model attributes in the form of hash
|
48
63
|
def initialize(attributes = {})
|
49
64
|
if (!attributes.is_a?(Hash))
|
50
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::UniversalSymbolCurrency` initialize method"
|
51
66
|
end
|
52
67
|
|
53
68
|
# check to see if the attribute exists and convert string to symbol for hash key
|
54
69
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
70
|
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::UniversalSymbolCurrency`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
72
|
end
|
58
73
|
h[k.to_sym] = v
|
59
74
|
}
|
@@ -62,6 +77,10 @@ module SnapTrade
|
|
62
77
|
self.id = attributes[:'id']
|
63
78
|
end
|
64
79
|
|
80
|
+
if attributes.key?(:'code')
|
81
|
+
self.code = attributes[:'code']
|
82
|
+
end
|
83
|
+
|
65
84
|
if attributes.key?(:'name')
|
66
85
|
self.name = attributes[:'name']
|
67
86
|
end
|
@@ -86,6 +105,7 @@ module SnapTrade
|
|
86
105
|
return true if self.equal?(o)
|
87
106
|
self.class == o.class &&
|
88
107
|
id == o.id &&
|
108
|
+
code == o.code &&
|
89
109
|
name == o.name
|
90
110
|
end
|
91
111
|
|
@@ -98,7 +118,7 @@ module SnapTrade
|
|
98
118
|
# Calculates hash code according to all attributes.
|
99
119
|
# @return [Integer] Hash code
|
100
120
|
def hash
|
101
|
-
[id, name].hash
|
121
|
+
[id, code, name].hash
|
102
122
|
end
|
103
123
|
|
104
124
|
# Builds the object from hash
|