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
@@ -24,10 +24,10 @@ module MoneyKit
24
24
  # @param id [String] The unique ID for this link.
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @option opts [Array<String>] :account_ids An optional list of account IDs to filter the results.
27
- # @option opts [Integer] :page The page number to return. (default to 1)
28
- # @option opts [Integer] :size The number of items to return per page. (default to 50)
29
27
  # @option opts [Date] :start_date The earliest date for which data should be returned, formatted as YYYY-MM-DD. Defaults to 90 days before the &#x60;end_date&#x60;. &lt;p&gt;If you want to retrieve **all** transactions, use &#x60;1900-01-01&#x60;.
30
28
  # @option opts [Date] :end_date The latest date for which data should be returned, formatted as YYYY-MM-DD. Defaults to today.
29
+ # @option opts [Integer] :page The page number to return. (default to 1)
30
+ # @option opts [Integer] :size The number of items to return per page. (default to 50)
31
31
  # @return [GetTransactionsResponse]
32
32
  def get_transactions(id, opts = {})
33
33
  data, _status_code, _headers = get_transactions_with_http_info(id, opts)
@@ -39,10 +39,10 @@ module MoneyKit
39
39
  # @param id [String] The unique ID for this link.
40
40
  # @param [Hash] opts the optional parameters
41
41
  # @option opts [Array<String>] :account_ids An optional list of account IDs to filter the results.
42
- # @option opts [Integer] :page The page number to return. (default to 1)
43
- # @option opts [Integer] :size The number of items to return per page. (default to 50)
44
42
  # @option opts [Date] :start_date The earliest date for which data should be returned, formatted as YYYY-MM-DD. Defaults to 90 days before the &#x60;end_date&#x60;. &lt;p&gt;If you want to retrieve **all** transactions, use &#x60;1900-01-01&#x60;.
45
43
  # @option opts [Date] :end_date The latest date for which data should be returned, formatted as YYYY-MM-DD. Defaults to today.
44
+ # @option opts [Integer] :page The page number to return. (default to 1)
45
+ # @option opts [Integer] :size The number of items to return per page. (default to 50)
46
46
  # @return [Array<(GetTransactionsResponse, Integer, Hash)>] GetTransactionsResponse data, response status code and response headers
47
47
  def get_transactions_with_http_info(id, opts = {})
48
48
  if @api_client.config.debugging
@@ -70,10 +70,10 @@ module MoneyKit
70
70
  # query parameters
71
71
  query_params = opts[:query_params] || {}
72
72
  query_params[:'account_ids'] = @api_client.build_collection_param(opts[:'account_ids'], :multi) if !opts[:'account_ids'].nil?
73
- query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
74
- query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
75
73
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
76
74
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
75
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
76
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
77
77
 
78
78
  # header parameters
79
79
  header_params = opts[:header_params] || {}
@@ -110,38 +110,38 @@ module MoneyKit
110
110
  end
111
111
 
112
112
  # /links/{id}/transactions/sync
113
- # Provides a paginated feed of transactions, grouped into `created`, `updated`, and `removed` lists. <p>Each call will also return a `cursor.next` value. In subsequent calls, include that value to receive only changes that have occurred since the previous call. <p>Large numbers of transactions will be paginated, and the `has_more` field will be true. You should continue calling this endpoint with each new `cursor.next` value until `has_more` is false. <p>**Note** that this endpoint does **not** trigger a fetch of transactions from the institution; it merely returns transactions that have already been fetched, either because `prefetch` was requested when the link was created, or because of scheduled or on-demand updates. <p>MoneyKit checks for updated account data, including transactions, periodically throughout the day, but the update frequency can vary, depending on the downstream data provider, the institution, and whether one or both provide webhook-based updates. **To force a check for updated transactions, you can use the <a href=#operation/refresh_products>/products</a> endpoint.** <p>Note also that the `transactions.updates_available` webhook will alert you when new data is available.
113
+ # Provides a paginated feed of transactions, grouped into `created`, `updated`, and `removed` lists. <p>Each call will also return a `cursor.next` value. In subsequent calls, include that value to receive only changes that have occurred since the previous call. <p>**Pending** transactions will only be reported as `created`. Pending transactions are completely removed and replaced with each transaction refresh or update; no attempt is made to track their removal or modification. <p>Large numbers of transactions will be paginated, and the `has_more` field will be true. You should continue calling this endpoint with each new `cursor.next` value until `has_more` is false. <p>**Note** that this endpoint does **not** trigger a fetch of transactions from the institution; it merely returns transactions that have already been fetched, either because `prefetch` was requested when the link was created, or because of scheduled or on-demand updates. <p>MoneyKit checks for updated account data, including transactions, periodically throughout the day, but the update frequency can vary, depending on the downstream data provider, the institution, and whether one or both provide webhook-based updates. **To force a check for updated transactions, you can use the <a href=#operation/refresh_products>/products</a> endpoint.** <p>Note also that the `transactions.updates_available` webhook will alert you when new data is available.
114
114
  # @param id [String] The unique ID for this link.
