snaptrade 2.0.47 → 2.0.49
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +7 -4
- data/lib/snaptrade/api/authentication_api.rb +2 -2
- data/lib/snaptrade/api/transactions_and_reporting_api.rb +4 -4
- data/lib/snaptrade/models/account_order_record.rb +15 -15
- data/lib/snaptrade/models/account_order_record_universal_symbol.rb +17 -17
- data/lib/snaptrade/models/brokerage.rb +26 -26
- data/lib/snaptrade/models/brokerage_authorization.rb +14 -14
- data/lib/snaptrade/models/manual_trade_symbol.rb +14 -14
- data/lib/snaptrade/models/option_brokerage_symbol.rb +13 -13
- data/lib/snaptrade/models/options_position.rb +15 -15
- data/lib/snaptrade/models/position.rb +16 -16
- data/lib/snaptrade/models/position_symbol.rb +10 -10
- data/lib/snaptrade/models/snap_trade_login_user_request_body.rb +1 -1
- data/lib/snaptrade/models/underlying_symbol.rb +17 -17
- data/lib/snaptrade/models/universal_activity.rb +1 -1
- data/lib/snaptrade/models/universal_symbol.rb +17 -17
- data/lib/snaptrade/version.rb +1 -1
- data/spec/api/transactions_and_reporting_api_spec.rb +1 -1
- data/spec/models/account_order_record_spec.rb +6 -6
- data/spec/models/account_order_record_universal_symbol_spec.rb +3 -3
- data/spec/models/brokerage_authorization_spec.rb +6 -6
- data/spec/models/brokerage_spec.rb +8 -8
- data/spec/models/manual_trade_symbol_spec.rb +6 -6
- data/spec/models/option_brokerage_symbol_spec.rb +3 -3
- data/spec/models/options_position_spec.rb +2 -2
- data/spec/models/position_spec.rb +2 -2
- data/spec/models/position_symbol_spec.rb +3 -3
- data/spec/models/underlying_symbol_spec.rb +3 -3
- data/spec/models/universal_symbol_spec.rb +3 -3
- metadata +100 -100
@@ -13,9 +13,6 @@ require 'time'
|
|
13
13
|
module SnapTrade
|
14
14
|
# Information about the security for the order.
|
15
15
|
class ManualTradeSymbol
|
16
|
-
# A unique ID for the security within SnapTrade, scoped to the brokerage account that the security belongs to. This is a legacy field and should not be used. Do not rely on this being a stable ID as it can change.
|
17
|
-
attr_accessor :brokerage_symbol_id
|
18
|
-
|
19
16
|
# Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
|
20
17
|
attr_accessor :universal_symbol_id
|
21
18
|
|
@@ -30,15 +27,18 @@ module SnapTrade
|
|
30
27
|
# This field is deprecated and should not be used.
|
31
28
|
attr_accessor :symbol
|
32
29
|
|
30
|
+
# A unique ID for the security within SnapTrade, scoped to the brokerage account that the security belongs to. This is a legacy field and should not be used. Do not rely on this being a stable ID as it can change.
|
31
|
+
attr_accessor :brokerage_symbol_id
|
32
|
+
|
33
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
34
34
|
def self.attribute_map
|
35
35
|
{
|
36
|
-
:'brokerage_symbol_id' => :'brokerage_symbol_id',
|
37
36
|
:'universal_symbol_id' => :'universal_symbol_id',
|
38
37
|
:'currency' => :'currency',
|
39
38
|
:'local_id' => :'local_id',
|
40
39
|
:'description' => :'description',
|
41
|
-
:'symbol' => :'symbol'
|
40
|
+
:'symbol' => :'symbol',
|
41
|
+
:'brokerage_symbol_id' => :'brokerage_symbol_id'
|
42
42
|
}
|
43
43
|
end
|
44
44
|
|
@@ -50,12 +50,12 @@ module SnapTrade
|
|
50
50
|
# Attribute type mapping.
|
51
51
|
def self.openapi_types
|
52
52
|
{
|
53
|
-
:'brokerage_symbol_id' => :'String',
|
54
53
|
:'universal_symbol_id' => :'String',
|
55
54
|
:'currency' => :'Currency',
|
56
55
|
:'local_id' => :'String',
|
57
56
|
:'description' => :'String',
|
58
|
-
:'symbol' => :'String'
|
57
|
+
:'symbol' => :'String',
|
58
|
+
:'brokerage_symbol_id' => :'String'
|
59
59
|
}
|
60
60
|
end
|
61
61
|
|
@@ -81,10 +81,6 @@ module SnapTrade
|
|
81
81
|
h[k.to_sym] = v
|
82
82
|
}
|
83
83
|
|
84
|
-
if attributes.key?(:'brokerage_symbol_id')
|
85
|
-
self.brokerage_symbol_id = attributes[:'brokerage_symbol_id']
|
86
|
-
end
|
87
|
-
|
88
84
|
if attributes.key?(:'universal_symbol_id')
|
89
85
|
self.universal_symbol_id = attributes[:'universal_symbol_id']
|
90
86
|
end
|
@@ -104,6 +100,10 @@ module SnapTrade
|
|
104
100
|
if attributes.key?(:'symbol')
|
105
101
|
self.symbol = attributes[:'symbol']
|
106
102
|
end
|
103
|
+
|
104
|
+
if attributes.key?(:'brokerage_symbol_id')
|
105
|
+
self.brokerage_symbol_id = attributes[:'brokerage_symbol_id']
|
106
|
+
end
|
107
107
|
end
|
108
108
|
|
109
109
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -124,12 +124,12 @@ module SnapTrade
|
|
124
124
|
def ==(o)
|
125
125
|
return true if self.equal?(o)
|
126
126
|
self.class == o.class &&
|
127
|
-
brokerage_symbol_id == o.brokerage_symbol_id &&
|
128
127
|
universal_symbol_id == o.universal_symbol_id &&
|
129
128
|
currency == o.currency &&
|
130
129
|
local_id == o.local_id &&
|
131
130
|
description == o.description &&
|
132
|
-
symbol == o.symbol
|
131
|
+
symbol == o.symbol &&
|
132
|
+
brokerage_symbol_id == o.brokerage_symbol_id
|
133
133
|
end
|
134
134
|
|
135
135
|
# @see the `==` method
|
@@ -141,7 +141,7 @@ module SnapTrade
|
|
141
141
|
# Calculates hash code according to all attributes.
|
142
142
|
# @return [Integer] Hash code
|
143
143
|
def hash
|
144
|
-
[
|
144
|
+
[universal_symbol_id, currency, local_id, description, symbol, brokerage_symbol_id].hash
|
145
145
|
end
|
146
146
|
|
147
147
|
# Builds the object from hash
|
@@ -13,20 +13,20 @@ require 'time'
|
|
13
13
|
module SnapTrade
|
14
14
|
# Uniquely describes a security for the option position within an account. The distinction between this and the `option_symbol` child property is that this object is specific to a position within an account, while the `option_symbol` child property is universal across all brokerage accounts. The caller should rely on the `option_symbol` child property for most use cases.
|
15
15
|
class OptionBrokerageSymbol
|
16
|
+
attr_accessor :option_symbol
|
17
|
+
|
16
18
|
# A unique ID for the security within SnapTrade, scoped to the brokerage account that the security belongs to. This is a legacy field and should not be used. Do not rely on this being a stable ID as it can change.
|
17
19
|
attr_accessor :id
|
18
20
|
|
19
21
|
# This field is deprecated and the caller should use the `option_symbol` child property's `description` instead.
|
20
22
|
attr_accessor :description
|
21
23
|
|
22
|
-
attr_accessor :option_symbol
|
23
|
-
|
24
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
25
25
|
def self.attribute_map
|
26
26
|
{
|
27
|
+
:'option_symbol' => :'option_symbol',
|
27
28
|
:'id' => :'id',
|
28
|
-
:'description' => :'description'
|
29
|
-
:'option_symbol' => :'option_symbol'
|
29
|
+
:'description' => :'description'
|
30
30
|
}
|
31
31
|
end
|
32
32
|
|
@@ -38,9 +38,9 @@ module SnapTrade
|
|
38
38
|
# Attribute type mapping.
|
39
39
|
def self.openapi_types
|
40
40
|
{
|
41
|
+
:'option_symbol' => :'OptionsSymbol',
|
41
42
|
:'id' => :'String',
|
42
|
-
:'description' => :'String'
|
43
|
-
:'option_symbol' => :'OptionsSymbol'
|
43
|
+
:'description' => :'String'
|
44
44
|
}
|
45
45
|
end
|
46
46
|
|
@@ -65,6 +65,10 @@ module SnapTrade
|
|
65
65
|
h[k.to_sym] = v
|
66
66
|
}
|
67
67
|
|
68
|
+
if attributes.key?(:'option_symbol')
|
69
|
+
self.option_symbol = attributes[:'option_symbol']
|
70
|
+
end
|
71
|
+
|
68
72
|
if attributes.key?(:'id')
|
69
73
|
self.id = attributes[:'id']
|
70
74
|
end
|
@@ -72,10 +76,6 @@ module SnapTrade
|
|
72
76
|
if attributes.key?(:'description')
|
73
77
|
self.description = attributes[:'description']
|
74
78
|
end
|
75
|
-
|
76
|
-
if attributes.key?(:'option_symbol')
|
77
|
-
self.option_symbol = attributes[:'option_symbol']
|
78
|
-
end
|
79
79
|
end
|
80
80
|
|
81
81
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -96,9 +96,9 @@ module SnapTrade
|
|
96
96
|
def ==(o)
|
97
97
|
return true if self.equal?(o)
|
98
98
|
self.class == o.class &&
|
99
|
+
option_symbol == o.option_symbol &&
|
99
100
|
id == o.id &&
|
100
|
-
description == o.description
|
101
|
-
option_symbol == o.option_symbol
|
101
|
+
description == o.description
|
102
102
|
end
|
103
103
|
|
104
104
|
# @see the `==` method
|
@@ -110,7 +110,7 @@ module SnapTrade
|
|
110
110
|
# Calculates hash code according to all attributes.
|
111
111
|
# @return [Integer] Hash code
|
112
112
|
def hash
|
113
|
-
[id, description
|
113
|
+
[option_symbol, id, description].hash
|
114
114
|
end
|
115
115
|
|
116
116
|
# Builds the object from hash
|
@@ -21,19 +21,19 @@ module SnapTrade
|
|
21
21
|
# The number of contracts for this option position. A positive number indicates a long position, while a negative number indicates a short position.
|
22
22
|
attr_accessor :units
|
23
23
|
|
24
|
-
attr_accessor :currency
|
25
|
-
|
26
24
|
# Cost basis _per contract_ of this option position. To get the cost basis _per share_, divide this value by the number of shares per contract (usually 100).
|
27
25
|
attr_accessor :average_purchase_price
|
28
26
|
|
27
|
+
attr_accessor :currency
|
28
|
+
|
29
29
|
# Attribute mapping from ruby-style variable name to JSON key.
|
30
30
|
def self.attribute_map
|
31
31
|
{
|
32
32
|
:'symbol' => :'symbol',
|
33
33
|
:'price' => :'price',
|
34
34
|
:'units' => :'units',
|
35
|
-
:'
|
36
|
-
:'
|
35
|
+
:'average_purchase_price' => :'average_purchase_price',
|
36
|
+
:'currency' => :'currency'
|
37
37
|
}
|
38
38
|
end
|
39
39
|
|
@@ -48,8 +48,8 @@ module SnapTrade
|
|
48
48
|
:'symbol' => :'OptionBrokerageSymbol',
|
49
49
|
:'price' => :'Float',
|
50
50
|
:'units' => :'Float',
|
51
|
-
:'
|
52
|
-
:'
|
51
|
+
:'average_purchase_price' => :'Float',
|
52
|
+
:'currency' => :'OptionsPositionCurrency'
|
53
53
|
}
|
54
54
|
end
|
55
55
|
|
@@ -57,8 +57,8 @@ module SnapTrade
|
|
57
57
|
def self.openapi_nullable
|
58
58
|
Set.new([
|
59
59
|
:'price',
|
60
|
-
:'
|
61
|
-
:'
|
60
|
+
:'average_purchase_price',
|
61
|
+
:'currency'
|
62
62
|
])
|
63
63
|
end
|
64
64
|
|
@@ -89,13 +89,13 @@ module SnapTrade
|
|
89
89
|
self.units = attributes[:'units']
|
90
90
|
end
|
91
91
|
|
92
|
-
if attributes.key?(:'currency')
|
93
|
-
self.currency = attributes[:'currency']
|
94
|
-
end
|
95
|
-
|
96
92
|
if attributes.key?(:'average_purchase_price')
|
97
93
|
self.average_purchase_price = attributes[:'average_purchase_price']
|
98
94
|
end
|
95
|
+
|
96
|
+
if attributes.key?(:'currency')
|
97
|
+
self.currency = attributes[:'currency']
|
98
|
+
end
|
99
99
|
end
|
100
100
|
|
101
101
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -119,8 +119,8 @@ module SnapTrade
|
|
119
119
|
symbol == o.symbol &&
|
120
120
|
price == o.price &&
|
121
121
|
units == o.units &&
|
122
|
-
|
123
|
-
|
122
|
+
average_purchase_price == o.average_purchase_price &&
|
123
|
+
currency == o.currency
|
124
124
|
end
|
125
125
|
|
126
126
|
# @see the `==` method
|
@@ -132,7 +132,7 @@ module SnapTrade
|
|
132
132
|
# Calculates hash code according to all attributes.
|
133
133
|
# @return [Integer] Hash code
|
134
134
|
def hash
|
135
|
-
[symbol, price, units,
|
135
|
+
[symbol, price, units, average_purchase_price, currency].hash
|
136
136
|
end
|
137
137
|
|
138
138
|
# Builds the object from hash
|
@@ -24,12 +24,12 @@ module SnapTrade
|
|
24
24
|
# The profit or loss on the position since it was opened. This is calculated as the difference between the current market value of the position and the total cost of the position. It is recommended to calculate this value using the average purchase price and the current market price yourself, instead of relying on this field.
|
25
25
|
attr_accessor :open_pnl
|
26
26
|
|
27
|
-
# Deprecated, use the `units` field for both fractional and integer units going forward
|
28
|
-
attr_accessor :fractional_units
|
29
|
-
|
30
27
|
# Cost basis _per share_ of this position.
|
31
28
|
attr_accessor :average_purchase_price
|
32
29
|
|
30
|
+
# Deprecated, use the `units` field for both fractional and integer units going forward
|
31
|
+
attr_accessor :fractional_units
|
32
|
+
|
33
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
34
34
|
def self.attribute_map
|
35
35
|
{
|
@@ -37,8 +37,8 @@ module SnapTrade
|
|
37
37
|
:'units' => :'units',
|
38
38
|
:'price' => :'price',
|
39
39
|
:'open_pnl' => :'open_pnl',
|
40
|
-
:'
|
41
|
-
:'
|
40
|
+
:'average_purchase_price' => :'average_purchase_price',
|
41
|
+
:'fractional_units' => :'fractional_units'
|
42
42
|
}
|
43
43
|
end
|
44
44
|
|
@@ -54,8 +54,8 @@ module SnapTrade
|
|
54
54
|
:'units' => :'Float',
|
55
55
|
:'price' => :'Float',
|
56
56
|
:'open_pnl' => :'Float',
|
57
|
-
:'
|
58
|
-
:'
|
57
|
+
:'average_purchase_price' => :'Float',
|
58
|
+
:'fractional_units' => :'Float'
|
59
59
|
}
|
60
60
|
end
|
61
61
|
|
@@ -65,8 +65,8 @@ module SnapTrade
|
|
65
65
|
:'units',
|
66
66
|
:'price',
|
67
67
|
:'open_pnl',
|
68
|
-
:'
|
69
|
-
:'
|
68
|
+
:'average_purchase_price',
|
69
|
+
:'fractional_units'
|
70
70
|
])
|
71
71
|
end
|
72
72
|
|
@@ -101,13 +101,13 @@ module SnapTrade
|
|
101
101
|
self.open_pnl = attributes[:'open_pnl']
|
102
102
|
end
|
103
103
|
|
104
|
-
if attributes.key?(:'fractional_units')
|
105
|
-
self.fractional_units = attributes[:'fractional_units']
|
106
|
-
end
|
107
|
-
|
108
104
|
if attributes.key?(:'average_purchase_price')
|
109
105
|
self.average_purchase_price = attributes[:'average_purchase_price']
|
110
106
|
end
|
107
|
+
|
108
|
+
if attributes.key?(:'fractional_units')
|
109
|
+
self.fractional_units = attributes[:'fractional_units']
|
110
|
+
end
|
111
111
|
end
|
112
112
|
|
113
113
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -132,8 +132,8 @@ module SnapTrade
|
|
132
132
|
units == o.units &&
|
133
133
|
price == o.price &&
|
134
134
|
open_pnl == o.open_pnl &&
|
135
|
-
|
136
|
-
|
135
|
+
average_purchase_price == o.average_purchase_price &&
|
136
|
+
fractional_units == o.fractional_units
|
137
137
|
end
|
138
138
|
|
139
139
|
# @see the `==` method
|
@@ -145,7 +145,7 @@ module SnapTrade
|
|
145
145
|
# Calculates hash code according to all attributes.
|
146
146
|
# @return [Integer] Hash code
|
147
147
|
def hash
|
148
|
-
[symbol, units, price, open_pnl,
|
148
|
+
[symbol, units, price, open_pnl, average_purchase_price, fractional_units].hash
|
149
149
|
end
|
150
150
|
|
151
151
|
# Builds the object from hash
|
@@ -13,14 +13,14 @@ require 'time'
|
|
13
13
|
module SnapTrade
|
14
14
|
# Uniquely describes a security for the position within an account. The distinction between this and the `symbol` child property is that this object is specific to a position within an account, while the `symbol` child property is universal across all brokerage accounts. The caller should rely on the `symbol` child property for most use cases.
|
15
15
|
class PositionSymbol
|
16
|
+
attr_accessor :symbol
|
17
|
+
|
16
18
|
# A unique ID for the security within SnapTrade, scoped to the brokerage account that the security belongs to. This is a legacy field and should not be used. Do not rely on this being a stable ID as it can change.
|
17
19
|
attr_accessor :id
|
18
20
|
|
19
21
|
# This field is deprecated and the caller should use the `symbol` child property's `description` instead.
|
20
22
|
attr_accessor :description
|
21
23
|
|
22
|
-
attr_accessor :symbol
|
23
|
-
|
24
24
|
# This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
|
25
25
|
attr_accessor :local_id
|
26
26
|
|
@@ -33,9 +33,9 @@ module SnapTrade
|
|
33
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
34
34
|
def self.attribute_map
|
35
35
|
{
|
36
|
+
:'symbol' => :'symbol',
|
36
37
|
:'id' => :'id',
|
37
38
|
:'description' => :'description',
|
38
|
-
:'symbol' => :'symbol',
|
39
39
|
:'local_id' => :'local_id',
|
40
40
|
:'is_quotable' => :'is_quotable',
|
41
41
|
:'is_tradable' => :'is_tradable'
|
@@ -50,9 +50,9 @@ module SnapTrade
|
|
50
50
|
# Attribute type mapping.
|
51
51
|
def self.openapi_types
|
52
52
|
{
|
53
|
+
:'symbol' => :'UniversalSymbol',
|
53
54
|
:'id' => :'String',
|
54
55
|
:'description' => :'String',
|
55
|
-
:'symbol' => :'UniversalSymbol',
|
56
56
|
:'local_id' => :'String',
|
57
57
|
:'is_quotable' => :'Boolean',
|
58
58
|
:'is_tradable' => :'Boolean'
|
@@ -81,6 +81,10 @@ module SnapTrade
|
|
81
81
|
h[k.to_sym] = v
|
82
82
|
}
|
83
83
|
|
84
|
+
if attributes.key?(:'symbol')
|
85
|
+
self.symbol = attributes[:'symbol']
|
86
|
+
end
|
87
|
+
|
84
88
|
if attributes.key?(:'id')
|
85
89
|
self.id = attributes[:'id']
|
86
90
|
end
|
@@ -89,10 +93,6 @@ module SnapTrade
|
|
89
93
|
self.description = attributes[:'description']
|
90
94
|
end
|
91
95
|
|
92
|
-
if attributes.key?(:'symbol')
|
93
|
-
self.symbol = attributes[:'symbol']
|
94
|
-
end
|
95
|
-
|
96
96
|
if attributes.key?(:'local_id')
|
97
97
|
self.local_id = attributes[:'local_id']
|
98
98
|
end
|
@@ -124,9 +124,9 @@ module SnapTrade
|
|
124
124
|
def ==(o)
|
125
125
|
return true if self.equal?(o)
|
126
126
|
self.class == o.class &&
|
127
|
+
symbol == o.symbol &&
|
127
128
|
id == o.id &&
|
128
129
|
description == o.description &&
|
129
|
-
symbol == o.symbol &&
|
130
130
|
local_id == o.local_id &&
|
131
131
|
is_quotable == o.is_quotable &&
|
132
132
|
is_tradable == o.is_tradable
|
@@ -141,7 +141,7 @@ module SnapTrade
|
|
141
141
|
# Calculates hash code according to all attributes.
|
142
142
|
# @return [Integer] Hash code
|
143
143
|
def hash
|
144
|
-
[id, description,
|
144
|
+
[symbol, id, description, local_id, is_quotable, is_tradable].hash
|
145
145
|
end
|
146
146
|
|
147
147
|
# Builds the object from hash
|
@@ -25,7 +25,7 @@ module SnapTrade
|
|
25
25
|
# The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See the [guide on fixing broken connections](/docs/fix-broken-connections) for more information.
|
26
26
|
attr_accessor :reconnect
|
27
27
|
|
28
|
-
# Sets whether the connection should be read-only or trade-enabled.
|
28
|
+
# Sets whether the connection should be read-only or trade-enabled. Defaults to read-only if not specified.
|
29
29
|
attr_accessor :connection_type
|
30
30
|
|
31
31
|
# Sets the version of the connection portal to render.
|
@@ -31,14 +31,14 @@ module SnapTrade
|
|
31
31
|
|
32
32
|
attr_accessor :type
|
33
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.
|
35
|
-
attr_accessor :currencies
|
36
|
-
|
37
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.
|
38
35
|
attr_accessor :figi_code
|
39
36
|
|
40
37
|
attr_accessor :figi_instrument
|
41
38
|
|
39
|
+
# This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
|
40
|
+
attr_accessor :currencies
|
41
|
+
|
42
42
|
# Attribute mapping from ruby-style variable name to JSON key.
|
43
43
|
def self.attribute_map
|
44
44
|
{
|
@@ -49,9 +49,9 @@ module SnapTrade
|
|
49
49
|
:'currency' => :'currency',
|
50
50
|
:'exchange' => :'exchange',
|
51
51
|
:'type' => :'type',
|
52
|
-
:'currencies' => :'currencies',
|
53
52
|
:'figi_code' => :'figi_code',
|
54
|
-
:'figi_instrument' => :'figi_instrument'
|
53
|
+
:'figi_instrument' => :'figi_instrument',
|
54
|
+
:'currencies' => :'currencies'
|
55
55
|
}
|
56
56
|
end
|
57
57
|
|
@@ -70,9 +70,9 @@ module SnapTrade
|
|
70
70
|
:'currency' => :'SymbolCurrency',
|
71
71
|
:'exchange' => :'UnderlyingSymbolExchange',
|
72
72
|
:'type' => :'UnderlyingSymbolType',
|
73
|
-
:'currencies' => :'Array<Currency>',
|
74
73
|
:'figi_code' => :'String',
|
75
|
-
:'figi_instrument' => :'SymbolFigiInstrument'
|
74
|
+
:'figi_instrument' => :'SymbolFigiInstrument',
|
75
|
+
:'currencies' => :'Array<Currency>'
|
76
76
|
}
|
77
77
|
end
|
78
78
|
|
@@ -81,7 +81,7 @@ module SnapTrade
|
|
81
81
|
Set.new([
|
82
82
|
:'description',
|
83
83
|
:'figi_code',
|
84
|
-
:'figi_instrument'
|
84
|
+
:'figi_instrument',
|
85
85
|
])
|
86
86
|
end
|
87
87
|
|
@@ -128,12 +128,6 @@ module SnapTrade
|
|
128
128
|
self.type = attributes[:'type']
|
129
129
|
end
|
130
130
|
|
131
|
-
if attributes.key?(:'currencies')
|
132
|
-
if (value = attributes[:'currencies']).is_a?(Array)
|
133
|
-
self.currencies = value
|
134
|
-
end
|
135
|
-
end
|
136
|
-
|
137
131
|
if attributes.key?(:'figi_code')
|
138
132
|
self.figi_code = attributes[:'figi_code']
|
139
133
|
end
|
@@ -141,6 +135,12 @@ module SnapTrade
|
|
141
135
|
if attributes.key?(:'figi_instrument')
|
142
136
|
self.figi_instrument = attributes[:'figi_instrument']
|
143
137
|
end
|
138
|
+
|
139
|
+
if attributes.key?(:'currencies')
|
140
|
+
if (value = attributes[:'currencies']).is_a?(Array)
|
141
|
+
self.currencies = value
|
142
|
+
end
|
143
|
+
end
|
144
144
|
end
|
145
145
|
|
146
146
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -168,9 +168,9 @@ module SnapTrade
|
|
168
168
|
currency == o.currency &&
|
169
169
|
exchange == o.exchange &&
|
170
170
|
type == o.type &&
|
171
|
-
currencies == o.currencies &&
|
172
171
|
figi_code == o.figi_code &&
|
173
|
-
figi_instrument == o.figi_instrument
|
172
|
+
figi_instrument == o.figi_instrument &&
|
173
|
+
currencies == o.currencies
|
174
174
|
end
|
175
175
|
|
176
176
|
# @see the `==` method
|
@@ -182,7 +182,7 @@ module SnapTrade
|
|
182
182
|
# Calculates hash code according to all attributes.
|
183
183
|
# @return [Integer] Hash code
|
184
184
|
def hash
|
185
|
-
[id, symbol, raw_symbol, description, currency, exchange, type,
|
185
|
+
[id, symbol, raw_symbol, description, currency, exchange, type, figi_code, figi_instrument, currencies].hash
|
186
186
|
end
|
187
187
|
|
188
188
|
# Builds the object from hash
|
@@ -33,7 +33,7 @@ module SnapTrade
|
|
33
33
|
|
34
34
|
attr_accessor :currency
|
35
35
|
|
36
|
-
# A string representing the type of transaction. SnapTrade does a best effort to categorize the brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account.
|
36
|
+
# A string representing the type of transaction. SnapTrade does a best effort to categorize the brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. `option_symbol` contains the related option contract info. - `OPTIONASSIGNMENT` - Option assignment event. `option_symbol` contains the related option contract info. - `OPTIONEXERCISE` - Option exercise event. `option_symbol` contains the related option contract info.
|
37
37
|
attr_accessor :type
|
38
38
|
|
39
39
|
# If an option `BUY` or `SELL` transaction, this further specifies the type of action. The possible values are: - BUY_TO_OPEN - BUY_TO_CLOSE - SELL_TO_OPEN - SELL_TO_CLOSE
|
@@ -31,14 +31,14 @@ module SnapTrade
|
|
31
31
|
|
32
32
|
attr_accessor :type
|
33
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.
|
35
|
-
attr_accessor :currencies
|
36
|
-
|
37
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.
|
38
35
|
attr_accessor :figi_code
|
39
36
|
|
40
37
|
attr_accessor :figi_instrument
|
41
38
|
|
39
|
+
# This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
|
40
|
+
attr_accessor :currencies
|
41
|
+
|
42
42
|
# Attribute mapping from ruby-style variable name to JSON key.
|
43
43
|
def self.attribute_map
|
44
44
|
{
|
@@ -49,9 +49,9 @@ module SnapTrade
|
|
49
49
|
:'currency' => :'currency',
|
50
50
|
:'exchange' => :'exchange',
|
51
51
|
:'type' => :'type',
|
52
|
-
:'currencies' => :'currencies',
|
53
52
|
:'figi_code' => :'figi_code',
|
54
|
-
:'figi_instrument' => :'figi_instrument'
|
53
|
+
:'figi_instrument' => :'figi_instrument',
|
54
|
+
:'currencies' => :'currencies'
|
55
55
|
}
|
56
56
|
end
|
57
57
|
|
@@ -70,9 +70,9 @@ module SnapTrade
|
|
70
70
|
:'currency' => :'SymbolCurrency',
|
71
71
|
:'exchange' => :'SymbolExchange',
|
72
72
|
:'type' => :'SecurityType',
|
73
|
-
:'currencies' => :'Array<Currency>',
|
74
73
|
:'figi_code' => :'String',
|
75
|
-
:'figi_instrument' => :'SymbolFigiInstrument'
|
74
|
+
:'figi_instrument' => :'SymbolFigiInstrument',
|
75
|
+
:'currencies' => :'Array<Currency>'
|
76
76
|
}
|
77
77
|
end
|
78
78
|
|
@@ -81,7 +81,7 @@ module SnapTrade
|
|
81
81
|
Set.new([
|
82
82
|
:'description',
|
83
83
|
:'figi_code',
|
84
|
-
:'figi_instrument'
|
84
|
+
:'figi_instrument',
|
85
85
|
])
|
86
86
|
end
|
87
87
|
|
@@ -128,12 +128,6 @@ module SnapTrade
|
|
128
128
|
self.type = attributes[:'type']
|
129
129
|
end
|
130
130
|
|
131
|
-
if attributes.key?(:'currencies')
|
132
|
-
if (value = attributes[:'currencies']).is_a?(Array)
|
133
|
-
self.currencies = value
|
134
|
-
end
|
135
|
-
end
|
136
|
-
|
137
131
|
if attributes.key?(:'figi_code')
|
138
132
|
self.figi_code = attributes[:'figi_code']
|
139
133
|
end
|
@@ -141,6 +135,12 @@ module SnapTrade
|
|
141
135
|
if attributes.key?(:'figi_instrument')
|
142
136
|
self.figi_instrument = attributes[:'figi_instrument']
|
143
137
|
end
|
138
|
+
|
139
|
+
if attributes.key?(:'currencies')
|
140
|
+
if (value = attributes[:'currencies']).is_a?(Array)
|
141
|
+
self.currencies = value
|
142
|
+
end
|
143
|
+
end
|
144
144
|
end
|
145
145
|
|
146
146
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -198,9 +198,9 @@ module SnapTrade
|
|
198
198
|
currency == o.currency &&
|
199
199
|
exchange == o.exchange &&
|
200
200
|
type == o.type &&
|
201
|
-
currencies == o.currencies &&
|
202
201
|
figi_code == o.figi_code &&
|
203
|
-
figi_instrument == o.figi_instrument
|
202
|
+
figi_instrument == o.figi_instrument &&
|
203
|
+
currencies == o.currencies
|
204
204
|
end
|
205
205
|
|
206
206
|
# @see the `==` method
|
@@ -212,7 +212,7 @@ module SnapTrade
|
|
212
212
|
# Calculates hash code according to all attributes.
|
213
213
|
# @return [Integer] Hash code
|
214
214
|
def hash
|
215
|
-
[id, symbol, raw_symbol, description, currency, exchange, type,
|
215
|
+
[id, symbol, raw_symbol, description, currency, exchange, type, figi_code, figi_instrument, currencies].hash
|
216
216
|
end
|
217
217
|
|
218
218
|
# Builds the object from hash
|
data/lib/snaptrade/version.rb
CHANGED
@@ -37,7 +37,7 @@ describe 'TransactionsAndReportingApi' do
|
|
37
37
|
# @option opts [Date] :end_date The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
|
38
38
|
# @option opts [String] :accounts Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The `brokerageAuthorizations` parameter takes precedence over this parameter.
|
39
39
|
# @option opts [String] :brokerage_authorizations Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the `accounts` parameter.
|
40
|
-
# @option opts [String] :type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account.
|
40
|
+
# @option opts [String] :type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event.
|
41
41
|
# @return [Array<UniversalActivity>]
|
42
42
|
describe 'get_activities test' do
|
43
43
|
it 'should work' do
|
@@ -32,12 +32,6 @@ describe SnapTrade::AccountOrderRecord do
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
describe 'test attribute "symbol"' do
|
36
|
-
it 'should work' do
|
37
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
35
|
describe 'test attribute "universal_symbol"' do
|
42
36
|
it 'should work' do
|
43
37
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -134,4 +128,10 @@ describe SnapTrade::AccountOrderRecord do
|
|
134
128
|
end
|
135
129
|
end
|
136
130
|
|
131
|
+
describe 'test attribute "symbol"' do
|
132
|
+
it 'should work' do
|
133
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
137
|
end
|