snaptrade 2.0.33 → 2.0.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +81 -54
  4. data/lib/snaptrade/api/account_information_api.rb +74 -56
  5. data/lib/snaptrade/api/authentication_api.rb +44 -46
  6. data/lib/snaptrade/api/connections_api.rb +8 -8
  7. data/lib/snaptrade/api/options_api.rb +16 -12
  8. data/lib/snaptrade/api/transactions_and_reporting_api.rb +36 -28
  9. data/lib/snaptrade/models/account.rb +11 -2
  10. data/lib/snaptrade/models/account_balance_total.rb +1 -8
  11. data/lib/snaptrade/models/account_holdings_account.rb +1 -1
  12. data/lib/snaptrade/models/account_order_record.rb +1 -1
  13. data/lib/snaptrade/models/account_order_record_universal_symbol.rb +2 -2
  14. data/lib/snaptrade/models/account_simple.rb +4 -1
  15. data/lib/snaptrade/models/account_sync_status.rb +1 -1
  16. data/lib/snaptrade/models/balance.rb +1 -1
  17. data/lib/snaptrade/models/{snap_trade_holdings_account_account_id_balance.rb → balance_currency.rb} +33 -12
  18. data/lib/snaptrade/models/delete_user_response.rb +12 -3
  19. data/lib/snaptrade/models/holdings_status.rb +4 -4
  20. data/lib/snaptrade/models/login_redirect_uri.rb +3 -2
  21. data/lib/snaptrade/models/snap_trade_login_user_request_body.rb +10 -6
  22. data/lib/snaptrade/models/symbol.rb +16 -10
  23. data/lib/snaptrade/models/{universal_symbol_currency.rb → symbol_currency.rb} +3 -3
  24. data/lib/snaptrade/models/{universal_symbol_exchange.rb → symbol_exchange.rb} +3 -3
  25. data/lib/snaptrade/models/transactions_status.rb +4 -5
  26. data/lib/snaptrade/models/underlying_symbol.rb +1 -1
  27. data/lib/snaptrade/models/universal_activity.rb +91 -81
  28. data/lib/snaptrade/models/{amount.rb → universal_activity_currency.rb} +36 -19
  29. data/lib/snaptrade/models/{snap_trade_holdings_account_account_id.rb → universal_activity_option_symbol.rb} +83 -82
  30. data/lib/snaptrade/models/universal_activity_symbol.rb +304 -0
  31. data/lib/snaptrade/models/universal_symbol.rb +2 -2
  32. data/lib/snaptrade/models/user_i_dand_secret.rb +1 -1
  33. data/lib/snaptrade/version.rb +1 -1
  34. data/lib/snaptrade.rb +6 -5
  35. data/spec/api/account_information_api_spec.rb +13 -13
  36. data/spec/api/authentication_api_spec.rb +7 -7
  37. data/spec/api/connections_api_spec.rb +2 -2
  38. data/spec/api/options_api_spec.rb +3 -3
  39. data/spec/api/transactions_and_reporting_api_spec.rb +7 -7
  40. data/spec/models/{universal_symbol_currency_spec.rb → balance_currency_spec.rb} +6 -6
  41. data/spec/models/delete_user_response_spec.rb +6 -0
  42. data/spec/models/symbol_currency_spec.rb +41 -0
  43. data/spec/models/{universal_symbol_exchange_spec.rb → symbol_exchange_spec.rb} +6 -6
  44. data/spec/models/symbol_spec.rb +1 -1
  45. data/spec/models/universal_activity_currency_spec.rb +41 -0
  46. data/spec/models/universal_activity_option_symbol_spec.rb +65 -0
  47. data/spec/models/universal_activity_spec.rb +15 -15
  48. data/spec/models/{snap_trade_holdings_account_account_id_spec.rb → universal_activity_symbol_spec.rb} +14 -20
  49. metadata +20 -17
  50. data/spec/models/amount_spec.rb +0 -35
  51. data/spec/models/snap_trade_holdings_account_account_id_balance_spec.rb +0 -29
