mx-platform-ruby 0.3.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +29 -222
  4. data/docs/ChallengeResponse.md +2 -2
  5. data/docs/{ChallengeImageOptions.md → ImageOptionResponse.md} +2 -2
  6. data/docs/{ChallengeOptions.md → OptionResponse.md} +2 -2
  7. data/lib/mx-platform-ruby/models/challenge_response.rb +2 -2
  8. data/lib/mx-platform-ruby/models/{challenge_image_options.rb → image_option_response.rb} +3 -3
  9. data/lib/mx-platform-ruby/models/{challenge_options.rb → option_response.rb} +3 -3
  10. data/lib/mx-platform-ruby/version.rb +1 -1
  11. data/lib/mx-platform-ruby.rb +2 -2
  12. data/openapi/config.yml +1 -1
  13. data/openapi/templates/README.mustache +71 -0
  14. data/spec/models/{challenge_image_options_spec.rb → image_option_response_spec.rb} +6 -6
  15. data/spec/models/{challenge_options_spec.rb → option_response_spec.rb} +6 -6
  16. metadata +88 -190
  17. data/docs/Account.md +0 -96
  18. data/docs/AccountNumber.md +0 -32
  19. data/docs/AccountOwner.md +0 -40
  20. data/docs/Category.md +0 -32
  21. data/docs/Challenge.md +0 -30
  22. data/docs/ChallengeResponseImageOptions.md +0 -22
  23. data/docs/ChallengeResponseOptions.md +0 -20
  24. data/docs/ConnectWidget.md +0 -20
  25. data/docs/Credential.md +0 -26
  26. data/docs/EnhanceTransaction.md +0 -48
  27. data/docs/Holding.md +0 -52
  28. data/docs/InlineResponse200.md +0 -18
  29. data/docs/Institution.md +0 -36
  30. data/docs/Member.md +0 -40
  31. data/docs/MemberStatus.md +0 -34
  32. data/docs/Merchant.md +0 -28
  33. data/docs/OAuthWindow.md +0 -20
  34. data/docs/Pagination.md +0 -24
  35. data/docs/Statement.md +0 -32
  36. data/docs/Tag.md +0 -22
  37. data/docs/Tagging.md +0 -26
  38. data/docs/Transaction.md +0 -88
  39. data/docs/TransactionRule.md +0 -30
  40. data/docs/User.md +0 -26
  41. data/docs/Widget.md +0 -22
  42. data/lib/mx-platform-ruby/models/account.rb +0 -569
  43. data/lib/mx-platform-ruby/models/account_number.rb +0 -281
  44. data/lib/mx-platform-ruby/models/account_owner.rb +0 -317
  45. data/lib/mx-platform-ruby/models/category.rb +0 -281
  46. data/lib/mx-platform-ruby/models/challenge.rb +0 -276
  47. data/lib/mx-platform-ruby/models/challenge_response_image_options.rb +0 -236
  48. data/lib/mx-platform-ruby/models/challenge_response_options.rb +0 -227
  49. data/lib/mx-platform-ruby/models/connect_widget.rb +0 -227
  50. data/lib/mx-platform-ruby/models/credential.rb +0 -254
  51. data/lib/mx-platform-ruby/models/enhance_transaction.rb +0 -353
  52. data/lib/mx-platform-ruby/models/holding.rb +0 -371
  53. data/lib/mx-platform-ruby/models/inline_response200.rb +0 -218
  54. data/lib/mx-platform-ruby/models/institution.rb +0 -299
  55. data/lib/mx-platform-ruby/models/member.rb +0 -317
  56. data/lib/mx-platform-ruby/models/member_status.rb +0 -292
  57. data/lib/mx-platform-ruby/models/merchant.rb +0 -263
  58. data/lib/mx-platform-ruby/models/o_auth_window.rb +0 -227
  59. data/lib/mx-platform-ruby/models/pagination.rb +0 -245
  60. data/lib/mx-platform-ruby/models/statement.rb +0 -281
  61. data/lib/mx-platform-ruby/models/tag.rb +0 -236
  62. data/lib/mx-platform-ruby/models/tagging.rb +0 -254
  63. data/lib/mx-platform-ruby/models/transaction.rb +0 -533
  64. data/lib/mx-platform-ruby/models/transaction_rule.rb +0 -272
  65. data/lib/mx-platform-ruby/models/user.rb +0 -254
  66. data/lib/mx-platform-ruby/models/widget.rb +0 -236
  67. data/openapi/mx_platform_ruby.yml +0 -11
  68. data/pkg/mx-platform-ruby-0.2.0.gem +0 -0
  69. data/pkg/mx-platform-ruby-0.2.1.gem +0 -0
  70. data/spec/models/account_number_spec.rb +0 -76
  71. data/spec/models/account_owner_spec.rb +0 -100
  72. data/spec/models/account_spec.rb +0 -268
  73. data/spec/models/category_spec.rb +0 -76
  74. data/spec/models/challenge_response_image_options_spec.rb +0 -46
  75. data/spec/models/challenge_response_options_spec.rb +0 -40
  76. data/spec/models/challenge_spec.rb +0 -70
  77. data/spec/models/connect_widget_spec.rb +0 -40
  78. data/spec/models/credential_spec.rb +0 -58
  79. data/spec/models/enhance_transaction_spec.rb +0 -124
  80. data/spec/models/holding_spec.rb +0 -136
  81. data/spec/models/inline_response200_spec.rb +0 -34
  82. data/spec/models/institution_spec.rb +0 -88
  83. data/spec/models/member_spec.rb +0 -100
  84. data/spec/models/member_status_spec.rb +0 -82
  85. data/spec/models/merchant_spec.rb +0 -64
  86. data/spec/models/o_auth_window_spec.rb +0 -40
  87. data/spec/models/pagination_spec.rb +0 -52
  88. data/spec/models/statement_spec.rb +0 -76
  89. data/spec/models/tag_spec.rb +0 -46
  90. data/spec/models/tagging_spec.rb +0 -58
  91. data/spec/models/transaction_rule_spec.rb +0 -70
  92. data/spec/models/transaction_spec.rb +0 -244
  93. data/spec/models/user_spec.rb +0 -58
  94. data/spec/models/widget_spec.rb +0 -46
