snaptrade 2.0.209 → 2.0.211
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 +3 -3
- data/lib/snaptrade/api/account_information_api.rb +4 -4
- data/lib/snaptrade/models/account_position.rb +2 -2
- data/lib/snaptrade/models/cfd_instrument.rb +315 -0
- data/lib/snaptrade/models/cfd_instrument_kind.rb +36 -0
- data/lib/snaptrade/models/instrument.rb +2 -0
- data/lib/snaptrade/models/model501_not_implemented_response.rb +218 -0
- data/lib/snaptrade/models/model503_brokerage_request_response.rb +238 -0
- data/lib/snaptrade/models/option_instrument.rb +16 -1
- data/lib/snaptrade/models/underlying_cfd_instrument.rb +63 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +5 -0
- data/spec/api/account_information_api_spec.rb +1 -1
- data/spec/models/cfd_instrument_kind_spec.rb +23 -0
- data/spec/models/cfd_instrument_spec.rb +71 -0
- data/spec/models/model501_not_implemented_response_spec.rb +29 -0
- data/spec/models/model503_brokerage_request_response_spec.rb +41 -0
- data/spec/models/option_instrument_spec.rb +6 -0
- data/spec/models/underlying_cfd_instrument_spec.rb +38 -0
- metadata +17 -2
|
@@ -0,0 +1,238 @@
|
|
|
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
|
+
# Example for a response that failed because of an upstream brokerage API failure
|
|
15
|
+
class Model503BrokerageRequestResponse
|
|
16
|
+
attr_accessor :detail
|
|
17
|
+
|
|
18
|
+
attr_accessor :status_code
|
|
19
|
+
|
|
20
|
+
attr_accessor :code
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'detail' => :'detail',
|
|
26
|
+
:'status_code' => :'status_code',
|
|
27
|
+
:'code' => :'code'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns all the JSON keys this model knows about
|
|
32
|
+
def self.acceptable_attributes
|
|
33
|
+
attribute_map.values
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Attribute type mapping.
|
|
37
|
+
def self.openapi_types
|
|
38
|
+
{
|
|
39
|
+
:'detail' => :'Object',
|
|
40
|
+
:'status_code' => :'Object',
|
|
41
|
+
:'code' => :'Object'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
:'detail',
|
|
49
|
+
:'status_code',
|
|
50
|
+
:'code'
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::Model503BrokerageRequestResponse` initialize method"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
63
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
64
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::Model503BrokerageRequestResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
65
|
+
end
|
|
66
|
+
h[k.to_sym] = v
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if attributes.key?(:'detail')
|
|
70
|
+
self.detail = attributes[:'detail']
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
if attributes.key?(:'status_code')
|
|
74
|
+
self.status_code = attributes[:'status_code']
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'code')
|
|
78
|
+
self.code = attributes[:'code']
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
83
|
+
# @return Array for valid properties with the reasons
|
|
84
|
+
def list_invalid_properties
|
|
85
|
+
invalid_properties = Array.new
|
|
86
|
+
invalid_properties
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Check to see if the all the properties in the model are valid
|
|
90
|
+
# @return true if the model is valid
|
|
91
|
+
def valid?
|
|
92
|
+
true
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Checks equality by comparing each attribute.
|
|
96
|
+
# @param [Object] Object to be compared
|
|
97
|
+
def ==(o)
|
|
98
|
+
return true if self.equal?(o)
|
|
99
|
+
self.class == o.class &&
|
|
100
|
+
detail == o.detail &&
|
|
101
|
+
status_code == o.status_code &&
|
|
102
|
+
code == o.code
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# @see the `==` method
|
|
106
|
+
# @param [Object] Object to be compared
|
|
107
|
+
def eql?(o)
|
|
108
|
+
self == o
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Calculates hash code according to all attributes.
|
|
112
|
+
# @return [Integer] Hash code
|
|
113
|
+
def hash
|
|
114
|
+
[detail, status_code, code].hash
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Builds the object from hash
|
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
119
|
+
# @return [Object] Returns the model itself
|
|
120
|
+
def self.build_from_hash(attributes)
|
|
121
|
+
new.build_from_hash(attributes)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Builds the object from hash
|
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
126
|
+
# @return [Object] Returns the model itself
|
|
127
|
+
def build_from_hash(attributes)
|
|
128
|
+
return nil unless attributes.is_a?(Hash)
|
|
129
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
130
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
131
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
132
|
+
self.send("#{key}=", nil)
|
|
133
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
134
|
+
# check to ensure the input is an array given that the attribute
|
|
135
|
+
# is documented as an array but the input is not
|
|
136
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
137
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
138
|
+
end
|
|
139
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
140
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
self
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Deserializes the data based on type
|
|
148
|
+
# @param string type Data type
|
|
149
|
+
# @param string value Value to be deserialized
|
|
150
|
+
# @return [Object] Deserialized data
|
|
151
|
+
def _deserialize(type, value)
|
|
152
|
+
case type.to_sym
|
|
153
|
+
when :Time
|
|
154
|
+
Time.parse(value)
|
|
155
|
+
when :Date
|
|
156
|
+
Date.parse(value)
|
|
157
|
+
when :String
|
|
158
|
+
value.to_s
|
|
159
|
+
when :Integer
|
|
160
|
+
value.to_i
|
|
161
|
+
when :Float
|
|
162
|
+
value.to_f
|
|
163
|
+
when :Boolean
|
|
164
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
165
|
+
true
|
|
166
|
+
else
|
|
167
|
+
false
|
|
168
|
+
end
|
|
169
|
+
when :Object
|
|
170
|
+
# generic object (usually a Hash), return directly
|
|
171
|
+
value
|
|
172
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
173
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
174
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
175
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
176
|
+
k_type = Regexp.last_match[:k_type]
|
|
177
|
+
v_type = Regexp.last_match[:v_type]
|
|
178
|
+
{}.tap do |hash|
|
|
179
|
+
value.each do |k, v|
|
|
180
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
else # model
|
|
184
|
+
# models (e.g. Pet) or oneOf
|
|
185
|
+
klass = SnapTrade.const_get(type)
|
|
186
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Returns the string representation of the object
|
|
191
|
+
# @return [String] String presentation of the object
|
|
192
|
+
def to_s
|
|
193
|
+
to_hash.to_s
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
|
198
|
+
def to_body
|
|
199
|
+
to_hash
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Returns the object in the form of hash
|
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
|
204
|
+
def to_hash
|
|
205
|
+
hash = {}
|
|
206
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
207
|
+
value = self.send(attr)
|
|
208
|
+
if value.nil?
|
|
209
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
210
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
hash[param] = _to_hash(value)
|
|
214
|
+
end
|
|
215
|
+
hash
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Outputs non-array value in the form of hash
|
|
219
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
220
|
+
# @param [Object] value Any valid value
|
|
221
|
+
# @return [Hash] Returns the value in the form of hash
|
|
222
|
+
def _to_hash(value)
|
|
223
|
+
if value.is_a?(Array)
|
|
224
|
+
value.compact.map { |v| _to_hash(v) }
|
|
225
|
+
elsif value.is_a?(Hash)
|
|
226
|
+
{}.tap do |hash|
|
|
227
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
228
|
+
end
|
|
229
|
+
elsif value.respond_to? :to_hash
|
|
230
|
+
value.to_hash
|
|
231
|
+
else
|
|
232
|
+
value
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
end
|
|
@@ -31,6 +31,9 @@ module SnapTrade
|
|
|
31
31
|
# Expiration date of the option contract.
|
|
32
32
|
attr_accessor :expiration_date
|
|
33
33
|
|
|
34
|
+
# Number of underlying shares per contract. Standard options are 100, mini options are 10.
|
|
35
|
+
attr_accessor :multiplier
|
|
36
|
+
|
|
34
37
|
# Human-readable description of the option contract.
|
|
35
38
|
attr_accessor :description
|
|
36
39
|
|
|
@@ -45,6 +48,7 @@ module SnapTrade
|
|
|
45
48
|
:'option_type' => :'option_type',
|
|
46
49
|
:'strike_price' => :'strike_price',
|
|
47
50
|
:'expiration_date' => :'expiration_date',
|
|
51
|
+
:'multiplier' => :'multiplier',
|
|
48
52
|
:'description' => :'description',
|
|
49
53
|
:'underlying' => :'underlying'
|
|
50
54
|
}
|
|
@@ -64,6 +68,7 @@ module SnapTrade
|
|
|
64
68
|
:'option_type' => :'OptionType',
|
|
65
69
|
:'strike_price' => :'Float',
|
|
66
70
|
:'expiration_date' => :'Date',
|
|
71
|
+
:'multiplier' => :'Float',
|
|
67
72
|
:'description' => :'String',
|
|
68
73
|
:'underlying' => :'UnderlyingOptionInstrument'
|
|
69
74
|
}
|
|
@@ -115,6 +120,10 @@ module SnapTrade
|
|
|
115
120
|
self.expiration_date = attributes[:'expiration_date']
|
|
116
121
|
end
|
|
117
122
|
|
|
123
|
+
if attributes.key?(:'multiplier')
|
|
124
|
+
self.multiplier = attributes[:'multiplier']
|
|
125
|
+
end
|
|
126
|
+
|
|
118
127
|
if attributes.key?(:'description')
|
|
119
128
|
self.description = attributes[:'description']
|
|
120
129
|
end
|
|
@@ -152,6 +161,10 @@ module SnapTrade
|
|
|
152
161
|
invalid_properties.push('invalid value for "expiration_date", expiration_date cannot be nil.')
|
|
153
162
|
end
|
|
154
163
|
|
|
164
|
+
if @multiplier.nil?
|
|
165
|
+
invalid_properties.push('invalid value for "multiplier", multiplier cannot be nil.')
|
|
166
|
+
end
|
|
167
|
+
|
|
155
168
|
if @underlying.nil?
|
|
156
169
|
invalid_properties.push('invalid value for "underlying", underlying cannot be nil.')
|
|
157
170
|
end
|
|
@@ -168,6 +181,7 @@ module SnapTrade
|
|
|
168
181
|
return false if @option_type.nil?
|
|
169
182
|
return false if @strike_price.nil?
|
|
170
183
|
return false if @expiration_date.nil?
|
|
184
|
+
return false if @multiplier.nil?
|
|
171
185
|
return false if @underlying.nil?
|
|
172
186
|
true
|
|
173
187
|
end
|
|
@@ -183,6 +197,7 @@ module SnapTrade
|
|
|
183
197
|
option_type == o.option_type &&
|
|
184
198
|
strike_price == o.strike_price &&
|
|
185
199
|
expiration_date == o.expiration_date &&
|
|
200
|
+
multiplier == o.multiplier &&
|
|
186
201
|
description == o.description &&
|
|
187
202
|
underlying == o.underlying
|
|
188
203
|
end
|
|
@@ -196,7 +211,7 @@ module SnapTrade
|
|
|
196
211
|
# Calculates hash code according to all attributes.
|
|
197
212
|
# @return [Integer] Hash code
|
|
198
213
|
def hash
|
|
199
|
-
[kind, id, symbol, option_type, strike_price, expiration_date, description, underlying].hash
|
|
214
|
+
[kind, id, symbol, option_type, strike_price, expiration_date, multiplier, description, underlying].hash
|
|
200
215
|
end
|
|
201
216
|
|
|
202
217
|
# Builds the object from hash
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#SnapTrade
|
|
3
|
+
|
|
4
|
+
#Connect brokerage accounts to your app for live positions and trading
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: api@snaptrade.com
|
|
8
|
+
=end
|
|
9
|
+
|
|
10
|
+
require 'date'
|
|
11
|
+
require 'time'
|
|
12
|
+
|
|
13
|
+
module SnapTrade
|
|
14
|
+
# The underlying instrument referenced by a CFD contract.
|
|
15
|
+
module UnderlyingCfdInstrument
|
|
16
|
+
class << self
|
|
17
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
18
|
+
def openapi_one_of
|
|
19
|
+
[
|
|
20
|
+
:'AdrInstrument',
|
|
21
|
+
:'CefInstrument',
|
|
22
|
+
:'CryptoInstrument',
|
|
23
|
+
:'EtfInstrument',
|
|
24
|
+
:'MutualFundInstrument',
|
|
25
|
+
:'OtherInstrument',
|
|
26
|
+
:'StockInstrument'
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Discriminator's property name (OpenAPI v3)
|
|
31
|
+
def openapi_discriminator_name
|
|
32
|
+
:'kind'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Discriminator's mapping (OpenAPI v3)
|
|
36
|
+
def openapi_discriminator_mapping
|
|
37
|
+
{
|
|
38
|
+
:'adr' => :'AdrInstrument',
|
|
39
|
+
:'cef' => :'CefInstrument',
|
|
40
|
+
:'crypto' => :'CryptoInstrument',
|
|
41
|
+
:'etf' => :'EtfInstrument',
|
|
42
|
+
:'mutualfund' => :'MutualFundInstrument',
|
|
43
|
+
:'other' => :'OtherInstrument',
|
|
44
|
+
:'stock' => :'StockInstrument'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Builds the object
|
|
49
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
50
|
+
# @return [Object] Returns the model or the data itself
|
|
51
|
+
def build(data)
|
|
52
|
+
discriminator_value = data[openapi_discriminator_name]
|
|
53
|
+
return nil if discriminator_value.nil?
|
|
54
|
+
|
|
55
|
+
klass = openapi_discriminator_mapping[discriminator_value.to_s.to_sym]
|
|
56
|
+
return nil unless klass
|
|
57
|
+
|
|
58
|
+
SnapTrade.const_get(klass).build_from_hash(data)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
end
|
data/lib/snaptrade/version.rb
CHANGED
data/lib/snaptrade.rb
CHANGED
|
@@ -72,6 +72,8 @@ require 'snaptrade/models/cancel_order_response'
|
|
|
72
72
|
require 'snaptrade/models/cash_change_direction'
|
|
73
73
|
require 'snaptrade/models/cef_instrument'
|
|
74
74
|
require 'snaptrade/models/cef_instrument_kind'
|
|
75
|
+
require 'snaptrade/models/cfd_instrument'
|
|
76
|
+
require 'snaptrade/models/cfd_instrument_kind'
|
|
75
77
|
require 'snaptrade/models/child_brokerage_order_ids'
|
|
76
78
|
require 'snaptrade/models/complex_order_leg'
|
|
77
79
|
require 'snaptrade/models/complex_order_leg_order_role'
|
|
@@ -139,6 +141,8 @@ require 'snaptrade/models/model404_failed_request_response'
|
|
|
139
141
|
require 'snaptrade/models/model425_failed_request_response'
|
|
140
142
|
require 'snaptrade/models/model429_too_many_requests_response'
|
|
141
143
|
require 'snaptrade/models/model500_unexpected_exception_response'
|
|
144
|
+
require 'snaptrade/models/model501_not_implemented_response'
|
|
145
|
+
require 'snaptrade/models/model503_brokerage_request_response'
|
|
142
146
|
require 'snaptrade/models/monthly_dividends'
|
|
143
147
|
require 'snaptrade/models/mutual_fund_instrument'
|
|
144
148
|
require 'snaptrade/models/mutual_fund_instrument_kind'
|
|
@@ -221,6 +225,7 @@ require 'snaptrade/models/trailing_stop'
|
|
|
221
225
|
require 'snaptrade/models/transactions_status'
|
|
222
226
|
require 'snaptrade/models/type'
|
|
223
227
|
require 'snaptrade/models/us_exchange'
|
|
228
|
+
require 'snaptrade/models/underlying_cfd_instrument'
|
|
224
229
|
require 'snaptrade/models/underlying_option_instrument'
|
|
225
230
|
require 'snaptrade/models/underlying_symbol'
|
|
226
231
|
require 'snaptrade/models/underlying_symbol_exchange'
|
|
@@ -62,7 +62,7 @@ describe 'AccountInformationApi' do
|
|
|
62
62
|
|
|
63
63
|
# unit tests for get_all_account_positions
|
|
64
64
|
# List all account positions
|
|
65
|
-
# Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, and
|
|
65
|
+
# Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, option positions, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. `mutualfund` positions may also include `cash_equivalent`. `stock` positions may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
66
66
|
# @param user_id
|
|
67
67
|
# @param user_secret
|
|
68
68
|
# @param account_id
|
|
@@ -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::CfdInstrumentKind
|
|
15
|
+
describe SnapTrade::CfdInstrumentKind do
|
|
16
|
+
let(:instance) { SnapTrade::CfdInstrumentKind.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of CfdInstrumentKind' do
|
|
19
|
+
it 'should create an instance of CfdInstrumentKind' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::CfdInstrumentKind)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -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::CfdInstrument
|
|
15
|
+
describe SnapTrade::CfdInstrument do
|
|
16
|
+
let(:instance) { SnapTrade::CfdInstrument.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of CfdInstrument' do
|
|
19
|
+
it 'should create an instance of CfdInstrument' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::CfdInstrument)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
describe 'test attribute "kind"' 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 "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
|
+
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
|
+
describe 'test attribute "raw_symbol"' 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 "description"' 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 "currency"' 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 "exchange"' 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 "underlying_instrument"' 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,29 @@
|
|
|
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::Model501NotImplementedResponse
|
|
15
|
+
describe SnapTrade::Model501NotImplementedResponse do
|
|
16
|
+
let(:instance) { SnapTrade::Model501NotImplementedResponse.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of Model501NotImplementedResponse' do
|
|
19
|
+
it 'should create an instance of Model501NotImplementedResponse' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::Model501NotImplementedResponse)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
describe 'test attribute "error"' 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
|
+
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::Model503BrokerageRequestResponse
|
|
15
|
+
describe SnapTrade::Model503BrokerageRequestResponse do
|
|
16
|
+
let(:instance) { SnapTrade::Model503BrokerageRequestResponse.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of Model503BrokerageRequestResponse' do
|
|
19
|
+
it 'should create an instance of Model503BrokerageRequestResponse' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::Model503BrokerageRequestResponse)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
describe 'test attribute "detail"' 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 "status_code"' 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 "code"' 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
|
|
@@ -56,6 +56,12 @@ describe SnapTrade::OptionInstrument do
|
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
+
describe 'test attribute "multiplier"' 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
|
+
|
|
59
65
|
describe 'test attribute "description"' do
|
|
60
66
|
it 'should work' do
|
|
61
67
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
@@ -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 'spec_helper'
|
|
11
|
+
require 'json'
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
# Unit tests for SnapTrade::UnderlyingCfdInstrument
|
|
15
|
+
describe SnapTrade::UnderlyingCfdInstrument do
|
|
16
|
+
describe '.openapi_one_of' do
|
|
17
|
+
it 'lists the items referenced in the oneOf array' do
|
|
18
|
+
expect(described_class.openapi_one_of).to_not be_empty
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
describe '.openapi_discriminator_name' do
|
|
23
|
+
it 'returns the value of the "discriminator" property' do
|
|
24
|
+
expect(described_class.openapi_discriminator_name).to_not be_empty
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
describe '.openapi_discriminator_mapping' do
|
|
29
|
+
it 'returns the key/values of the "mapping" property' do
|
|
30
|
+
expect(described_class.openapi_discriminator_mapping.values.sort).to eq(described_class.openapi_one_of.sort)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
describe '.build' do
|
|
35
|
+
it 'returns the correct model' do
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|