@@ -11,50 +11,38 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # A single brokerage account at a financial institution.
15
- class SnapTradeHoldingsAccountAccountId
16
- # Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
14
+ # The option security for the transaction. The field is `null` if the transaction is not related to an option security (like a deposit, withdrawal, fee, etc). SnapTrade does a best effort to map the brokerage's option symbol. In cases where the brokerage option symbol is not recognized, the field will be set to `null`.
15
+ class UniversalActivityOptionSymbol
16
+ # Unique identifier for the option symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
17
17
  attr_accessor :id
18
18
 
19
- # Unique identifier for the connection (brokerage authorization). This is the UUID used to reference the connection in SnapTrade.
20
- attr_accessor :brokerage_authorization
19
+ # The [OCC symbol](https://en.wikipedia.org/wiki/Option_symbol) for the option.
20
+ attr_accessor :ticker
21
21
 
22
- # Portfolio Group ID. Portfolio Groups have been deprecated. Please contact support if you have a usecase for it.
23
- attr_accessor :portfolio_group
22
+ # The type of option. Either \"CALL\" or \"PUT\".
23
+ attr_accessor :option_type
24
24
 
25
- # A display name for the account. Either assigned by the user or by the financial institution itself. For certain institutions, SnapTrade appends the institution name to the account name for clarity.
26
- attr_accessor :name
25
+ # The option strike price.
26
+ attr_accessor :strike_price
27
27
 
28
- # The account number assigned by the financial institution.
29
- attr_accessor :number
28
+ # The option expiration date.
29
+ attr_accessor :expiration_date
30
30
 
31
- # The name of the financial institution that holds the account.
32
- attr_accessor :institution_name
31
+ # Whether the option is a mini option. Mini options have 10 underlying shares per contract instead of the standard 100.
32
+ attr_accessor :is_mini_option
33
33
 
34
- attr_accessor :balance
35
-
36
- # Additional information about the account, such as account type, status, etc. This information is specific to the financial institution and there's no standard format for this data. Please use at your own risk.
37
- attr_accessor :meta
38
-
39
- # This field is deprecated.
40
- attr_accessor :cash_restrictions
41
-
42
- # Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was created in SnapTrade. This is _not_ the account opening date at the financial institution.
43
- attr_accessor :created_date
34
+ attr_accessor :underlying_symbol
44
35
 
45
36
  # Attribute mapping from ruby-style variable name to JSON key.
46
37
  def self.attribute_map
47
38
  {
48
39
  :'id' => :'id',
49
- :'brokerage_authorization' => :'brokerage_authorization',
50
- :'portfolio_group' => :'portfolio_group',
51
- :'name' => :'name',
52
- :'number' => :'number',
53
- :'institution_name' => :'institution_name',
54
- :'balance' => :'balance',
55
- :'meta' => :'meta',
56
- :'cash_restrictions' => :'cash_restrictions',
57
- :'created_date' => :'created_date'
40
+ :'ticker' => :'ticker',
41
+ :'option_type' => :'option_type',
42
+ :'strike_price' => :'strike_price',
43
+ :'expiration_date' => :'expiration_date',
44
+ :'is_mini_option' => :'is_mini_option',
45
+ :'underlying_symbol' => :'underlying_symbol'
58
46
  }
59
47
  end
60
48
 
@@ -67,37 +55,39 @@ module SnapTrade
67
55
  def self.openapi_types
68
56
  {
69
57
  :'id' => :'String',
70
- :'brokerage_authorization' => :'String',
71
- :'portfolio_group' => :'String',
72
- :'name' => :'String',
73
- :'number' => :'String',
74
- :'institution_name' => :'String',
75
- :'balance' => :'SnapTradeHoldingsAccountAccountIdBalance',
76
- :'meta' => :'Hash<String, Object>',
77
- :'cash_restrictions' => :'Array<String>',
78
- :'created_date' => :'Time'
58
+ :'ticker' => :'String',
59
+ :'option_type' => :'OptionType',
60
+ :'strike_price' => :'Float',
61
+ :'expiration_date' => :'Date',
62
+ :'is_mini_option' => :'Boolean',
63
+ :'underlying_symbol' => :'UnderlyingSymbol'
79
64
  }
