snaptrade 2.0.31 → 2.0.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +31 -29
- data/README.md +4 -2
- data/lib/snaptrade/api/account_information_api.rb +6 -2
- data/lib/snaptrade/models/account_holdings_account.rb +1 -1
- data/lib/snaptrade/models/account_order_record.rb +4 -2
- data/lib/snaptrade/models/exchange.rb +9 -1
- data/lib/snaptrade/models/figi_instrument.rb +3 -1
- data/lib/snaptrade/models/option_brokerage_symbol.rb +3 -1
- data/lib/snaptrade/models/options_position.rb +1 -1
- data/lib/snaptrade/models/options_position_currency.rb +1 -0
- data/lib/snaptrade/models/options_symbol.rb +12 -24
- data/lib/snaptrade/models/position_symbol.rb +6 -1
- data/lib/snaptrade/models/security_type.rb +5 -1
- data/lib/snaptrade/models/symbol_figi_instrument.rb +2 -0
- data/lib/snaptrade/models/underlying_symbol.rb +20 -5
- data/lib/snaptrade/models/{model_portfolio.rb → underlying_symbol_exchange.rb} +73 -12
- data/lib/snaptrade/models/{brokerage_symbol.rb → underlying_symbol_type.rb} +28 -38
- data/lib/snaptrade/models/universal_symbol.rb +9 -3
- data/lib/snaptrade/models/{model_asset_class.rb → universal_symbol_currency.rb} +24 -4
- data/lib/snaptrade/models/{portfolio_group.rb → universal_symbol_exchange.rb} +78 -7
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +4 -36
- data/spec/api/account_information_api_spec.rb +1 -1
- data/spec/models/options_symbol_spec.rb +0 -12
- data/spec/models/{brokerage_symbol_option_symbol_spec.rb → underlying_symbol_exchange_spec.rb} +14 -14
- data/spec/models/underlying_symbol_spec.rb +6 -0
- data/spec/models/{trade_impact_spec.rb → underlying_symbol_type_spec.rb} +10 -16
- data/spec/models/{model_portfolio_spec.rb → universal_symbol_currency_spec.rb} +8 -8
- data/spec/models/{trade_spec.rb → universal_symbol_exchange_spec.rb} +13 -13
- metadata +113 -209
- data/lib/snaptrade/models/brokerage_authorization_type.rb +0 -216
- data/lib/snaptrade/models/brokerage_authorization_type_type.rb +0 -37
- data/lib/snaptrade/models/brokerage_symbol_option_symbol.rb +0 -325
- data/lib/snaptrade/models/brokerage_symbol_symbol.rb +0 -339
- data/lib/snaptrade/models/calculated_trade.rb +0 -228
- data/lib/snaptrade/models/excluded_asset.rb +0 -217
- data/lib/snaptrade/models/jwt.rb +0 -217
- data/lib/snaptrade/models/model_asset_class_details.rb +0 -227
- data/lib/snaptrade/models/model_asset_class_target.rb +0 -216
- data/lib/snaptrade/models/model_portfolio_asset_class.rb +0 -249
- data/lib/snaptrade/models/model_portfolio_details.rb +0 -238
- data/lib/snaptrade/models/model_portfolio_security.rb +0 -249
- data/lib/snaptrade/models/model_type.rb +0 -38
- data/lib/snaptrade/models/portfolio_group_info.rb +0 -325
- data/lib/snaptrade/models/portfolio_group_position.rb +0 -237
- data/lib/snaptrade/models/portfolio_group_settings.rb +0 -276
- data/lib/snaptrade/models/redirect_tokenand_pin.rb +0 -226
- data/lib/snaptrade/models/snap_trade_api_disclaimer_accept_status.rb +0 -226
- data/lib/snaptrade/models/state.rb +0 -40
- data/lib/snaptrade/models/strategy_impact.rb +0 -309
- data/lib/snaptrade/models/strategy_impact_legs_inner.rb +0 -270
- data/lib/snaptrade/models/strategy_order_place.rb +0 -228
- data/lib/snaptrade/models/strategy_order_place_orders_inner.rb +0 -596
- data/lib/snaptrade/models/strategy_order_place_orders_inner_legs_inner.rb +0 -270
- data/lib/snaptrade/models/target_asset.rb +0 -289
- data/lib/snaptrade/models/trade.rb +0 -280
- data/lib/snaptrade/models/trade_action.rb +0 -37
- data/lib/snaptrade/models/trade_execution_status.rb +0 -297
- data/lib/snaptrade/models/trade_execution_status_action.rb +0 -37
- data/lib/snaptrade/models/trade_impact.rb +0 -256
- data/lib/snaptrade/models/user_error_log.rb +0 -262
- data/lib/snaptrade/models/user_settings.rb +0 -298
- data/spec/models/brokerage_authorization_type_spec.rb +0 -29
- data/spec/models/brokerage_authorization_type_type_spec.rb +0 -23
- data/spec/models/brokerage_symbol_spec.rb +0 -59
- data/spec/models/brokerage_symbol_symbol_spec.rb +0 -83
- data/spec/models/calculated_trade_spec.rb +0 -35
- data/spec/models/excluded_asset_spec.rb +0 -29
- data/spec/models/jwt_spec.rb +0 -29
- data/spec/models/model_asset_class_details_spec.rb +0 -35
- data/spec/models/model_asset_class_spec.rb +0 -35
- data/spec/models/model_asset_class_target_spec.rb +0 -29
- data/spec/models/model_portfolio_asset_class_spec.rb +0 -35
- data/spec/models/model_portfolio_details_spec.rb +0 -41
- data/spec/models/model_portfolio_security_spec.rb +0 -35
- data/spec/models/model_type_spec.rb +0 -23
- data/spec/models/portfolio_group_info_spec.rb +0 -89
- data/spec/models/portfolio_group_position_spec.rb +0 -41
- data/spec/models/portfolio_group_settings_spec.rb +0 -53
- data/spec/models/portfolio_group_spec.rb +0 -35
- data/spec/models/redirect_tokenand_pin_spec.rb +0 -35
- data/spec/models/snap_trade_api_disclaimer_accept_status_spec.rb +0 -35
- data/spec/models/state_spec.rb +0 -23
- data/spec/models/strategy_impact_legs_inner_spec.rb +0 -65
- data/spec/models/strategy_impact_spec.rb +0 -89
- data/spec/models/strategy_order_place_orders_inner_legs_inner_spec.rb +0 -65
- data/spec/models/strategy_order_place_orders_inner_spec.rb +0 -281
- data/spec/models/strategy_order_place_spec.rb +0 -35
- data/spec/models/target_asset_spec.rb +0 -59
- data/spec/models/trade_action_spec.rb +0 -23
- data/spec/models/trade_execution_status_action_spec.rb +0 -23
- data/spec/models/trade_execution_status_spec.rb +0 -77
- data/spec/models/user_error_log_spec.rb +0 -59
- data/spec/models/user_settings_spec.rb +0 -83
@@ -1,228 +0,0 @@
|
|
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 reponse for a correctly placed order
|
15
|
-
class StrategyOrderPlace
|
16
|
-
attr_accessor :order_id
|
17
|
-
|
18
|
-
attr_accessor :orders
|
19
|
-
|
20
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
-
def self.attribute_map
|
22
|
-
{
|
23
|
-
:'order_id' => :'orderId',
|
24
|
-
:'orders' => :'orders'
|
25
|
-
}
|
26
|
-
end
|
27
|
-
|
28
|
-
# Returns all the JSON keys this model knows about
|
29
|
-
def self.acceptable_attributes
|
30
|
-
attribute_map.values
|
31
|
-
end
|
32
|
-
|
33
|
-
# Attribute type mapping.
|
34
|
-
def self.openapi_types
|
35
|
-
{
|
36
|
-
:'order_id' => :'Integer',
|
37
|
-
:'orders' => :'Array<StrategyOrderPlaceOrdersInner>'
|
38
|
-
}
|
39
|
-
end
|
40
|
-
|
41
|
-
# List of attributes with nullable: true
|
42
|
-
def self.openapi_nullable
|
43
|
-
Set.new([
|
44
|
-
])
|
45
|
-
end
|
46
|
-
|
47
|
-
# Initializes the object
|
48
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
49
|
-
def initialize(attributes = {})
|
50
|
-
if (!attributes.is_a?(Hash))
|
51
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::StrategyOrderPlace` initialize method"
|
52
|
-
end
|
53
|
-
|
54
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
55
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
56
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
57
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::StrategyOrderPlace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
58
|
-
end
|
59
|
-
h[k.to_sym] = v
|
60
|
-
}
|
61
|
-
|
62
|
-
if attributes.key?(:'order_id')
|
63
|
-
self.order_id = attributes[:'order_id']
|
64
|
-
end
|
65
|
-
|
66
|
-
if attributes.key?(:'orders')
|
67
|
-
if (value = attributes[:'orders']).is_a?(Array)
|
68
|
-
self.orders = value
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
74
|
-
# @return Array for valid properties with the reasons
|
75
|
-
def list_invalid_properties
|
76
|
-
invalid_properties = Array.new
|
77
|
-
invalid_properties
|
78
|
-
end
|
79
|
-
|
80
|
-
# Check to see if the all the properties in the model are valid
|
81
|
-
# @return true if the model is valid
|
82
|
-
def valid?
|
83
|
-
true
|
84
|
-
end
|
85
|
-
|
86
|
-
# Checks equality by comparing each attribute.
|
87
|
-
# @param [Object] Object to be compared
|
88
|
-
def ==(o)
|
89
|
-
return true if self.equal?(o)
|
90
|
-
self.class == o.class &&
|
91
|
-
order_id == o.order_id &&
|
92
|
-
orders == o.orders
|
93
|
-
end
|
94
|
-
|
95
|
-
# @see the `==` method
|
96
|
-
# @param [Object] Object to be compared
|
97
|
-
def eql?(o)
|
98
|
-
self == o
|
99
|
-
end
|
100
|
-
|
101
|
-
# Calculates hash code according to all attributes.
|
102
|
-
# @return [Integer] Hash code
|
103
|
-
def hash
|
104
|
-
[order_id, orders].hash
|
105
|
-
end
|
106
|
-
|
107
|
-
# Builds the object from hash
|
108
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
-
# @return [Object] Returns the model itself
|
110
|
-
def self.build_from_hash(attributes)
|
111
|
-
new.build_from_hash(attributes)
|
112
|
-
end
|
113
|
-
|
114
|
-
# Builds the object from hash
|
115
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
116
|
-
# @return [Object] Returns the model itself
|
117
|
-
def build_from_hash(attributes)
|
118
|
-
return nil unless attributes.is_a?(Hash)
|
119
|
-
attributes = attributes.transform_keys(&:to_sym)
|
120
|
-
self.class.openapi_types.each_pair do |key, type|
|
121
|
-
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
122
|
-
self.send("#{key}=", nil)
|
123
|
-
elsif type =~ /\AArray<(.*)>/i
|
124
|
-
# check to ensure the input is an array given that the attribute
|
125
|
-
# is documented as an array but the input is not
|
126
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
127
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
128
|
-
end
|
129
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
130
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
self
|
135
|
-
end
|
136
|
-
|
137
|
-
# Deserializes the data based on type
|
138
|
-
# @param string type Data type
|
139
|
-
# @param string value Value to be deserialized
|
140
|
-
# @return [Object] Deserialized data
|
141
|
-
def _deserialize(type, value)
|
142
|
-
case type.to_sym
|
143
|
-
when :Time
|
144
|
-
Time.parse(value)
|
145
|
-
when :Date
|
146
|
-
Date.parse(value)
|
147
|
-
when :String
|
148
|
-
value.to_s
|
149
|
-
when :Integer
|
150
|
-
value.to_i
|
151
|
-
when :Float
|
152
|
-
value.to_f
|
153
|
-
when :Boolean
|
154
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
155
|
-
true
|
156
|
-
else
|
157
|
-
false
|
158
|
-
end
|
159
|
-
when :Object
|
160
|
-
# generic object (usually a Hash), return directly
|
161
|
-
value
|
162
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
163
|
-
inner_type = Regexp.last_match[:inner_type]
|
164
|
-
value.map { |v| _deserialize(inner_type, v) }
|
165
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
166
|
-
k_type = Regexp.last_match[:k_type]
|
167
|
-
v_type = Regexp.last_match[:v_type]
|
168
|
-
{}.tap do |hash|
|
169
|
-
value.each do |k, v|
|
170
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
171
|
-
end
|
172
|
-
end
|
173
|
-
else # model
|
174
|
-
# models (e.g. Pet) or oneOf
|
175
|
-
klass = SnapTrade.const_get(type)
|
176
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
177
|
-
end
|
178
|
-
end
|
179
|
-
|
180
|
-
# Returns the string representation of the object
|
181
|
-
# @return [String] String presentation of the object
|
182
|
-
def to_s
|
183
|
-
to_hash.to_s
|
184
|
-
end
|
185
|
-
|
186
|
-
# to_body is an alias to to_hash (backward compatibility)
|
187
|
-
# @return [Hash] Returns the object in the form of hash
|
188
|
-
def to_body
|
189
|
-
to_hash
|
190
|
-
end
|
191
|
-
|
192
|
-
# Returns the object in the form of hash
|
193
|
-
# @return [Hash] Returns the object in the form of hash
|
194
|
-
def to_hash
|
195
|
-
hash = {}
|
196
|
-
self.class.attribute_map.each_pair do |attr, param|
|
197
|
-
value = self.send(attr)
|
198
|
-
if value.nil?
|
199
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
200
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
201
|
-
end
|
202
|
-
|
203
|
-
hash[param] = _to_hash(value)
|
204
|
-
end
|
205
|
-
hash
|
206
|
-
end
|
207
|
-
|
208
|
-
# Outputs non-array value in the form of hash
|
209
|
-
# For object, use to_hash. Otherwise, just return the value
|
210
|
-
# @param [Object] value Any valid value
|
211
|
-
# @return [Hash] Returns the value in the form of hash
|
212
|
-
def _to_hash(value)
|
213
|
-
if value.is_a?(Array)
|
214
|
-
value.compact.map { |v| _to_hash(v) }
|
215
|
-
elsif value.is_a?(Hash)
|
216
|
-
{}.tap do |hash|
|
217
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
218
|
-
end
|
219
|
-
elsif value.respond_to? :to_hash
|
220
|
-
value.to_hash
|
221
|
-
else
|
222
|
-
value
|
223
|
-
end
|
224
|
-
end
|
225
|
-
|
226
|
-
end
|
227
|
-
|
228
|
-
end
|