@@ -1,353 +0,0 @@
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.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module MxPlatformRuby
17
- class EnhanceTransaction
18
- attr_accessor :amount
19
-
20
- attr_accessor :category
21
-
22
- attr_accessor :description
23
-
24
- attr_accessor :id
25
-
26
- attr_accessor :is_bill_pay
27
-
28
- attr_accessor :is_direct_deposit
29
-
30
- attr_accessor :is_expense
31
-
32
- attr_accessor :is_fee
33
-
34
- attr_accessor :is_income
35
-
36
- attr_accessor :is_international
37
-
38
- attr_accessor :is_overdraft_fee
39
-
40
- attr_accessor :is_payroll_advance
41
-
42
- attr_accessor :merchant_category_code
43
-
44
- attr_accessor :merchant_guid
45
-
46
- attr_accessor :original_description
47
-
48
- attr_accessor :type
49
-
50
- # Attribute mapping from ruby-style variable name to JSON key.
51
- def self.attribute_map
52
- {
53
- :'amount' => :'amount',
54
- :'category' => :'category',
55
- :'description' => :'description',
56
- :'id' => :'id',
57
- :'is_bill_pay' => :'is_bill_pay',
58
- :'is_direct_deposit' => :'is_direct_deposit',
59
- :'is_expense' => :'is_expense',
60
- :'is_fee' => :'is_fee',
61
- :'is_income' => :'is_income',
62
- :'is_international' => :'is_international',
63
- :'is_overdraft_fee' => :'is_overdraft_fee',
64
- :'is_payroll_advance' => :'is_payroll_advance',
65
- :'merchant_category_code' => :'merchant_category_code',
66
- :'merchant_guid' => :'merchant_guid',
67
- :'original_description' => :'original_description',
68
- :'type' => :'type'
69
- }
70
- end
71
-
72
- # Returns all the JSON keys this model knows about
73
- def self.acceptable_attributes
74
- attribute_map.values
75
- end
76
-
77
- # Attribute type mapping.
78
- def self.openapi_types
79
- {
80
- :'amount' => :'Float',
81
- :'category' => :'String',
82
- :'description' => :'String',
83
- :'id' => :'String',
84
- :'is_bill_pay' => :'Boolean',
85
- :'is_direct_deposit' => :'Boolean',
86
- :'is_expense' => :'Boolean',
87
- :'is_fee' => :'Boolean',
88
- :'is_income' => :'Boolean',
89
- :'is_international' => :'Boolean',
90
- :'is_overdraft_fee' => :'Boolean',
91
- :'is_payroll_advance' => :'Boolean',
92
- :'merchant_category_code' => :'Integer',
93
- :'merchant_guid' => :'String',
94
- :'original_description' => :'String',
95
- :'type' => :'String'
96
- }
97
- end
98
-
99
- # List of attributes with nullable: true
100
- def self.openapi_nullable
101
- Set.new([
102
- ])
103
- end
104
-
105
- # Initializes the object
106
- # @param [Hash] attributes Model attributes in the form of hash
107
- def initialize(attributes = {})
108
- if (!attributes.is_a?(Hash))
109
- fail ArgumentError, "The input argument (attributes) must be a hash in `MxPlatformRuby::EnhanceTransaction` initialize method"
110
- end
111
-
112
- # check to see if the attribute exists and convert string to symbol for hash key
113
- attributes = attributes.each_with_object({}) { |(k, v), h|
114
- if (!self.class.attribute_map.key?(k.to_sym))
115
- fail ArgumentError, "`#{k}` is not a valid attribute in `MxPlatformRuby::EnhanceTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
116
- end
117
- h[k.to_sym] = v
118
- }
119
-
120
- if attributes.key?(:'amount')
121
- self.amount = attributes[:'amount']
122
- end
123
-
124
- if attributes.key?(:'category')
125
- self.category = attributes[:'category']
126
- end
127
-
128
- if attributes.key?(:'description')
129
- self.description = attributes[:'description']
130
- end
131
-
132
- if attributes.key?(:'id')
133
- self.id = attributes[:'id']
134
- end
135
-
136
- if attributes.key?(:'is_bill_pay')
137
- self.is_bill_pay = attributes[:'is_bill_pay']
138
- end
139
-
140
- if attributes.key?(:'is_direct_deposit')
141
- self.is_direct_deposit = attributes[:'is_direct_deposit']
142
- end
143
-
144
- if attributes.key?(:'is_expense')
145
- self.is_expense = attributes[:'is_expense']
146
- end
147
-
148
- if attributes.key?(:'is_fee')
149
- self.is_fee = attributes[:'is_fee']
150
- end
151
-
152
- if attributes.key?(:'is_income')
153
- self.is_income = attributes[:'is_income']
154
- end
155
-
156
- if attributes.key?(:'is_international')
157
- self.is_international = attributes[:'is_international']
158
- end
159
-
160
- if attributes.key?(:'is_overdraft_fee')
161
- self.is_overdraft_fee = attributes[:'is_overdraft_fee']
162
- end
163
-
164
- if attributes.key?(:'is_payroll_advance')
165
- self.is_payroll_advance = attributes[:'is_payroll_advance']
166
- end
167
-
168
- if attributes.key?(:'merchant_category_code')
169
- self.merchant_category_code = attributes[:'merchant_category_code']
170
- end
171
-
172
- if attributes.key?(:'merchant_guid')
173
- self.merchant_guid = attributes[:'merchant_guid']
174
- end
175
-
176
- if attributes.key?(:'original_description')
177
- self.original_description = attributes[:'original_description']
178
- end
179
-
180
- if attributes.key?(:'type')
181
- self.type = attributes[:'type']
182
- end
183
- end
184
-
185
- # Show invalid properties with the reasons. Usually used together with valid?
186
- # @return Array for valid properties with the reasons
187
- def list_invalid_properties
188
- invalid_properties = Array.new
189
- invalid_properties
190
- end
191
-
192
- # Check to see if the all the properties in the model are valid
193
- # @return true if the model is valid
194
- def valid?
195
- true
196
- end
197
-
198
- # Checks equality by comparing each attribute.
199
- # @param [Object] Object to be compared
200
- def ==(o)
201
- return true if self.equal?(o)
202
- self.class == o.class &&
203
- amount == o.amount &&
204
- category == o.category &&
205
- description == o.description &&
206
- id == o.id &&
207
- is_bill_pay == o.is_bill_pay &&
208
- is_direct_deposit == o.is_direct_deposit &&
209
- is_expense == o.is_expense &&
210
- is_fee == o.is_fee &&
211
- is_income == o.is_income &&
212
- is_international == o.is_international &&
213
- is_overdraft_fee == o.is_overdraft_fee &&
214
- is_payroll_advance == o.is_payroll_advance &&
215
- merchant_category_code == o.merchant_category_code &&
216
- merchant_guid == o.merchant_guid &&
217
- original_description == o.original_description &&
218
- type == o.type
219
- end
220
-
221
- # @see the `==` method
222
- # @param [Object] Object to be compared
223
- def eql?(o)
224
- self == o
225
- end
226
-
227
- # Calculates hash code according to all attributes.
228
- # @return [Integer] Hash code
229
- def hash
230
- [amount, category, description, id, is_bill_pay, is_direct_deposit, is_expense, is_fee, is_income, is_international, is_overdraft_fee, is_payroll_advance, merchant_category_code, merchant_guid, original_description, type].hash
231
- end
232
-
233
- # Builds the object from hash
234
- # @param [Hash] attributes Model attributes in the form of hash
235
- # @return [Object] Returns the model itself
236
- def self.build_from_hash(attributes)
237
- new.build_from_hash(attributes)
238
- end
239
-
240
- # Builds the object from hash
241
- # @param [Hash] attributes Model attributes in the form of hash
242
- # @return [Object] Returns the model itself
243
- def build_from_hash(attributes)
244
- return nil unless attributes.is_a?(Hash)
245
- self.class.openapi_types.each_pair do |key, type|
246
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
247
- self.send("#{key}=", nil)
248
- elsif type =~ /\AArray<(.*)>/i
249
- # check to ensure the input is an array given that the attribute
250
- # is documented as an array but the input is not
251
- if attributes[self.class.attribute_map[key]].is_a?(Array)
252
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
253
- end
254
- elsif !attributes[self.class.attribute_map[key]].nil?
255
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
256
- end
257
- end
258
-
259
- self
260
- end
261
-
262
- # Deserializes the data based on type
263
- # @param string type Data type
264
- # @param string value Value to be deserialized
265
- # @return [Object] Deserialized data
266
- def _deserialize(type, value)
267
- case type.to_sym
268
- when :Time
269
- Time.parse(value)
270
- when :Date
271
- Date.parse(value)
272
- when :String
273
- value.to_s
274
- when :Integer
275
- value.to_i
276
- when :Float
277
- value.to_f
278
- when :Boolean
279
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
280
- true
281
- else
282
- false
283
- end
284
- when :Object
285
- # generic object (usually a Hash), return directly
286
- value
287
- when /\AArray<(?<inner_type>.+)>\z/
288
- inner_type = Regexp.last_match[:inner_type]
289
- value.map { |v| _deserialize(inner_type, v) }
290
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
291
- k_type = Regexp.last_match[:k_type]
292
- v_type = Regexp.last_match[:v_type]
293
- {}.tap do |hash|
294
- value.each do |k, v|
295
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
296
- end
297
- end
298
- else # model
299
- # models (e.g. Pet) or oneOf
300
- klass = MxPlatformRuby.const_get(type)
301
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
302
- end
303
- end
304
-
305
- # Returns the string representation of the object
306
- # @return [String] String presentation of the object
307
- def to_s
308
- to_hash.to_s
309
- end
310
-
311
- # to_body is an alias to to_hash (backward compatibility)
312
- # @return [Hash] Returns the object in the form of hash
313
- def to_body
314
- to_hash
315
- end
316
-
317
- # Returns the object in the form of hash
318
- # @return [Hash] Returns the object in the form of hash
319
- def to_hash
320
- hash = {}
321
- self.class.attribute_map.each_pair do |attr, param|
322
- value = self.send(attr)
323
- if value.nil?
324
- is_nullable = self.class.openapi_nullable.include?(attr)
325
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
326
- end
327
-
328
- hash[param] = _to_hash(value)
329
- end
330
- hash
331
- end
332
-
333
- # Outputs non-array value in the form of hash
334
- # For object, use to_hash. Otherwise, just return the value
335
- # @param [Object] value Any valid value
336
- # @return [Hash] Returns the value in the form of hash
337
- def _to_hash(value)
338
- if value.is_a?(Array)
339
- value.compact.map { |v| _to_hash(v) }
340
- elsif value.is_a?(Hash)
341
- {}.tap do |hash|
342
- value.each { |k, v| hash[k] = _to_hash(v) }
343
- end
344
- elsif value.respond_to? :to_hash
345
- value.to_hash
346
- else
347
- value
348
- end
349
- end
350
-
351
- end
352
-
353
- end
@@ -1,371 +0,0 @@
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.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module MxPlatformRuby
17
- class Holding
18
- attr_accessor :account_guid
19
-
20
- attr_accessor :cost_basis
21
-
22
- attr_accessor :created_at
23
-
24
- attr_accessor :currency_code
25
-
26
- attr_accessor :cusip
27
-
28
- attr_accessor :daily_change
29
-
30
- attr_accessor :description
31
-
32
- attr_accessor :guid
33
-
34
- attr_accessor :holding_type
35
-
36
- attr_accessor :id
37
-
38
- attr_accessor :market_value
39
-
40
- attr_accessor :member_guid
41
-
42
- attr_accessor :metadata
43
-
44
- attr_accessor :purchase_price
45
-
46
- attr_accessor :shares
47
-
48
- attr_accessor :symbol
49
-
50
- attr_accessor :updated_at
51
-
52
- attr_accessor :user_guid
53
-
54
- # Attribute mapping from ruby-style variable name to JSON key.
55
- def self.attribute_map
56
- {
57
- :'account_guid' => :'account_guid',
58
- :'cost_basis' => :'cost_basis',
59
- :'created_at' => :'created_at',
60
- :'currency_code' => :'currency_code',
61
- :'cusip' => :'cusip',
62
- :'daily_change' => :'daily_change',
63
- :'description' => :'description',
64
- :'guid' => :'guid',
65
- :'holding_type' => :'holding_type',
66
- :'id' => :'id',
67
- :'market_value' => :'market_value',
68
- :'member_guid' => :'member_guid',
69
- :'metadata' => :'metadata',
70
- :'purchase_price' => :'purchase_price',
71
- :'shares' => :'shares',
72
- :'symbol' => :'symbol',
73
- :'updated_at' => :'updated_at',
74
- :'user_guid' => :'user_guid'
75
- }
76
- end
77
-
78
- # Returns all the JSON keys this model knows about
79
- def self.acceptable_attributes
80
- attribute_map.values
81
- end
82
-
83
- # Attribute type mapping.
84
- def self.openapi_types
85
- {
86
- :'account_guid' => :'String',
87
- :'cost_basis' => :'Float',
88
- :'created_at' => :'String',
89
- :'currency_code' => :'String',
90
- :'cusip' => :'String',
91
- :'daily_change' => :'Float',
92
- :'description' => :'String',
93
- :'guid' => :'String',
94
- :'holding_type' => :'String',
95
- :'id' => :'String',
96
- :'market_value' => :'Float',
97
- :'member_guid' => :'String',
98
- :'metadata' => :'String',
99
- :'purchase_price' => :'Float',
100
- :'shares' => :'Float',
101
- :'symbol' => :'String',
102
- :'updated_at' => :'String',
103
- :'user_guid' => :'String'
104
- }
105
- end
106
-
107
- # List of attributes with nullable: true
108
- def self.openapi_nullable
109
- Set.new([
110
- ])
111
- end
112
-
113
- # Initializes the object
114
- # @param [Hash] attributes Model attributes in the form of hash
115
- def initialize(attributes = {})
116
- if (!attributes.is_a?(Hash))
117
- fail ArgumentError, "The input argument (attributes) must be a hash in `MxPlatformRuby::Holding` initialize method"
118
- end
119
-
120
- # check to see if the attribute exists and convert string to symbol for hash key
121
- attributes = attributes.each_with_object({}) { |(k, v), h|
122
- if (!self.class.attribute_map.key?(k.to_sym))
123
- fail ArgumentError, "`#{k}` is not a valid attribute in `MxPlatformRuby::Holding`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
124
- end
125
- h[k.to_sym] = v
126
- }
127
-
128
- if attributes.key?(:'account_guid')
129
- self.account_guid = attributes[:'account_guid']
130
- end
131
-
132
- if attributes.key?(:'cost_basis')
133
- self.cost_basis = attributes[:'cost_basis']
134
- end
135
-
136
- if attributes.key?(:'created_at')
137
- self.created_at = attributes[:'created_at']
138
- end
139
-
140
- if attributes.key?(:'currency_code')
141
- self.currency_code = attributes[:'currency_code']
142
- end
143
-
144
- if attributes.key?(:'cusip')
145
- self.cusip = attributes[:'cusip']
146
- end
147
-
148
- if attributes.key?(:'daily_change')
149
- self.daily_change = attributes[:'daily_change']
150
- end
151
-
152
- if attributes.key?(:'description')
153
- self.description = attributes[:'description']
154
- end
155
-
156
- if attributes.key?(:'guid')
157
- self.guid = attributes[:'guid']
158
- end
159
-
160
- if attributes.key?(:'holding_type')
161
- self.holding_type = attributes[:'holding_type']
162
- end
163
-
164
- if attributes.key?(:'id')
165
- self.id = attributes[:'id']
166
- end
167
-
168
- if attributes.key?(:'market_value')
169
- self.market_value = attributes[:'market_value']
170
- end
171
-
172
- if attributes.key?(:'member_guid')
173
- self.member_guid = attributes[:'member_guid']
174
- end
175
-
176
- if attributes.key?(:'metadata')
177
- self.metadata = attributes[:'metadata']
178
- end
179
-
180
- if attributes.key?(:'purchase_price')
181
- self.purchase_price = attributes[:'purchase_price']
182
- end
183
-
184
- if attributes.key?(:'shares')
185
- self.shares = attributes[:'shares']
186
- end
187
-
188
- if attributes.key?(:'symbol')
189
- self.symbol = attributes[:'symbol']
190
- end
191
-
192
- if attributes.key?(:'updated_at')
193
- self.updated_at = attributes[:'updated_at']
194
- end
195
-
196
- if attributes.key?(:'user_guid')
197
- self.user_guid = attributes[:'user_guid']
198
- end
199
- end
200
-
201
- # Show invalid properties with the reasons. Usually used together with valid?
202
- # @return Array for valid properties with the reasons
203
- def list_invalid_properties
204
- invalid_properties = Array.new
205
- invalid_properties
206
- end
207
-
208
- # Check to see if the all the properties in the model are valid
209
- # @return true if the model is valid
210
- def valid?
211
- true
212
- end
213
-
214
- # Checks equality by comparing each attribute.
215
- # @param [Object] Object to be compared
216
- def ==(o)
217
- return true if self.equal?(o)
218
- self.class == o.class &&
219
- account_guid == o.account_guid &&
220
- cost_basis == o.cost_basis &&
221
- created_at == o.created_at &&
222
- currency_code == o.currency_code &&
223
- cusip == o.cusip &&
224
- daily_change == o.daily_change &&
225
- description == o.description &&
226
- guid == o.guid &&
227
- holding_type == o.holding_type &&
228
- id == o.id &&
229
- market_value == o.market_value &&
230
- member_guid == o.member_guid &&
231
- metadata == o.metadata &&
232
- purchase_price == o.purchase_price &&
233
- shares == o.shares &&
234
- symbol == o.symbol &&
235
- updated_at == o.updated_at &&
236
- user_guid == o.user_guid
237
- end
238
-
239
- # @see the `==` method
240
- # @param [Object] Object to be compared
241
- def eql?(o)
242
- self == o
243
- end
244
-
245
- # Calculates hash code according to all attributes.
246
- # @return [Integer] Hash code
247
- def hash
248
- [account_guid, cost_basis, created_at, currency_code, cusip, daily_change, description, guid, holding_type, id, market_value, member_guid, metadata, purchase_price, shares, symbol, updated_at, user_guid].hash
249
- end
250
-
251
- # Builds the object from hash
252
- # @param [Hash] attributes Model attributes in the form of hash
253
- # @return [Object] Returns the model itself
254
- def self.build_from_hash(attributes)
255
- new.build_from_hash(attributes)
256
- end
257
-
258
- # Builds the object from hash
259
- # @param [Hash] attributes Model attributes in the form of hash
260
- # @return [Object] Returns the model itself
261
- def build_from_hash(attributes)
262
- return nil unless attributes.is_a?(Hash)
263
- self.class.openapi_types.each_pair do |key, type|
264
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
265
- self.send("#{key}=", nil)
266
- elsif type =~ /\AArray<(.*)>/i
267
- # check to ensure the input is an array given that the attribute
268
- # is documented as an array but the input is not
269
- if attributes[self.class.attribute_map[key]].is_a?(Array)
270
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
271
- end
272
- elsif !attributes[self.class.attribute_map[key]].nil?
273
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
274
- end
275
- end
276
-
277
- self
278
- end
279
-
280
- # Deserializes the data based on type
281
- # @param string type Data type
282
- # @param string value Value to be deserialized
283
- # @return [Object] Deserialized data
284
- def _deserialize(type, value)
285
- case type.to_sym
286
- when :Time
287
- Time.parse(value)
288
- when :Date
289
- Date.parse(value)
290
- when :String
291
- value.to_s
292
- when :Integer
293
- value.to_i
294
- when :Float
295
- value.to_f
296
- when :Boolean
297
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
298
- true
299
- else
300
- false
301
- end
302
- when :Object
303
- # generic object (usually a Hash), return directly
304
- value
305
- when /\AArray<(?<inner_type>.+)>\z/
306
- inner_type = Regexp.last_match[:inner_type]
307
- value.map { |v| _deserialize(inner_type, v) }
308
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
309
- k_type = Regexp.last_match[:k_type]
310
- v_type = Regexp.last_match[:v_type]
311
- {}.tap do |hash|
312
- value.each do |k, v|
313
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
314
- end
315
- end
316
- else # model
317
- # models (e.g. Pet) or oneOf
318
- klass = MxPlatformRuby.const_get(type)
319
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
320
- end
321
- end
322
-
323
- # Returns the string representation of the object
324
- # @return [String] String presentation of the object
325
- def to_s
326
- to_hash.to_s
327
- end
328
-
329
- # to_body is an alias to to_hash (backward compatibility)
330
- # @return [Hash] Returns the object in the form of hash
331
- def to_body
332
- to_hash
333
- end
334
-
335
- # Returns the object in the form of hash
336
- # @return [Hash] Returns the object in the form of hash
337
- def to_hash
338
- hash = {}
339
- self.class.attribute_map.each_pair do |attr, param|
340
- value = self.send(attr)
341
- if value.nil?
342
- is_nullable = self.class.openapi_nullable.include?(attr)
343
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
344
- end
345
-
346
- hash[param] = _to_hash(value)
347
- end
348
- hash
349
- end
350
-
351
- # Outputs non-array value in the form of hash
352
- # For object, use to_hash. Otherwise, just return the value
353
- # @param [Object] value Any valid value
354
- # @return [Hash] Returns the value in the form of hash
355
- def _to_hash(value)
356
- if value.is_a?(Array)
357
- value.compact.map { |v| _to_hash(v) }
358
- elsif value.is_a?(Hash)
359
- {}.tap do |hash|
360
- value.each { |k, v| hash[k] = _to_hash(v) }
361
- end
362
- elsif value.respond_to? :to_hash
363
- value.to_hash
364
- else
365
- value
366
- end
367
- end
368
-
369
- end
370
-
371
- end