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,280 @@
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 AccountImportData
18
+ # Your internal ID for this account. Must be unique within the imported account batch.
19
+ attr_accessor :account_id
20
+
21
+ # The account name. This value may change if synced with a data provider later.
22
+ attr_accessor :name
23
+
24
+ # The account type. It can have any initial value but it will be converted to a MoneyKit account type (see <a href=/pages/account_types>Account Types</a>) upon output. The account may change types if it is synced with a data provider later.
25
+ attr_accessor :type
26
+
27
+ # The last four characters (usually digits) of the account number. This field can be omitted, but you are strongly encouraged to supply it because it is the most important factor for properly connecting new data to this account if it is synced with a data provider later.
28
+ attr_accessor :mask
29
+
30
+ attr_accessor :balances
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'account_id' => :'account_id',
36
+ :'name' => :'name',
37
+ :'type' => :'type',
38
+ :'mask' => :'mask',
39
+ :'balances' => :'balances'
40
+ }
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ attribute_map.values
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'account_id' => :'String',
52
+ :'name' => :'String',
53
+ :'type' => :'String',
54
+ :'mask' => :'String',
55
+ :'balances' => :'AccountBalances'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::AccountImportData` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::AccountImportData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'account_id')
81
+ self.account_id = attributes[:'account_id']
82
+ else
83
+ self.account_id = nil
84
+ end
85
+
86
+ if attributes.key?(:'name')
87
+ self.name = attributes[:'name']
88
+ else
89
+ self.name = nil
90
+ end
91
+
92
+ if attributes.key?(:'type')
93
+ self.type = attributes[:'type']
94
+ else
95
+ self.type = nil
96
+ end
97
+
98
+ if attributes.key?(:'mask')
99
+ self.mask = attributes[:'mask']
100
+ end
101
+
102
+ if attributes.key?(:'balances')
103
+ self.balances = attributes[:'balances']
104
+ else
105
+ self.balances = nil
106
+ end
107
+ end
108
+
109
+ # Show invalid properties with the reasons. Usually used together with valid?
110
+ # @return Array for valid properties with the reasons
111
+ def list_invalid_properties
112
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
113
+ invalid_properties = Array.new
114
+ if @account_id.nil?
115
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
116
+ end
117
+
118
+ if @name.nil?
119
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
120
+ end
121
+
122
+ if @type.nil?
123
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
124
+ end
125
+
126
+ if @balances.nil?
127
+ invalid_properties.push('invalid value for "balances", balances cannot be nil.')
128
+ end
129
+
130
+ invalid_properties
131
+ end
132
+
133
+ # Check to see if the all the properties in the model are valid
134
+ # @return true if the model is valid
135
+ def valid?
136
+ warn '[DEPRECATED] the `valid?` method is obsolete'
137
+ return false if @account_id.nil?
138
+ return false if @name.nil?
139
+ return false if @type.nil?
140
+ return false if @balances.nil?
141
+ true
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(o)
147
+ return true if self.equal?(o)
148
+ self.class == o.class &&
149
+ account_id == o.account_id &&
150
+ name == o.name &&
151
+ type == o.type &&
152
+ mask == o.mask &&
153
+ balances == o.balances
154
+ end
155
+
156
+ # @see the `==` method
157
+ # @param [Object] Object to be compared
158
+ def eql?(o)
159
+ self == o
160
+ end
161
+
162
+ # Calculates hash code according to all attributes.
163
+ # @return [Integer] Hash code
164
+ def hash
165
+ [account_id, name, type, mask, balances].hash
166
+ end
167
+
168
+ # Builds the object from hash
169
+ # @param [Hash] attributes Model attributes in the form of hash
170
+ # @return [Object] Returns the model itself
171
+ def self.build_from_hash(attributes)
172
+ return nil unless attributes.is_a?(Hash)
173
+ attributes = attributes.transform_keys(&:to_sym)
174
+ transformed_hash = {}
175
+ openapi_types.each_pair do |key, type|
176
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = nil
178
+ elsif type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[attribute_map[key]].is_a?(Array)
182
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
183
+ end
184
+ elsif !attributes[attribute_map[key]].nil?
185
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
186
+ end
187
+ end
188
+ new(transformed_hash)
189
+ end
190
+
191
+ # Deserializes the data based on type
192
+ # @param string type Data type
193
+ # @param string value Value to be deserialized
194
+ # @return [Object] Deserialized data
195
+ def self._deserialize(type, value)
196
+ case type.to_sym
197
+ when :Time
198
+ Time.parse(value)
199
+ when :Date
200
+ Date.parse(value)
201
+ when :String
202
+ value.to_s
203
+ when :Integer
204
+ value.to_i
205
+ when :Float
206
+ value.to_f
207
+ when :Boolean
208
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
209
+ true
210
+ else
211
+ false
212
+ end
213
+ when :Object
214
+ # generic object (usually a Hash), return directly
215
+ value
216
+ when /\AArray<(?<inner_type>.+)>\z/
217
+ inner_type = Regexp.last_match[:inner_type]
218
+ value.map { |v| _deserialize(inner_type, v) }
219
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
220
+ k_type = Regexp.last_match[:k_type]
221
+ v_type = Regexp.last_match[:v_type]
222
+ {}.tap do |hash|
223
+ value.each do |k, v|
224
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
225
+ end
226
+ end
227
+ else # model
228
+ # models (e.g. Pet) or oneOf
229
+ klass = MoneyKit.const_get(type)
230
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
231
+ end
232
+ end
233
+
234
+ # Returns the string representation of the object
235
+ # @return [String] String presentation of the object
236
+ def to_s
237
+ to_hash.to_s
238
+ end
239
+
240
+ # to_body is an alias to to_hash (backward compatibility)
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_body
243
+ to_hash
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ if value.nil?
253
+ is_nullable = self.class.openapi_nullable.include?(attr)
254
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
255
+ end
256
+
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ # Outputs non-array value in the form of hash
263
+ # For object, use to_hash. Otherwise, just return the value
264
+ # @param [Object] value Any valid value
265
+ # @return [Hash] Returns the value in the form of hash
266
+ def _to_hash(value)
267
+ if value.is_a?(Array)
268
+ value.compact.map { |v| _to_hash(v) }
269
+ elsif value.is_a?(Hash)
270
+ {}.tap do |hash|
271
+ value.each { |k, v| hash[k] = _to_hash(v) }
272
+ end
273
+ elsif value.respond_to? :to_hash
274
+ value.to_hash
275
+ else
276
+ value
277
+ end
278
+ end
279
+ end
280
+ end
@@ -0,0 +1,290 @@
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 AccountResponse
18
+ # MoneyKit's unique ID for the account. <p>The `account_id` is distinct from the institution's account number. For accounts that may change account numbers from time to time, such as credit cards, MoneyKit attempts to keep the `account_id` constant. However, if MoneyKit can't reconcile the new account data with the old data, the `account_id` may change.
19
+ attr_accessor :account_id
20
+
21
+ # See <a href=/pages/account_types>Account Types</a> for an explanation of account types. Account types are dot-prefixed with one of `depository`, `investment`, `liability`, or `other`; or the value is `unknown`. <p>**Balances for `liability` accounts are reversed:** negative balances (the amount owed) are reported as positive values. For all other types of accounts, a negative balance indicates the amount owed.
22
+ attr_accessor :account_type
23
+
24
+ # The account name, according to the institution. Note that some institutions allow the end user to nickname the account; in such cases this field may be the name assigned by the user.
25
+ attr_accessor :name
26
+
27
+ # The last four characters (usually digits) of the account number. Note that this mask may be non-unique between accounts.
28
+ attr_accessor :account_mask
29
+
30
+ attr_accessor :balances
31
+
32
+ # The original ID of this account, if supplied (by you) during an import.
33
+ attr_accessor :original_id
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'account_id' => :'account_id',
39
+ :'account_type' => :'account_type',
40
+ :'name' => :'name',
41
+ :'account_mask' => :'account_mask',
42
+ :'balances' => :'balances',
43
+ :'original_id' => :'original_id'
44
+ }
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ def self.acceptable_attributes
49
+ attribute_map.values
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'account_id' => :'String',
56
+ :'account_type' => :'String',
57
+ :'name' => :'String',
58
+ :'account_mask' => :'String',
59
+ :'balances' => :'AccountBalances',
60
+ :'original_id' => :'String'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::AccountResponse` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::AccountResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'account_id')
86
+ self.account_id = attributes[:'account_id']
87
+ else
88
+ self.account_id = nil
89
+ end
90
+
91
+ if attributes.key?(:'account_type')
92
+ self.account_type = attributes[:'account_type']
93
+ else
94
+ self.account_type = nil
95
+ end
96
+
97
+ if attributes.key?(:'name')
98
+ self.name = attributes[:'name']
99
+ else
100
+ self.name = nil
101
+ end
102
+
103
+ if attributes.key?(:'account_mask')
104
+ self.account_mask = attributes[:'account_mask']
105
+ end
106
+
107
+ if attributes.key?(:'balances')
108
+ self.balances = attributes[:'balances']
109
+ else
110
+ self.balances = nil
111
+ end
112
+
113
+ if attributes.key?(:'original_id')
114
+ self.original_id = attributes[:'original_id']
115
+ end
116
+ end
117
+
118
+ # Show invalid properties with the reasons. Usually used together with valid?
119
+ # @return Array for valid properties with the reasons
120
+ def list_invalid_properties
121
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
122
+ invalid_properties = Array.new
123
+ if @account_id.nil?
124
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
125
+ end
126
+
127
+ if @account_type.nil?
128
+ invalid_properties.push('invalid value for "account_type", account_type cannot be nil.')
129
+ end
130
+
131
+ if @name.nil?
132
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
133
+ end
134
+
135
+ if @balances.nil?
136
+ invalid_properties.push('invalid value for "balances", balances cannot be nil.')
137
+ end
138
+
139
+ invalid_properties
140
+ end
141
+
142
+ # Check to see if the all the properties in the model are valid
143
+ # @return true if the model is valid
144
+ def valid?
145
+ warn '[DEPRECATED] the `valid?` method is obsolete'
146
+ return false if @account_id.nil?
147
+ return false if @account_type.nil?
148
+ return false if @name.nil?
149
+ return false if @balances.nil?
150
+ true
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ account_id == o.account_id &&
159
+ account_type == o.account_type &&
160
+ name == o.name &&
161
+ account_mask == o.account_mask &&
162
+ balances == o.balances &&
163
+ original_id == o.original_id
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Integer] Hash code
174
+ def hash
175
+ [account_id, account_type, name, account_mask, balances, original_id].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def self.build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ attributes = attributes.transform_keys(&:to_sym)
184
+ transformed_hash = {}
185
+ openapi_types.each_pair do |key, type|
186
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
187
+ transformed_hash["#{key}"] = nil
188
+ elsif type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[attribute_map[key]].is_a?(Array)
192
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
193
+ end
194
+ elsif !attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
196
+ end
197
+ end
198
+ new(transformed_hash)
199
+ end
200
+
201
+ # Deserializes the data based on type
202
+ # @param string type Data type
203
+ # @param string value Value to be deserialized
204
+ # @return [Object] Deserialized data
205
+ def self._deserialize(type, value)
206
+ case type.to_sym
207
+ when :Time
208
+ Time.parse(value)
209
+ when :Date
210
+ Date.parse(value)
211
+ when :String
212
+ value.to_s
213
+ when :Integer
214
+ value.to_i
215
+ when :Float
216
+ value.to_f
217
+ when :Boolean
218
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
219
+ true
220
+ else
221
+ false
222
+ end
223
+ when :Object
224
+ # generic object (usually a Hash), return directly
225
+ value
226
+ when /\AArray<(?<inner_type>.+)>\z/
227
+ inner_type = Regexp.last_match[:inner_type]
228
+ value.map { |v| _deserialize(inner_type, v) }
229
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
230
+ k_type = Regexp.last_match[:k_type]
231
+ v_type = Regexp.last_match[:v_type]
232
+ {}.tap do |hash|
233
+ value.each do |k, v|
234
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
235
+ end
236
+ end
237
+ else # model
238
+ # models (e.g. Pet) or oneOf
239
+ klass = MoneyKit.const_get(type)
240
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
241
+ end
242
+ end
243
+
244
+ # Returns the string representation of the object
245
+ # @return [String] String presentation of the object
246
+ def to_s
247
+ to_hash.to_s
248
+ end
249
+
250
+ # to_body is an alias to to_hash (backward compatibility)
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_body
253
+ to_hash
254
+ end
255
+
256
+ # Returns the object in the form of hash
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_hash
259
+ hash = {}
260
+ self.class.attribute_map.each_pair do |attr, param|
261
+ value = self.send(attr)
262
+ if value.nil?
263
+ is_nullable = self.class.openapi_nullable.include?(attr)
264
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
265
+ end
266
+
267
+ hash[param] = _to_hash(value)
268
+ end
269
+ hash
270
+ end
271
+
272
+ # Outputs non-array value in the form of hash
273
+ # For object, use to_hash. Otherwise, just return the value
274
+ # @param [Object] value Any valid value
275
+ # @return [Hash] Returns the value in the form of hash
276
+ def _to_hash(value)
277
+ if value.is_a?(Array)
278
+ value.compact.map { |v| _to_hash(v) }
279
+ elsif value.is_a?(Hash)
280
+ {}.tap do |hash|
281
+ value.each { |k, v| hash[k] = _to_hash(v) }
282
+ end
283
+ elsif value.respond_to? :to_hash
284
+ value.to_hash
285
+ else
286
+ value
287
+ end
288
+ end
289
+ end
290
+ end
@@ -29,6 +29,9 @@ module MoneyKit
29
29
 
