snaptrade 2.0.37 → 2.0.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +115 -77
- data/lib/snaptrade/api/account_information_api.rb +4 -4
- data/lib/snaptrade/api/authentication_api.rb +4 -4
- data/lib/snaptrade/api/connections_api.rb +70 -52
- data/lib/snaptrade/api/options_api.rb +4 -4
- data/lib/snaptrade/api/trading_api.rb +106 -106
- data/lib/snaptrade/models/account.rb +2 -2
- data/lib/snaptrade/models/brokerage.rb +25 -40
- data/lib/snaptrade/models/brokerage_authorization.rb +12 -8
- data/lib/snaptrade/models/brokerage_authorization_disabled_confirmation.rb +1 -0
- data/lib/snaptrade/models/brokerage_authorization_refresh_confirmation.rb +1 -0
- data/lib/snaptrade/models/brokerage_type.rb +1 -1
- data/lib/snaptrade/models/manual_trade.rb +7 -5
- data/lib/snaptrade/models/manual_trade_and_impact.rb +2 -2
- data/lib/snaptrade/models/manual_trade_balance.rb +3 -3
- data/lib/snaptrade/models/manual_trade_form.rb +52 -25
- data/lib/snaptrade/models/manual_trade_impact.rb +260 -0
- data/lib/snaptrade/models/manual_trade_symbol.rb +6 -1
- data/lib/snaptrade/models/notional_value.rb +1 -1
- data/lib/snaptrade/models/options_place_option_strategy_request.rb +2 -2
- data/lib/snaptrade/models/symbols_quotes_inner.rb +15 -10
- data/lib/snaptrade/models/trading_cancel_user_account_order_request.rb +1 -0
- data/lib/snaptrade/models/validated_trade_body.rb +1 -2
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +1 -0
- data/spec/api/account_information_api_spec.rb +1 -1
- data/spec/api/authentication_api_spec.rb +1 -1
- data/spec/api/connections_api_spec.rb +13 -13
- data/spec/api/trading_api_spec.rb +15 -15
- data/spec/models/brokerage_spec.rb +6 -24
- data/spec/models/manual_trade_form_spec.rb +6 -6
- data/spec/models/manual_trade_impact_spec.rb +53 -0
- data/spec/models/symbols_quotes_inner_spec.rb +3 -3
- metadata +5 -2
@@ -0,0 +1,260 @@
|
|
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 ManualTradeImpact
|
15
|
+
# Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
|
16
|
+
attr_accessor :account
|
17
|
+
|
18
|
+
# Unique identifier for the currency. This is the UUID used to reference the currency in SnapTrade.
|
19
|
+
attr_accessor :currency
|
20
|
+
|
21
|
+
# Estimated amount of cash remaining in the account after the trade.
|
22
|
+
attr_accessor :remaining_cash
|
23
|
+
|
24
|
+
# Estimated commission for the trade.
|
25
|
+
attr_accessor :estimated_commission
|
26
|
+
|
27
|
+
# Estimated foreign transaction fees for the trade.
|
28
|
+
attr_accessor :forex_fees
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'account' => :'account',
|
34
|
+
:'currency' => :'currency',
|
35
|
+
:'remaining_cash' => :'remaining_cash',
|
36
|
+
:'estimated_commission' => :'estimated_commission',
|
37
|
+
:'forex_fees' => :'forex_fees'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# Returns all the JSON keys this model knows about
|
42
|
+
def self.acceptable_attributes
|
43
|
+
attribute_map.values
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute type mapping.
|
47
|
+
def self.openapi_types
|
48
|
+
{
|
49
|
+
:'account' => :'String',
|
50
|
+
:'currency' => :'String',
|
51
|
+
:'remaining_cash' => :'Float',
|
52
|
+
:'estimated_commission' => :'Float',
|
53
|
+
:'forex_fees' => :'Float'
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
# List of attributes with nullable: true
|
58
|
+
def self.openapi_nullable
|
59
|
+
Set.new([
|
60
|
+
:'remaining_cash',
|
61
|
+
:'estimated_commission',
|
62
|
+
:'forex_fees'
|
63
|
+
])
|
64
|
+
end
|
65
|
+
|
66
|
+
# Initializes the object
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
68
|
+
def initialize(attributes = {})
|
69
|
+
if (!attributes.is_a?(Hash))
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::ManualTradeImpact` initialize method"
|
71
|
+
end
|
72
|
+
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
74
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
75
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
76
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::ManualTradeImpact`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
77
|
+
end
|
78
|
+
h[k.to_sym] = v
|
79
|
+
}
|
80
|
+
|
81
|
+
if attributes.key?(:'account')
|
82
|
+
self.account = attributes[:'account']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'currency')
|
86
|
+
self.currency = attributes[:'currency']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'remaining_cash')
|
90
|
+
self.remaining_cash = attributes[:'remaining_cash']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.key?(:'estimated_commission')
|
94
|
+
self.estimated_commission = attributes[:'estimated_commission']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.key?(:'forex_fees')
|
98
|
+
self.forex_fees = attributes[:'forex_fees']
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
103
|
+
# @return Array for valid properties with the reasons
|
104
|
+
def list_invalid_properties
|
105
|
+
invalid_properties = Array.new
|
106
|
+
invalid_properties
|
107
|
+
end
|
108
|
+
|
109
|
+
# Check to see if the all the properties in the model are valid
|
110
|
+
# @return true if the model is valid
|
111
|
+
def valid?
|
112
|
+
true
|
113
|
+
end
|
114
|
+
|
115
|
+
# Checks equality by comparing each attribute.
|
116
|
+
# @param [Object] Object to be compared
|
117
|
+
def ==(o)
|
118
|
+
return true if self.equal?(o)
|
119
|
+
self.class == o.class &&
|
120
|
+
account == o.account &&
|
121
|
+
currency == o.currency &&
|
122
|
+
remaining_cash == o.remaining_cash &&
|
123
|
+
estimated_commission == o.estimated_commission &&
|
124
|
+
forex_fees == o.forex_fees
|
125
|
+
end
|
126
|
+
|
127
|
+
# @see the `==` method
|
128
|
+
# @param [Object] Object to be compared
|
129
|
+
def eql?(o)
|
130
|
+
self == o
|
131
|
+
end
|
132
|
+
|
133
|
+
# Calculates hash code according to all attributes.
|
134
|
+
# @return [Integer] Hash code
|
135
|
+
def hash
|
136
|
+
[account, currency, remaining_cash, estimated_commission, forex_fees].hash
|
137
|
+
end
|
138
|
+
|
139
|
+
# Builds the object from hash
|
140
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
141
|
+
# @return [Object] Returns the model itself
|
142
|
+
def self.build_from_hash(attributes)
|
143
|
+
new.build_from_hash(attributes)
|
144
|
+
end
|
145
|
+
|
146
|
+
# Builds the object from hash
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
148
|
+
# @return [Object] Returns the model itself
|
149
|
+
def build_from_hash(attributes)
|
150
|
+
return nil unless attributes.is_a?(Hash)
|
151
|
+
attributes = attributes.transform_keys(&:to_sym)
|
152
|
+
self.class.openapi_types.each_pair do |key, type|
|
153
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
154
|
+
self.send("#{key}=", nil)
|
155
|
+
elsif type =~ /\AArray<(.*)>/i
|
156
|
+
# check to ensure the input is an array given that the attribute
|
157
|
+
# is documented as an array but the input is not
|
158
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
159
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
160
|
+
end
|
161
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
162
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
self
|
167
|
+
end
|
168
|
+
|
169
|
+
# Deserializes the data based on type
|
170
|
+
# @param string type Data type
|
171
|
+
# @param string value Value to be deserialized
|
172
|
+
# @return [Object] Deserialized data
|
173
|
+
def _deserialize(type, value)
|
174
|
+
case type.to_sym
|
175
|
+
when :Time
|
176
|
+
Time.parse(value)
|
177
|
+
when :Date
|
178
|
+
Date.parse(value)
|
179
|
+
when :String
|
180
|
+
value.to_s
|
181
|
+
when :Integer
|
182
|
+
value.to_i
|
183
|
+
when :Float
|
184
|
+
value.to_f
|
185
|
+
when :Boolean
|
186
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
187
|
+
true
|
188
|
+
else
|
189
|
+
false
|
190
|
+
end
|
191
|
+
when :Object
|
192
|
+
# generic object (usually a Hash), return directly
|
193
|
+
value
|
194
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
195
|
+
inner_type = Regexp.last_match[:inner_type]
|
196
|
+
value.map { |v| _deserialize(inner_type, v) }
|
197
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
198
|
+
k_type = Regexp.last_match[:k_type]
|
199
|
+
v_type = Regexp.last_match[:v_type]
|
200
|
+
{}.tap do |hash|
|
201
|
+
value.each do |k, v|
|
202
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
else # model
|
206
|
+
# models (e.g. Pet) or oneOf
|
207
|
+
klass = SnapTrade.const_get(type)
|
208
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
# Returns the string representation of the object
|
213
|
+
# @return [String] String presentation of the object
|
214
|
+
def to_s
|
215
|
+
to_hash.to_s
|
216
|
+
end
|
217
|
+
|
218
|
+
# to_body is an alias to to_hash (backward compatibility)
|
219
|
+
# @return [Hash] Returns the object in the form of hash
|
220
|
+
def to_body
|
221
|
+
to_hash
|
222
|
+
end
|
223
|
+
|
224
|
+
# Returns the object in the form of hash
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
226
|
+
def to_hash
|
227
|
+
hash = {}
|
228
|
+
self.class.attribute_map.each_pair do |attr, param|
|
229
|
+
value = self.send(attr)
|
230
|
+
if value.nil?
|
231
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
232
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
233
|
+
end
|
234
|
+
|
235
|
+
hash[param] = _to_hash(value)
|
236
|
+
end
|
237
|
+
hash
|
238
|
+
end
|
239
|
+
|
240
|
+
# Outputs non-array value in the form of hash
|
241
|
+
# For object, use to_hash. Otherwise, just return the value
|
242
|
+
# @param [Object] value Any valid value
|
243
|
+
# @return [Hash] Returns the value in the form of hash
|
244
|
+
def _to_hash(value)
|
245
|
+
if value.is_a?(Array)
|
246
|
+
value.compact.map { |v| _to_hash(v) }
|
247
|
+
elsif value.is_a?(Hash)
|
248
|
+
{}.tap do |hash|
|
249
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
250
|
+
end
|
251
|
+
elsif value.respond_to? :to_hash
|
252
|
+
value.to_hash
|
253
|
+
else
|
254
|
+
value
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
end
|
259
|
+
|
260
|
+
end
|
@@ -11,18 +11,23 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
14
|
+
# Information about the security for the order.
|
15
15
|
class ManualTradeSymbol
|
16
|
+
# A unique ID for the security within SnapTrade, scoped to the brokerage account that the security belongs to. This is a legacy field and should not be used. Do not rely on this being a stable ID as it can change.
|
16
17
|
attr_accessor :brokerage_symbol_id
|
17
18
|
|
19
|
+
# Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
|
18
20
|
attr_accessor :universal_symbol_id
|
19
21
|
|
20
22
|
attr_accessor :currency
|
21
23
|
|
24
|
+
# This field is deprecated and should not be used.
|
22
25
|
attr_accessor :local_id
|
23
26
|
|
27
|
+
# This field is deprecated and should not be used.
|
24
28
|
attr_accessor :description
|
25
29
|
|
30
|
+
# This field is deprecated and should not be used.
|
26
31
|
attr_accessor :symbol
|
27
32
|
|
28
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -11,7 +11,7 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
14
|
+
# Total notional amount for the order. Must be `null` if `units` is provided. Can only work with `Market` for `order_type` and `Day` for `time_in_force`. This is only available for certain brokerages. Please check the [integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=e7bbcbf9f272441593f93decde660687) for more information.
|
15
15
|
module NotionalValue
|
16
16
|
class << self
|
17
17
|
# List of class defined in oneOf (OpenAPI v3)
|
@@ -12,10 +12,10 @@ require 'time'
|
|
12
12
|
|
13
13
|
module SnapTrade
|
14
14
|
class OptionsPlaceOptionStrategyRequest
|
15
|
-
#
|
15
|
+
# The type of order to place. - For `Limit` and `StopLimit` orders, the `price` field is required. - For `Stop` and `StopLimit` orders, the `stop` field is required.
|
16
16
|
attr_accessor :order_type
|
17
17
|
|
18
|
-
#
|
18
|
+
# The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
|
19
19
|
attr_accessor :time_in_force
|
20
20
|
|
21
21
|
# Trade Price if limit or stop limit order
|
@@ -14,23 +14,28 @@ module SnapTrade
|
|
14
14
|
class SymbolsQuotesInner
|
15
15
|
attr_accessor :symbol
|
16
16
|
|
17
|
+
# The most recent trade price from the brokerage.
|
18
|
+
attr_accessor :last_trade_price
|
19
|
+
|
20
|
+
# The most recent bid price from the brokerage.
|
17
21
|
attr_accessor :bid_price
|
18
22
|
|
23
|
+
# The most recent price from the brokerage.
|
19
24
|
attr_accessor :ask_price
|
20
25
|
|
21
|
-
|
22
|
-
|
26
|
+
# The most recent bid size from the brokerage.
|
23
27
|
attr_accessor :bid_size
|
24
28
|
|
29
|
+
# The most recent ask size from the brokerage.
|
25
30
|
attr_accessor :ask_size
|
26
31
|
|
27
32
|
# Attribute mapping from ruby-style variable name to JSON key.
|
28
33
|
def self.attribute_map
|
29
34
|
{
|
30
35
|
:'symbol' => :'symbol',
|
36
|
+
:'last_trade_price' => :'last_trade_price',
|
31
37
|
:'bid_price' => :'bid_price',
|
32
38
|
:'ask_price' => :'ask_price',
|
33
|
-
:'last_trade_price' => :'last_trade_price',
|
34
39
|
:'bid_size' => :'bid_size',
|
35
40
|
:'ask_size' => :'ask_size'
|
36
41
|
}
|
@@ -45,9 +50,9 @@ module SnapTrade
|
|
45
50
|
def self.openapi_types
|
46
51
|
{
|
47
52
|
:'symbol' => :'UniversalSymbol',
|
53
|
+
:'last_trade_price' => :'Float',
|
48
54
|
:'bid_price' => :'Float',
|
49
55
|
:'ask_price' => :'Float',
|
50
|
-
:'last_trade_price' => :'Float',
|
51
56
|
:'bid_size' => :'Float',
|
52
57
|
:'ask_size' => :'Float'
|
53
58
|
}
|
@@ -78,6 +83,10 @@ module SnapTrade
|
|
78
83
|
self.symbol = attributes[:'symbol']
|
79
84
|
end
|
80
85
|
|
86
|
+
if attributes.key?(:'last_trade_price')
|
87
|
+
self.last_trade_price = attributes[:'last_trade_price']
|
88
|
+
end
|
89
|
+
|
81
90
|
if attributes.key?(:'bid_price')
|
82
91
|
self.bid_price = attributes[:'bid_price']
|
83
92
|
end
|
@@ -86,10 +95,6 @@ module SnapTrade
|
|
86
95
|
self.ask_price = attributes[:'ask_price']
|
87
96
|
end
|
88
97
|
|
89
|
-
if attributes.key?(:'last_trade_price')
|
90
|
-
self.last_trade_price = attributes[:'last_trade_price']
|
91
|
-
end
|
92
|
-
|
93
98
|
if attributes.key?(:'bid_size')
|
94
99
|
self.bid_size = attributes[:'bid_size']
|
95
100
|
end
|
@@ -118,9 +123,9 @@ module SnapTrade
|
|
118
123
|
return true if self.equal?(o)
|
119
124
|
self.class == o.class &&
|
120
125
|
symbol == o.symbol &&
|
126
|
+
last_trade_price == o.last_trade_price &&
|
121
127
|
bid_price == o.bid_price &&
|
122
128
|
ask_price == o.ask_price &&
|
123
|
-
last_trade_price == o.last_trade_price &&
|
124
129
|
bid_size == o.bid_size &&
|
125
130
|
ask_size == o.ask_size
|
126
131
|
end
|
@@ -134,7 +139,7 @@ module SnapTrade
|
|
134
139
|
# Calculates hash code according to all attributes.
|
135
140
|
# @return [Integer] Hash code
|
136
141
|
def hash
|
137
|
-
[symbol, bid_price, ask_price,
|
142
|
+
[symbol, last_trade_price, bid_price, ask_price, bid_size, ask_size].hash
|
138
143
|
end
|
139
144
|
|
140
145
|
# Builds the object from hash
|
@@ -12,6 +12,7 @@ require 'time'
|
|
12
12
|
|
13
13
|
module SnapTrade
|
14
14
|
class TradingCancelUserAccountOrderRequest
|
15
|
+
# Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
|
15
16
|
attr_accessor :brokerage_order_id
|
16
17
|
|
17
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -11,9 +11,8 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
# Validated Trade Form
|
15
14
|
class ValidatedTradeBody
|
16
|
-
# Optional, defaults to true. Determines if a wait is performed to check on order status. If false, latency will be reduced but orders returned will be more likely to be of status PENDING as we will not wait to check on the status before responding to the request
|
15
|
+
# Optional, defaults to true. Determines if a wait is performed to check on order status. If false, latency will be reduced but orders returned will be more likely to be of status `PENDING` as we will not wait to check on the status before responding to the request.
|
17
16
|
attr_accessor :wait_to_confirm
|
18
17
|
|
19
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
data/lib/snaptrade/version.rb
CHANGED
data/lib/snaptrade.rb
CHANGED
@@ -57,6 +57,7 @@ require 'snaptrade/models/manual_trade_and_impact'
|
|
57
57
|
require 'snaptrade/models/manual_trade_balance'
|
58
58
|
require 'snaptrade/models/manual_trade_form'
|
59
59
|
require 'snaptrade/models/manual_trade_form_notional_value'
|
60
|
+
require 'snaptrade/models/manual_trade_impact'
|
60
61
|
require 'snaptrade/models/manual_trade_symbol'
|
61
62
|
require 'snaptrade/models/model400_failed_request_response'
|
62
63
|
require 'snaptrade/models/model401_failed_request_response'
|
@@ -115,7 +115,7 @@ describe 'AccountInformationApi' do
|
|
115
115
|
|
116
116
|
# unit tests for list_user_accounts
|
117
117
|
# List accounts
|
118
|
-
# Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
118
|
+
# Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
119
119
|
# @param user_id
|
120
120
|
# @param user_secret
|
121
121
|
# @param [Hash] opts the optional parameters
|
@@ -41,7 +41,7 @@ describe 'AuthenticationApi' do
|
|
41
41
|
|
42
42
|
# unit tests for list_snap_trade_users
|
43
43
|
# List all users
|
44
|
-
# Returns a list of all registered user IDs.
|
44
|
+
# Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
45
45
|
# @param [Hash] opts the optional parameters
|
46
46
|
# @return [Array<String>]
|
47
47
|
describe 'list_snap_trade_users test' do
|
@@ -28,9 +28,9 @@ describe 'ConnectionsApi' do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
# unit tests for detail_brokerage_authorization
|
31
|
-
# Get
|
32
|
-
# Returns a single
|
33
|
-
# @param authorization_id
|
31
|
+
# Get connection detail
|
32
|
+
# Returns a single connection for the specified ID.
|
33
|
+
# @param authorization_id
|
34
34
|
# @param user_id
|
35
35
|
# @param user_secret
|
36
36
|
# @param [Hash] opts the optional parameters
|
@@ -42,9 +42,9 @@ describe 'ConnectionsApi' do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
# unit tests for disable_brokerage_authorization
|
45
|
-
#
|
46
|
-
# Manually
|
47
|
-
# @param authorization_id
|
45
|
+
# Force disable connection
|
46
|
+
# Manually force the specified connection to become disabled. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a [`CONNECTION_BROKEN` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_broken) for the connection. *Please contact us in order to use this endpoint as it is disabled by default.*
|
47
|
+
# @param authorization_id
|
48
48
|
# @param user_id
|
49
49
|
# @param user_secret
|
50
50
|
# @param [Hash] opts the optional parameters
|
@@ -56,8 +56,8 @@ describe 'ConnectionsApi' do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
# unit tests for list_brokerage_authorizations
|
59
|
-
# List all
|
60
|
-
# Returns a list of Brokerage Authorization
|
59
|
+
# List all connections
|
60
|
+
# Returns a list of all connections for the specified user. Note that `Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency. A connection is usually tied to a single login at a brokerage. A single connection can contain multiple brokerage accounts. SnapTrade performs de-duping on connections for a given user. If the user has an existing connection with the brokerage, when connecting the brokerage with the same credentials, SnapTrade will return the existing connection instead of creating a new one.
|
61
61
|
# @param user_id
|
62
62
|
# @param user_secret
|
63
63
|
# @param [Hash] opts the optional parameters
|
@@ -70,8 +70,8 @@ describe 'ConnectionsApi' do
|
|
70
70
|
|
71
71
|
# unit tests for refresh_brokerage_authorization
|
72
72
|
# Refresh holdings for a connection
|
73
|
-
# Trigger a holdings update for all accounts under this
|
74
|
-
# @param authorization_id
|
73
|
+
# Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. *Please contact support for access as this endpoint is not enabled by default.*
|
74
|
+
# @param authorization_id
|
75
75
|
# @param user_id
|
76
76
|
# @param user_secret
|
77
77
|
# @param [Hash] opts the optional parameters
|
@@ -83,9 +83,9 @@ describe 'ConnectionsApi' do
|
|
83
83
|
end
|
84
84
|
|
85
85
|
# unit tests for remove_brokerage_authorization
|
86
|
-
# Delete
|
87
|
-
# Deletes
|
88
|
-
# @param authorization_id
|
86
|
+
# Delete connection
|
87
|
+
# Deletes the connection specified by the ID. This will also delete all accounts and holdings associated with the connection. This action is irreversible. This endpoint is synchronous, a 204 response indicates that the connection has been successfully deleted.
|
88
|
+
# @param authorization_id
|
89
89
|
# @param user_id
|
90
90
|
# @param user_secret
|
91
91
|
# @param [Hash] opts the optional parameters
|
@@ -28,12 +28,12 @@ describe 'TradingApi' do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
# unit tests for cancel_user_account_order
|
31
|
-
# Cancel
|
32
|
-
#
|
31
|
+
# Cancel order
|
32
|
+
# Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
|
33
33
|
# @param user_id
|
34
34
|
# @param user_secret
|
35
|
-
# @param account_id
|
36
|
-
# @param trading_cancel_user_account_order_request
|
35
|
+
# @param account_id
|
36
|
+
# @param trading_cancel_user_account_order_request
|
37
37
|
# @param [Hash] opts the optional parameters
|
38
38
|
# @return [AccountOrderRecord]
|
39
39
|
describe 'cancel_user_account_order test' do
|
@@ -43,8 +43,8 @@ describe 'TradingApi' do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
# unit tests for get_order_impact
|
46
|
-
# Check
|
47
|
-
#
|
46
|
+
# Check order impact
|
47
|
+
# Simulates an order and its impact on the account. This endpoint does not place the order with the brokerage. If successful, it returns a `Trade` object and the ID of the object can be used to place the order with the brokerage using the [place checked order endpoint](/reference/Trading/Trading_placeOrder). Please note that the `Trade` object returned expires after 5 minutes. Any order placed using an expired `Trade` will be rejected.
|
48
48
|
# @param user_id
|
49
49
|
# @param user_secret
|
50
50
|
# @param manual_trade_form
|
@@ -58,13 +58,13 @@ describe 'TradingApi' do
|
|
58
58
|
|
59
59
|
# unit tests for get_user_account_quotes
|
60
60
|
# Get symbol quotes
|
61
|
-
# Returns
|
61
|
+
# Returns quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. This endpoint does not work for options quotes.
|
62
62
|
# @param user_id
|
63
63
|
# @param user_secret
|
64
|
-
# @param symbols List of
|
65
|
-
# @param account_id
|
64
|
+
# @param symbols List of Universal Symbol IDs or tickers to get quotes for.
|
65
|
+
# @param account_id
|
66
66
|
# @param [Hash] opts the optional parameters
|
67
|
-
# @option opts [Boolean] :use_ticker Should be set to True if
|
67
|
+
# @option opts [Boolean] :use_ticker Should be set to `True` if `symbols` are comprised of tickers. Defaults to `False` if not provided.
|
68
68
|
# @return [Array<SymbolsQuotesInner>]
|
69
69
|
describe 'get_user_account_quotes test' do
|
70
70
|
it 'should work' do
|
@@ -73,8 +73,8 @@ describe 'TradingApi' do
|
|
73
73
|
end
|
74
74
|
|
75
75
|
# unit tests for place_force_order
|
76
|
-
# Place
|
77
|
-
# Places a
|
76
|
+
# Place order
|
77
|
+
# Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds. This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact).
|
78
78
|
# @param user_id
|
79
79
|
# @param user_secret
|
80
80
|
# @param manual_trade_form
|
@@ -87,9 +87,9 @@ describe 'TradingApi' do
|
|
87
87
|
end
|
88
88
|
|
89
89
|
# unit tests for place_order
|
90
|
-
# Place order
|
91
|
-
# Places the
|
92
|
-
# @param trade_id
|
90
|
+
# Place checked order
|
91
|
+
# Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder).
|
92
|
+
# @param trade_id Obtained from calling the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact)
|
93
93
|
# @param user_id
|
94
94
|
# @param user_secret
|
95
95
|
# @param [Hash] opts the optional parameters
|
@@ -26,6 +26,12 @@ describe SnapTrade::Brokerage do
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
describe 'test attribute "slug"' 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
|
+
|
29
35
|
describe 'test attribute "name"' do
|
30
36
|
it 'should work' do
|
31
37
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -62,12 +68,6 @@ describe SnapTrade::Brokerage do
|
|
62
68
|
end
|
63
69
|
end
|
64
70
|
|
65
|
-
describe 'test attribute "slug"' 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
71
|
describe 'test attribute "url"' do
|
72
72
|
it 'should work' do
|
73
73
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -110,24 +110,6 @@ describe SnapTrade::Brokerage do
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
-
describe 'test attribute "allows_trading_through_snaptrade_api"' do
|
114
|
-
it 'should work' do
|
115
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
describe 'test attribute "is_scraping_integration"' do
|
120
|
-
it 'should work' do
|
121
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
describe 'test attribute "default_currency"' do
|
126
|
-
it 'should work' do
|
127
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
113
|
describe 'test attribute "brokerage_type"' do
|
132
114
|
it 'should work' do
|
133
115
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|