moneykit 0.1.10 → 0.1.12

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 (148) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +1 -1
  4. data/docs/AccessTokenApi.md +26 -21
  5. data/docs/AccountBalances.md +2 -2
  6. data/docs/AccountGroup.md +1 -1
  7. data/docs/AccountIdentity.md +2 -0
  8. data/docs/AccountImportData.md +26 -0
  9. data/docs/AccountResponse.md +28 -0
  10. data/docs/AccountWithAccountNumbersLegacy20230218.md +2 -0
  11. data/docs/Address.md +1 -1
  12. data/docs/AppClientResponse.md +2 -2
  13. data/docs/AppLinkStateChangedWebhook.md +36 -0
  14. data/docs/AppResponse.md +2 -2
  15. data/docs/Body.md +3 -3
  16. data/docs/CreateAccessTokenResponse.md +22 -0
  17. data/docs/CreateLinkSessionRequest.md +1 -1
  18. data/docs/CustomerUser.md +22 -0
  19. data/docs/CustomerUserEmail.md +20 -0
  20. data/docs/CustomerUserPhone.md +22 -0
  21. data/docs/Date.md +15 -0
  22. data/docs/Email.md +1 -1
  23. data/docs/GetAccountResponse.md +1 -1
  24. data/docs/GetAccountsResponse.md +1 -1
  25. data/docs/GetHoldingsResponse.md +1 -1
  26. data/docs/GetInvestmentTransactionsResponse.md +1 -1
  27. data/docs/GetTransactionsResponse.md +2 -2
  28. data/docs/GetUserTransactionsResponse.md +1 -1
  29. data/docs/ImportLinkRequest.md +26 -0
  30. data/docs/Institution.md +1 -1
  31. data/docs/LinkCommon.md +3 -3
  32. data/docs/LinkProductError.md +15 -0
  33. data/docs/LinkProductRefreshWebhook.md +2 -2
  34. data/docs/LinkProductResponse.md +28 -0
  35. data/docs/LinkProducts.md +7 -5
  36. data/docs/LinkResponse.md +3 -3
  37. data/docs/LinkSessionApi.md +1 -1
  38. data/docs/LinksApi.md +79 -9
  39. data/docs/PhoneNumber.md +1 -1
  40. data/docs/PublicLinkState.md +15 -0
  41. data/docs/Response401DeleteLinkLinksIdDelete.md +22 -0
  42. data/docs/Response401GetTransactionsSyncLinksIdTransactionsSyncGet.md +22 -0
  43. data/docs/Response401ImportLinkLinksImportPost.md +22 -0
  44. data/docs/ResponseHandleLinkWebhookEventRequestBodyWebhookPost.md +3 -3
  45. data/docs/TransactionCategoryResponse.md +20 -0
  46. data/docs/TransactionEnrichmentResponse.md +26 -0
  47. data/docs/TransactionImportData.md +28 -0
  48. data/docs/TransactionMerchantResponse.md +24 -0
  49. data/docs/TransactionProcessorResponse.md +24 -0
  50. data/docs/TransactionRecurrenceResponse.md +20 -0
  51. data/docs/TransactionResponse.md +42 -0
  52. data/docs/TransactionSubcategoryResponse.md +20 -0
  53. data/docs/TransactionSync.md +22 -0
  54. data/docs/TransactionSyncResponse.md +1 -1
  55. data/docs/TransactionUpdatesAvailableWebhook.md +4 -2
  56. data/docs/TransactionsApi.md +15 -15
  57. data/docs/TransactionsLinkProduct.md +1 -1
  58. data/lib/moneykit/api/access_token_api.rb +19 -16
  59. data/lib/moneykit/api/links_api.rb +75 -7
  60. data/lib/moneykit/api/transactions_api.rb +17 -17
  61. data/lib/moneykit/api_client.rb +1 -1
  62. data/lib/moneykit/models/account_balances.rb +2 -30
  63. data/lib/moneykit/models/account_group.rb +1 -1
  64. data/lib/moneykit/models/account_identity.rb +11 -1
  65. data/lib/moneykit/models/account_import_data.rb +280 -0
  66. data/lib/moneykit/models/account_response.rb +290 -0
  67. data/lib/moneykit/models/account_with_account_numbers_legacy20230218.rb +11 -1
  68. data/lib/moneykit/models/address.rb +0 -2
  69. data/lib/moneykit/models/app_client_response.rb +1 -1
  70. data/lib/moneykit/models/app_link_state_changed_webhook.rb +394 -0
  71. data/lib/moneykit/models/body.rb +1 -1
  72. data/lib/moneykit/models/create_access_token_response.rb +255 -0
  73. data/lib/moneykit/models/create_link_session_request.rb +1 -1
  74. data/lib/moneykit/models/customer_user.rb +266 -0
  75. data/lib/moneykit/models/customer_user_email.rb +258 -0
  76. data/lib/moneykit/models/customer_user_phone.rb +289 -0
  77. data/lib/moneykit/models/date.rb +104 -0
  78. data/lib/moneykit/models/email.rb +0 -2
  79. data/lib/moneykit/models/get_account_response.rb +1 -1
  80. data/lib/moneykit/models/get_accounts_response.rb +1 -1
  81. data/lib/moneykit/models/get_holdings_response.rb +1 -1
  82. data/lib/moneykit/models/get_investment_transactions_response.rb +1 -1
  83. data/lib/moneykit/models/get_transactions_response.rb +2 -2
  84. data/lib/moneykit/models/get_user_transactions_response.rb +1 -1
  85. data/lib/moneykit/models/import_link_request.rb +303 -0
  86. data/lib/moneykit/models/institution.rb +0 -7
  87. data/lib/moneykit/models/link_common.rb +3 -3
  88. data/lib/moneykit/models/link_product_error.rb +46 -0
  89. data/lib/moneykit/models/link_product_refresh_webhook.rb +24 -24
  90. data/lib/moneykit/models/link_product_response.rb +283 -0
  91. data/lib/moneykit/models/link_product_state.rb +3 -1
  92. data/lib/moneykit/models/link_products.rb +16 -7
  93. data/lib/moneykit/models/link_response.rb +3 -3
  94. data/lib/moneykit/models/phone_number.rb +0 -2
  95. data/lib/moneykit/models/product.rb +2 -1
  96. data/lib/moneykit/models/provider.rb +1 -2
  97. data/lib/moneykit/models/public_link_error.rb +1 -1
  98. data/lib/moneykit/models/public_link_state.rb +43 -0
  99. data/lib/moneykit/models/response401_delete_link_links_id_delete.rb +104 -0
  100. data/lib/moneykit/models/response401_get_transactions_sync_links_id_transactions_sync_get.rb +104 -0
  101. data/lib/moneykit/models/response401_import_link_links_import_post.rb +103 -0
  102. data/lib/moneykit/models/response_handle_link_webhook_event_request_body_webhook_post.rb +1 -1
  103. data/lib/moneykit/models/transaction_category_response.rb +230 -0
  104. data/lib/moneykit/models/transaction_enrichment_response.rb +255 -0
  105. data/lib/moneykit/models/transaction_import_data.rb +283 -0
  106. data/lib/moneykit/models/transaction_merchant_response.rb +243 -0
  107. data/lib/moneykit/models/transaction_processor_response.rb +243 -0
  108. data/lib/moneykit/models/transaction_recurrence_response.rb +223 -0
  109. data/lib/moneykit/models/transaction_response.rb +402 -0
  110. data/lib/moneykit/models/transaction_subcategory_response.rb +230 -0
  111. data/lib/moneykit/models/transaction_sync.rb +257 -0
  112. data/lib/moneykit/models/transaction_sync_response.rb +1 -1
  113. data/lib/moneykit/models/transaction_updates_available_webhook.rb +42 -24
  114. data/lib/moneykit/models/transactions_link_product.rb +1 -1
  115. data/lib/moneykit/version.rb +1 -1
  116. data/lib/moneykit.rb +25 -16
  117. data/spec/models/account_import_data_spec.rb +60 -0
  118. data/spec/models/account_response_spec.rb +66 -0
  119. data/spec/models/app_link_state_changed_webhook_spec.rb +102 -0
  120. data/spec/models/create_access_token_response_spec.rb +48 -0
  121. data/spec/models/customer_user_email_spec.rb +42 -0
  122. data/spec/models/customer_user_phone_spec.rb +48 -0
  123. data/spec/models/customer_user_spec.rb +48 -0
  124. data/spec/models/date_spec.rb +21 -0
  125. data/spec/models/import_link_request_spec.rb +60 -0
  126. data/spec/models/link_product_error_spec.rb +30 -0
  127. data/spec/models/link_product_response_spec.rb +66 -0
  128. data/spec/models/public_link_error_spec.rb +30 -0
  129. data/spec/models/public_link_state_spec.rb +30 -0
  130. data/spec/models/response401_delete_link_links_id_delete_spec.rb +21 -0
  131. data/spec/models/response401_get_transactions_sync_links_id_transactions_sync_get_spec.rb +21 -0
  132. data/spec/models/response401_import_link_links_import_post_spec.rb +21 -0
  133. data/spec/models/transaction_category_response_spec.rb +42 -0
  134. data/spec/models/transaction_enrichment_response_spec.rb +60 -0
  135. data/spec/models/transaction_import_data_spec.rb +66 -0
  136. data/spec/models/transaction_merchant_response_spec.rb +54 -0
  137. data/spec/models/transaction_processor_response_spec.rb +54 -0
  138. data/spec/models/transaction_recurrence_response_spec.rb +42 -0
  139. data/spec/models/transaction_response_spec.rb +108 -0
  140. data/spec/models/transaction_subcategory_response_spec.rb +42 -0
  141. data/spec/models/transaction_sync_spec.rb +48 -0
  142. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/gem_make.out +5 -5
  143. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  144. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.1.1.1/gem_make.out +5 -5
  145. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.1.1.1/mkmf.log +2 -2
  146. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.7.3/gem_make.out +5 -5
  147. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.1.0/gem_make.out +5 -5
  148. metadata +220 -122