115
115
  # @param [Hash] opts the optional parameters
116
116
  # @option opts [String] :cursor A cursor value representing the last update requested. If included, the response will only return changes after this update. If omitted, a complete history of updates will be returned. This value must be stored by the client as we do not keep track of app cursors.
117
117
  # @option opts [Integer] :size The number of items to return. (default to 50)
118
118
  # @return [TransactionSyncResponse]
119
- def get_transactions_diff(id, opts = {})
120
- data, _status_code, _headers = get_transactions_diff_with_http_info(id, opts)
119
+ def get_transactions_sync(id, opts = {})
120
+ data, _status_code, _headers = get_transactions_sync_with_http_info(id, opts)
121
121
  data
122
122
  end
123
123
 
124
124
  # /links/{id}/transactions/sync
125
- # Provides a paginated feed of transactions, grouped into &#x60;created&#x60;, &#x60;updated&#x60;, and &#x60;removed&#x60; lists. &lt;p&gt;Each call will also return a &#x60;cursor.next&#x60; value. In subsequent calls, include that value to receive only changes that have occurred since the previous call. &lt;p&gt;Large numbers of transactions will be paginated, and the &#x60;has_more&#x60; field will be true. You should continue calling this endpoint with each new &#x60;cursor.next&#x60; value until &#x60;has_more&#x60; is false. &lt;p&gt;**Note** that this endpoint does **not** trigger a fetch of transactions from the institution; it merely returns transactions that have already been fetched, either because &#x60;prefetch&#x60; was requested when the link was created, or because of scheduled or on-demand updates. &lt;p&gt;MoneyKit checks for updated account data, including transactions, periodically throughout the day, but the update frequency can vary, depending on the downstream data provider, the institution, and whether one or both provide webhook-based updates. **To force a check for updated transactions, you can use the &lt;a href&#x3D;#operation/refresh_products&gt;/products&lt;/a&gt; endpoint.** &lt;p&gt;Note also that the &#x60;transactions.updates_available&#x60; webhook will alert you when new data is available.
125
+ # Provides a paginated feed of transactions, grouped into &#x60;created&#x60;, &#x60;updated&#x60;, and &#x60;removed&#x60; lists. &lt;p&gt;Each call will also return a &#x60;cursor.next&#x60; value. In subsequent calls, include that value to receive only changes that have occurred since the previous call. &lt;p&gt;**Pending** transactions will only be reported as &#x60;created&#x60;. Pending transactions are completely removed and replaced with each transaction refresh or update; no attempt is made to track their removal or modification. &lt;p&gt;Large numbers of transactions will be paginated, and the &#x60;has_more&#x60; field will be true. You should continue calling this endpoint with each new &#x60;cursor.next&#x60; value until &#x60;has_more&#x60; is false. &lt;p&gt;**Note** that this endpoint does **not** trigger a fetch of transactions from the institution; it merely returns transactions that have already been fetched, either because &#x60;prefetch&#x60; was requested when the link was created, or because of scheduled or on-demand updates. &lt;p&gt;MoneyKit checks for updated account data, including transactions, periodically throughout the day, but the update frequency can vary, depending on the downstream data provider, the institution, and whether one or both provide webhook-based updates. **To force a check for updated transactions, you can use the &lt;a href&#x3D;#operation/refresh_products&gt;/products&lt;/a&gt; endpoint.** &lt;p&gt;Note also that the &#x60;transactions.updates_available&#x60; webhook will alert you when new data is available.
126
126
  # @param id [String] The unique ID for this link.
127
127
  # @param [Hash] opts the optional parameters
128
128
  # @option opts [String] :cursor A cursor value representing the last update requested. If included, the response will only return changes after this update. If omitted, a complete history of updates will be returned. This value must be stored by the client as we do not keep track of app cursors.
129
129
  # @option opts [Integer] :size The number of items to return. (default to 50)
130
130
  # @return [Array<(TransactionSyncResponse, Integer, Hash)>] TransactionSyncResponse data, response status code and response headers
131
- def get_transactions_diff_with_http_info(id, opts = {})
131
+ def get_transactions_sync_with_http_info(id, opts = {})
132
132
  if @api_client.config.debugging
133
- @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions_diff ...'
133
+ @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions_sync ...'
134
134
  end
135
135
  # verify the required parameter 'id' is set
136
136
  if @api_client.config.client_side_validation && id.nil?
137
- fail ArgumentError, "Missing the required parameter 'id' when calling TransactionsApi.get_transactions_diff"
137
+ fail ArgumentError, "Missing the required parameter 'id' when calling TransactionsApi.get_transactions_sync"
138
138
  end
139
139
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 500
140
- fail ArgumentError, 'invalid value for "opts[:"size"]" when calling TransactionsApi.get_transactions_diff, must be smaller than or equal to 500.'
140
+ fail ArgumentError, 'invalid value for "opts[:"size"]" when calling TransactionsApi.get_transactions_sync, must be smaller than or equal to 500.'
141
141
  end
142
142
 
