snaptrade 2.0.183 → 2.0.185
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 +76 -2
- data/lib/snaptrade/api/trading_api.rb +142 -0
- data/lib/snaptrade/models/account.rb +12 -1
- data/lib/snaptrade/models/account_category.rb +38 -0
- data/lib/snaptrade/models/complex_order_leg.rb +319 -0
- data/lib/snaptrade/models/complex_order_response.rb +229 -0
- data/lib/snaptrade/models/complex_order_response_type.rb +38 -0
- data/lib/snaptrade/models/manual_trade_form_complex.rb +251 -0
- data/lib/snaptrade/models/manual_trade_form_complex_type.rb +38 -0
- data/lib/snaptrade/models/order_role.rb +38 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +7 -0
- data/spec/api/trading_api_spec.rb +15 -0
- data/spec/models/account_category_spec.rb +23 -0
- data/spec/models/account_spec.rb +6 -0
- data/spec/models/complex_order_leg_spec.rb +71 -0
- data/spec/models/complex_order_response_spec.rb +35 -0
- data/spec/models/complex_order_response_type_spec.rb +23 -0
- data/spec/models/manual_trade_form_complex_spec.rb +41 -0
- data/spec/models/manual_trade_form_complex_type_spec.rb +23 -0
- data/spec/models/order_role_spec.rb +23 -0
- metadata +23 -2
|
@@ -0,0 +1,251 @@
|
|
|
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
|
+
# Request body for placing a complex conditional order (OCO, OTO, or OTOCO).
|
|
15
|
+
class ManualTradeFormComplex
|
|
16
|
+
# The complex order type. - `OCO`: One Cancels the Other — two peer orders. - `OTO`: One Triggers the Other — a trigger order and a conditional order. - `OTOCO`: One Triggers a One Cancels the Other — a trigger order and two peer orders.
|
|
17
|
+
attr_accessor :type
|
|
18
|
+
|
|
19
|
+
# The orders that make up the complex order. Required counts and roles per type: - `OCO`: exactly 2 orders, both `PEER` - `OTO`: exactly 2 orders, one `TRIGGER` and one `CONDITIONAL` - `OTOCO`: exactly 3 orders, one `TRIGGER` and two `PEER`
|
|
20
|
+
attr_accessor :orders
|
|
21
|
+
|
|
22
|
+
# An optional client-provided identifier for this complex order. Passed through to the brokerage and returned in the response.
|
|
23
|
+
attr_accessor :client_order_id
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'type' => :'type',
|
|
29
|
+
:'orders' => :'orders',
|
|
30
|
+
:'client_order_id' => :'client_order_id'
|
|
31
|
+
}
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Returns all the JSON keys this model knows about
|
|
35
|
+
def self.acceptable_attributes
|
|
36
|
+
attribute_map.values
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Attribute type mapping.
|
|
40
|
+
def self.openapi_types
|
|
41
|
+
{
|
|
42
|
+
:'type' => :'ManualTradeFormComplexType',
|
|
43
|
+
:'orders' => :'Array<ComplexOrderLeg>',
|
|
44
|
+
:'client_order_id' => :'String'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
:'client_order_id'
|
|
52
|
+
])
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Initializes the object
|
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
57
|
+
def initialize(attributes = {})
|
|
58
|
+
if (!attributes.is_a?(Hash))
|
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::ManualTradeFormComplex` initialize method"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::ManualTradeFormComplex`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
66
|
+
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'type')
|
|
71
|
+
self.type = attributes[:'type']
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'orders')
|
|
75
|
+
if (value = attributes[:'orders']).is_a?(Array)
|
|
76
|
+
self.orders = value
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'client_order_id')
|
|
81
|
+
self.client_order_id = attributes[:'client_order_id']
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
86
|
+
# @return Array for valid properties with the reasons
|
|
87
|
+
def list_invalid_properties
|
|
88
|
+
invalid_properties = Array.new
|
|
89
|
+
if @type.nil?
|
|
90
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if @orders.nil?
|
|
94
|
+
invalid_properties.push('invalid value for "orders", orders cannot be nil.')
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
invalid_properties
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Check to see if the all the properties in the model are valid
|
|
101
|
+
# @return true if the model is valid
|
|
102
|
+
def valid?
|
|
103
|
+
return false if @type.nil?
|
|
104
|
+
return false if @orders.nil?
|
|
105
|
+
true
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Checks equality by comparing each attribute.
|
|
109
|
+
# @param [Object] Object to be compared
|
|
110
|
+
def ==(o)
|
|
111
|
+
return true if self.equal?(o)
|
|
112
|
+
self.class == o.class &&
|
|
113
|
+
type == o.type &&
|
|
114
|
+
orders == o.orders &&
|
|
115
|
+
client_order_id == o.client_order_id
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# @see the `==` method
|
|
119
|
+
# @param [Object] Object to be compared
|
|
120
|
+
def eql?(o)
|
|
121
|
+
self == o
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Calculates hash code according to all attributes.
|
|
125
|
+
# @return [Integer] Hash code
|
|
126
|
+
def hash
|
|
127
|
+
[type, orders, client_order_id].hash
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Builds the object from hash
|
|
131
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
132
|
+
# @return [Object] Returns the model itself
|
|
133
|
+
def self.build_from_hash(attributes)
|
|
134
|
+
new.build_from_hash(attributes)
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Builds the object from hash
|
|
138
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
139
|
+
# @return [Object] Returns the model itself
|
|
140
|
+
def build_from_hash(attributes)
|
|
141
|
+
return nil unless attributes.is_a?(Hash)
|
|
142
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
143
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
144
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
145
|
+
self.send("#{key}=", nil)
|
|
146
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
147
|
+
# check to ensure the input is an array given that the attribute
|
|
148
|
+
# is documented as an array but the input is not
|
|
149
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
150
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
151
|
+
end
|
|
152
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
153
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
self
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Deserializes the data based on type
|
|
161
|
+
# @param string type Data type
|
|
162
|
+
# @param string value Value to be deserialized
|
|
163
|
+
# @return [Object] Deserialized data
|
|
164
|
+
def _deserialize(type, value)
|
|
165
|
+
case type.to_sym
|
|
166
|
+
when :Time
|
|
167
|
+
Time.parse(value)
|
|
168
|
+
when :Date
|
|
169
|
+
Date.parse(value)
|
|
170
|
+
when :String
|
|
171
|
+
value.to_s
|
|
172
|
+
when :Integer
|
|
173
|
+
value.to_i
|
|
174
|
+
when :Float
|
|
175
|
+
value.to_f
|
|
176
|
+
when :Boolean
|
|
177
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
178
|
+
true
|
|
179
|
+
else
|
|
180
|
+
false
|
|
181
|
+
end
|
|
182
|
+
when :Object
|
|
183
|
+
# generic object (usually a Hash), return directly
|
|
184
|
+
value
|
|
185
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
186
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
187
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
188
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
189
|
+
k_type = Regexp.last_match[:k_type]
|
|
190
|
+
v_type = Regexp.last_match[:v_type]
|
|
191
|
+
{}.tap do |hash|
|
|
192
|
+
value.each do |k, v|
|
|
193
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
else # model
|
|
197
|
+
# models (e.g. Pet) or oneOf
|
|
198
|
+
klass = SnapTrade.const_get(type)
|
|
199
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Returns the string representation of the object
|
|
204
|
+
# @return [String] String presentation of the object
|
|
205
|
+
def to_s
|
|
206
|
+
to_hash.to_s
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
210
|
+
# @return [Hash] Returns the object in the form of hash
|
|
211
|
+
def to_body
|
|
212
|
+
to_hash
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Returns the object in the form of hash
|
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
|
217
|
+
def to_hash
|
|
218
|
+
hash = {}
|
|
219
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
220
|
+
value = self.send(attr)
|
|
221
|
+
if value.nil?
|
|
222
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
223
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
hash[param] = _to_hash(value)
|
|
227
|
+
end
|
|
228
|
+
hash
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Outputs non-array value in the form of hash
|
|
232
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
233
|
+
# @param [Object] value Any valid value
|
|
234
|
+
# @return [Hash] Returns the value in the form of hash
|
|
235
|
+
def _to_hash(value)
|
|
236
|
+
if value.is_a?(Array)
|
|
237
|
+
value.compact.map { |v| _to_hash(v) }
|
|
238
|
+
elsif value.is_a?(Hash)
|
|
239
|
+
{}.tap do |hash|
|
|
240
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
241
|
+
end
|
|
242
|
+
elsif value.respond_to? :to_hash
|
|
243
|
+
value.to_hash
|
|
244
|
+
else
|
|
245
|
+
value
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
end
|
|
@@ -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 ManualTradeFormComplexType
|
|
15
|
+
OCO = "OCO".freeze
|
|
16
|
+
OTO = "OTO".freeze
|
|
17
|
+
OTOCO = "OTOCO".freeze
|
|
18
|
+
|
|
19
|
+
def self.all_vars
|
|
20
|
+
@all_vars ||= [OCO, OTO, OTOCO].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 ManualTradeFormComplexType.all_vars.include?(value)
|
|
35
|
+
raise "Invalid ENUM value #{value} for class #ManualTradeFormComplexType"
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -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 OrderRole
|
|
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 OrderRole.all_vars.include?(value)
|
|
35
|
+
raise "Invalid ENUM value #{value} for class #OrderRole"
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
data/lib/snaptrade/version.rb
CHANGED
data/lib/snaptrade.rb
CHANGED
|
@@ -19,6 +19,7 @@ require 'snaptrade/configuration'
|
|
|
19
19
|
require 'snaptrade/models/account'
|
|
20
20
|
require 'snaptrade/models/account_balance'
|
|
21
21
|
require 'snaptrade/models/account_balance_total'
|
|
22
|
+
require 'snaptrade/models/account_category'
|
|
22
23
|
require 'snaptrade/models/account_holdings'
|
|
23
24
|
require 'snaptrade/models/account_holdings_account'
|
|
24
25
|
require 'snaptrade/models/account_information_get_user_account_order_detail_request'
|
|
@@ -64,6 +65,9 @@ require 'snaptrade/models/brokerage_type'
|
|
|
64
65
|
require 'snaptrade/models/cancel_order_response'
|
|
65
66
|
require 'snaptrade/models/cash_change_direction'
|
|
66
67
|
require 'snaptrade/models/child_brokerage_order_ids'
|
|
68
|
+
require 'snaptrade/models/complex_order_leg'
|
|
69
|
+
require 'snaptrade/models/complex_order_response'
|
|
70
|
+
require 'snaptrade/models/complex_order_response_type'
|
|
67
71
|
require 'snaptrade/models/connection_portal_version'
|
|
68
72
|
require 'snaptrade/models/connection_type'
|
|
69
73
|
require 'snaptrade/models/connections_session_events200_response_inner'
|
|
@@ -92,6 +96,8 @@ require 'snaptrade/models/manual_trade_and_impact'
|
|
|
92
96
|
require 'snaptrade/models/manual_trade_balance'
|
|
93
97
|
require 'snaptrade/models/manual_trade_form'
|
|
94
98
|
require 'snaptrade/models/manual_trade_form_bracket'
|
|
99
|
+
require 'snaptrade/models/manual_trade_form_complex'
|
|
100
|
+
require 'snaptrade/models/manual_trade_form_complex_type'
|
|
95
101
|
require 'snaptrade/models/manual_trade_form_notional_value'
|
|
96
102
|
require 'snaptrade/models/manual_trade_form_with_options'
|
|
97
103
|
require 'snaptrade/models/manual_trade_impact'
|
|
@@ -133,6 +139,7 @@ require 'snaptrade/models/option_type'
|
|
|
133
139
|
require 'snaptrade/models/options_position'
|
|
134
140
|
require 'snaptrade/models/options_position_currency'
|
|
135
141
|
require 'snaptrade/models/options_symbol'
|
|
142
|
+
require 'snaptrade/models/order_role'
|
|
136
143
|
require 'snaptrade/models/order_type_strict'
|
|
137
144
|
require 'snaptrade/models/order_updated_response'
|
|
138
145
|
require 'snaptrade/models/order_updated_response_order'
|
|
@@ -147,6 +147,21 @@ describe 'TradingApi' do
|
|
|
147
147
|
end
|
|
148
148
|
end
|
|
149
149
|
|
|
150
|
+
# unit tests for place_complex_order
|
|
151
|
+
# Place complex order
|
|
152
|
+
# Places a complex conditional order (OCO, OTO, or OTOCO). Disabled by default — contact support to enable. Only supported on certain brokerages. - **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.
|
|
153
|
+
# @param account_id The ID of the account to execute the trade on.
|
|
154
|
+
# @param user_id
|
|
155
|
+
# @param user_secret
|
|
156
|
+
# @param manual_trade_form_complex
|
|
157
|
+
# @param [Hash] opts the optional parameters
|
|
158
|
+
# @return [ComplexOrderResponse]
|
|
159
|
+
describe 'place_complex_order test' do
|
|
160
|
+
it 'should work' do
|
|
161
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
150
165
|
# unit tests for place_crypto_order
|
|
151
166
|
# Place crypto order
|
|
152
167
|
# Places an order in the specified account. This endpoint does not compute the impact to the account balance from the order before submitting the order.
|
|
@@ -0,0 +1,23 @@
|
|
|
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 'spec_helper'
|
|
11
|
+
require 'json'
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
# Unit tests for SnapTrade::AccountCategory
|
|
15
|
+
describe SnapTrade::AccountCategory do
|
|
16
|
+
let(:instance) { SnapTrade::AccountCategory.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of AccountCategory' do
|
|
19
|
+
it 'should create an instance of AccountCategory' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::AccountCategory)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
data/spec/models/account_spec.rb
CHANGED
|
@@ -98,6 +98,12 @@ describe SnapTrade::Account do
|
|
|
98
98
|
end
|
|
99
99
|
end
|
|
100
100
|
|
|
101
|
+
describe 'test attribute "account_category"' do
|
|
102
|
+
it 'should work' do
|
|
103
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
101
107
|
describe 'test attribute "meta"' do
|
|
102
108
|
it 'should work' do
|
|
103
109
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
@@ -0,0 +1,71 @@
|
|
|
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 'spec_helper'
|
|
11
|
+
require 'json'
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
# Unit tests for SnapTrade::ComplexOrderLeg
|
|
15
|
+
describe SnapTrade::ComplexOrderLeg do
|
|
16
|
+
let(:instance) { SnapTrade::ComplexOrderLeg.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of ComplexOrderLeg' do
|
|
19
|
+
it 'should create an instance of ComplexOrderLeg' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::ComplexOrderLeg)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
describe 'test attribute "order_role"' do
|
|
24
|
+
it 'should work' do
|
|
25
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test attribute "action"' do
|
|
30
|
+
it 'should work' do
|
|
31
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
describe 'test attribute "instrument"' 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
|
+
describe 'test attribute "order_type"' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
describe 'test attribute "units"' do
|
|
48
|
+
it 'should work' do
|
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
describe 'test attribute "time_in_force"' do
|
|
54
|
+
it 'should work' do
|
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
describe 'test attribute "price"' do
|
|
60
|
+
it 'should work' do
|
|
61
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
describe 'test attribute "stop"' do
|
|
66
|
+
it 'should work' do
|
|
67
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
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 'spec_helper'
|
|
11
|
+
require 'json'
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
# Unit tests for SnapTrade::ComplexOrderResponse
|
|
15
|
+
describe SnapTrade::ComplexOrderResponse do
|
|
16
|
+
let(:instance) { SnapTrade::ComplexOrderResponse.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of ComplexOrderResponse' do
|
|
19
|
+
it 'should create an instance of ComplexOrderResponse' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::ComplexOrderResponse)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
describe 'test attribute "type"' do
|
|
24
|
+
it 'should work' do
|
|
25
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test attribute "brokerage_group_order_id"' do
|
|
30
|
+
it 'should work' do
|
|
31
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
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 'spec_helper'
|
|
11
|
+
require 'json'
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
# Unit tests for SnapTrade::ComplexOrderResponseType
|
|
15
|
+
describe SnapTrade::ComplexOrderResponseType do
|
|
16
|
+
let(:instance) { SnapTrade::ComplexOrderResponseType.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of ComplexOrderResponseType' do
|
|
19
|
+
it 'should create an instance of ComplexOrderResponseType' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::ComplexOrderResponseType)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
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 'spec_helper'
|
|
11
|
+
require 'json'
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
# Unit tests for SnapTrade::ManualTradeFormComplex
|
|
15
|
+
describe SnapTrade::ManualTradeFormComplex do
|
|
16
|
+
let(:instance) { SnapTrade::ManualTradeFormComplex.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of ManualTradeFormComplex' do
|
|
19
|
+
it 'should create an instance of ManualTradeFormComplex' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::ManualTradeFormComplex)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
describe 'test attribute "type"' do
|
|
24
|
+
it 'should work' do
|
|
25
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test attribute "orders"' do
|
|
30
|
+
it 'should work' do
|
|
31
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
describe 'test attribute "client_order_id"' 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
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
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 'spec_helper'
|
|
11
|
+
require 'json'
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
# Unit tests for SnapTrade::ManualTradeFormComplexType
|
|
15
|
+
describe SnapTrade::ManualTradeFormComplexType do
|
|
16
|
+
let(:instance) { SnapTrade::ManualTradeFormComplexType.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of ManualTradeFormComplexType' do
|
|
19
|
+
it 'should create an instance of ManualTradeFormComplexType' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::ManualTradeFormComplexType)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
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 'spec_helper'
|
|
11
|
+
require 'json'
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
# Unit tests for SnapTrade::OrderRole
|
|
15
|
+
describe SnapTrade::OrderRole do
|
|
16
|
+
let(:instance) { SnapTrade::OrderRole.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of OrderRole' do
|
|
19
|
+
it 'should create an instance of OrderRole' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::OrderRole)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|