snaptrade 3.0.5 → 3.0.7
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 +7 -7
- data/lib/snaptrade/api/experimental_endpoints_api.rb +21 -21
- data/lib/snaptrade/models/account_order_record_v2.rb +24 -43
- data/lib/snaptrade/models/account_order_record_v2_order_role.rb +38 -0
- data/lib/snaptrade/models/connection_account_sync_status.rb +1 -1
- data/lib/snaptrade/models/deposit_account.rb +16 -16
- data/lib/snaptrade/models/{deposit_account_balance.rb → deposit_account_net_value.rb} +4 -4
- data/lib/snaptrade/models/deposit_account_sync_status.rb +228 -0
- data/lib/snaptrade/models/investment_account.rb +27 -27
- data/lib/snaptrade/models/{investment_account_market_value.rb → investment_account_net_value.rb} +4 -4
- data/lib/snaptrade/models/o_auth_webhook_base.rb +341 -0
- data/lib/snaptrade/models/price_effect.rb +39 -0
- data/lib/snaptrade/models/schema_version.rb +36 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +7 -2
- data/spec/api/experimental_endpoints_api_spec.rb +2 -2
- data/spec/models/account_order_record_v2_order_role_spec.rb +23 -0
- data/spec/models/account_order_record_v2_spec.rb +7 -5
- data/spec/models/{deposit_account_balance_spec.rb → deposit_account_net_value_spec.rb} +6 -6
- data/spec/models/deposit_account_spec.rb +1 -1
- data/spec/models/deposit_account_sync_status_spec.rb +35 -0
- data/spec/models/{investment_account_market_value_spec.rb → investment_account_net_value_spec.rb} +6 -6
- data/spec/models/investment_account_spec.rb +4 -4
- data/spec/models/o_auth_webhook_base_spec.rb +89 -0
- data/spec/models/price_effect_spec.rb +23 -0
- data/spec/models/schema_version_spec.rb +23 -0
- metadata +228 -213
|
@@ -0,0 +1,341 @@
|
|
|
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 versioned webhook content sent to an authorized OAuth application.
|
|
15
|
+
class OAuthWebhookBase
|
|
16
|
+
attr_accessor :schema_version
|
|
17
|
+
|
|
18
|
+
attr_accessor :webhook_id
|
|
19
|
+
|
|
20
|
+
# The OAuth client ID of the application receiving the webhook.
|
|
21
|
+
attr_accessor :oauth_client_id
|
|
22
|
+
|
|
23
|
+
attr_accessor :event_timestamp
|
|
24
|
+
|
|
25
|
+
# The SnapTrade Personal user UUID, matching `sub.snaptrade_user_id` in the OAuth token response.
|
|
26
|
+
attr_accessor :user_id
|
|
27
|
+
|
|
28
|
+
attr_accessor :event_type
|
|
29
|
+
|
|
30
|
+
attr_accessor :account_id
|
|
31
|
+
|
|
32
|
+
attr_accessor :connection_id
|
|
33
|
+
|
|
34
|
+
attr_accessor :brokerage_id
|
|
35
|
+
|
|
36
|
+
attr_accessor :connection_attempted_result
|
|
37
|
+
|
|
38
|
+
attr_accessor :details
|
|
39
|
+
|
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
41
|
+
def self.attribute_map
|
|
42
|
+
{
|
|
43
|
+
:'schema_version' => :'schemaVersion',
|
|
44
|
+
:'webhook_id' => :'webhookId',
|
|
45
|
+
:'oauth_client_id' => :'oauthClientId',
|
|
46
|
+
:'event_timestamp' => :'eventTimestamp',
|
|
47
|
+
:'user_id' => :'userId',
|
|
48
|
+
:'event_type' => :'eventType',
|
|
49
|
+
:'account_id' => :'accountId',
|
|
50
|
+
:'connection_id' => :'connectionId',
|
|
51
|
+
:'brokerage_id' => :'brokerageId',
|
|
52
|
+
:'connection_attempted_result' => :'connectionAttemptedResult',
|
|
53
|
+
:'details' => :'details'
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns all the JSON keys this model knows about
|
|
58
|
+
def self.acceptable_attributes
|
|
59
|
+
attribute_map.values
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute type mapping.
|
|
63
|
+
def self.openapi_types
|
|
64
|
+
{
|
|
65
|
+
:'schema_version' => :'SchemaVersion',
|
|
66
|
+
:'webhook_id' => :'String',
|
|
67
|
+
:'oauth_client_id' => :'String',
|
|
68
|
+
:'event_timestamp' => :'Time',
|
|
69
|
+
:'user_id' => :'String',
|
|
70
|
+
:'event_type' => :'String',
|
|
71
|
+
:'account_id' => :'String',
|
|
72
|
+
:'connection_id' => :'String',
|
|
73
|
+
:'brokerage_id' => :'String',
|
|
74
|
+
:'connection_attempted_result' => :'String',
|
|
75
|
+
:'details' => :'Hash<String, Object>'
|
|
76
|
+
}
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# List of attributes with nullable: true
|
|
80
|
+
def self.openapi_nullable
|
|
81
|
+
Set.new([
|
|
82
|
+
])
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Initializes the object
|
|
86
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
87
|
+
def initialize(attributes = {})
|
|
88
|
+
if (!attributes.is_a?(Hash))
|
|
89
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::OAuthWebhookBase` initialize method"
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
93
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
94
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
95
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::OAuthWebhookBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
96
|
+
end
|
|
97
|
+
h[k.to_sym] = v
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'schema_version')
|
|
101
|
+
self.schema_version = attributes[:'schema_version']
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'webhook_id')
|
|
105
|
+
self.webhook_id = attributes[:'webhook_id']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'oauth_client_id')
|
|
109
|
+
self.oauth_client_id = attributes[:'oauth_client_id']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'event_timestamp')
|
|
113
|
+
self.event_timestamp = attributes[:'event_timestamp']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'user_id')
|
|
117
|
+
self.user_id = attributes[:'user_id']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'event_type')
|
|
121
|
+
self.event_type = attributes[:'event_type']
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'account_id')
|
|
125
|
+
self.account_id = attributes[:'account_id']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'connection_id')
|
|
129
|
+
self.connection_id = attributes[:'connection_id']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'brokerage_id')
|
|
133
|
+
self.brokerage_id = attributes[:'brokerage_id']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'connection_attempted_result')
|
|
137
|
+
self.connection_attempted_result = attributes[:'connection_attempted_result']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'details')
|
|
141
|
+
if (value = attributes[:'details']).is_a?(Hash)
|
|
142
|
+
self.details = value
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
148
|
+
# @return Array for valid properties with the reasons
|
|
149
|
+
def list_invalid_properties
|
|
150
|
+
invalid_properties = Array.new
|
|
151
|
+
if @schema_version.nil?
|
|
152
|
+
invalid_properties.push('invalid value for "schema_version", schema_version cannot be nil.')
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if @webhook_id.nil?
|
|
156
|
+
invalid_properties.push('invalid value for "webhook_id", webhook_id cannot be nil.')
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if @oauth_client_id.nil?
|
|
160
|
+
invalid_properties.push('invalid value for "oauth_client_id", oauth_client_id cannot be nil.')
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if @event_timestamp.nil?
|
|
164
|
+
invalid_properties.push('invalid value for "event_timestamp", event_timestamp cannot be nil.')
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if @user_id.nil?
|
|
168
|
+
invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if @event_type.nil?
|
|
172
|
+
invalid_properties.push('invalid value for "event_type", event_type cannot be nil.')
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
invalid_properties
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Check to see if the all the properties in the model are valid
|
|
179
|
+
# @return true if the model is valid
|
|
180
|
+
def valid?
|
|
181
|
+
return false if @schema_version.nil?
|
|
182
|
+
return false if @webhook_id.nil?
|
|
183
|
+
return false if @oauth_client_id.nil?
|
|
184
|
+
return false if @event_timestamp.nil?
|
|
185
|
+
return false if @user_id.nil?
|
|
186
|
+
return false if @event_type.nil?
|
|
187
|
+
true
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Checks equality by comparing each attribute.
|
|
191
|
+
# @param [Object] Object to be compared
|
|
192
|
+
def ==(o)
|
|
193
|
+
return true if self.equal?(o)
|
|
194
|
+
self.class == o.class &&
|
|
195
|
+
schema_version == o.schema_version &&
|
|
196
|
+
webhook_id == o.webhook_id &&
|
|
197
|
+
oauth_client_id == o.oauth_client_id &&
|
|
198
|
+
event_timestamp == o.event_timestamp &&
|
|
199
|
+
user_id == o.user_id &&
|
|
200
|
+
event_type == o.event_type &&
|
|
201
|
+
account_id == o.account_id &&
|
|
202
|
+
connection_id == o.connection_id &&
|
|
203
|
+
brokerage_id == o.brokerage_id &&
|
|
204
|
+
connection_attempted_result == o.connection_attempted_result &&
|
|
205
|
+
details == o.details
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# @see the `==` method
|
|
209
|
+
# @param [Object] Object to be compared
|
|
210
|
+
def eql?(o)
|
|
211
|
+
self == o
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Calculates hash code according to all attributes.
|
|
215
|
+
# @return [Integer] Hash code
|
|
216
|
+
def hash
|
|
217
|
+
[schema_version, webhook_id, oauth_client_id, event_timestamp, user_id, event_type, account_id, connection_id, brokerage_id, connection_attempted_result, details].hash
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Builds the object from hash
|
|
221
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
222
|
+
# @return [Object] Returns the model itself
|
|
223
|
+
def self.build_from_hash(attributes)
|
|
224
|
+
new.build_from_hash(attributes)
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Builds the object from hash
|
|
228
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
229
|
+
# @return [Object] Returns the model itself
|
|
230
|
+
def build_from_hash(attributes)
|
|
231
|
+
return nil unless attributes.is_a?(Hash)
|
|
232
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
233
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
234
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
235
|
+
self.send("#{key}=", nil)
|
|
236
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
237
|
+
# check to ensure the input is an array given that the attribute
|
|
238
|
+
# is documented as an array but the input is not
|
|
239
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
240
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
241
|
+
end
|
|
242
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
243
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
244
|
+
end
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
self
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Deserializes the data based on type
|
|
251
|
+
# @param string type Data type
|
|
252
|
+
# @param string value Value to be deserialized
|
|
253
|
+
# @return [Object] Deserialized data
|
|
254
|
+
def _deserialize(type, value)
|
|
255
|
+
case type.to_sym
|
|
256
|
+
when :Time
|
|
257
|
+
Time.parse(value)
|
|
258
|
+
when :Date
|
|
259
|
+
Date.parse(value)
|
|
260
|
+
when :String
|
|
261
|
+
value.to_s
|
|
262
|
+
when :Integer
|
|
263
|
+
value.to_i
|
|
264
|
+
when :Float
|
|
265
|
+
value.to_f
|
|
266
|
+
when :Boolean
|
|
267
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
268
|
+
true
|
|
269
|
+
else
|
|
270
|
+
false
|
|
271
|
+
end
|
|
272
|
+
when :Object
|
|
273
|
+
# generic object (usually a Hash), return directly
|
|
274
|
+
value
|
|
275
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
276
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
277
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
278
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
279
|
+
k_type = Regexp.last_match[:k_type]
|
|
280
|
+
v_type = Regexp.last_match[:v_type]
|
|
281
|
+
{}.tap do |hash|
|
|
282
|
+
value.each do |k, v|
|
|
283
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
284
|
+
end
|
|
285
|
+
end
|
|
286
|
+
else # model
|
|
287
|
+
# models (e.g. Pet) or oneOf
|
|
288
|
+
klass = SnapTrade.const_get(type)
|
|
289
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
290
|
+
end
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Returns the string representation of the object
|
|
294
|
+
# @return [String] String presentation of the object
|
|
295
|
+
def to_s
|
|
296
|
+
to_hash.to_s
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
300
|
+
# @return [Hash] Returns the object in the form of hash
|
|
301
|
+
def to_body
|
|
302
|
+
to_hash
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
# Returns the object in the form of hash
|
|
306
|
+
# @return [Hash] Returns the object in the form of hash
|
|
307
|
+
def to_hash
|
|
308
|
+
hash = {}
|
|
309
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
310
|
+
value = self.send(attr)
|
|
311
|
+
if value.nil?
|
|
312
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
313
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
hash[param] = _to_hash(value)
|
|
317
|
+
end
|
|
318
|
+
hash
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
# Outputs non-array value in the form of hash
|
|
322
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
323
|
+
# @param [Object] value Any valid value
|
|
324
|
+
# @return [Hash] Returns the value in the form of hash
|
|
325
|
+
def _to_hash(value)
|
|
326
|
+
if value.is_a?(Array)
|
|
327
|
+
value.compact.map { |v| _to_hash(v) }
|
|
328
|
+
elsif value.is_a?(Hash)
|
|
329
|
+
{}.tap do |hash|
|
|
330
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
331
|
+
end
|
|
332
|
+
elsif value.respond_to? :to_hash
|
|
333
|
+
value.to_hash
|
|
334
|
+
else
|
|
335
|
+
value
|
|
336
|
+
end
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
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 PriceEffect
|
|
15
|
+
CREDIT = "CREDIT".freeze
|
|
16
|
+
DEBIT = "DEBIT".freeze
|
|
17
|
+
EVEN = "EVEN".freeze
|
|
18
|
+
UNKNOWN = "UNKNOWN".freeze
|
|
19
|
+
|
|
20
|
+
def self.all_vars
|
|
21
|
+
@all_vars ||= [CREDIT, DEBIT, EVEN, UNKNOWN].freeze
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Builds the enum from string
|
|
25
|
+
# @param [String] The enum value in the form of the string
|
|
26
|
+
# @return [String] The enum value
|
|
27
|
+
def self.build_from_hash(value)
|
|
28
|
+
new.build_from_hash(value)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Builds the enum from string
|
|
32
|
+
# @param [String] The enum value in the form of the string
|
|
33
|
+
# @return [String] The enum value
|
|
34
|
+
def build_from_hash(value)
|
|
35
|
+
return value if PriceEffect.all_vars.include?(value)
|
|
36
|
+
raise "Invalid ENUM value #{value} for class #PriceEffect"
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
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 SchemaVersion
|
|
15
|
+
OAUTH_V1 = "oauth_v1".freeze
|
|
16
|
+
|
|
17
|
+
def self.all_vars
|
|
18
|
+
@all_vars ||= [OAUTH_V1].freeze
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Builds the enum from string
|
|
22
|
+
# @param [String] The enum value in the form of the string
|
|
23
|
+
# @return [String] The enum value
|
|
24
|
+
def self.build_from_hash(value)
|
|
25
|
+
new.build_from_hash(value)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Builds the enum from string
|
|
29
|
+
# @param [String] The enum value in the form of the string
|
|
30
|
+
# @return [String] The enum value
|
|
31
|
+
def build_from_hash(value)
|
|
32
|
+
return value if SchemaVersion.all_vars.include?(value)
|
|
33
|
+
raise "Invalid ENUM value #{value} for class #SchemaVersion"
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
data/lib/snaptrade/version.rb
CHANGED
data/lib/snaptrade.rb
CHANGED
|
@@ -35,6 +35,7 @@ require 'snaptrade/models/account_order_record_status_v2'
|
|
|
35
35
|
require 'snaptrade/models/account_order_record_trailing_stop'
|
|
36
36
|
require 'snaptrade/models/account_order_record_universal_symbol'
|
|
37
37
|
require 'snaptrade/models/account_order_record_v2'
|
|
38
|
+
require 'snaptrade/models/account_order_record_v2_order_role'
|
|
38
39
|
require 'snaptrade/models/account_orders_v2_response'
|
|
39
40
|
require 'snaptrade/models/account_position'
|
|
40
41
|
require 'snaptrade/models/account_simple'
|
|
@@ -99,8 +100,9 @@ require 'snaptrade/models/currency'
|
|
|
99
100
|
require 'snaptrade/models/delete_connection_confirmation'
|
|
100
101
|
require 'snaptrade/models/delete_user_response'
|
|
101
102
|
require 'snaptrade/models/deposit_account'
|
|
102
|
-
require 'snaptrade/models/deposit_account_balance'
|
|
103
103
|
require 'snaptrade/models/deposit_account_kind'
|
|
104
|
+
require 'snaptrade/models/deposit_account_net_value'
|
|
105
|
+
require 'snaptrade/models/deposit_account_sync_status'
|
|
104
106
|
require 'snaptrade/models/dividend_at_date'
|
|
105
107
|
require 'snaptrade/models/encrypted_response'
|
|
106
108
|
require 'snaptrade/models/encrypted_response_encrypted_message_data'
|
|
@@ -114,7 +116,7 @@ require 'snaptrade/models/future_instrument_kind'
|
|
|
114
116
|
require 'snaptrade/models/holdings_status'
|
|
115
117
|
require 'snaptrade/models/instrument'
|
|
116
118
|
require 'snaptrade/models/investment_account'
|
|
117
|
-
require 'snaptrade/models/
|
|
119
|
+
require 'snaptrade/models/investment_account_net_value'
|
|
118
120
|
require 'snaptrade/models/kind'
|
|
119
121
|
require 'snaptrade/models/login_redirect_uri'
|
|
120
122
|
require 'snaptrade/models/manual_trade'
|
|
@@ -156,6 +158,7 @@ require 'snaptrade/models/mutual_fund_instrument_kind'
|
|
|
156
158
|
require 'snaptrade/models/net_contributions'
|
|
157
159
|
require 'snaptrade/models/net_dividend'
|
|
158
160
|
require 'snaptrade/models/notional_value'
|
|
161
|
+
require 'snaptrade/models/o_auth_webhook_base'
|
|
159
162
|
require 'snaptrade/models/option_brokerage_symbol'
|
|
160
163
|
require 'snaptrade/models/option_chain_inner'
|
|
161
164
|
require 'snaptrade/models/option_chain_inner_chain_per_root_inner'
|
|
@@ -188,9 +191,11 @@ require 'snaptrade/models/performance_custom'
|
|
|
188
191
|
require 'snaptrade/models/position'
|
|
189
192
|
require 'snaptrade/models/position_currency'
|
|
190
193
|
require 'snaptrade/models/position_symbol'
|
|
194
|
+
require 'snaptrade/models/price_effect'
|
|
191
195
|
require 'snaptrade/models/rate_of_return_object'
|
|
192
196
|
require 'snaptrade/models/rate_of_return_response'
|
|
193
197
|
require 'snaptrade/models/recent_orders_response'
|
|
198
|
+
require 'snaptrade/models/schema_version'
|
|
194
199
|
require 'snaptrade/models/security_type'
|
|
195
200
|
require 'snaptrade/models/session_event'
|
|
196
201
|
require 'snaptrade/models/session_event_type'
|
|
@@ -101,8 +101,8 @@ describe 'ExperimentalEndpointsApi' do
|
|
|
101
101
|
|
|
102
102
|
# unit tests for list_connection_accounts
|
|
103
103
|
# List accounts for a connection (discriminated union)
|
|
104
|
-
# Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total
|
|
105
|
-
# @param
|
|
104
|
+
# Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
105
|
+
# @param connection_id
|
|
106
106
|
# @param user_id
|
|
107
107
|
# @param user_secret
|
|
108
108
|
# @param [Hash] opts the optional parameters
|
|
@@ -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::AccountOrderRecordV2OrderRole
|
|
15
|
+
describe SnapTrade::AccountOrderRecordV2OrderRole do
|
|
16
|
+
let(:instance) { SnapTrade::AccountOrderRecordV2OrderRole.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of AccountOrderRecordV2OrderRole' do
|
|
19
|
+
it 'should create an instance of AccountOrderRecordV2OrderRole' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::AccountOrderRecordV2OrderRole)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -35,10 +35,6 @@ describe SnapTrade::AccountOrderRecordV2 do
|
|
|
35
35
|
describe 'test attribute "order_role"' do
|
|
36
36
|
it 'should work' do
|
|
37
37
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
38
|
-
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["TRIGGER", "CONDITIONAL", "PEER"])
|
|
39
|
-
# validator.allowable_values.each do |value|
|
|
40
|
-
# expect { instance.order_role = value }.not_to raise_error
|
|
41
|
-
# end
|
|
42
38
|
end
|
|
43
39
|
end
|
|
44
40
|
|
|
@@ -72,7 +68,13 @@ describe SnapTrade::AccountOrderRecordV2 do
|
|
|
72
68
|
end
|
|
73
69
|
end
|
|
74
70
|
|
|
75
|
-
describe 'test attribute "
|
|
71
|
+
describe 'test attribute "price_currency"' do
|
|
72
|
+
it 'should work' do
|
|
73
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
describe 'test attribute "price_effect"' do
|
|
76
78
|
it 'should work' do
|
|
77
79
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
78
80
|
end
|
|
@@ -11,13 +11,13 @@ require 'spec_helper'
|
|
|
11
11
|
require 'json'
|
|
12
12
|
require 'date'
|
|
13
13
|
|
|
14
|
-
# Unit tests for SnapTrade::
|
|
15
|
-
describe SnapTrade::
|
|
16
|
-
let(:instance) { SnapTrade::
|
|
14
|
+
# Unit tests for SnapTrade::DepositAccountNetValue
|
|
15
|
+
describe SnapTrade::DepositAccountNetValue do
|
|
16
|
+
let(:instance) { SnapTrade::DepositAccountNetValue.new }
|
|
17
17
|
|
|
18
|
-
describe 'test an instance of
|
|
19
|
-
it 'should create an instance of
|
|
20
|
-
expect(instance).to be_instance_of(SnapTrade::
|
|
18
|
+
describe 'test an instance of DepositAccountNetValue' do
|
|
19
|
+
it 'should create an instance of DepositAccountNetValue' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::DepositAccountNetValue)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
describe 'test attribute "amount"' do
|
|
@@ -80,7 +80,7 @@ describe SnapTrade::DepositAccount do
|
|
|
80
80
|
end
|
|
81
81
|
end
|
|
82
82
|
|
|
83
|
-
describe 'test attribute "
|
|
83
|
+
describe 'test attribute "net_value"' do
|
|
84
84
|
it 'should work' do
|
|
85
85
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
86
86
|
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::DepositAccountSyncStatus
|
|
15
|
+
describe SnapTrade::DepositAccountSyncStatus do
|
|
16
|
+
let(:instance) { SnapTrade::DepositAccountSyncStatus.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of DepositAccountSyncStatus' do
|
|
19
|
+
it 'should create an instance of DepositAccountSyncStatus' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::DepositAccountSyncStatus)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
describe 'test attribute "transactions"' 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 "balances"' 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
|
data/spec/models/{investment_account_market_value_spec.rb → investment_account_net_value_spec.rb}
RENAMED
|
@@ -11,13 +11,13 @@ require 'spec_helper'
|
|
|
11
11
|
require 'json'
|
|
12
12
|
require 'date'
|
|
13
13
|
|
|
14
|
-
# Unit tests for SnapTrade::
|
|
15
|
-
describe SnapTrade::
|
|
16
|
-
let(:instance) { SnapTrade::
|
|
14
|
+
# Unit tests for SnapTrade::InvestmentAccountNetValue
|
|
15
|
+
describe SnapTrade::InvestmentAccountNetValue do
|
|
16
|
+
let(:instance) { SnapTrade::InvestmentAccountNetValue.new }
|
|
17
17
|
|
|
18
|
-
describe 'test an instance of
|
|
19
|
-
it 'should create an instance of
|
|
20
|
-
expect(instance).to be_instance_of(SnapTrade::
|
|
18
|
+
describe 'test an instance of InvestmentAccountNetValue' do
|
|
19
|
+
it 'should create an instance of InvestmentAccountNetValue' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::InvestmentAccountNetValue)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
describe 'test attribute "amount"' do
|
|
@@ -68,19 +68,19 @@ describe SnapTrade::InvestmentAccount do
|
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
-
describe 'test attribute "
|
|
71
|
+
describe 'test attribute "funding_date"' do
|
|
72
72
|
it 'should work' do
|
|
73
73
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
74
74
|
end
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
-
describe 'test attribute "
|
|
77
|
+
describe 'test attribute "sync_status"' do
|
|
78
78
|
it 'should work' do
|
|
79
79
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
80
80
|
end
|
|
81
81
|
end
|
|
82
82
|
|
|
83
|
-
describe 'test attribute "
|
|
83
|
+
describe 'test attribute "raw_type"' do
|
|
84
84
|
it 'should work' do
|
|
85
85
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
86
86
|
end
|
|
@@ -92,7 +92,7 @@ describe SnapTrade::InvestmentAccount do
|
|
|
92
92
|
end
|
|
93
93
|
end
|
|
94
94
|
|
|
95
|
-
describe 'test attribute "
|
|
95
|
+
describe 'test attribute "net_value"' do
|
|
96
96
|
it 'should work' do
|
|
97
97
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
98
98
|
end
|