snaptrade 2.0.185 → 2.0.187

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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +52 -2
  4. data/lib/snaptrade/api/experimental_endpoints_api.rb +141 -0
  5. data/lib/snaptrade/models/account_order_record.rb +23 -1
  6. data/lib/snaptrade/models/account_order_record_option_symbol.rb +1 -1
  7. data/lib/snaptrade/models/account_order_record_quote_universal_symbol.rb +1 -1
  8. data/lib/snaptrade/models/account_order_record_universal_symbol.rb +1 -1
  9. data/lib/snaptrade/models/account_order_record_v2.rb +57 -1
  10. data/lib/snaptrade/models/account_position.rb +288 -0
  11. data/lib/snaptrade/models/account_universal_activity_option_symbol.rb +1 -1
  12. data/lib/snaptrade/models/account_universal_activity_symbol.rb +1 -1
  13. data/lib/snaptrade/models/all_account_positions_response.rb +262 -0
  14. data/lib/snaptrade/models/complex_order_leg.rb +1 -1
  15. data/lib/snaptrade/models/complex_order_leg_order_role.rb +38 -0
  16. data/lib/snaptrade/models/crypto_instrument.rb +311 -0
  17. data/lib/snaptrade/models/crypto_instrument_kind.rb +36 -0
  18. data/lib/snaptrade/models/etf_instrument.rb +311 -0
  19. data/lib/snaptrade/models/etf_instrument_kind.rb +36 -0
  20. data/lib/snaptrade/models/future_instrument.rb +326 -0
  21. data/lib/snaptrade/models/future_instrument_kind.rb +36 -0
  22. data/lib/snaptrade/models/instrument.rb +61 -0
  23. data/lib/snaptrade/models/kind.rb +36 -0
  24. data/lib/snaptrade/models/option_instrument.rb +322 -0
  25. data/lib/snaptrade/models/option_instrument_kind.rb +36 -0
  26. data/lib/snaptrade/models/options_symbol.rb +1 -1
  27. data/lib/snaptrade/models/options_symbol_option_type.rb +37 -0
  28. data/lib/snaptrade/models/order_updated_response_order.rb +23 -1
  29. data/lib/snaptrade/models/other_instrument.rb +311 -0
  30. data/lib/snaptrade/models/other_instrument_kind.rb +36 -0
  31. data/lib/snaptrade/models/stock_instrument.rb +311 -0
  32. data/lib/snaptrade/models/{symbol_figi_instrument.rb → stock_instrument_figi_instrument.rb} +3 -3
  33. data/lib/snaptrade/models/symbol.rb +1 -1
  34. data/lib/snaptrade/models/underlying_option_instrument.rb +57 -0
  35. data/lib/snaptrade/models/underlying_symbol.rb +1 -1
  36. data/lib/snaptrade/models/universal_symbol.rb +1 -1
  37. data/lib/snaptrade/version.rb +1 -1
  38. data/lib/snaptrade.rb +19 -1
  39. data/spec/api/experimental_endpoints_api_spec.rb +16 -0
  40. data/spec/models/account_order_record_spec.rb +12 -0
  41. data/spec/models/account_order_record_v2_spec.rb +16 -0
  42. data/spec/models/account_position_spec.rb +65 -0
  43. data/spec/models/all_account_positions_response_spec.rb +47 -0
  44. data/spec/models/complex_order_leg_order_role_spec.rb +23 -0
  45. data/spec/models/crypto_instrument_kind_spec.rb +23 -0
  46. data/spec/models/crypto_instrument_spec.rb +71 -0
  47. data/spec/models/etf_instrument_kind_spec.rb +23 -0
  48. data/spec/models/etf_instrument_spec.rb +71 -0
  49. data/spec/models/future_instrument_kind_spec.rb +23 -0
  50. data/spec/models/future_instrument_spec.rb +77 -0
  51. data/spec/models/instrument_spec.rb +38 -0
  52. data/spec/models/kind_spec.rb +23 -0
  53. data/spec/models/option_instrument_kind_spec.rb +23 -0
  54. data/spec/models/option_instrument_spec.rb +71 -0
  55. data/spec/models/options_symbol_option_type_spec.rb +23 -0
  56. data/spec/models/order_updated_response_order_spec.rb +12 -0
  57. data/spec/models/other_instrument_kind_spec.rb +23 -0
  58. data/spec/models/other_instrument_spec.rb +71 -0
  59. data/spec/models/{symbol_figi_instrument_spec.rb → stock_instrument_figi_instrument_spec.rb} +6 -6
  60. data/spec/models/stock_instrument_spec.rb +71 -0
  61. data/spec/models/underlying_option_instrument_spec.rb +38 -0
  62. metadata +222 -168