143
143
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] < 1
144
- fail ArgumentError, 'invalid value for "opts[:"size"]" when calling TransactionsApi.get_transactions_diff, must be greater than or equal to 1.'
144
+ fail ArgumentError, 'invalid value for "opts[:"size"]" when calling TransactionsApi.get_transactions_sync, must be greater than or equal to 1.'
145
145
  end
146
146
 
147
147
  # resource path
@@ -170,7 +170,7 @@ module MoneyKit
170
170
  auth_names = opts[:debug_auth_names] || ['OAuth2ClientCredentials']
171
171
 
172
172
  new_options = opts.merge(
173
- :operation => :"TransactionsApi.get_transactions_diff",
173
+ :operation => :"TransactionsApi.get_transactions_sync",
174
174
  :header_params => header_params,
175
175
  :query_params => query_params,
176
176
  :form_params => form_params,
@@ -181,7 +181,7 @@ module MoneyKit
181
181
 
182
182
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
183
183
  if @api_client.config.debugging
184
- @api_client.config.logger.debug "API called: TransactionsApi#get_transactions_diff\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
184
+ @api_client.config.logger.debug "API called: TransactionsApi#get_transactions_sync\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
185
185
  end
186
186
  return data, status_code, headers
187
187
  end
@@ -15,6 +15,7 @@ require 'time'
15
15
 
16
16
  module MoneyKit
17
17
  class AccountBalances
18
+ # A three-character currency code (ISO-4217 or similar, *e.g.*, `USD`, `CAD`) for the account balances.
18
19
  attr_accessor :currency
19
20
 
20
21
  # The amount of funds available for use. Not all institutions report the available balance. <p>Note that the available balance typically does not include overdraft limits.
@@ -29,28 +30,6 @@ module MoneyKit
29
30
  # The date that the balance was captured at. This may not include a time. When this field is null, the balance was captured at an unknown time.
30
31
  attr_accessor :balance_date
31
32
 
32
- class EnumAttributeValidator
33
- attr_reader :datatype
34
- attr_reader :allowable_values
35
-
36
- def initialize(datatype, allowable_values)
37
- @allowable_values = allowable_values.map do |value|
38
- case datatype.to_s
39
- when /Integer/i
40
- value.to_i
41
- when /Float/i
42
- value.to_f
43
- else
44
- value
45
- end
46
- end
47
- end
48
-
49
- def valid?(value)
50
- !value || allowable_values.include?(value)
51
- end
52
- end
53
-
54
33
  # Attribute mapping from ruby-style variable name to JSON key.
55
34
  def self.attribute_map
56
35
  {
@@ -70,7 +49,7 @@ module MoneyKit
70
49
  # Attribute type mapping.
71
50
  def self.openapi_types
72
51
  {
73
- :'currency' => :'Currency',
52
+ :'currency' => :'String',
74
53
  :'available' => :'Float',
75
54
  :'current' => :'Float',
76
55
  :'limit' => :'Float',
@@ -101,8 +80,6 @@ module MoneyKit
101
80
 
102
81
  if attributes.key?(:'currency')
103
82
  self.currency = attributes[:'currency']
104
- else
105
- self.currency = nil
106
83
  end
107
84
 
108
85
  if attributes.key?(:'available')
@@ -127,10 +104,6 @@ module MoneyKit
127
104
  def list_invalid_properties
128
105
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
106
  invalid_properties = Array.new
130
- if @currency.nil?
131
- invalid_properties.push('invalid value for "currency", currency cannot be nil.')
132
- end
133
-
134
107
  invalid_properties
135
108
  end
136
109
 
@@ -138,7 +111,6 @@ module MoneyKit
138
111
  # @return true if the model is valid
139
112
  def valid?
140
113
  warn '[DEPRECATED] the `valid?` method is obsolete'
141
- return false if @currency.nil?
142
114
  true
143
115
  end
144
116
 
@@ -36,7 +36,7 @@ module MoneyKit
36
36
  # Attribute type mapping.
37
37
  def self.openapi_types
38
38
  {
39
- :'accounts' => :'Array<Account>',
39
+ :'accounts' => :'Array<AccountResponse>',
40
40
  :'last_synced_at' => :'Time'
41
41
  }
42
42
  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 :owners
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
  :'owners' => :'owners'
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
  :'owners' => :'Array<Owner>'
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?(:'owners')
113
122
  if (value = attributes[:'owners']).is_a?(Array)
114
123
  self.owners = value
@@ -168,6 +177,7 @@ module MoneyKit
168
177
  name == o.name &&
169
178
  account_mask == o.account_mask &&
170
179
  balances == o.balances &&
180
+ original_id == o.original_id &&
171
181
  owners == o.owners
172
182
  end
173
183
 
@@ -180,7 +190,7 @@ module MoneyKit
180
190
  # Calculates hash code according to all attributes.
181
191
  # @return [Integer] Hash code
182
192
  def hash
183
- [account_id, account_type, name, account_mask, balances, owners].hash
193
+ [account_id, account_type, name, account_mask, balances, original_id, owners].hash
184
194
  end
185
195
 
186
196
  # Builds the object from hash
@@ -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