snaptrade 1.17.1 → 1.17.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -3
- data/docs/AccountInformationApi.md +11 -7
- data/docs/AuthenticationApi.md +6 -4
- data/docs/Model500UnexpectedExceptionResponse.md +22 -0
- data/docs/OptionsApi.md +5 -5
- data/docs/OptionsPosition.md +1 -5
- data/docs/ReferenceDataApi.md +7 -5
- data/docs/SnapTradeLoginUserRequestBody.md +4 -4
- data/docs/SnapTradeRegisterUserRequestBody.md +1 -3
- data/docs/TradingApi.md +1 -1
- data/docs/TransactionsAndReportingApi.md +1 -1
- data/lib/snaptrade/api/account_information_api.rb +24 -16
- data/lib/snaptrade/api/authentication_api.rb +22 -14
- data/lib/snaptrade/api/options_api.rb +20 -20
- data/lib/snaptrade/api/reference_data_api.rb +12 -8
- data/lib/snaptrade/api/trading_api.rb +4 -4
- data/lib/snaptrade/api/transactions_and_reporting_api.rb +4 -4
- data/lib/snaptrade/models/model500_unexpected_exception_response.rb +239 -0
- data/lib/snaptrade/models/options_position.rb +5 -26
- data/lib/snaptrade/models/snap_trade_login_user_request_body.rb +4 -0
- data/lib/snaptrade/models/snap_trade_register_user_request_body.rb +4 -14
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +1 -0
- data/spec/api/account_information_api_spec.rb +6 -4
- data/spec/api/authentication_api_spec.rb +3 -0
- data/spec/api/options_api_spec.rb +5 -5
- data/spec/api/reference_data_api_spec.rb +3 -2
- data/spec/api/trading_api_spec.rb +1 -1
- data/spec/api/transactions_and_reporting_api_spec.rb +1 -1
- data/spec/models/model500_unexpected_exception_response_spec.rb +42 -0
- data/spec/models/options_position_spec.rb +0 -12
- data/spec/models/snap_trade_register_user_request_body_spec.rb +0 -6
- metadata +6 -2
@@ -0,0 +1,239 @@
|
|
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
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'date'
|
12
|
+
require 'time'
|
13
|
+
|
14
|
+
module SnapTrade
|
15
|
+
# Example for a response that failed for unexpected reasons
|
16
|
+
class Model500UnexpectedExceptionResponse
|
17
|
+
attr_accessor :detail
|
18
|
+
|
19
|
+
attr_accessor :status_code
|
20
|
+
|
21
|
+
attr_accessor :code
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'detail' => :'detail',
|
27
|
+
:'status_code' => :'status_code',
|
28
|
+
:'code' => :'code'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns all the JSON keys this model knows about
|
33
|
+
def self.acceptable_attributes
|
34
|
+
attribute_map.values
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.openapi_types
|
39
|
+
{
|
40
|
+
:'detail' => :'Object',
|
41
|
+
:'status_code' => :'Object',
|
42
|
+
:'code' => :'Object'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# List of attributes with nullable: true
|
47
|
+
def self.openapi_nullable
|
48
|
+
Set.new([
|
49
|
+
:'detail',
|
50
|
+
:'status_code',
|
51
|
+
:'code'
|
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::Model500UnexpectedExceptionResponse` 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::Model500UnexpectedExceptionResponse`. 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?(:'detail')
|
71
|
+
self.detail = attributes[:'detail']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:'status_code')
|
75
|
+
self.status_code = attributes[:'status_code']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:'code')
|
79
|
+
self.code = attributes[:'code']
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
84
|
+
# @return Array for valid properties with the reasons
|
85
|
+
def list_invalid_properties
|
86
|
+
invalid_properties = Array.new
|
87
|
+
invalid_properties
|
88
|
+
end
|
89
|
+
|
90
|
+
# Check to see if the all the properties in the model are valid
|
91
|
+
# @return true if the model is valid
|
92
|
+
def valid?
|
93
|
+
true
|
94
|
+
end
|
95
|
+
|
96
|
+
# Checks equality by comparing each attribute.
|
97
|
+
# @param [Object] Object to be compared
|
98
|
+
def ==(o)
|
99
|
+
return true if self.equal?(o)
|
100
|
+
self.class == o.class &&
|
101
|
+
detail == o.detail &&
|
102
|
+
status_code == o.status_code &&
|
103
|
+
code == o.code
|
104
|
+
end
|
105
|
+
|
106
|
+
# @see the `==` method
|
107
|
+
# @param [Object] Object to be compared
|
108
|
+
def eql?(o)
|
109
|
+
self == o
|
110
|
+
end
|
111
|
+
|
112
|
+
# Calculates hash code according to all attributes.
|
113
|
+
# @return [Integer] Hash code
|
114
|
+
def hash
|
115
|
+
[detail, status_code, code].hash
|
116
|
+
end
|
117
|
+
|
118
|
+
# Builds the object from hash
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
120
|
+
# @return [Object] Returns the model itself
|
121
|
+
def self.build_from_hash(attributes)
|
122
|
+
new.build_from_hash(attributes)
|
123
|
+
end
|
124
|
+
|
125
|
+
# Builds the object from hash
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
+
# @return [Object] Returns the model itself
|
128
|
+
def build_from_hash(attributes)
|
129
|
+
return nil unless attributes.is_a?(Hash)
|
130
|
+
attributes = attributes.transform_keys(&:to_sym)
|
131
|
+
self.class.openapi_types.each_pair do |key, type|
|
132
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
133
|
+
self.send("#{key}=", nil)
|
134
|
+
elsif type =~ /\AArray<(.*)>/i
|
135
|
+
# check to ensure the input is an array given that the attribute
|
136
|
+
# is documented as an array but the input is not
|
137
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
138
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
139
|
+
end
|
140
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
141
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
self
|
146
|
+
end
|
147
|
+
|
148
|
+
# Deserializes the data based on type
|
149
|
+
# @param string type Data type
|
150
|
+
# @param string value Value to be deserialized
|
151
|
+
# @return [Object] Deserialized data
|
152
|
+
def _deserialize(type, value)
|
153
|
+
case type.to_sym
|
154
|
+
when :Time
|
155
|
+
Time.parse(value)
|
156
|
+
when :Date
|
157
|
+
Date.parse(value)
|
158
|
+
when :String
|
159
|
+
value.to_s
|
160
|
+
when :Integer
|
161
|
+
value.to_i
|
162
|
+
when :Float
|
163
|
+
value.to_f
|
164
|
+
when :Boolean
|
165
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
166
|
+
true
|
167
|
+
else
|
168
|
+
false
|
169
|
+
end
|
170
|
+
when :Object
|
171
|
+
# generic object (usually a Hash), return directly
|
172
|
+
value
|
173
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
174
|
+
inner_type = Regexp.last_match[:inner_type]
|
175
|
+
value.map { |v| _deserialize(inner_type, v) }
|
176
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
177
|
+
k_type = Regexp.last_match[:k_type]
|
178
|
+
v_type = Regexp.last_match[:v_type]
|
179
|
+
{}.tap do |hash|
|
180
|
+
value.each do |k, v|
|
181
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
182
|
+
end
|
183
|
+
end
|
184
|
+
else # model
|
185
|
+
# models (e.g. Pet) or oneOf
|
186
|
+
klass = SnapTrade.const_get(type)
|
187
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the string representation of the object
|
192
|
+
# @return [String] String presentation of the object
|
193
|
+
def to_s
|
194
|
+
to_hash.to_s
|
195
|
+
end
|
196
|
+
|
197
|
+
# to_body is an alias to to_hash (backward compatibility)
|
198
|
+
# @return [Hash] Returns the object in the form of hash
|
199
|
+
def to_body
|
200
|
+
to_hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Returns the object in the form of hash
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_hash
|
206
|
+
hash = {}
|
207
|
+
self.class.attribute_map.each_pair do |attr, param|
|
208
|
+
value = self.send(attr)
|
209
|
+
if value.nil?
|
210
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
211
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
212
|
+
end
|
213
|
+
|
214
|
+
hash[param] = _to_hash(value)
|
215
|
+
end
|
216
|
+
hash
|
217
|
+
end
|
218
|
+
|
219
|
+
# Outputs non-array value in the form of hash
|
220
|
+
# For object, use to_hash. Otherwise, just return the value
|
221
|
+
# @param [Object] value Any valid value
|
222
|
+
# @return [Hash] Returns the value in the form of hash
|
223
|
+
def _to_hash(value)
|
224
|
+
if value.is_a?(Array)
|
225
|
+
value.compact.map { |v| _to_hash(v) }
|
226
|
+
elsif value.is_a?(Hash)
|
227
|
+
{}.tap do |hash|
|
228
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
229
|
+
end
|
230
|
+
elsif value.respond_to? :to_hash
|
231
|
+
value.to_hash
|
232
|
+
else
|
233
|
+
value
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
end
|
238
|
+
|
239
|
+
end
|
@@ -26,11 +26,6 @@ module SnapTrade
|
|
26
26
|
# Average purchase price for this position
|
27
27
|
attr_accessor :average_purchase_price
|
28
28
|
|
29
|
-
attr_accessor :open_pnl
|
30
|
-
|
31
|
-
# Deprecated, use the units field for both fractional and integer units going forward
|
32
|
-
attr_accessor :fractional_units
|
33
|
-
|
34
29
|
# Attribute mapping from ruby-style variable name to JSON key.
|
35
30
|
def self.attribute_map
|
36
31
|
{
|
@@ -38,9 +33,7 @@ module SnapTrade
|
|
38
33
|
:'price' => :'price',
|
39
34
|
:'units' => :'units',
|
40
35
|
:'currency' => :'currency',
|
41
|
-
:'average_purchase_price' => :'average_purchase_price'
|
42
|
-
:'open_pnl' => :'open_pnl',
|
43
|
-
:'fractional_units' => :'fractional_units'
|
36
|
+
:'average_purchase_price' => :'average_purchase_price'
|
44
37
|
}
|
45
38
|
end
|
46
39
|
|
@@ -56,9 +49,7 @@ module SnapTrade
|
|
56
49
|
:'price' => :'Float',
|
57
50
|
:'units' => :'Float',
|
58
51
|
:'currency' => :'OptionsPositionCurrency',
|
59
|
-
:'average_purchase_price' => :'Float'
|
60
|
-
:'open_pnl' => :'Float',
|
61
|
-
:'fractional_units' => :'Float'
|
52
|
+
:'average_purchase_price' => :'Float'
|
62
53
|
}
|
63
54
|
end
|
64
55
|
|
@@ -67,9 +58,7 @@ module SnapTrade
|
|
67
58
|
Set.new([
|
68
59
|
:'price',
|
69
60
|
:'currency',
|
70
|
-
:'average_purchase_price'
|
71
|
-
:'open_pnl',
|
72
|
-
:'fractional_units'
|
61
|
+
:'average_purchase_price'
|
73
62
|
])
|
74
63
|
end
|
75
64
|
|
@@ -107,14 +96,6 @@ module SnapTrade
|
|
107
96
|
if attributes.key?(:'average_purchase_price')
|
108
97
|
self.average_purchase_price = attributes[:'average_purchase_price']
|
109
98
|
end
|
110
|
-
|
111
|
-
if attributes.key?(:'open_pnl')
|
112
|
-
self.open_pnl = attributes[:'open_pnl']
|
113
|
-
end
|
114
|
-
|
115
|
-
if attributes.key?(:'fractional_units')
|
116
|
-
self.fractional_units = attributes[:'fractional_units']
|
117
|
-
end
|
118
99
|
end
|
119
100
|
|
120
101
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -139,9 +120,7 @@ module SnapTrade
|
|
139
120
|
price == o.price &&
|
140
121
|
units == o.units &&
|
141
122
|
currency == o.currency &&
|
142
|
-
average_purchase_price == o.average_purchase_price
|
143
|
-
open_pnl == o.open_pnl &&
|
144
|
-
fractional_units == o.fractional_units
|
123
|
+
average_purchase_price == o.average_purchase_price
|
145
124
|
end
|
146
125
|
|
147
126
|
# @see the `==` method
|
@@ -153,7 +132,7 @@ module SnapTrade
|
|
153
132
|
# Calculates hash code according to all attributes.
|
154
133
|
# @return [Integer] Hash code
|
155
134
|
def hash
|
156
|
-
[symbol, price, units, currency, average_purchase_price
|
135
|
+
[symbol, price, units, currency, average_purchase_price].hash
|
157
136
|
end
|
158
137
|
|
159
138
|
# Builds the object from hash
|
@@ -14,12 +14,16 @@ require 'time'
|
|
14
14
|
module SnapTrade
|
15
15
|
# Data to login a user via SnapTrade Partner
|
16
16
|
class SnapTradeLoginUserRequestBody
|
17
|
+
# Slug of the brokerage to connect the user to
|
17
18
|
attr_accessor :broker
|
18
19
|
|
20
|
+
# When set to True, user will be redirected back to the partner's site instead of the connection portal
|
19
21
|
attr_accessor :immediate_redirect
|
20
22
|
|
23
|
+
# URL to redirect the user to after the user connects their brokerage account
|
21
24
|
attr_accessor :custom_redirect
|
22
25
|
|
26
|
+
# The UUID of the brokerage connection to be reconnected
|
23
27
|
attr_accessor :reconnect
|
24
28
|
|
25
29
|
attr_accessor :connection_type
|
@@ -17,14 +17,10 @@ module SnapTrade
|
|
17
17
|
# SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user
|
18
18
|
attr_accessor :user_id
|
19
19
|
|
20
|
-
# Open SSH RSA public key
|
21
|
-
attr_accessor :rsa_public_key
|
22
|
-
|
23
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
24
21
|
def self.attribute_map
|
25
22
|
{
|
26
|
-
:'user_id' => :'userId'
|
27
|
-
:'rsa_public_key' => :'rsaPublicKey'
|
23
|
+
:'user_id' => :'userId'
|
28
24
|
}
|
29
25
|
end
|
30
26
|
|
@@ -36,8 +32,7 @@ module SnapTrade
|
|
36
32
|
# Attribute type mapping.
|
37
33
|
def self.openapi_types
|
38
34
|
{
|
39
|
-
:'user_id' => :'String'
|
40
|
-
:'rsa_public_key' => :'String'
|
35
|
+
:'user_id' => :'String'
|
41
36
|
}
|
42
37
|
end
|
43
38
|
|
@@ -65,10 +60,6 @@ module SnapTrade
|
|
65
60
|
if attributes.key?(:'user_id')
|
66
61
|
self.user_id = attributes[:'user_id']
|
67
62
|
end
|
68
|
-
|
69
|
-
if attributes.key?(:'rsa_public_key')
|
70
|
-
self.rsa_public_key = attributes[:'rsa_public_key']
|
71
|
-
end
|
72
63
|
end
|
73
64
|
|
74
65
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -89,8 +80,7 @@ module SnapTrade
|
|
89
80
|
def ==(o)
|
90
81
|
return true if self.equal?(o)
|
91
82
|
self.class == o.class &&
|
92
|
-
user_id == o.user_id
|
93
|
-
rsa_public_key == o.rsa_public_key
|
83
|
+
user_id == o.user_id
|
94
84
|
end
|
95
85
|
|
96
86
|
# @see the `==` method
|
@@ -102,7 +92,7 @@ module SnapTrade
|
|
102
92
|
# Calculates hash code according to all attributes.
|
103
93
|
# @return [Integer] Hash code
|
104
94
|
def hash
|
105
|
-
[user_id
|
95
|
+
[user_id].hash
|
106
96
|
end
|
107
97
|
|
108
98
|
# Builds the object from hash
|
data/lib/snaptrade/version.rb
CHANGED
data/lib/snaptrade.rb
CHANGED
@@ -62,6 +62,7 @@ require 'snaptrade/models/model400_failed_request_response'
|
|
62
62
|
require 'snaptrade/models/model401_failed_request_response'
|
63
63
|
require 'snaptrade/models/model403_failed_request_response'
|
64
64
|
require 'snaptrade/models/model404_failed_request_response'
|
65
|
+
require 'snaptrade/models/model500_unexpected_exception_response'
|
65
66
|
require 'snaptrade/models/model_asset_class'
|
66
67
|
require 'snaptrade/models/model_asset_class_details'
|
67
68
|
require 'snaptrade/models/model_asset_class_target'
|
@@ -43,9 +43,10 @@ describe 'AccountInformationApi' do
|
|
43
43
|
|
44
44
|
# unit tests for get_user_account_balance
|
45
45
|
# List account balances
|
46
|
+
# A list of account balances for the specified account (one per currency that the account holds).
|
46
47
|
# @param user_id
|
47
48
|
# @param user_secret
|
48
|
-
# @param account_id The ID of the account get
|
49
|
+
# @param account_id The ID of the account to get balances.
|
49
50
|
# @param [Hash] opts the optional parameters
|
50
51
|
# @return [Array<Balance>]
|
51
52
|
describe 'get_user_account_balance test' do
|
@@ -69,9 +70,10 @@ describe 'AccountInformationApi' do
|
|
69
70
|
|
70
71
|
# unit tests for get_user_account_orders
|
71
72
|
# Get history of orders placed in account
|
73
|
+
# Fetch all recent orders from a user's account.
|
72
74
|
# @param user_id
|
73
75
|
# @param user_secret
|
74
|
-
# @param account_id The ID of the account get
|
76
|
+
# @param account_id The ID of the account to get orders.
|
75
77
|
# @param [Hash] opts the optional parameters
|
76
78
|
# @option opts [String] :state defaults value is set to \"all\"
|
77
79
|
# @return [Array<AccountOrderRecord>]
|
@@ -85,7 +87,7 @@ describe 'AccountInformationApi' do
|
|
85
87
|
# List account positions
|
86
88
|
# @param user_id
|
87
89
|
# @param user_secret
|
88
|
-
# @param account_id The ID of the account get positions.
|
90
|
+
# @param account_id The ID of the account to get positions.
|
89
91
|
# @param [Hash] opts the optional parameters
|
90
92
|
# @return [Array<Position>]
|
91
93
|
describe 'get_user_account_positions test' do
|
@@ -95,7 +97,7 @@ describe 'AccountInformationApi' do
|
|
95
97
|
end
|
96
98
|
|
97
99
|
# unit tests for get_user_holdings
|
98
|
-
# List balances, positions and orders for the specified account
|
100
|
+
# List balances, positions and orders for the specified account
|
99
101
|
# @param account_id The ID of the account to fetch holdings for.
|
100
102
|
# @param user_id
|
101
103
|
# @param user_secret
|
@@ -30,6 +30,7 @@ describe 'AuthenticationApi' do
|
|
30
30
|
|
31
31
|
# unit tests for delete_snap_trade_user
|
32
32
|
# Delete SnapTrade user
|
33
|
+
# Deletes a user you've registered over the SnapTrade API, and any data associated with them or their investment accounts.
|
33
34
|
# @param user_id
|
34
35
|
# @param [Hash] opts the optional parameters
|
35
36
|
# @return [DeleteUserResponse]
|
@@ -53,6 +54,7 @@ describe 'AuthenticationApi' do
|
|
53
54
|
|
54
55
|
# unit tests for list_snap_trade_users
|
55
56
|
# List SnapTrade users
|
57
|
+
# Returns a list of users you've registered over the SnapTrade API.
|
56
58
|
# @param [Hash] opts the optional parameters
|
57
59
|
# @return [Array<String>]
|
58
60
|
describe 'list_snap_trade_users test' do
|
@@ -63,6 +65,7 @@ describe 'AuthenticationApi' do
|
|
63
65
|
|
64
66
|
# unit tests for login_snap_trade_user
|
65
67
|
# Login user & generate connection link
|
68
|
+
# Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account.
|
66
69
|
# @param user_id
|
67
70
|
# @param user_secret
|
68
71
|
# @param [Hash] opts the optional parameters
|
@@ -32,7 +32,7 @@ describe 'OptionsApi' do
|
|
32
32
|
# Creates an option strategy object that will be used to place an option strategy order
|
33
33
|
# @param user_id
|
34
34
|
# @param user_secret
|
35
|
-
# @param account_id The ID of the account
|
35
|
+
# @param account_id The ID of the account to create the option strategy object in.
|
36
36
|
# @param options_get_option_strategy_request
|
37
37
|
# @param [Hash] opts the optional parameters
|
38
38
|
# @return [StrategyQuotes]
|
@@ -46,7 +46,7 @@ describe 'OptionsApi' do
|
|
46
46
|
# Get the options chain
|
47
47
|
# @param user_id
|
48
48
|
# @param user_secret
|
49
|
-
# @param account_id The ID of the account get
|
49
|
+
# @param account_id The ID of the account to get the options chain from.
|
50
50
|
# @param symbol Universal symbol ID if symbol
|
51
51
|
# @param [Hash] opts the optional parameters
|
52
52
|
# @return [Array<OptionChainInner>]
|
@@ -60,7 +60,7 @@ describe 'OptionsApi' do
|
|
60
60
|
# Get latest market data of option strategy
|
61
61
|
# @param user_id
|
62
62
|
# @param user_secret
|
63
|
-
# @param account_id The ID of the account
|
63
|
+
# @param account_id The ID of the account the strategy will be placed in.
|
64
64
|
# @param option_strategy_id Option strategy id obtained from response when creating option strategy object
|
65
65
|
# @param [Hash] opts the optional parameters
|
66
66
|
# @return [StrategyQuotes]
|
@@ -74,7 +74,7 @@ describe 'OptionsApi' do
|
|
74
74
|
# Get the options holdings in the account
|
75
75
|
# @param user_id
|
76
76
|
# @param user_secret
|
77
|
-
# @param account_id The ID of the account
|
77
|
+
# @param account_id The ID of the account to fetch options holdings for.
|
78
78
|
# @param [Hash] opts the optional parameters
|
79
79
|
# @return [Array<OptionsPosition>]
|
80
80
|
describe 'list_option_holdings test' do
|
@@ -87,7 +87,7 @@ describe 'OptionsApi' do
|
|
87
87
|
# Place an option strategy order on the brokerage
|
88
88
|
# @param user_id
|
89
89
|
# @param user_secret
|
90
|
-
# @param account_id The ID of the account
|
90
|
+
# @param account_id The ID of the account to execute the strategy in.
|
91
91
|
# @param option_strategy_id Option strategy id obtained from response when creating option strategy object
|
92
92
|
# @param options_place_option_strategy_request
|
93
93
|
# @param [Hash] opts the optional parameters
|
@@ -50,7 +50,8 @@ describe 'ReferenceDataApi' do
|
|
50
50
|
end
|
51
51
|
|
52
52
|
# unit tests for get_security_types
|
53
|
-
# List of all security types
|
53
|
+
# List of all security types
|
54
|
+
# List security types available on SnapTrade.
|
54
55
|
# @param [Hash] opts the optional parameters
|
55
56
|
# @return [Array<SecurityType>]
|
56
57
|
describe 'get_security_types test' do
|
@@ -137,7 +138,7 @@ describe 'ReferenceDataApi' do
|
|
137
138
|
# Search for symbols available in an account
|
138
139
|
# @param user_id
|
139
140
|
# @param user_secret
|
140
|
-
# @param account_id The ID of the account
|
141
|
+
# @param account_id The ID of the account to search for symbols within.
|
141
142
|
# @param [Hash] opts the optional parameters
|
142
143
|
# @option opts [SymbolQuery] :symbol_query
|
143
144
|
# @return [Array<UniversalSymbol>]
|
@@ -32,7 +32,7 @@ describe 'TradingApi' do
|
|
32
32
|
# Cancel open order in account
|
33
33
|
# @param user_id
|
34
34
|
# @param user_secret
|
35
|
-
# @param account_id The ID of the account
|
35
|
+
# @param account_id The ID of the account to cancel the order in.
|
36
36
|
# @param trading_cancel_user_account_order_request The Order ID to be canceled
|
37
37
|
# @param [Hash] opts the optional parameters
|
38
38
|
# @return [AccountOrderRecord]
|
@@ -30,7 +30,7 @@ describe 'TransactionsAndReportingApi' do
|
|
30
30
|
|
31
31
|
# unit tests for get_activities
|
32
32
|
# Get transaction history for a user
|
33
|
-
# Returns activities (transactions) for a user. Specifing start and end date is highly recommended for
|
33
|
+
# Returns activities (transactions) for a user. Specifing start and end date is highly recommended for better performance
|
34
34
|
# @param user_id
|
35
35
|
# @param user_secret
|
36
36
|
# @param [Hash] opts the optional parameters
|
@@ -0,0 +1,42 @@
|
|
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
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'spec_helper'
|
12
|
+
require 'json'
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
# Unit tests for SnapTrade::Model500UnexpectedExceptionResponse
|
16
|
+
describe SnapTrade::Model500UnexpectedExceptionResponse do
|
17
|
+
let(:instance) { SnapTrade::Model500UnexpectedExceptionResponse.new }
|
18
|
+
|
19
|
+
describe 'test an instance of Model500UnexpectedExceptionResponse' do
|
20
|
+
it 'should create an instance of Model500UnexpectedExceptionResponse' do
|
21
|
+
expect(instance).to be_instance_of(SnapTrade::Model500UnexpectedExceptionResponse)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
describe 'test attribute "detail"' do
|
25
|
+
it 'should work' do
|
26
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test attribute "status_code"' do
|
31
|
+
it 'should work' do
|
32
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe 'test attribute "code"' do
|
37
|
+
it 'should work' do
|
38
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -51,16 +51,4 @@ describe SnapTrade::OptionsPosition do
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
describe 'test attribute "open_pnl"' do
|
55
|
-
it 'should work' do
|
56
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
describe 'test attribute "fractional_units"' do
|
61
|
-
it 'should work' do
|
62
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
54
|
end
|
@@ -27,10 +27,4 @@ describe SnapTrade::SnapTradeRegisterUserRequestBody do
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
describe 'test attribute "rsa_public_key"' do
|
31
|
-
it 'should work' do
|
32
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snaptrade
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.17.
|
4
|
+
version: 1.17.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SnapTrade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -131,6 +131,7 @@ files:
|
|
131
131
|
- docs/Model401FailedRequestResponse.md
|
132
132
|
- docs/Model403FailedRequestResponse.md
|
133
133
|
- docs/Model404FailedRequestResponse.md
|
134
|
+
- docs/Model500UnexpectedExceptionResponse.md
|
134
135
|
- docs/ModelAssetClass.md
|
135
136
|
- docs/ModelAssetClassDetails.md
|
136
137
|
- docs/ModelAssetClassTarget.md
|
@@ -279,6 +280,7 @@ files:
|
|
279
280
|
- lib/snaptrade/models/model401_failed_request_response.rb
|
280
281
|
- lib/snaptrade/models/model403_failed_request_response.rb
|
281
282
|
- lib/snaptrade/models/model404_failed_request_response.rb
|
283
|
+
- lib/snaptrade/models/model500_unexpected_exception_response.rb
|
282
284
|
- lib/snaptrade/models/model_asset_class.rb
|
283
285
|
- lib/snaptrade/models/model_asset_class_details.rb
|
284
286
|
- lib/snaptrade/models/model_asset_class_target.rb
|
@@ -422,6 +424,7 @@ files:
|
|
422
424
|
- spec/models/model401_failed_request_response_spec.rb
|
423
425
|
- spec/models/model403_failed_request_response_spec.rb
|
424
426
|
- spec/models/model404_failed_request_response_spec.rb
|
427
|
+
- spec/models/model500_unexpected_exception_response_spec.rb
|
425
428
|
- spec/models/model_asset_class_details_spec.rb
|
426
429
|
- spec/models/model_asset_class_spec.rb
|
427
430
|
- spec/models/model_asset_class_target_spec.rb
|
@@ -576,6 +579,7 @@ test_files:
|
|
576
579
|
- spec/models/strategy_quotes_spec.rb
|
577
580
|
- spec/models/model_asset_class_details_spec.rb
|
578
581
|
- spec/models/manual_trade_and_impact_spec.rb
|
582
|
+
- spec/models/model500_unexpected_exception_response_spec.rb
|
579
583
|
- spec/models/brokerage_authorization_type_read_only_type_spec.rb
|
580
584
|
- spec/models/manual_trade_symbol_spec.rb
|
581
585
|
- spec/models/position_spec.rb
|