moneykit 0.1.10 → 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 (147) 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/models/account_balances.rb +2 -30
  62. data/lib/moneykit/models/account_group.rb +1 -1
  63. data/lib/moneykit/models/account_identity.rb +11 -1
  64. data/lib/moneykit/models/account_import_data.rb +280 -0
  65. data/lib/moneykit/models/account_response.rb +290 -0
  66. data/lib/moneykit/models/account_with_account_numbers_legacy20230218.rb +11 -1
  67. data/lib/moneykit/models/address.rb +0 -2
  68. data/lib/moneykit/models/app_client_response.rb +1 -1
  69. data/lib/moneykit/models/app_link_state_changed_webhook.rb +394 -0
  70. data/lib/moneykit/models/body.rb +1 -1
  71. data/lib/moneykit/models/create_access_token_response.rb +255 -0
  72. data/lib/moneykit/models/create_link_session_request.rb +1 -1
  73. data/lib/moneykit/models/customer_user.rb +266 -0
  74. data/lib/moneykit/models/customer_user_email.rb +258 -0
  75. data/lib/moneykit/models/customer_user_phone.rb +289 -0
  76. data/lib/moneykit/models/date.rb +104 -0
  77. data/lib/moneykit/models/email.rb +0 -2
  78. data/lib/moneykit/models/get_account_response.rb +1 -1
  79. data/lib/moneykit/models/get_accounts_response.rb +1 -1
  80. data/lib/moneykit/models/get_holdings_response.rb +1 -1
  81. data/lib/moneykit/models/get_investment_transactions_response.rb +1 -1
  82. data/lib/moneykit/models/get_transactions_response.rb +2 -2
  83. data/lib/moneykit/models/get_user_transactions_response.rb +1 -1
  84. data/lib/moneykit/models/import_link_request.rb +303 -0
  85. data/lib/moneykit/models/institution.rb +0 -7
  86. data/lib/moneykit/models/link_common.rb +3 -3
  87. data/lib/moneykit/models/link_product_error.rb +46 -0
  88. data/lib/moneykit/models/link_product_refresh_webhook.rb +24 -24
  89. data/lib/moneykit/models/link_product_response.rb +283 -0
  90. data/lib/moneykit/models/link_product_state.rb +3 -1
  91. data/lib/moneykit/models/link_products.rb +16 -7
  92. data/lib/moneykit/models/link_response.rb +3 -3
  93. data/lib/moneykit/models/phone_number.rb +0 -2
  94. data/lib/moneykit/models/product.rb +2 -1
  95. data/lib/moneykit/models/provider.rb +1 -2
  96. data/lib/moneykit/models/public_link_error.rb +1 -1
  97. data/lib/moneykit/models/public_link_state.rb +43 -0
  98. data/lib/moneykit/models/response401_delete_link_links_id_delete.rb +104 -0
  99. data/lib/moneykit/models/response401_get_transactions_sync_links_id_transactions_sync_get.rb +104 -0
  100. data/lib/moneykit/models/response401_import_link_links_import_post.rb +103 -0
  101. data/lib/moneykit/models/response_handle_link_webhook_event_request_body_webhook_post.rb +1 -1
  102. data/lib/moneykit/models/transaction_category_response.rb +230 -0
  103. data/lib/moneykit/models/transaction_enrichment_response.rb +255 -0
  104. data/lib/moneykit/models/transaction_import_data.rb +283 -0
  105. data/lib/moneykit/models/transaction_merchant_response.rb +243 -0
  106. data/lib/moneykit/models/transaction_processor_response.rb +243 -0
  107. data/lib/moneykit/models/transaction_recurrence_response.rb +223 -0
  108. data/lib/moneykit/models/transaction_response.rb +402 -0
  109. data/lib/moneykit/models/transaction_subcategory_response.rb +230 -0
  110. data/lib/moneykit/models/transaction_sync.rb +257 -0
  111. data/lib/moneykit/models/transaction_sync_response.rb +1 -1
  112. data/lib/moneykit/models/transaction_updates_available_webhook.rb +42 -24
  113. data/lib/moneykit/models/transactions_link_product.rb +1 -1
  114. data/lib/moneykit/version.rb +1 -1
  115. data/lib/moneykit.rb +25 -16
  116. data/spec/models/account_import_data_spec.rb +60 -0
  117. data/spec/models/account_response_spec.rb +66 -0
  118. data/spec/models/app_link_state_changed_webhook_spec.rb +102 -0
  119. data/spec/models/create_access_token_response_spec.rb +48 -0
  120. data/spec/models/customer_user_email_spec.rb +42 -0
  121. data/spec/models/customer_user_phone_spec.rb +48 -0
  122. data/spec/models/customer_user_spec.rb +48 -0
  123. data/spec/models/date_spec.rb +21 -0
  124. data/spec/models/import_link_request_spec.rb +60 -0
  125. data/spec/models/link_product_error_spec.rb +30 -0
  126. data/spec/models/link_product_response_spec.rb +66 -0
  127. data/spec/models/public_link_error_spec.rb +30 -0
  128. data/spec/models/public_link_state_spec.rb +30 -0
  129. data/spec/models/response401_delete_link_links_id_delete_spec.rb +21 -0
  130. data/spec/models/response401_get_transactions_sync_links_id_transactions_sync_get_spec.rb +21 -0
  131. data/spec/models/response401_import_link_links_import_post_spec.rb +21 -0
  132. data/spec/models/transaction_category_response_spec.rb +42 -0
  133. data/spec/models/transaction_enrichment_response_spec.rb +60 -0
  134. data/spec/models/transaction_import_data_spec.rb +66 -0
  135. data/spec/models/transaction_merchant_response_spec.rb +54 -0
  136. data/spec/models/transaction_processor_response_spec.rb +54 -0
  137. data/spec/models/transaction_recurrence_response_spec.rb +42 -0
  138. data/spec/models/transaction_response_spec.rb +108 -0
  139. data/spec/models/transaction_subcategory_response_spec.rb +42 -0
  140. data/spec/models/transaction_sync_spec.rb +48 -0
  141. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/gem_make.out +5 -5
  142. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  143. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.1.1.1/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/mkmf.log +2 -2
  145. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.7.3/gem_make.out +5 -5
  146. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.1.0/gem_make.out +5 -5
  147. metadata +219 -121