30
30
  attr_accessor :balances
31
31
 
32
+ # The original ID of this account, if supplied (by you) during an import.
33
+ attr_accessor :original_id
34
+
32
35
  attr_accessor :numbers
33
36
 
34
37
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -39,6 +42,7 @@ module MoneyKit
39
42
  :'name' => :'name',
40
43
  :'account_mask' => :'account_mask',
41
44
  :'balances' => :'balances',
45
+ :'original_id' => :'original_id',
42
46
  :'numbers' => :'numbers'
43
47
  }
44
48
  end
@@ -56,6 +60,7 @@ module MoneyKit
56
60
  :'name' => :'String',
57
61
  :'account_mask' => :'String',
58
62
  :'balances' => :'AccountBalances',
63
+ :'original_id' => :'String',
59
64
  :'numbers' => :'AccountNumbersLegacy20230218'
60
65
  }
61
66
  end
@@ -109,6 +114,10 @@ module MoneyKit
109
114
  self.balances = nil
110
115
  end
111
116
 
117
+ if attributes.key?(:'original_id')
118
+ self.original_id = attributes[:'original_id']
119
+ end
120
+
112
121
  if attributes.key?(:'numbers')
113
122
  self.numbers = attributes[:'numbers']
114
123
  else
@@ -166,6 +175,7 @@ module MoneyKit
166
175
  name == o.name &&
167
176
  account_mask == o.account_mask &&
168
177
  balances == o.balances &&
178
+ original_id == o.original_id &&
169
179
  numbers == o.numbers
170
180
  end
171
181
 
@@ -178,7 +188,7 @@ module MoneyKit
178
188
  # Calculates hash code according to all attributes.
179
189
  # @return [Integer] Hash code
180
190
  def hash
181
- [account_id, account_type, name, account_mask, balances, numbers].hash
191
+ [account_id, account_type, name, account_mask, balances, original_id, numbers].hash
182
192
  end
183
193
 
184
194
  # Builds the object from hash
@@ -105,8 +105,6 @@ module MoneyKit
105
105
 
106
106
  if attributes.key?(:'primary')
107
107
  self.primary = attributes[:'primary']
108
- else
109
- self.primary = false
110
108
  end
111
109
  end
112
110
 
@@ -19,7 +19,7 @@ module MoneyKit
19
19
  # The client's client ID.
20
20
  attr_accessor :client_id
21
21
 
22
- # Friendly client name for identification.
22
+ # (deprecated) Friendly client name for identification.
23
23
  attr_accessor :client_name
24
24
 
25
25
  # Actions allowed by this client.