@@ -0,0 +1,288 @@
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
+ # Describes a single position.
15
+ class AccountPosition
16
+ attr_accessor :instrument
17
+
18
+ # The number of units held in the position. Positive numbers indicate long positions and negative numbers indicate short positions.
19
+ attr_accessor :units
20
+
21
+ # Last known market price for the position.
22
+ attr_accessor :price
23
+
24
+ # Book price or average purchase price for the position.
25
+ attr_accessor :cost_basis
26
+
27
+ # ISO-4217 currency code for the position `price` and `cost_basis`.
28
+ attr_accessor :currency
29
+
30
+ # Present for stock positions that are also counted in cash balance or buying power.
31
+ attr_accessor :cash_equivalent
32
+
33
+ # Present for stock positions when tax lot data is enabled for the account.
34
+ attr_accessor :tax_lots
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'instrument' => :'instrument',
40
+ :'units' => :'units',
41
+ :'price' => :'price',
42
+ :'cost_basis' => :'cost_basis',
43
+ :'currency' => :'currency',
44
+ :'cash_equivalent' => :'cash_equivalent',
45
+ :'tax_lots' => :'tax_lots'
46
+ }
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'instrument' => :'Instrument',
58
+ :'units' => :'Float',
59
+ :'price' => :'Float',
60
+ :'cost_basis' => :'Float',
61
+ :'currency' => :'String',
62
+ :'cash_equivalent' => :'Boolean',
63
+ :'tax_lots' => :'Array<TaxLot>'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ :'units',
71
+ :'price',
72
+ :'cost_basis',
73
+ :'currency',
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::AccountPosition` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::AccountPosition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'instrument')
93
+ self.instrument = attributes[:'instrument']
94
+ end
95
+
96
+ if attributes.key?(:'units')
97
+ self.units = attributes[:'units']
98
+ end
99
+
100
+ if attributes.key?(:'price')
101
+ self.price = attributes[:'price']
102
+ end
103
+
104
+ if attributes.key?(:'cost_basis')
105
+ self.cost_basis = attributes[:'cost_basis']
106
+ end
107
+
108
+ if attributes.key?(:'currency')
109
+ self.currency = attributes[:'currency']
110
+ end
111
+
112
+ if attributes.key?(:'cash_equivalent')
113
+ self.cash_equivalent = attributes[:'cash_equivalent']
114
+ end
115
+
116
+ if attributes.key?(:'tax_lots')
117
+ if (value = attributes[:'tax_lots']).is_a?(Array)
118
+ self.tax_lots = value
119
+ end
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ invalid_properties = Array.new
127
+ if @instrument.nil?
128
+ invalid_properties.push('invalid value for "instrument", instrument cannot be nil.')
129
+ end
130
+
131
+ invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ return false if @instrument.nil?
138
+ true
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param [Object] Object to be compared
143
+ def ==(o)
144
+ return true if self.equal?(o)
145
+ self.class == o.class &&
146
+ instrument == o.instrument &&
147
+ units == o.units &&
148
+ price == o.price &&
149
+ cost_basis == o.cost_basis &&
150
+ currency == o.currency &&
151
+ cash_equivalent == o.cash_equivalent &&
152
+ tax_lots == o.tax_lots
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(o)
158
+ self == o
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Integer] Hash code
163
+ def hash
164
+ [instrument, units, price, cost_basis, currency, cash_equivalent, tax_lots].hash
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def self.build_from_hash(attributes)
171
+ new.build_from_hash(attributes)
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ attributes = attributes.transform_keys(&:to_sym)
180
+ self.class.openapi_types.each_pair do |key, type|
181
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
182
+ self.send("#{key}=", nil)
183
+ elsif type =~ /\AArray<(.*)>/i
184
+ # check to ensure the input is an array given that the attribute
185
+ # is documented as an array but the input is not
186
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
187
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
188
+ end
189
+ elsif !attributes[self.class.attribute_map[key]].nil?
190
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
191
+ end
192
+ end
193
+
194
+ self
195
+ end
196
+
197
+ # Deserializes the data based on type
198
+ # @param string type Data type
199
+ # @param string value Value to be deserialized
200
+ # @return [Object] Deserialized data
201
+ def _deserialize(type, value)
202
+ case type.to_sym
203
+ when :Time
204
+ Time.parse(value)
205
+ when :Date
206
+ Date.parse(value)
207
+ when :String
208
+ value.to_s
209
+ when :Integer
210
+ value.to_i
211
+ when :Float
212
+ value.to_f
213
+ when :Boolean
214
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
215
+ true
216
+ else
217
+ false
218
+ end
219
+ when :Object
220
+ # generic object (usually a Hash), return directly
221
+ value
222
+ when /\AArray<(?<inner_type>.+)>\z/
223
+ inner_type = Regexp.last_match[:inner_type]
224
+ value.map { |v| _deserialize(inner_type, v) }
225
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
226
+ k_type = Regexp.last_match[:k_type]
227
+ v_type = Regexp.last_match[:v_type]
228
+ {}.tap do |hash|
229
+ value.each do |k, v|
230
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
231
+ end
232
+ end
233
+ else # model
234
+ # models (e.g. Pet) or oneOf
235
+ klass = SnapTrade.const_get(type)
236
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
237
+ end
238
+ end
239
+
240
+ # Returns the string representation of the object
241
+ # @return [String] String presentation of the object
242
+ def to_s
243
+ to_hash.to_s
244
+ end
245
+
246
+ # to_body is an alias to to_hash (backward compatibility)
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_body
249
+ to_hash
250
+ end
251
+
252
+ # Returns the object in the form of hash
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_hash
255
+ hash = {}
256
+ self.class.attribute_map.each_pair do |attr, param|
257
+ value = self.send(attr)
258
+ if value.nil?
259
+ is_nullable = self.class.openapi_nullable.include?(attr)
260
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
261
+ end
262
+
263
+ hash[param] = _to_hash(value)
264
+ end
265
+ hash
266
+ end
267
+
268
+ # Outputs non-array value in the form of hash
269
+ # For object, use to_hash. Otherwise, just return the value
270
+ # @param [Object] value Any valid value
271
+ # @return [Hash] Returns the value in the form of hash
272
+ def _to_hash(value)
273
+ if value.is_a?(Array)
274
+ value.compact.map { |v| _to_hash(v) }
275
+ elsif value.is_a?(Hash)
276
+ {}.tap do |hash|
277
+ value.each { |k, v| hash[k] = _to_hash(v) }
278
+ end
279
+ elsif value.respond_to? :to_hash
280
+ value.to_hash
281
+ else
282
+ value
283
+ end
284
+ end
285
+
286
+ end
287
+
288
+ end
@@ -56,7 +56,7 @@ module SnapTrade
56
56
  {
57
57
  :'id' => :'String',
58
58
  :'ticker' => :'String',
59
- :'option_type' => :'OptionType',
59
+ :'option_type' => :'OptionsSymbolOptionType',
60
60
  :'strike_price' => :'Float',
61
61
  :'expiration_date' => :'Date',
62
62
  :'is_mini_option' => :'Boolean',
@@ -67,7 +67,7 @@ module SnapTrade
67
67
  :'exchange' => :'SymbolExchange',
68
68
  :'type' => :'SecurityType',
69
69
  :'figi_code' => :'String',
70
- :'figi_instrument' => :'SymbolFigiInstrument'
70
+ :'figi_instrument' => :'StockInstrumentFigiInstrument'
71
71
  }
72
72
  end
73
73
 
@@ -0,0 +1,262 @@
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
+ # A paginated list of all account positions.
15
+ class AllAccountPositionsResponse
16
+ # The total number of positions available across all pages.
17
+ attr_accessor :count
18
+
19
+ # The URL for the next page of results, or `null` if there is no next page.
20
+ attr_accessor :_next
21
+
22
+ # The URL for the previous page of results, or `null` if there is no previous page.
23
+ attr_accessor :previous
24
+
25
+ # Positions returned for the current page.
26
+ attr_accessor :results
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'count' => :'count',
32
+ :'_next' => :'next',
33
+ :'previous' => :'previous',
34
+ :'results' => :'results'
35
+ }
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'count' => :'Integer',
47
+ :'_next' => :'String',
48
+ :'previous' => :'String',
49
+ :'results' => :'Array<AccountPosition>'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ :'_next',
57
+ :'previous',
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::AllAccountPositionsResponse` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::AllAccountPositionsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'count')
77
+ self.count = attributes[:'count']
78
+ end
79
+
80
+ if attributes.key?(:'_next')
81
+ self._next = attributes[:'_next']
82
+ end
83
+
84
+ if attributes.key?(:'previous')
85
+ self.previous = attributes[:'previous']
86
+ end
87
+
88
+ if attributes.key?(:'results')
89
+ if (value = attributes[:'results']).is_a?(Array)
90
+ self.results = value
91
+ end
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ if @count.nil?
100
+ invalid_properties.push('invalid value for "count", count cannot be nil.')
101
+ end
102
+
103
+ if @results.nil?
104
+ invalid_properties.push('invalid value for "results", results cannot be nil.')
105
+ end
106
+
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ return false if @count.nil?
114
+ return false if @results.nil?
115
+ true
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ count == o.count &&
124
+ _next == o._next &&
125
+ previous == o.previous &&
126
+ results == o.results
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ def hash
138
+ [count, _next, previous, results].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def self.build_from_hash(attributes)
145
+ new.build_from_hash(attributes)
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def build_from_hash(attributes)
152
+ return nil unless attributes.is_a?(Hash)
153
+ attributes = attributes.transform_keys(&:to_sym)
154
+ self.class.openapi_types.each_pair do |key, type|
155
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
156
+ self.send("#{key}=", nil)
157
+ elsif type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
161
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
162
+ end
163
+ elsif !attributes[self.class.attribute_map[key]].nil?
164
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
165
+ end
166
+ end
167
+
168
+ self
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def _deserialize(type, value)
176
+ case type.to_sym
177
+ when :Time
178
+ Time.parse(value)
179
+ when :Date
180
+ Date.parse(value)
181
+ when :String
182
+ value.to_s
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :Boolean
188
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
+ true
190
+ else
191
+ false
192
+ end
193
+ when :Object
194
+ # generic object (usually a Hash), return directly
195
+ value
196
+ when /\AArray<(?<inner_type>.+)>\z/
197
+ inner_type = Regexp.last_match[:inner_type]
198
+ value.map { |v| _deserialize(inner_type, v) }
199
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
+ k_type = Regexp.last_match[:k_type]
201
+ v_type = Regexp.last_match[:v_type]
202
+ {}.tap do |hash|
203
+ value.each do |k, v|
204
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
+ end
206
+ end
207
+ else # model
208
+ # models (e.g. Pet) or oneOf
209
+ klass = SnapTrade.const_get(type)
210
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ if value.nil?
233
+ is_nullable = self.class.openapi_nullable.include?(attr)
234
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
235
+ end
236
+
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ # Outputs non-array value in the form of hash
243
+ # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
246
+ def _to_hash(value)
247
+ if value.is_a?(Array)
248
+ value.compact.map { |v| _to_hash(v) }
249
+ elsif value.is_a?(Hash)
250
+ {}.tap do |hash|
251
+ value.each { |k, v| hash[k] = _to_hash(v) }
252
+ end
253
+ elsif value.respond_to? :to_hash
254
+ value.to_hash
255
+ else
256
+ value
257
+ end
258
+ end
259
+
260
+ end
261
+
262
+ end
@@ -58,7 +58,7 @@ module SnapTrade
58
58
  # Attribute type mapping.
