mx-platform-ruby 0.4.2 → 0.5.0

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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +5 -5
  3. data/README.md +1 -1
  4. data/docs/AccountResponse.md +15 -1
  5. data/docs/ManagedAccountCreateRequest.md +78 -0
  6. data/docs/ManagedAccountCreateRequestBody.md +18 -0
  7. data/docs/ManagedAccountUpdateRequest.md +78 -0
  8. data/docs/ManagedAccountUpdateRequestBody.md +18 -0
  9. data/docs/ManagedMemberCreateRequest.md +24 -0
  10. data/docs/ManagedMemberCreateRequestBody.md +18 -0
  11. data/docs/ManagedMemberUpdateRequest.md +22 -0
  12. data/docs/ManagedMemberUpdateRequestBody.md +18 -0
  13. data/docs/ManagedTransactionCreateRequest.md +56 -0
  14. data/docs/ManagedTransactionCreateRequestBody.md +18 -0
  15. data/docs/ManagedTransactionUpdateRequest.md +56 -0
  16. data/docs/ManagedTransactionUpdateRequestBody.md +18 -0
  17. data/docs/MemberResponse.md +5 -1
  18. data/docs/MerchantLocationResponse.md +40 -0
  19. data/docs/MerchantLocationResponseBody.md +18 -0
  20. data/docs/MxPlatformApi.md +1397 -119
  21. data/docs/TransactionResponse.md +11 -1
  22. data/lib/mx-platform-ruby/api/mx_platform_api.rb +1379 -125
  23. data/lib/mx-platform-ruby/models/account_response.rb +67 -4
  24. data/lib/mx-platform-ruby/models/managed_account_create_request.rb +503 -0
  25. data/lib/mx-platform-ruby/models/managed_account_create_request_body.rb +218 -0
  26. data/lib/mx-platform-ruby/models/managed_account_update_request.rb +488 -0
  27. data/lib/mx-platform-ruby/models/managed_account_update_request_body.rb +218 -0
  28. data/lib/mx-platform-ruby/models/managed_member_create_request.rb +250 -0
  29. data/lib/mx-platform-ruby/models/managed_member_create_request_body.rb +218 -0
  30. data/lib/mx-platform-ruby/models/managed_member_update_request.rb +236 -0
  31. data/lib/mx-platform-ruby/models/managed_member_update_request_body.rb +218 -0
  32. data/lib/mx-platform-ruby/models/managed_transaction_create_request.rb +414 -0
  33. data/lib/mx-platform-ruby/models/managed_transaction_create_request_body.rb +218 -0
  34. data/lib/mx-platform-ruby/models/managed_transaction_update_request.rb +389 -0
  35. data/lib/mx-platform-ruby/models/managed_transaction_update_request_body.rb +218 -0
  36. data/lib/mx-platform-ruby/models/member_response.rb +22 -4
  37. data/lib/mx-platform-ruby/models/merchant_location_response.rb +317 -0
  38. data/lib/mx-platform-ruby/models/merchant_location_response_body.rb +218 -0
  39. data/lib/mx-platform-ruby/models/transaction_response.rb +49 -4
  40. data/lib/mx-platform-ruby/version.rb +1 -1
  41. data/lib/mx-platform-ruby.rb +14 -0
  42. data/openapi/config.yml +1 -1
  43. data/spec/api/mx_platform_api_spec.rb +237 -0
  44. data/spec/models/account_response_spec.rb +42 -0
  45. data/spec/models/managed_account_create_request_body_spec.rb +34 -0
  46. data/spec/models/managed_account_create_request_spec.rb +214 -0
  47. data/spec/models/managed_account_update_request_body_spec.rb +34 -0
  48. data/spec/models/managed_account_update_request_spec.rb +214 -0
  49. data/spec/models/managed_member_create_request_body_spec.rb +34 -0
  50. data/spec/models/managed_member_create_request_spec.rb +52 -0
  51. data/spec/models/managed_member_update_request_body_spec.rb +34 -0
  52. data/spec/models/managed_member_update_request_spec.rb +46 -0
  53. data/spec/models/managed_transaction_create_request_body_spec.rb +34 -0
  54. data/spec/models/managed_transaction_create_request_spec.rb +148 -0
  55. data/spec/models/managed_transaction_update_request_body_spec.rb +34 -0
  56. data/spec/models/managed_transaction_update_request_spec.rb +148 -0
  57. data/spec/models/member_response_spec.rb +12 -0
  58. data/spec/models/merchant_location_response_body_spec.rb +34 -0
  59. data/spec/models/merchant_location_response_spec.rb +100 -0
  60. data/spec/models/transaction_response_spec.rb +30 -0
  61. metadata +136 -80