@@ -0,0 +1,266 @@
1
+ =begin
2
+ #MoneyKit API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 2023-02-18
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.1.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MoneyKit
17
+ class CustomerUser
18
+ # Your own unique ID for this user. Typically this will be a UUID or primary key from your application.
19
+ attr_accessor :id
20
+
21
+ attr_accessor :email
22
+
23
+ attr_accessor :phone
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'id' => :'id',
29
+ :'email' => :'email',
30
+ :'phone' => :'phone'
31
+ }
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'id' => :'String',
43
+ :'email' => :'CustomerUserEmail',
44
+ :'phone' => :'CustomerUserPhone'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::CustomerUser` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h|
63
+ if (!self.class.attribute_map.key?(k.to_sym))
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::CustomerUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ end
66
+ h[k.to_sym] = v
67
+ }
68
+
69
+ if attributes.key?(:'id')
70
+ self.id = attributes[:'id']
71
+ else
72
+ self.id = nil
73
+ end
74
+
75
+ if attributes.key?(:'email')
76
+ self.email = attributes[:'email']
77
+ end
78
+
79
+ if attributes.key?(:'phone')
80
+ self.phone = attributes[:'phone']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
88
+ invalid_properties = Array.new
89
+ if @id.nil?
90
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
91
+ end
92
+
93
+ if @id.to_s.length > 150
94
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 150.')
95
+ end
96
+
97
+ if @id.to_s.length < 4
98
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 4.')
99
+ end
100
+
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ warn '[DEPRECATED] the `valid?` method is obsolete'
108
+ return false if @id.nil?
109
+ return false if @id.to_s.length > 150
110
+ return false if @id.to_s.length < 4
111
+ true
112
+ end
113
+
114
+ # Custom attribute writer method with validation
115
+ # @param [Object] id Value to be assigned
116
+ def id=(id)
117
+ if id.nil?
118
+ fail ArgumentError, 'id cannot be nil'
119
+ end
120
+
121
+ if id.to_s.length > 150
122
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 150.'
123
+ end
124
+
125
+ if id.to_s.length < 4
126
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 4.'
127
+ end
128
+
129
+ @id = id
130
+ end
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] Object to be compared
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ id == o.id &&
138
+ email == o.email &&
139
+ phone == o.phone
140
+ end
141
+
142
+ # @see the `==` method
143
+ # @param [Object] Object to be compared
144
+ def eql?(o)
145
+ self == o
146
+ end
147
+
148
+ # Calculates hash code according to all attributes.
149
+ # @return [Integer] Hash code
150
+ def hash
151
+ [id, email, phone].hash
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def self.build_from_hash(attributes)
158
+ return nil unless attributes.is_a?(Hash)
159
+ attributes = attributes.transform_keys(&:to_sym)
160
+ transformed_hash = {}
161
+ openapi_types.each_pair do |key, type|
162
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
163
+ transformed_hash["#{key}"] = nil
164
+ elsif type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[attribute_map[key]].is_a?(Array)
168
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
169
+ end
170
+ elsif !attributes[attribute_map[key]].nil?
171
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
172
+ end
173
+ end
174
+ new(transformed_hash)
175
+ end
176
+
177
+ # Deserializes the data based on type
178
+ # @param string type Data type
179
+ # @param string value Value to be deserialized
180
+ # @return [Object] Deserialized data
181
+ def self._deserialize(type, value)
182
+ case type.to_sym
183
+ when :Time
184
+ Time.parse(value)
185
+ when :Date
186
+ Date.parse(value)
187
+ when :String
188
+ value.to_s
189
+ when :Integer
190
+ value.to_i
191
+ when :Float
192
+ value.to_f
193
+ when :Boolean
194
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
195
+ true
196
+ else
197
+ false
198
+ end
199
+ when :Object
200
+ # generic object (usually a Hash), return directly
201
+ value
202
+ when /\AArray<(?<inner_type>.+)>\z/
203
+ inner_type = Regexp.last_match[:inner_type]
204
+ value.map { |v| _deserialize(inner_type, v) }
205
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
206
+ k_type = Regexp.last_match[:k_type]
207
+ v_type = Regexp.last_match[:v_type]
208
+ {}.tap do |hash|
209
+ value.each do |k, v|
210
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
211
+ end
212
+ end
213
+ else # model
214
+ # models (e.g. Pet) or oneOf
215
+ klass = MoneyKit.const_get(type)
216
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
217
+ end
218
+ end
219
+
220
+ # Returns the string representation of the object
221
+ # @return [String] String presentation of the object
222
+ def to_s
223
+ to_hash.to_s
224
+ end
225
+
226
+ # to_body is an alias to to_hash (backward compatibility)
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_body
229
+ to_hash
230
+ end
231
+
232
+ # Returns the object in the form of hash
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_hash
235
+ hash = {}
236
+ self.class.attribute_map.each_pair do |attr, param|
237
+ value = self.send(attr)
238
+ if value.nil?
239
+ is_nullable = self.class.openapi_nullable.include?(attr)
240
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
241
+ end
242
+
243
+ hash[param] = _to_hash(value)
244
+ end
245
+ hash
246
+ end
247
+
248
+ # Outputs non-array value in the form of hash
249
+ # For object, use to_hash. Otherwise, just return the value
250
+ # @param [Object] value Any valid value
251
+ # @return [Hash] Returns the value in the form of hash
252
+ def _to_hash(value)
253
+ if value.is_a?(Array)
254
+ value.compact.map { |v| _to_hash(v) }
255
+ elsif value.is_a?(Hash)
256
+ {}.tap do |hash|
257
+ value.each { |k, v| hash[k] = _to_hash(v) }
258
+ end
259
+ elsif value.respond_to? :to_hash
260
+ value.to_hash
261
+ else
262
+ value
263
+ end
264
+ end
265
+ end
266
+ end
@@ -0,0 +1,258 @@
1
+ =begin
2
+ #MoneyKit API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 2023-02-18
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.1.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MoneyKit
17
+ class CustomerUserEmail
18
+ # The user's email address.
19
+ attr_accessor :address
20
+
21
+ # Optional timestamp that marks when you last verified this email (such as when the user most recently clicked a verification url sent to this address). Only include this field if you verified the address. You may supply zeros if the time (but not the date) is unknown.
22
+ attr_accessor :customer_verified_at
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'address' => :'address',
28
+ :'customer_verified_at' => :'customer_verified_at'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'address' => :'String',
41
+ :'customer_verified_at' => :'Time'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::CustomerUserEmail` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::CustomerUserEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'address')
67
+ self.address = attributes[:'address']
68
+ else
69
+ self.address = nil
70
+ end
71
+
72
+ if attributes.key?(:'customer_verified_at')
73
+ self.customer_verified_at = attributes[:'customer_verified_at']
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ invalid_properties = Array.new
82
+ if @address.nil?
83
+ invalid_properties.push('invalid value for "address", address cannot be nil.')
84
+ end
85
+
86
+ if @address.to_s.length > 254
87
+ invalid_properties.push('invalid value for "address", the character length must be smaller than or equal to 254.')
88
+ end
89
+
90
+ if @address.to_s.length < 4
91
+ invalid_properties.push('invalid value for "address", the character length must be great than or equal to 4.')
92
+ end
93
+
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
+ return false if @address.nil?
102
+ return false if @address.to_s.length > 254
103
+ return false if @address.to_s.length < 4
104
+ true
105
+ end
106
+
107
+ # Custom attribute writer method with validation
108
+ # @param [Object] address Value to be assigned
109
+ def address=(address)
110
+ if address.nil?
111
+ fail ArgumentError, 'address cannot be nil'
112
+ end
113
+
114
+ if address.to_s.length > 254
115
+ fail ArgumentError, 'invalid value for "address", the character length must be smaller than or equal to 254.'
116
+ end
117
+
118
+ if address.to_s.length < 4
119
+ fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 4.'
120
+ end
121
+
122
+ @address = address
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ address == o.address &&
131
+ customer_verified_at == o.customer_verified_at
132
+ end
133
+
134
+ # @see the `==` method
135
+ # @param [Object] Object to be compared
136
+ def eql?(o)
137
+ self == o
138
+ end
139
+
140
+ # Calculates hash code according to all attributes.
141
+ # @return [Integer] Hash code
142
+ def hash
143
+ [address, customer_verified_at].hash
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def self.build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ attributes = attributes.transform_keys(&:to_sym)
152
+ transformed_hash = {}
153
+ openapi_types.each_pair do |key, type|
154
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
155
+ transformed_hash["#{key}"] = nil
156
+ elsif type =~ /\AArray<(.*)>/i
157
+ # check to ensure the input is an array given that the attribute
158
+ # is documented as an array but the input is not
159
+ if attributes[attribute_map[key]].is_a?(Array)
160
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
161
+ end
162
+ elsif !attributes[attribute_map[key]].nil?
163
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
164
+ end
165
+ end
166
+ new(transformed_hash)
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def self._deserialize(type, value)
174
+ case type.to_sym
175
+ when :Time
176
+ Time.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :Boolean
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else # model
206
+ # models (e.g. Pet) or oneOf
207
+ klass = MoneyKit.const_get(type)
208
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ # Outputs non-array value in the form of hash
241
+ # For object, use to_hash. Otherwise, just return the value
242
+ # @param [Object] value Any valid value
243
+ # @return [Hash] Returns the value in the form of hash
244
+ def _to_hash(value)
245
+ if value.is_a?(Array)
246
+ value.compact.map { |v| _to_hash(v) }
247
+ elsif value.is_a?(Hash)
248
+ {}.tap do |hash|
249
+ value.each { |k, v| hash[k] = _to_hash(v) }
250
+ end
251
+ elsif value.respond_to? :to_hash
252
+ value.to_hash
253
+ else
254
+ value
255
+ end
256
+ end
257
+ end
258
+ end