@@ -0,0 +1,394 @@
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 AppLinkStateChangedWebhook
18
+ attr_accessor :webhook_major_version
19
+
20
+ attr_accessor :webhook_minor_version
21
+
22
+ attr_accessor :webhook_idempotency_key
23
+
24
+ attr_accessor :webhook_timestamp
25
+
26
+ attr_accessor :link_id
27
+
28
+ attr_accessor :link_tags
29
+
30
+ attr_accessor :webhook_event
31
+
32
+ attr_accessor :state
33
+
34
+ attr_accessor :error
35
+
36
+ attr_accessor :error_message
37
+
38
+ class EnumAttributeValidator
39
+ attr_reader :datatype
40
+ attr_reader :allowable_values
41
+
42
+ def initialize(datatype, allowable_values)
43
+ @allowable_values = allowable_values.map do |value|
44
+ case datatype.to_s
45
+ when /Integer/i
46
+ value.to_i
47
+ when /Float/i
48
+ value.to_f
49
+ else
50
+ value
51
+ end
52
+ end
53
+ end
54
+
55
+ def valid?(value)
56
+ !value || allowable_values.include?(value)
57
+ end
58
+ end
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+ :'webhook_major_version' => :'webhook_major_version',
64
+ :'webhook_minor_version' => :'webhook_minor_version',
65
+ :'webhook_idempotency_key' => :'webhook_idempotency_key',
66
+ :'webhook_timestamp' => :'webhook_timestamp',
67
+ :'link_id' => :'link_id',
68
+ :'link_tags' => :'link_tags',
69
+ :'webhook_event' => :'webhook_event',
70
+ :'state' => :'state',
71
+ :'error' => :'error',
72
+ :'error_message' => :'error_message'
73
+ }
74
+ end
75
+
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ attribute_map.values
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.openapi_types
83
+ {
84
+ :'webhook_major_version' => :'Integer',
85
+ :'webhook_minor_version' => :'Integer',
86
+ :'webhook_idempotency_key' => :'String',
87
+ :'webhook_timestamp' => :'Time',
88
+ :'link_id' => :'String',
89
+ :'link_tags' => :'Array<String>',
90
+ :'webhook_event' => :'String',
91
+ :'state' => :'PublicLinkState',
92
+ :'error' => :'PublicLinkError',
93
+ :'error_message' => :'String'
94
+ }
95
+ end
96
+
97
+ # List of attributes with nullable: true
98
+ def self.openapi_nullable
99
+ Set.new([
100
+ ])
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ if (!attributes.is_a?(Hash))
107
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::AppLinkStateChangedWebhook` initialize method"
108
+ end
109
+
110
+ # check to see if the attribute exists and convert string to symbol for hash key
111
+ attributes = attributes.each_with_object({}) { |(k, v), h|
112
+ if (!self.class.attribute_map.key?(k.to_sym))
113
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::AppLinkStateChangedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
114
+ end
115
+ h[k.to_sym] = v
116
+ }
117
+
118
+ if attributes.key?(:'webhook_major_version')
119
+ self.webhook_major_version = attributes[:'webhook_major_version']
120
+ else
121
+ self.webhook_major_version = WEBHOOK_MAJOR_VERSION::N1
122
+ end
123
+
124
+ if attributes.key?(:'webhook_minor_version')
125
+ self.webhook_minor_version = attributes[:'webhook_minor_version']
126
+ else
127
+ self.webhook_minor_version = WEBHOOK_MINOR_VERSION::N0
128
+ end
129
+
130
+ if attributes.key?(:'webhook_idempotency_key')
131
+ self.webhook_idempotency_key = attributes[:'webhook_idempotency_key']
132
+ else
133
+ self.webhook_idempotency_key = nil
134
+ end
135
+
136
+ if attributes.key?(:'webhook_timestamp')
137
+ self.webhook_timestamp = attributes[:'webhook_timestamp']
138
+ else
139
+ self.webhook_timestamp = nil
140
+ end
141
+
142
+ if attributes.key?(:'link_id')
143
+ self.link_id = attributes[:'link_id']
144
+ else
145
+ self.link_id = nil
146
+ end
147
+
148
+ if attributes.key?(:'link_tags')
149
+ if (value = attributes[:'link_tags']).is_a?(Array)
150
+ self.link_tags = value
151
+ end
152
+ else
153
+ self.link_tags = nil
154
+ end
155
+
156
+ if attributes.key?(:'webhook_event')
157
+ self.webhook_event = attributes[:'webhook_event']
158
+ else
159
+ self.webhook_event = 'link.state_changed'
160
+ end
161
+
162
+ if attributes.key?(:'state')
163
+ self.state = attributes[:'state']
164
+ else
165
+ self.state = nil
166
+ end
167
+
168
+ if attributes.key?(:'error')
169
+ self.error = attributes[:'error']
170
+ end
171
+
172
+ if attributes.key?(:'error_message')
173
+ self.error_message = attributes[:'error_message']
174
+ end
175
+ end
176
+
177
+ # Show invalid properties with the reasons. Usually used together with valid?
178
+ # @return Array for valid properties with the reasons
179
+ def list_invalid_properties
180
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
181
+ invalid_properties = Array.new
182
+ if @webhook_idempotency_key.nil?
183
+ invalid_properties.push('invalid value for "webhook_idempotency_key", webhook_idempotency_key cannot be nil.')
184
+ end
185
+
186
+ if @webhook_timestamp.nil?
187
+ invalid_properties.push('invalid value for "webhook_timestamp", webhook_timestamp cannot be nil.')
188
+ end
189
+
190
+ if @link_id.nil?
191
+ invalid_properties.push('invalid value for "link_id", link_id cannot be nil.')
192
+ end
193
+
194
+ if @link_tags.nil?
195
+ invalid_properties.push('invalid value for "link_tags", link_tags cannot be nil.')
196
+ end
197
+
198
+ if @state.nil?
199
+ invalid_properties.push('invalid value for "state", state cannot be nil.')
200
+ end
201
+
202
+ invalid_properties
203
+ end
204
+
205
+ # Check to see if the all the properties in the model are valid
206
+ # @return true if the model is valid
207
+ def valid?
208
+ warn '[DEPRECATED] the `valid?` method is obsolete'
209
+ webhook_major_version_validator = EnumAttributeValidator.new('Integer', [1])
210
+ return false unless webhook_major_version_validator.valid?(@webhook_major_version)
211
+ webhook_minor_version_validator = EnumAttributeValidator.new('Integer', [0])
212
+ return false unless webhook_minor_version_validator.valid?(@webhook_minor_version)
213
+ return false if @webhook_idempotency_key.nil?
214
+ return false if @webhook_timestamp.nil?
215
+ return false if @link_id.nil?
216
+ return false if @link_tags.nil?
217
+ webhook_event_validator = EnumAttributeValidator.new('String', ["link.state_changed"])
218
+ return false unless webhook_event_validator.valid?(@webhook_event)
219
+ return false if @state.nil?
220
+ true
221
+ end
222
+
223
+ # Custom attribute writer method checking allowed values (enum).
224
+ # @param [Object] webhook_major_version Object to be assigned
225
+ def webhook_major_version=(webhook_major_version)
226
+ validator = EnumAttributeValidator.new('Integer', [1])
227
+ unless validator.valid?(webhook_major_version)
228
+ fail ArgumentError, "invalid value for \"webhook_major_version\", must be one of #{validator.allowable_values}."
229
+ end
230
+ @webhook_major_version = webhook_major_version
231
+ end
232
+
233
+ # Custom attribute writer method checking allowed values (enum).
234
+ # @param [Object] webhook_minor_version Object to be assigned
235
+ def webhook_minor_version=(webhook_minor_version)
236
+ validator = EnumAttributeValidator.new('Integer', [0])
237
+ unless validator.valid?(webhook_minor_version)
238
+ fail ArgumentError, "invalid value for \"webhook_minor_version\", must be one of #{validator.allowable_values}."
239
+ end
240
+ @webhook_minor_version = webhook_minor_version
241
+ end
242
+
243
+ # Custom attribute writer method checking allowed values (enum).
244
+ # @param [Object] webhook_event Object to be assigned
245
+ def webhook_event=(webhook_event)
246
+ validator = EnumAttributeValidator.new('String', ["link.state_changed"])
247
+ unless validator.valid?(webhook_event)
248
+ fail ArgumentError, "invalid value for \"webhook_event\", must be one of #{validator.allowable_values}."
249
+ end
250
+ @webhook_event = webhook_event
251
+ end
252
+
253
+ # Checks equality by comparing each attribute.
254
+ # @param [Object] Object to be compared
255
+ def ==(o)
256
+ return true if self.equal?(o)
257
+ self.class == o.class &&
258
+ webhook_major_version == o.webhook_major_version &&
259
+ webhook_minor_version == o.webhook_minor_version &&
260
+ webhook_idempotency_key == o.webhook_idempotency_key &&
261
+ webhook_timestamp == o.webhook_timestamp &&
262
+ link_id == o.link_id &&
263
+ link_tags == o.link_tags &&
264
+ webhook_event == o.webhook_event &&
265
+ state == o.state &&
266
+ error == o.error &&
267
+ error_message == o.error_message
268
+ end
269
+
270
+ # @see the `==` method
271
+ # @param [Object] Object to be compared
272
+ def eql?(o)
273
+ self == o
274
+ end
275
+
276
+ # Calculates hash code according to all attributes.
277
+ # @return [Integer] Hash code
278
+ def hash
279
+ [webhook_major_version, webhook_minor_version, webhook_idempotency_key, webhook_timestamp, link_id, link_tags, webhook_event, state, error, error_message].hash
280
+ end
281
+
282
+ # Builds the object from hash
283
+ # @param [Hash] attributes Model attributes in the form of hash
284
+ # @return [Object] Returns the model itself
285
+ def self.build_from_hash(attributes)
286
+ return nil unless attributes.is_a?(Hash)
287
+ attributes = attributes.transform_keys(&:to_sym)
288
+ transformed_hash = {}
289
+ openapi_types.each_pair do |key, type|
290
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
291
+ transformed_hash["#{key}"] = nil
292
+ elsif type =~ /\AArray<(.*)>/i
293
+ # check to ensure the input is an array given that the attribute
294
+ # is documented as an array but the input is not
295
+ if attributes[attribute_map[key]].is_a?(Array)
296
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
297
+ end
298
+ elsif !attributes[attribute_map[key]].nil?
299
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
300
+ end
301
+ end
302
+ new(transformed_hash)
303
+ end
304
+
305
+ # Deserializes the data based on type
306
+ # @param string type Data type
307
+ # @param string value Value to be deserialized
308
+ # @return [Object] Deserialized data
309
+ def self._deserialize(type, value)
310
+ case type.to_sym
311
+ when :Time
312
+ Time.parse(value)
313
+ when :Date
314
+ Date.parse(value)
315
+ when :String
316
+ value.to_s
317
+ when :Integer
318
+ value.to_i
319
+ when :Float
320
+ value.to_f
321
+ when :Boolean
322
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
323
+ true
324
+ else
325
+ false
326
+ end
327
+ when :Object
328
+ # generic object (usually a Hash), return directly
329
+ value
330
+ when /\AArray<(?<inner_type>.+)>\z/
331
+ inner_type = Regexp.last_match[:inner_type]
332
+ value.map { |v| _deserialize(inner_type, v) }
333
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
334
+ k_type = Regexp.last_match[:k_type]
335
+ v_type = Regexp.last_match[:v_type]
336
+ {}.tap do |hash|
337
+ value.each do |k, v|
338
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
339
+ end
340
+ end
341
+ else # model
342
+ # models (e.g. Pet) or oneOf
343
+ klass = MoneyKit.const_get(type)
344
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
345
+ end
346
+ end
347
+
348
+ # Returns the string representation of the object
349
+ # @return [String] String presentation of the object
350
+ def to_s
351
+ to_hash.to_s
352
+ end
353
+
354
+ # to_body is an alias to to_hash (backward compatibility)
355
+ # @return [Hash] Returns the object in the form of hash
356
+ def to_body
357
+ to_hash
358
+ end
359
+
360
+ # Returns the object in the form of hash
361
+ # @return [Hash] Returns the object in the form of hash
362
+ def to_hash
363
+ hash = {}
364
+ self.class.attribute_map.each_pair do |attr, param|
365
+ value = self.send(attr)
366
+ if value.nil?
367
+ is_nullable = self.class.openapi_nullable.include?(attr)
368
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
369
+ end
370
+
371
+ hash[param] = _to_hash(value)
372
+ end
373
+ hash
374
+ end
375
+
376
+ # Outputs non-array value in the form of hash
377
+ # For object, use to_hash. Otherwise, just return the value
378
+ # @param [Object] value Any valid value
379
+ # @return [Hash] Returns the value in the form of hash
380
+ def _to_hash(value)
381
+ if value.is_a?(Array)
382
+ value.compact.map { |v| _to_hash(v) }
383
+ elsif value.is_a?(Hash)
384
+ {}.tap do |hash|
385
+ value.each { |k, v| hash[k] = _to_hash(v) }
386
+ end
387
+ elsif value.respond_to? :to_hash
388
+ value.to_hash
389
+ else
390
+ value
391
+ end
392
+ end
393
+ end
394
+ end
@@ -19,8 +19,8 @@ module MoneyKit
19
19
  # List of class defined in anyOf (OpenAPI v3)
20
20
  def openapi_any_of
21
21
  [
22
+ :'AppLinkStateChangedWebhook',
22
23
  :'LinkProductRefreshWebhook',
23
- :'LinkStateChangedWebhook',
24
24
  :'TransactionUpdatesAvailableWebhook'
25
25
  ]
26
26
  end
@@ -0,0 +1,255 @@
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
+ # MoneyKit API access token.
18
+ class CreateAccessTokenResponse
19
+ # Short-lived access token.
20
+ attr_accessor :access_token
21
+
22
+ # Always \"bearer\".
23
+ attr_accessor :token_type
24
+
25
+ # How long until `access_token` expires in seconds.
26
+ attr_accessor :expires_in
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'access_token' => :'access_token',
32
+ :'token_type' => :'token_type',
33
+ :'expires_in' => :'expires_in'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'access_token' => :'String',
46
+ :'token_type' => :'String',
47
+ :'expires_in' => :'Integer'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::CreateAccessTokenResponse` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::CreateAccessTokenResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'access_token')
73
+ self.access_token = attributes[:'access_token']
74
+ else
75
+ self.access_token = nil
76
+ end
77
+
78
+ if attributes.key?(:'token_type')
79
+ self.token_type = attributes[:'token_type']
80
+ else
81
+ self.token_type = nil
82
+ end
83
+
84
+ if attributes.key?(:'expires_in')
85
+ self.expires_in = attributes[:'expires_in']
86
+ else
87
+ self.expires_in = nil
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ if @access_token.nil?
97
+ invalid_properties.push('invalid value for "access_token", access_token cannot be nil.')
98
+ end
99
+
100
+ if @token_type.nil?
101
+ invalid_properties.push('invalid value for "token_type", token_type cannot be nil.')
102
+ end
103
+
104
+ if @expires_in.nil?
105
+ invalid_properties.push('invalid value for "expires_in", expires_in cannot be nil.')
106
+ end
107
+
108
+ invalid_properties
109
+ end
110
+
111
+ # Check to see if the all the properties in the model are valid
112
+ # @return true if the model is valid
113
+ def valid?
114
+ warn '[DEPRECATED] the `valid?` method is obsolete'
115
+ return false if @access_token.nil?
116
+ return false if @token_type.nil?
117
+ return false if @expires_in.nil?
118
+ true
119
+ end
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param [Object] Object to be compared
123
+ def ==(o)
124
+ return true if self.equal?(o)
125
+ self.class == o.class &&
126
+ access_token == o.access_token &&
127
+ token_type == o.token_type &&
128
+ expires_in == o.expires_in
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [access_token, token_type, expires_in].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ attributes = attributes.transform_keys(&:to_sym)
149
+ transformed_hash = {}
150
+ openapi_types.each_pair do |key, type|
151
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = nil
153
+ elsif type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[attribute_map[key]].is_a?(Array)
157
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
158
+ end
159
+ elsif !attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
+ end
162
+ end
163
+ new(transformed_hash)
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def self._deserialize(type, value)
171
+ case type.to_sym
172
+ when :Time
173
+ Time.parse(value)
174
+ when :Date
175
+ Date.parse(value)
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :Boolean
183
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else # model
203
+ # models (e.g. Pet) or oneOf
204
+ klass = MoneyKit.const_get(type)
205
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ if value.nil?
228
+ is_nullable = self.class.openapi_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+ end
255
+ end
@@ -58,7 +58,7 @@ module MoneyKit
58
58
  def self.openapi_types
59
59
  {
60
60
  :'settings' => :'LinkSessionSettingOverrides',
61
- :'customer_user' => :'LinkSessionCustomerUser',
61
+ :'customer_user' => :'CustomerUser',
62
62
  :'existing_link_id' => :'String',
63
63
  :'institution_id' => :'String',
64
64
  :'redirect_uri' => :'String',