80
65
  end
81
66
 
82
67
  # List of attributes with nullable: true
83
68
  def self.openapi_nullable
84
69
  Set.new([
85
- :'name',
86
- :'balance',
87
70
  ])
88
71
  end
89
72
 
73
+ # List of class defined in allOf (OpenAPI v3)
74
+ def self.openapi_all_of
75
+ [
76
+ :'OptionsSymbol'
77
+ ]
78
+ end
79
+
90
80
  # Initializes the object
91
81
  # @param [Hash] attributes Model attributes in the form of hash
92
82
  def initialize(attributes = {})
93
83
  if (!attributes.is_a?(Hash))
94
- fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::SnapTradeHoldingsAccountAccountId` initialize method"
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::UniversalActivityOptionSymbol` initialize method"
95
85
  end
96
86
 
97
87
  # check to see if the attribute exists and convert string to symbol for hash key
98
88
  attributes = attributes.each_with_object({}) { |(k, v), h|
99
89
  if (!self.class.attribute_map.key?(k.to_sym))
100
- fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::SnapTradeHoldingsAccountAccountId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::UniversalActivityOptionSymbol`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
101
91
  end
102
92
  h[k.to_sym] = v
103
93
  }
@@ -106,57 +96,71 @@ module SnapTrade
106
96
  self.id = attributes[:'id']
107
97
  end
108
98
 
109
- if attributes.key?(:'brokerage_authorization')
110
- self.brokerage_authorization = attributes[:'brokerage_authorization']
99
+ if attributes.key?(:'ticker')
100
+ self.ticker = attributes[:'ticker']
111
101
  end
112
102
 
113
- if attributes.key?(:'portfolio_group')
114
- self.portfolio_group = attributes[:'portfolio_group']
103
+ if attributes.key?(:'option_type')
104
+ self.option_type = attributes[:'option_type']
115
105
  end
116
106
 
117
- if attributes.key?(:'name')
118
- self.name = attributes[:'name']
107
+ if attributes.key?(:'strike_price')
108
+ self.strike_price = attributes[:'strike_price']
119
109
  end
120
110
 
121
- if attributes.key?(:'number')
122
- self.number = attributes[:'number']
111
+ if attributes.key?(:'expiration_date')
112
+ self.expiration_date = attributes[:'expiration_date']
123
113
  end
124
114
 
125
- if attributes.key?(:'institution_name')
126
- self.institution_name = attributes[:'institution_name']
115
+ if attributes.key?(:'is_mini_option')
116
+ self.is_mini_option = attributes[:'is_mini_option']
127
117
  end
128
118
 
129
- if attributes.key?(:'balance')
130
- self.balance = attributes[:'balance']
119
+ if attributes.key?(:'underlying_symbol')
120
+ self.underlying_symbol = attributes[:'underlying_symbol']
131
121
  end
122
+ end
132
123
 
133
- if attributes.key?(:'meta')
134
- if (value = attributes[:'meta']).is_a?(Hash)
135
- self.meta = value
136
- end
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properties with the reasons
126
+ def list_invalid_properties
127
+ invalid_properties = Array.new
128
+ if @id.nil?
129
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
137
130
  end
138
131
 
139
- if attributes.key?(:'cash_restrictions')
140
- if (value = attributes[:'cash_restrictions']).is_a?(Array)
141
- self.cash_restrictions = value
142
- end
132
+ if @ticker.nil?
133
+ invalid_properties.push('invalid value for "ticker", ticker cannot be nil.')
143
134
  end
144
135
 
145
- if attributes.key?(:'created_date')
146
- self.created_date = attributes[:'created_date']
136
+ if @option_type.nil?
137
+ invalid_properties.push('invalid value for "option_type", option_type cannot be nil.')
138
+ end
139
+
140
+ if @strike_price.nil?
141
+ invalid_properties.push('invalid value for "strike_price", strike_price cannot be nil.')
142
+ end
143
+
144
+ if @expiration_date.nil?
145
+ invalid_properties.push('invalid value for "expiration_date", expiration_date cannot be nil.')
146
+ end
147
+
148
+ if @underlying_symbol.nil?
149
+ invalid_properties.push('invalid value for "underlying_symbol", underlying_symbol cannot be nil.')
147
150
  end
148
- end
149
151
 
150
- # Show invalid properties with the reasons. Usually used together with valid?
151
- # @return Array for valid properties with the reasons
152
- def list_invalid_properties
153
- invalid_properties = Array.new
154
152
  invalid_properties
155
153
  end
156
154
 
157
155
  # Check to see if the all the properties in the model are valid
158
156
  # @return true if the model is valid
159
157
  def valid?
158
+ return false if @id.nil?
159
+ return false if @ticker.nil?
160
+ return false if @option_type.nil?
161
+ return false if @strike_price.nil?
162
+ return false if @expiration_date.nil?
163
+ return false if @underlying_symbol.nil?
160
164
  true
161
165
  end
162
166
 
@@ -166,15 +170,12 @@ module SnapTrade
166
170
  return true if self.equal?(o)
167
171
  self.class == o.class &&
168
172
  id == o.id &&
169
- brokerage_authorization == o.brokerage_authorization &&
170
- portfolio_group == o.portfolio_group &&
171
- name == o.name &&
172
- number == o.number &&
173
- institution_name == o.institution_name &&
174
- balance == o.balance &&
175
- meta == o.meta &&
176
- cash_restrictions == o.cash_restrictions &&
177
- created_date == o.created_date
173
+ ticker == o.ticker &&
174
+ option_type == o.option_type &&
175
+ strike_price == o.strike_price &&
176
+ expiration_date == o.expiration_date &&
177
+ is_mini_option == o.is_mini_option &&
178
+ underlying_symbol == o.underlying_symbol
178
179
  end
179
180
 
180
181
  # @see the `==` method
@@ -186,7 +187,7 @@ module SnapTrade
186
187
  # Calculates hash code according to all attributes.
187
188
  # @return [Integer] Hash code
188
189
  def hash
189
- [id, brokerage_authorization, portfolio_group, name, number, institution_name, balance, meta, cash_restrictions, created_date].hash
190
+ [id, ticker, option_type, strike_price, expiration_date, is_mini_option, underlying_symbol].hash
190
191
  end
191
192
 
192
193
  # Builds the object from hash
@@ -0,0 +1,304 @@
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 security for the transaction. The field is `null` if the transaction is not related to a security (like a deposit, withdrawal, fee, etc). SnapTrade does a best effort to map the brokerage's symbol. In cases where the brokerage symbol is not recognized, the field will be set to `null`.
15
+ class UniversalActivitySymbol
16
+ # Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
17
+ attr_accessor :id
18
+
19
+ # The security's trading ticker symbol. For example \"AAPL\" for Apple Inc. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on \"Yahoo Finance Market Coverage and Data Delays\"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix.
20
+ attr_accessor :symbol
21
+
22
+ # The raw symbol is `symbol` with the exchange suffix removed. For example, if `symbol` is \"VAB.TO\", then `raw_symbol` is \"VAB\".
23
+ attr_accessor :raw_symbol
24
+
25
+ # A human-readable description of the security. This is usually the company name or ETF name.
26
+ attr_accessor :description
27
+
28
+ attr_accessor :currency
29
+
30
+ attr_accessor :exchange
31
+
32
+ attr_accessor :type
33
+
34
+ # This identifier is unique per security per trading venue. See section 1.4.1 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information. This value should be the same as the `figi_code` in the `figi_instrument` child property.
35
+ attr_accessor :figi_code
36
+
37
+ attr_accessor :figi_instrument
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'id' => :'id',
43
+ :'symbol' => :'symbol',
44
+ :'raw_symbol' => :'raw_symbol',
45
+ :'description' => :'description',
46
+ :'currency' => :'currency',
47
+ :'exchange' => :'exchange',
48
+ :'type' => :'type',
49
+ :'figi_code' => :'figi_code',
50
+ :'figi_instrument' => :'figi_instrument'
51
+ }
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'id' => :'String',
63
+ :'symbol' => :'String',
64
+ :'raw_symbol' => :'String',
65
+ :'description' => :'String',
66
+ :'currency' => :'SymbolCurrency',
67
+ :'exchange' => :'SymbolExchange',
68
+ :'type' => :'SecurityType',
69
+ :'figi_code' => :'String',
70
+ :'figi_instrument' => :'SymbolFigiInstrument'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ :'description',
78
+ :'figi_code',
79
+ :'figi_instrument'
80
+ ])
81
+ end
82
+
83
+ # List of class defined in allOf (OpenAPI v3)
84
+ def self.openapi_all_of
85
+ [
86
+ :'Symbol'
87
+ ]
88
+ end
89
+
90
+ # Initializes the object
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ def initialize(attributes = {})
93
+ if (!attributes.is_a?(Hash))
94
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::UniversalActivitySymbol` initialize method"
95
+ end
96
+
97
+ # check to see if the attribute exists and convert string to symbol for hash key
98
+ attributes = attributes.each_with_object({}) { |(k, v), h|
99
+ if (!self.class.attribute_map.key?(k.to_sym))
100
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::UniversalActivitySymbol`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
101
+ end
102
+ h[k.to_sym] = v
103
+ }
104
+
105
+ if attributes.key?(:'id')
106
+ self.id = attributes[:'id']
107
+ end
108
+
109
+ if attributes.key?(:'symbol')
110
+ self.symbol = attributes[:'symbol']
111
+ end
112
+
113
+ if attributes.key?(:'raw_symbol')
114
+ self.raw_symbol = attributes[:'raw_symbol']
115
+ end
116
+
117
+ if attributes.key?(:'description')
118
+ self.description = attributes[:'description']
119
+ end
120
+
121
+ if attributes.key?(:'currency')
122
+ self.currency = attributes[:'currency']
123
+ end
124
+
125
+ if attributes.key?(:'exchange')
126
+ self.exchange = attributes[:'exchange']
127
+ end
128
+
129
+ if attributes.key?(:'type')
130
+ self.type = attributes[:'type']
131
+ end
132
+
133
+ if attributes.key?(:'figi_code')
134
+ self.figi_code = attributes[:'figi_code']
135
+ end
136
+
137
+ if attributes.key?(:'figi_instrument')
138
+ self.figi_instrument = attributes[:'figi_instrument']
139
+ end
140
+ end
141
+
142
+ # Show invalid properties with the reasons. Usually used together with valid?
143
+ # @return Array for valid properties with the reasons
144
+ def list_invalid_properties
145
+ invalid_properties = Array.new
146
+ invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ true
153
+ end
154
+
155
+ # Checks equality by comparing each attribute.
156
+ # @param [Object] Object to be compared
157
+ def ==(o)
158
+ return true if self.equal?(o)
159
+ self.class == o.class &&
160
+ id == o.id &&
161
+ symbol == o.symbol &&
162
+ raw_symbol == o.raw_symbol &&
163
+ description == o.description &&
164
+ currency == o.currency &&
165
+ exchange == o.exchange &&
166
+ type == o.type &&
167
+ figi_code == o.figi_code &&
168
+ figi_instrument == o.figi_instrument
169
+ end
170
+
171
+ # @see the `==` method
172
+ # @param [Object] Object to be compared
173
+ def eql?(o)
174
+ self == o
175
+ end
176
+
177
+ # Calculates hash code according to all attributes.
178
+ # @return [Integer] Hash code
179
+ def hash
180
+ [id, symbol, raw_symbol, description, currency, exchange, type, figi_code, figi_instrument].hash
181
+ end
182
+
183
+ # Builds the object from hash
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ # @return [Object] Returns the model itself
186
+ def self.build_from_hash(attributes)
187
+ new.build_from_hash(attributes)
188
+ end
189
+
190
+ # Builds the object from hash
191
+ # @param [Hash] attributes Model attributes in the form of hash
192
+ # @return [Object] Returns the model itself
193
+ def build_from_hash(attributes)
194
+ return nil unless attributes.is_a?(Hash)
195
+ attributes = attributes.transform_keys(&:to_sym)
196
+ self.class.openapi_types.each_pair do |key, type|
197
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
198
+ self.send("#{key}=", nil)
199
+ elsif type =~ /\AArray<(.*)>/i
200
+ # check to ensure the input is an array given that the attribute
201
+ # is documented as an array but the input is not
202
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
203
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
204
+ end
205
+ elsif !attributes[self.class.attribute_map[key]].nil?
206
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
207
+ end
208
+ end
209
+
210
+ self
211
+ end
212
+
213
+ # Deserializes the data based on type
214
+ # @param string type Data type
215
+ # @param string value Value to be deserialized
216
+ # @return [Object] Deserialized data
217
+ def _deserialize(type, value)
218
+ case type.to_sym
219
+ when :Time
220
+ Time.parse(value)
221
+ when :Date
222
+ Date.parse(value)
223
+ when :String
224
+ value.to_s
225
+ when :Integer
226
+ value.to_i
227
+ when :Float
228
+ value.to_f
229
+ when :Boolean
230
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
231
+ true
232
+ else
233
+ false
234
+ end
235
+ when :Object
236
+ # generic object (usually a Hash), return directly
237
+ value
238
+ when /\AArray<(?<inner_type>.+)>\z/
239
+ inner_type = Regexp.last_match[:inner_type]
240
+ value.map { |v| _deserialize(inner_type, v) }
241
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
242
+ k_type = Regexp.last_match[:k_type]
243
+ v_type = Regexp.last_match[:v_type]
244
+ {}.tap do |hash|
245
+ value.each do |k, v|
246
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
247
+ end
248
+ end
249
+ else # model
250
+ # models (e.g. Pet) or oneOf
251
+ klass = SnapTrade.const_get(type)
252
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
253
+ end
254
+ end
255
+
256
+ # Returns the string representation of the object
257
+ # @return [String] String presentation of the object
258
+ def to_s
259
+ to_hash.to_s
260
+ end
261
+
262
+ # to_body is an alias to to_hash (backward compatibility)
263
+ # @return [Hash] Returns the object in the form of hash
264
+ def to_body
265
+ to_hash
266
+ end
267
+
268
+ # Returns the object in the form of hash
269
+ # @return [Hash] Returns the object in the form of hash
270
+ def to_hash
271
+ hash = {}
272
+ self.class.attribute_map.each_pair do |attr, param|
273
+ value = self.send(attr)
274
+ if value.nil?
275
+ is_nullable = self.class.openapi_nullable.include?(attr)
276
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
277
+ end
278
+
279
+ hash[param] = _to_hash(value)
280
+ end
281
+ hash
282
+ end
283
+
284
+ # Outputs non-array value in the form of hash
285
+ # For object, use to_hash. Otherwise, just return the value
286
+ # @param [Object] value Any valid value
287
+ # @return [Hash] Returns the value in the form of hash
288
+ def _to_hash(value)
289
+ if value.is_a?(Array)
290
+ value.compact.map { |v| _to_hash(v) }
291
+ elsif value.is_a?(Hash)
292
+ {}.tap do |hash|
293
+ value.each { |k, v| hash[k] = _to_hash(v) }
294
+ end
295
+ elsif value.respond_to? :to_hash
296
+ value.to_hash
297
+ else
298
+ value
299
+ end
300
+ end
301
+
302
+ end
303
+
304
+ end
@@ -67,8 +67,8 @@ module SnapTrade
67
67
  :'symbol' => :'String',
68
68
  :'raw_symbol' => :'String',
69
69
  :'description' => :'String',
70
- :'currency' => :'UniversalSymbolCurrency',
71
- :'exchange' => :'UniversalSymbolExchange',
70
+ :'currency' => :'SymbolCurrency',
71
+ :'exchange' => :'SymbolExchange',
72
72
  :'type' => :'SecurityType',
73
73
  :'currencies' => :'Array<Currency>',
74
74
  :'figi_code' => :'String',
@@ -16,7 +16,7 @@ module SnapTrade
16
16
  # SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
17
17
  attr_accessor :user_id
18
18
 
19
- # SnapTrade User Secret randomly generated by SnapTrade. This is privileged information and if compromised, should be rotated via the SnapTrade API.
19
+ # SnapTrade User Secret randomly generated by SnapTrade. This is privileged information and if compromised, should be rotated via the [rotate user secret endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret)
20
20
  attr_accessor :user_secret
21
21
 
22
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -8,5 +8,5 @@ Contact: api@snaptrade.com
8
8
  =end
9
9
 
10
10
  module SnapTrade
11
- VERSION = '2.0.33'
11
+ VERSION = '2.0.35'
12
12
  end
data/lib/snaptrade.rb CHANGED
@@ -28,10 +28,10 @@ require 'snaptrade/models/account_order_record_universal_symbol'
28
28
  require 'snaptrade/models/account_simple'
29
29
  require 'snaptrade/models/account_sync_status'
30
30
  require 'snaptrade/models/action_strict'
31
- require 'snaptrade/models/amount'
32
31
  require 'snaptrade/models/auth_type'
33
32
  require 'snaptrade/models/authentication_login_snap_trade_user200_response'
34
33
  require 'snaptrade/models/balance'
34
+ require 'snaptrade/models/balance_currency'
35
35
  require 'snaptrade/models/brokerage'
36
36
  require 'snaptrade/models/brokerage_authorization'
37
37
  require 'snaptrade/models/brokerage_authorization_disabled_confirmation'
@@ -94,8 +94,6 @@ require 'snaptrade/models/security_type'
94
94
  require 'snaptrade/models/session_event'
95
95
  require 'snaptrade/models/session_event_type'
96
96
  require 'snaptrade/models/snap_trade_holdings_account'
97
- require 'snaptrade/models/snap_trade_holdings_account_account_id'
98
- require 'snaptrade/models/snap_trade_holdings_account_account_id_balance'
99
97
  require 'snaptrade/models/snap_trade_holdings_total_value'
100
98
  require 'snaptrade/models/snap_trade_login_user_request_body'
101
99
  require 'snaptrade/models/snap_trade_register_user_request_body'
@@ -107,6 +105,8 @@ require 'snaptrade/models/strategy_quotes_greek'
107
105
  require 'snaptrade/models/strategy_type'
108
106
  require 'snaptrade/models/sub_period_return_rate'
109
107
  require 'snaptrade/models/symbol'
108
+ require 'snaptrade/models/symbol_currency'
109
+ require 'snaptrade/models/symbol_exchange'
110
110
  require 'snaptrade/models/symbol_figi_instrument'
111
111
  require 'snaptrade/models/symbol_query'
112
112
  require 'snaptrade/models/symbols_quotes_inner'
@@ -119,9 +119,10 @@ require 'snaptrade/models/underlying_symbol'
119
119
  require 'snaptrade/models/underlying_symbol_exchange'
120
120
  require 'snaptrade/models/underlying_symbol_type'
121
121
  require 'snaptrade/models/universal_activity'
122
+ require 'snaptrade/models/universal_activity_currency'
123
+ require 'snaptrade/models/universal_activity_option_symbol'
124
+ require 'snaptrade/models/universal_activity_symbol'
122
125
  require 'snaptrade/models/universal_symbol'
123
- require 'snaptrade/models/universal_symbol_currency'
124
- require 'snaptrade/models/universal_symbol_exchange'
125
126
  require 'snaptrade/models/user_i_dand_secret'
126
127
  require 'snaptrade/models/validated_trade_body'
127
128