moneykit 0.1.9 → 0.1.11

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 (154) 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/AccountNumbersApi.md +9 -9
  10. data/docs/AccountResponse.md +28 -0
  11. data/docs/AccountWithAccountNumbersLegacy20230218.md +2 -0
  12. data/docs/AccountsApi.md +9 -9
  13. data/docs/Address.md +1 -1
  14. data/docs/AppClientResponse.md +2 -2
  15. data/docs/AppLinkStateChangedWebhook.md +36 -0
  16. data/docs/AppResponse.md +2 -2
  17. data/docs/Body.md +3 -3
  18. data/docs/CreateAccessTokenResponse.md +22 -0
  19. data/docs/CreateLinkSessionRequest.md +1 -1
  20. data/docs/CustomerUser.md +22 -0
  21. data/docs/CustomerUserEmail.md +20 -0
  22. data/docs/CustomerUserPhone.md +22 -0
  23. data/docs/Date.md +15 -0
  24. data/docs/Email.md +1 -1
  25. data/docs/GetAccountResponse.md +1 -1
  26. data/docs/GetAccountsResponse.md +1 -1
  27. data/docs/GetHoldingsResponse.md +1 -1
  28. data/docs/GetInvestmentTransactionsResponse.md +1 -1
  29. data/docs/GetTransactionsResponse.md +2 -2
  30. data/docs/GetUserTransactionsResponse.md +1 -1
  31. data/docs/ImportLinkRequest.md +26 -0
  32. data/docs/Institution.md +1 -1
  33. data/docs/LinkCommon.md +3 -3
  34. data/docs/LinkProductError.md +15 -0
  35. data/docs/LinkProductRefreshWebhook.md +2 -2
  36. data/docs/LinkProductResponse.md +28 -0
  37. data/docs/LinkProducts.md +7 -5
  38. data/docs/LinkResponse.md +3 -3
  39. data/docs/LinkSessionApi.md +1 -1
  40. data/docs/LinksApi.md +79 -9
  41. data/docs/PhoneNumber.md +1 -1
  42. data/docs/PublicLinkState.md +15 -0
  43. data/docs/Response401DeleteLinkLinksIdDelete.md +22 -0
  44. data/docs/Response401GetAccountNumbers.md +22 -0
  45. data/docs/Response401GetTransactionsSyncLinksIdTransactionsSyncGet.md +22 -0
  46. data/docs/Response401ImportLinkLinksImportPost.md +22 -0
  47. data/docs/ResponseHandleLinkWebhookEventRequestBodyWebhookPost.md +3 -3
  48. data/docs/TransactionCategoryResponse.md +20 -0
  49. data/docs/TransactionEnrichmentResponse.md +26 -0
  50. data/docs/TransactionImportData.md +28 -0
  51. data/docs/TransactionMerchantResponse.md +24 -0
  52. data/docs/TransactionProcessorResponse.md +24 -0
  53. data/docs/TransactionRecurrenceResponse.md +20 -0
  54. data/docs/TransactionResponse.md +42 -0
  55. data/docs/TransactionSubcategoryResponse.md +20 -0
  56. data/docs/TransactionSync.md +22 -0
  57. data/docs/TransactionSyncResponse.md +1 -1
  58. data/docs/TransactionUpdatesAvailableWebhook.md +4 -2
  59. data/docs/TransactionsApi.md +15 -15
  60. data/docs/TransactionsLinkProduct.md +1 -1
  61. data/lib/moneykit/api/access_token_api.rb +19 -16
  62. data/lib/moneykit/api/account_numbers_api.rb +7 -7
  63. data/lib/moneykit/api/accounts_api.rb +7 -7
  64. data/lib/moneykit/api/links_api.rb +75 -7
  65. data/lib/moneykit/api/transactions_api.rb +17 -17
  66. data/lib/moneykit/models/account_balances.rb +2 -30
  67. data/lib/moneykit/models/account_group.rb +1 -1
  68. data/lib/moneykit/models/account_identity.rb +11 -1
  69. data/lib/moneykit/models/account_import_data.rb +280 -0
  70. data/lib/moneykit/models/account_response.rb +290 -0
  71. data/lib/moneykit/models/account_with_account_numbers_legacy20230218.rb +11 -1
  72. data/lib/moneykit/models/address.rb +0 -2
  73. data/lib/moneykit/models/app_client_response.rb +1 -1
  74. data/lib/moneykit/models/app_link_state_changed_webhook.rb +394 -0
  75. data/lib/moneykit/models/body.rb +1 -1
  76. data/lib/moneykit/models/create_access_token_response.rb +255 -0
  77. data/lib/moneykit/models/create_link_session_request.rb +1 -1
  78. data/lib/moneykit/models/customer_user.rb +266 -0
  79. data/lib/moneykit/models/customer_user_email.rb +258 -0
  80. data/lib/moneykit/models/customer_user_phone.rb +289 -0
  81. data/lib/moneykit/models/date.rb +104 -0
  82. data/lib/moneykit/models/email.rb +0 -2
  83. data/lib/moneykit/models/get_account_response.rb +1 -1
  84. data/lib/moneykit/models/get_accounts_response.rb +1 -1
  85. data/lib/moneykit/models/get_holdings_response.rb +1 -1
  86. data/lib/moneykit/models/get_investment_transactions_response.rb +1 -1
  87. data/lib/moneykit/models/get_transactions_response.rb +2 -2
  88. data/lib/moneykit/models/get_user_transactions_response.rb +1 -1
  89. data/lib/moneykit/models/import_link_request.rb +303 -0
  90. data/lib/moneykit/models/institution.rb +0 -7
  91. data/lib/moneykit/models/link_common.rb +3 -3
  92. data/lib/moneykit/models/link_product_error.rb +46 -0
  93. data/lib/moneykit/models/link_product_refresh_webhook.rb +24 -24
  94. data/lib/moneykit/models/link_product_response.rb +283 -0
  95. data/lib/moneykit/models/link_product_state.rb +3 -1
  96. data/lib/moneykit/models/link_products.rb +16 -7
  97. data/lib/moneykit/models/link_response.rb +3 -3
  98. data/lib/moneykit/models/phone_number.rb +0 -2
  99. data/lib/moneykit/models/product.rb +2 -1
  100. data/lib/moneykit/models/provider.rb +1 -2
  101. data/lib/moneykit/models/public_link_error.rb +1 -1
  102. data/lib/moneykit/models/public_link_state.rb +43 -0
  103. data/lib/moneykit/models/response401_delete_link_links_id_delete.rb +104 -0
  104. data/lib/moneykit/models/response401_get_account_numbers.rb +104 -0
  105. data/lib/moneykit/models/response401_get_transactions_sync_links_id_transactions_sync_get.rb +104 -0
  106. data/lib/moneykit/models/response401_import_link_links_import_post.rb +103 -0
  107. data/lib/moneykit/models/response_handle_link_webhook_event_request_body_webhook_post.rb +1 -1
  108. data/lib/moneykit/models/transaction_category_response.rb +230 -0
  109. data/lib/moneykit/models/transaction_enrichment_response.rb +255 -0
  110. data/lib/moneykit/models/transaction_import_data.rb +283 -0
  111. data/lib/moneykit/models/transaction_merchant_response.rb +243 -0
  112. data/lib/moneykit/models/transaction_processor_response.rb +243 -0
  113. data/lib/moneykit/models/transaction_recurrence_response.rb +223 -0
  114. data/lib/moneykit/models/transaction_response.rb +402 -0
  115. data/lib/moneykit/models/transaction_subcategory_response.rb +230 -0
  116. data/lib/moneykit/models/transaction_sync.rb +257 -0
  117. data/lib/moneykit/models/transaction_sync_response.rb +1 -1
  118. data/lib/moneykit/models/transaction_updates_available_webhook.rb +42 -24
  119. data/lib/moneykit/models/transactions_link_product.rb +1 -1
  120. data/lib/moneykit/version.rb +1 -1
  121. data/lib/moneykit.rb +26 -17
  122. data/spec/models/account_import_data_spec.rb +60 -0
  123. data/spec/models/account_response_spec.rb +66 -0
  124. data/spec/models/app_link_state_changed_webhook_spec.rb +102 -0
  125. data/spec/models/create_access_token_response_spec.rb +48 -0
  126. data/spec/models/customer_user_email_spec.rb +42 -0
  127. data/spec/models/customer_user_phone_spec.rb +48 -0
  128. data/spec/models/customer_user_spec.rb +48 -0
  129. data/spec/models/date_spec.rb +21 -0
  130. data/spec/models/import_link_request_spec.rb +60 -0
  131. data/spec/models/link_product_error_spec.rb +30 -0
  132. data/spec/models/link_product_response_spec.rb +66 -0
  133. data/spec/models/public_link_error_spec.rb +30 -0
  134. data/spec/models/public_link_state_spec.rb +30 -0
  135. data/spec/models/response401_delete_link_links_id_delete_spec.rb +21 -0
  136. data/spec/models/response401_get_account_numbers_spec.rb +21 -0
  137. data/spec/models/response401_get_transactions_sync_links_id_transactions_sync_get_spec.rb +21 -0
  138. data/spec/models/response401_import_link_links_import_post_spec.rb +21 -0
  139. data/spec/models/transaction_category_response_spec.rb +42 -0
  140. data/spec/models/transaction_enrichment_response_spec.rb +60 -0
  141. data/spec/models/transaction_import_data_spec.rb +66 -0
  142. data/spec/models/transaction_merchant_response_spec.rb +54 -0
  143. data/spec/models/transaction_processor_response_spec.rb +54 -0
  144. data/spec/models/transaction_recurrence_response_spec.rb +42 -0
  145. data/spec/models/transaction_response_spec.rb +108 -0
  146. data/spec/models/transaction_subcategory_response_spec.rb +42 -0
  147. data/spec/models/transaction_sync_spec.rb +48 -0
  148. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/gem_make.out +5 -5
  149. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  150. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.1.1.1/gem_make.out +5 -5
  151. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.1.1.1/mkmf.log +2 -2
  152. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.7.3/gem_make.out +5 -5
  153. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.1.0/gem_make.out +5 -5
  154. metadata +222 -120
@@ -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.