59
59
  def self.openapi_types
60
60
  {
61
- :'order_role' => :'OrderRole',
61
+ :'order_role' => :'ComplexOrderLegOrderRole',
62
62
  :'action' => :'ActionStrict',
63
63
  :'instrument' => :'TradingInstrument',
64
64
  :'order_type' => :'OrderTypeStrict',
@@ -0,0 +1,38 @@
1
+ =begin
2
+ #SnapTrade
3
+
4
+ #Connect brokerage accounts to your app for live positions and trading
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: api@snaptrade.com
8
+ =end
9
+
10
+ require 'date'
11
+ require 'time'
12
+
13
+ module SnapTrade
14
+ class ComplexOrderLegOrderRole
15
+ TRIGGER = "TRIGGER".freeze
16
+ CONDITIONAL = "CONDITIONAL".freeze
17
+ PEER = "PEER".freeze
18
+
19
+ def self.all_vars
20
+ @all_vars ||= [TRIGGER, CONDITIONAL, PEER].freeze
21
+ end
22
+
23
+ # Builds the enum from string
24
+ # @param [String] The enum value in the form of the string
25
+ # @return [String] The enum value
26
+ def self.build_from_hash(value)
27
+ new.build_from_hash(value)
28
+ end
29
+
30
+ # Builds the enum from string
31
+ # @param [String] The enum value in the form of the string
32
+ # @return [String] The enum value
33
+ def build_from_hash(value)
34
+ return value if ComplexOrderLegOrderRole.all_vars.include?(value)
35
+ raise "Invalid ENUM value #{value} for class #ComplexOrderLegOrderRole"
36
+ end
37
+ end
38
+ end