@@ -0,0 +1,218 @@
1
+ =begin
2
+ #MX Platform API
3
+
4
+ #The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MxPlatformRuby
17
+ class ManagedAccountCreateRequestBody
18
+ attr_accessor :account
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'account' => :'account'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'account' => :'ManagedAccountCreateRequest'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MxPlatformRuby::ManagedAccountCreateRequestBody` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MxPlatformRuby::ManagedAccountCreateRequestBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'account')
61
+ self.account = attributes[:'account']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ account == o.account
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [account].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def self.build_from_hash(attributes)
102
+ new.build_from_hash(attributes)
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.openapi_types.each_pair do |key, type|
111
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
112
+ self.send("#{key}=", nil)
113
+ elsif type =~ /\AArray<(.*)>/i
114
+ # check to ensure the input is an array given that the attribute
115
+ # is documented as an array but the input is not
116
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
117
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
118
+ end
119
+ elsif !attributes[self.class.attribute_map[key]].nil?
120
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
121
+ end
122
+ end
123
+
124
+ self
125
+ end
126
+
127
+ # Deserializes the data based on type
128
+ # @param string type Data type
129
+ # @param string value Value to be deserialized
130
+ # @return [Object] Deserialized data
131
+ def _deserialize(type, value)
132
+ case type.to_sym
133
+ when :Time
134
+ Time.parse(value)
135
+ when :Date
136
+ Date.parse(value)
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :Boolean
144
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ # models (e.g. Pet) or oneOf
165
+ klass = MxPlatformRuby.const_get(type)
166
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
167
+ end
168
+ end
169
+
170
+ # Returns the string representation of the object
171
+ # @return [String] String presentation of the object
172
+ def to_s
173
+ to_hash.to_s
174
+ end
175
+
176
+ # to_body is an alias to to_hash (backward compatibility)
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_body
179
+ to_hash
180
+ end
181
+
182
+ # Returns the object in the form of hash
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_hash
185
+ hash = {}
186
+ self.class.attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ if value.nil?
189
+ is_nullable = self.class.openapi_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ # Outputs non-array value in the form of hash
199
+ # For object, use to_hash. Otherwise, just return the value
200
+ # @param [Object] value Any valid value
201
+ # @return [Hash] Returns the value in the form of hash
202
+ def _to_hash(value)
203
+ if value.is_a?(Array)
204
+ value.compact.map { |v| _to_hash(v) }
205
+ elsif value.is_a?(Hash)
206
+ {}.tap do |hash|
207
+ value.each { |k, v| hash[k] = _to_hash(v) }
208
+ end
209
+ elsif value.respond_to? :to_hash
210
+ value.to_hash
211
+ else
212
+ value
213
+ end
214
+ end
215
+
216
+ end
217
+
218
+ end
@@ -0,0 +1,488 @@
1
+ =begin
2
+ #MX Platform API
3
+
4
+ #The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MxPlatformRuby
17
+ class ManagedAccountUpdateRequest
18
+ attr_accessor :account_number
19
+
20
+ attr_accessor :apr
21
+
22
+ attr_accessor :apy
23
+
24
+ attr_accessor :available_balance
25
+
26
+ attr_accessor :available_credit
27
+
28
+ attr_accessor :balance
29
+
30
+ attr_accessor :cash_surrender_value
31
+
32
+ attr_accessor :credit_limit
33
+
34
+ attr_accessor :currency_code
35
+
36
+ attr_accessor :day_payment_is_due
37
+
38
+ attr_accessor :death_benefit
39
+
40
+ attr_accessor :id
41
+
42
+ attr_accessor :interest_rate
43
+
44
+ attr_accessor :is_closed
45
+
46
+ attr_accessor :is_hidden
47
+
48
+ attr_accessor :last_payment
49
+
50
+ attr_accessor :last_payment_at
51
+
52
+ attr_accessor :loan_amount
53
+
54
+ attr_accessor :matures_on
55
+
56
+ attr_accessor :metadata
57
+
58
+ attr_accessor :minimum_balance
59
+
60
+ attr_accessor :minimum_payment
61
+
62
+ attr_accessor :name
63
+
64
+ attr_accessor :nickname
65
+
66
+ attr_accessor :original_balance
67
+
68
+ attr_accessor :payment_due_at
69
+
70
+ attr_accessor :payoff_balance
71
+
72
+ attr_accessor :routing_number
73
+
74
+ attr_accessor :started_on
75
+
76
+ attr_accessor :subtype
77
+
78
+ attr_accessor :type
79
+
80
+ # Attribute mapping from ruby-style variable name to JSON key.
81
+ def self.attribute_map
82
+ {
83
+ :'account_number' => :'account_number',
84
+ :'apr' => :'apr',
85
+ :'apy' => :'apy',
86
+ :'available_balance' => :'available_balance',
87
+ :'available_credit' => :'available_credit',
88
+ :'balance' => :'balance',
89
+ :'cash_surrender_value' => :'cash_surrender_value',
90
+ :'credit_limit' => :'credit_limit',
91
+ :'currency_code' => :'currency_code',
92
+ :'day_payment_is_due' => :'day_payment_is_due',
93
+ :'death_benefit' => :'death_benefit',
94
+ :'id' => :'id',
95
+ :'interest_rate' => :'interest_rate',
96
+ :'is_closed' => :'is_closed',
97
+ :'is_hidden' => :'is_hidden',
98
+ :'last_payment' => :'last_payment',
99
+ :'last_payment_at' => :'last_payment_at',
100
+ :'loan_amount' => :'loan_amount',
101
+ :'matures_on' => :'matures_on',
102
+ :'metadata' => :'metadata',
103
+ :'minimum_balance' => :'minimum_balance',
104
+ :'minimum_payment' => :'minimum_payment',
105
+ :'name' => :'name',
106
+ :'nickname' => :'nickname',
107
+ :'original_balance' => :'original_balance',
108
+ :'payment_due_at' => :'payment_due_at',
109
+ :'payoff_balance' => :'payoff_balance',
110
+ :'routing_number' => :'routing_number',
111
+ :'started_on' => :'started_on',
112
+ :'subtype' => :'subtype',
113
+ :'type' => :'type'
114
+ }
115
+ end
116
+
117
+ # Returns all the JSON keys this model knows about
118
+ def self.acceptable_attributes
119
+ attribute_map.values
120
+ end
121
+
122
+ # Attribute type mapping.
123
+ def self.openapi_types
124
+ {
125
+ :'account_number' => :'String',
126
+ :'apr' => :'Float',
127
+ :'apy' => :'Float',
128
+ :'available_balance' => :'Float',
129
+ :'available_credit' => :'Float',
130
+ :'balance' => :'Float',
131
+ :'cash_surrender_value' => :'Float',
132
+ :'credit_limit' => :'Float',
133
+ :'currency_code' => :'String',
134
+ :'day_payment_is_due' => :'Integer',
135
+ :'death_benefit' => :'Integer',
136
+ :'id' => :'String',
137
+ :'interest_rate' => :'Float',
138
+ :'is_closed' => :'Boolean',
139
+ :'is_hidden' => :'Boolean',
140
+ :'last_payment' => :'Float',
141
+ :'last_payment_at' => :'String',
142
+ :'loan_amount' => :'Float',
143
+ :'matures_on' => :'String',
144
+ :'metadata' => :'String',
145
+ :'minimum_balance' => :'Float',
146
+ :'minimum_payment' => :'Float',
147
+ :'name' => :'String',
148
+ :'nickname' => :'String',
149
+ :'original_balance' => :'Float',
150
+ :'payment_due_at' => :'String',
151
+ :'payoff_balance' => :'Float',
152
+ :'routing_number' => :'String',
153
+ :'started_on' => :'String',
154
+ :'subtype' => :'String',
155
+ :'type' => :'String'
156
+ }
157
+ end
158
+
159
+ # List of attributes with nullable: true
160
+ def self.openapi_nullable
161
+ Set.new([
162
+ ])
163
+ end
164
+
165
+ # Initializes the object
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ def initialize(attributes = {})
168
+ if (!attributes.is_a?(Hash))
169
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MxPlatformRuby::ManagedAccountUpdateRequest` initialize method"
170
+ end
171
+
172
+ # check to see if the attribute exists and convert string to symbol for hash key
173
+ attributes = attributes.each_with_object({}) { |(k, v), h|
174
+ if (!self.class.attribute_map.key?(k.to_sym))
175
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MxPlatformRuby::ManagedAccountUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
176
+ end
177
+ h[k.to_sym] = v
178
+ }
179
+
180
+ if attributes.key?(:'account_number')
181
+ self.account_number = attributes[:'account_number']
182
+ end
183
+
184
+ if attributes.key?(:'apr')
185
+ self.apr = attributes[:'apr']
186
+ end
187
+
188
+ if attributes.key?(:'apy')
189
+ self.apy = attributes[:'apy']
190
+ end
191
+
192
+ if attributes.key?(:'available_balance')
193
+ self.available_balance = attributes[:'available_balance']
194
+ end
195
+
196
+ if attributes.key?(:'available_credit')
197
+ self.available_credit = attributes[:'available_credit']
198
+ end
199
+
200
+ if attributes.key?(:'balance')
201
+ self.balance = attributes[:'balance']
202
+ end
203
+
204
+ if attributes.key?(:'cash_surrender_value')
205
+ self.cash_surrender_value = attributes[:'cash_surrender_value']
206
+ end
207
+
208
+ if attributes.key?(:'credit_limit')
209
+ self.credit_limit = attributes[:'credit_limit']
210
+ end
211
+
212
+ if attributes.key?(:'currency_code')
213
+ self.currency_code = attributes[:'currency_code']
214
+ end
215
+
216
+ if attributes.key?(:'day_payment_is_due')
217
+ self.day_payment_is_due = attributes[:'day_payment_is_due']
218
+ end
219
+
220
+ if attributes.key?(:'death_benefit')
221
+ self.death_benefit = attributes[:'death_benefit']
222
+ end
223
+
224
+ if attributes.key?(:'id')
225
+ self.id = attributes[:'id']
226
+ end
227
+
228
+ if attributes.key?(:'interest_rate')
229
+ self.interest_rate = attributes[:'interest_rate']
230
+ end
231
+
232
+ if attributes.key?(:'is_closed')
233
+ self.is_closed = attributes[:'is_closed']
234
+ end
235
+
236
+ if attributes.key?(:'is_hidden')
237
+ self.is_hidden = attributes[:'is_hidden']
238
+ end
239
+
240
+ if attributes.key?(:'last_payment')
241
+ self.last_payment = attributes[:'last_payment']
242
+ end
243
+
244
+ if attributes.key?(:'last_payment_at')
245
+ self.last_payment_at = attributes[:'last_payment_at']
246
+ end
247
+
248
+ if attributes.key?(:'loan_amount')
249
+ self.loan_amount = attributes[:'loan_amount']
250
+ end
251
+
252
+ if attributes.key?(:'matures_on')
253
+ self.matures_on = attributes[:'matures_on']
254
+ end
255
+
256
+ if attributes.key?(:'metadata')
257
+ self.metadata = attributes[:'metadata']
258
+ end
259
+
260
+ if attributes.key?(:'minimum_balance')
261
+ self.minimum_balance = attributes[:'minimum_balance']
262
+ end
263
+
264
+ if attributes.key?(:'minimum_payment')
265
+ self.minimum_payment = attributes[:'minimum_payment']
266
+ end
267
+
268
+ if attributes.key?(:'name')
269
+ self.name = attributes[:'name']
270
+ end
271
+
272
+ if attributes.key?(:'nickname')
273
+ self.nickname = attributes[:'nickname']
274
+ end
275
+
276
+ if attributes.key?(:'original_balance')
277
+ self.original_balance = attributes[:'original_balance']
278
+ end
279
+
280
+ if attributes.key?(:'payment_due_at')
281
+ self.payment_due_at = attributes[:'payment_due_at']
282
+ end
283
+
284
+ if attributes.key?(:'payoff_balance')
285
+ self.payoff_balance = attributes[:'payoff_balance']
286
+ end
287
+
288
+ if attributes.key?(:'routing_number')
289
+ self.routing_number = attributes[:'routing_number']
290
+ end
291
+
292
+ if attributes.key?(:'started_on')
293
+ self.started_on = attributes[:'started_on']
294
+ end
295
+
296
+ if attributes.key?(:'subtype')
297
+ self.subtype = attributes[:'subtype']
298
+ end
299
+
300
+ if attributes.key?(:'type')
301
+ self.type = attributes[:'type']
302
+ end
303
+ end
304
+
305
+ # Show invalid properties with the reasons. Usually used together with valid?
306
+ # @return Array for valid properties with the reasons
307
+ def list_invalid_properties
308
+ invalid_properties = Array.new
309
+ invalid_properties
310
+ end
311
+
312
+ # Check to see if the all the properties in the model are valid
313
+ # @return true if the model is valid
314
+ def valid?
315
+ true
316
+ end
317
+
318
+ # Checks equality by comparing each attribute.
319
+ # @param [Object] Object to be compared
320
+ def ==(o)
321
+ return true if self.equal?(o)
322
+ self.class == o.class &&
323
+ account_number == o.account_number &&
324
+ apr == o.apr &&
325
+ apy == o.apy &&
326
+ available_balance == o.available_balance &&
327
+ available_credit == o.available_credit &&
328
+ balance == o.balance &&
329
+ cash_surrender_value == o.cash_surrender_value &&
330
+ credit_limit == o.credit_limit &&
331
+ currency_code == o.currency_code &&
332
+ day_payment_is_due == o.day_payment_is_due &&
333
+ death_benefit == o.death_benefit &&
334
+ id == o.id &&
335
+ interest_rate == o.interest_rate &&
336
+ is_closed == o.is_closed &&
337
+ is_hidden == o.is_hidden &&
338
+ last_payment == o.last_payment &&
339
+ last_payment_at == o.last_payment_at &&
340
+ loan_amount == o.loan_amount &&
341
+ matures_on == o.matures_on &&
342
+ metadata == o.metadata &&
343
+ minimum_balance == o.minimum_balance &&
344
+ minimum_payment == o.minimum_payment &&
345
+ name == o.name &&
346
+ nickname == o.nickname &&
347
+ original_balance == o.original_balance &&
348
+ payment_due_at == o.payment_due_at &&
349
+ payoff_balance == o.payoff_balance &&
350
+ routing_number == o.routing_number &&
351
+ started_on == o.started_on &&
352
+ subtype == o.subtype &&
353
+ type == o.type
354
+ end
355
+
356
+ # @see the `==` method
357
+ # @param [Object] Object to be compared
358
+ def eql?(o)
359
+ self == o
360
+ end
361
+
362
+ # Calculates hash code according to all attributes.
363
+ # @return [Integer] Hash code
364
+ def hash
365
+ [account_number, apr, apy, available_balance, available_credit, balance, cash_surrender_value, credit_limit, currency_code, day_payment_is_due, death_benefit, id, interest_rate, is_closed, is_hidden, last_payment, last_payment_at, loan_amount, matures_on, metadata, minimum_balance, minimum_payment, name, nickname, original_balance, payment_due_at, payoff_balance, routing_number, started_on, subtype, type].hash
366
+ end
367
+
368
+ # Builds the object from hash
369
+ # @param [Hash] attributes Model attributes in the form of hash
370
+ # @return [Object] Returns the model itself
371
+ def self.build_from_hash(attributes)
372
+ new.build_from_hash(attributes)
373
+ end
374
+
375
+ # Builds the object from hash
376
+ # @param [Hash] attributes Model attributes in the form of hash
377
+ # @return [Object] Returns the model itself
378
+ def build_from_hash(attributes)
379
+ return nil unless attributes.is_a?(Hash)
380
+ self.class.openapi_types.each_pair do |key, type|
381
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
382
+ self.send("#{key}=", nil)
383
+ elsif type =~ /\AArray<(.*)>/i
384
+ # check to ensure the input is an array given that the attribute
385
+ # is documented as an array but the input is not
386
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
387
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
388
+ end
389
+ elsif !attributes[self.class.attribute_map[key]].nil?
390
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
391
+ end
392
+ end
393
+
394
+ self
395
+ end
396
+
397
+ # Deserializes the data based on type
398
+ # @param string type Data type
399
+ # @param string value Value to be deserialized
400
+ # @return [Object] Deserialized data
401
+ def _deserialize(type, value)
402
+ case type.to_sym
403
+ when :Time
404
+ Time.parse(value)
405
+ when :Date
406
+ Date.parse(value)
407
+ when :String
408
+ value.to_s
409
+ when :Integer
410
+ value.to_i
411
+ when :Float
412
+ value.to_f
413
+ when :Boolean
414
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
415
+ true
416
+ else
417
+ false
418
+ end
419
+ when :Object
420
+ # generic object (usually a Hash), return directly
421
+ value
422
+ when /\AArray<(?<inner_type>.+)>\z/
423
+ inner_type = Regexp.last_match[:inner_type]
424
+ value.map { |v| _deserialize(inner_type, v) }
425
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
426
+ k_type = Regexp.last_match[:k_type]
427
+ v_type = Regexp.last_match[:v_type]
428
+ {}.tap do |hash|
429
+ value.each do |k, v|
430
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
431
+ end
432
+ end
433
+ else # model
434
+ # models (e.g. Pet) or oneOf
435
+ klass = MxPlatformRuby.const_get(type)
436
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
437
+ end
438
+ end
439
+
440
+ # Returns the string representation of the object
441
+ # @return [String] String presentation of the object
442
+ def to_s
443
+ to_hash.to_s
444
+ end
445
+
446
+ # to_body is an alias to to_hash (backward compatibility)
447
+ # @return [Hash] Returns the object in the form of hash
448
+ def to_body
449
+ to_hash
450
+ end
451
+
452
+ # Returns the object in the form of hash
453
+ # @return [Hash] Returns the object in the form of hash
454
+ def to_hash
455
+ hash = {}
456
+ self.class.attribute_map.each_pair do |attr, param|
457
+ value = self.send(attr)
458
+ if value.nil?
459
+ is_nullable = self.class.openapi_nullable.include?(attr)
460
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
461
+ end
462
+
463
+ hash[param] = _to_hash(value)
464
+ end
465
+ hash
466
+ end
467
+
468
+ # Outputs non-array value in the form of hash
469
+ # For object, use to_hash. Otherwise, just return the value
470
+ # @param [Object] value Any valid value
471
+ # @return [Hash] Returns the value in the form of hash
472
+ def _to_hash(value)
473
+ if value.is_a?(Array)
474
+ value.compact.map { |v| _to_hash(v) }
475
+ elsif value.is_a?(Hash)
476
+ {}.tap do |hash|
477
+ value.each { |k, v| hash[k] = _to_hash(v) }
478
+ end
479
+ elsif value.respond_to? :to_hash
480
+ value.to_hash
481
+ else
482
+ value
483
+ end
484
+ end
485
+
486
+ end
487
+
488
+ end