plaid 14.0.0.beta.5 → 14.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (387) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/CONTRIBUTING.md +1 -5
  4. data/Gemfile.lock +14 -4
  5. data/Makefile +1 -1
  6. data/README.md +5 -4
  7. data/doc/rdoc/.DS_Store +0 -0
  8. data/lib/plaid.rb +59 -13
  9. data/lib/plaid/.DS_Store +0 -0
  10. data/lib/plaid/api/plaid_api.rb +644 -61
  11. data/lib/plaid/api_client.rb +3 -2
  12. data/lib/plaid/api_error.rb +1 -1
  13. data/lib/plaid/configuration.rb +1 -1
  14. data/lib/plaid/models/account_access.rb +238 -0
  15. data/lib/plaid/models/account_assets.rb +16 -5
  16. data/lib/plaid/models/account_assets_all_of.rb +16 -4
  17. data/lib/plaid/models/account_balance.rb +6 -10
  18. data/lib/plaid/models/account_base.rb +1 -2
  19. data/lib/plaid/models/account_filter.rb +258 -0
  20. data/lib/plaid/models/account_filters_response.rb +1 -1
  21. data/lib/plaid/models/account_identity.rb +1 -2
  22. data/lib/plaid/models/account_identity_all_of.rb +1 -1
  23. data/lib/plaid/models/account_selection_cardinality.rb +38 -0
  24. data/lib/plaid/models/account_subtype.rb +5 -1
  25. data/lib/plaid/models/account_type.rb +1 -1
  26. data/lib/plaid/models/accounts_balance_get_request.rb +1 -1
  27. data/lib/plaid/models/accounts_balance_get_request_options.rb +1 -1
  28. data/lib/plaid/models/accounts_get_request.rb +1 -1
  29. data/lib/plaid/models/accounts_get_request_options.rb +1 -1
  30. data/lib/plaid/models/accounts_get_response.rb +1 -1
  31. data/lib/plaid/models/ach_class.rb +1 -1
  32. data/lib/plaid/models/address.rb +1 -2
  33. data/lib/plaid/models/address_data.rb +2 -6
  34. data/lib/plaid/models/{nullable_address_data.rb → address_data_nullable.rb} +5 -9
  35. data/lib/plaid/models/{nullable_address.rb → address_nullable.rb} +4 -5
  36. data/lib/plaid/models/application.rb +17 -2
  37. data/lib/plaid/models/application_get_request.rb +1 -1
  38. data/lib/plaid/models/application_get_response.rb +1 -1
  39. data/lib/plaid/models/apr.rb +1 -1
  40. data/lib/plaid/models/asset_report.rb +2 -2
  41. data/lib/plaid/models/asset_report_audit_copy_create_request.rb +1 -1
  42. data/lib/plaid/models/asset_report_audit_copy_create_response.rb +1 -1
  43. data/lib/plaid/models/asset_report_audit_copy_get_request.rb +1 -1
  44. data/lib/plaid/models/asset_report_audit_copy_remove_request.rb +1 -1
  45. data/lib/plaid/models/asset_report_audit_copy_remove_response.rb +1 -1
  46. data/lib/plaid/models/asset_report_create_request.rb +1 -1
  47. data/lib/plaid/models/asset_report_create_request_options.rb +1 -1
  48. data/lib/plaid/models/asset_report_create_response.rb +1 -1
  49. data/lib/plaid/models/asset_report_filter_request.rb +1 -1
  50. data/lib/plaid/models/asset_report_filter_response.rb +1 -1
  51. data/lib/plaid/models/asset_report_get_request.rb +1 -1
  52. data/lib/plaid/models/asset_report_get_response.rb +1 -1
  53. data/lib/plaid/models/asset_report_item.rb +2 -2
  54. data/lib/plaid/models/asset_report_pdf_get_request.rb +1 -1
  55. data/lib/plaid/models/asset_report_refresh_request.rb +1 -1
  56. data/lib/plaid/models/asset_report_refresh_request_options.rb +1 -1
  57. data/lib/plaid/models/asset_report_refresh_response.rb +1 -1
  58. data/lib/plaid/models/asset_report_remove_request.rb +1 -1
  59. data/lib/plaid/models/asset_report_remove_response.rb +1 -1
  60. data/lib/plaid/models/asset_report_transaction.rb +108 -187
  61. data/lib/plaid/models/asset_report_transaction_all_of.rb +6 -21
  62. data/lib/plaid/models/asset_report_user.rb +2 -2
  63. data/lib/plaid/models/assets_error_webhook.rb +1 -1
  64. data/lib/plaid/models/assets_product_ready_webhook.rb +1 -1
  65. data/lib/plaid/models/auth_get_numbers.rb +21 -1
  66. data/lib/plaid/models/auth_get_request.rb +1 -1
  67. data/lib/plaid/models/auth_get_request_options.rb +1 -1
  68. data/lib/plaid/models/auth_get_response.rb +1 -1
  69. data/lib/plaid/models/automatically_verified_webhook.rb +1 -1
  70. data/lib/plaid/models/bank_initiated_return_risk.rb +300 -0
  71. data/lib/plaid/models/bank_transfer.rb +2 -2
  72. data/lib/plaid/models/bank_transfer_balance.rb +1 -1
  73. data/lib/plaid/models/bank_transfer_balance_get_request.rb +1 -1
  74. data/lib/plaid/models/bank_transfer_balance_get_response.rb +1 -1
  75. data/lib/plaid/models/bank_transfer_cancel_request.rb +1 -1
  76. data/lib/plaid/models/bank_transfer_cancel_response.rb +1 -1
  77. data/lib/plaid/models/bank_transfer_create_request.rb +1 -1
  78. data/lib/plaid/models/bank_transfer_create_response.rb +1 -1
  79. data/lib/plaid/models/bank_transfer_direction.rb +2 -1
  80. data/lib/plaid/models/bank_transfer_event.rb +2 -2
  81. data/lib/plaid/models/bank_transfer_event_list_request.rb +16 -4
  82. data/lib/plaid/models/bank_transfer_event_list_response.rb +1 -1
  83. data/lib/plaid/models/bank_transfer_event_sync_request.rb +1 -1
  84. data/lib/plaid/models/bank_transfer_event_sync_response.rb +1 -1
  85. data/lib/plaid/models/bank_transfer_event_type.rb +1 -1
  86. data/lib/plaid/models/bank_transfer_failure.rb +2 -2
  87. data/lib/plaid/models/bank_transfer_get_request.rb +1 -1
  88. data/lib/plaid/models/bank_transfer_get_response.rb +1 -1
  89. data/lib/plaid/models/bank_transfer_list_request.rb +1 -1
  90. data/lib/plaid/models/bank_transfer_list_response.rb +1 -1
  91. data/lib/plaid/models/bank_transfer_migrate_account_request.rb +1 -1
  92. data/lib/plaid/models/bank_transfer_migrate_account_response.rb +1 -1
  93. data/lib/plaid/models/bank_transfer_network.rb +1 -1
  94. data/lib/plaid/models/bank_transfer_receiver_details.rb +3 -3
  95. data/lib/plaid/models/bank_transfer_status.rb +1 -1
  96. data/lib/plaid/models/bank_transfer_type.rb +1 -1
  97. data/lib/plaid/models/bank_transfer_user.rb +2 -2
  98. data/lib/plaid/models/bank_transfers_events_update_webhook.rb +1 -1
  99. data/lib/plaid/models/categories_get_response.rb +1 -1
  100. data/lib/plaid/models/category.rb +1 -1
  101. data/lib/plaid/models/cause.rb +1 -1
  102. data/lib/plaid/models/connected_application.rb +357 -0
  103. data/lib/plaid/models/country_code.rb +1 -1
  104. data/lib/plaid/models/credit_card_liability.rb +5 -9
  105. data/lib/plaid/models/credit_filter.rb +2 -2
  106. data/lib/plaid/models/customer_initiated_return_risk.rb +300 -0
  107. data/lib/plaid/models/default_update_webhook.rb +1 -1
  108. data/lib/plaid/models/deposit_switch_address_data.rb +1 -1
  109. data/lib/plaid/models/deposit_switch_alt_create_request.rb +59 -5
  110. data/lib/plaid/models/deposit_switch_alt_create_response.rb +1 -1
  111. data/lib/plaid/models/deposit_switch_create_request.rb +59 -5
  112. data/lib/plaid/models/deposit_switch_create_request_options.rb +251 -0
  113. data/lib/plaid/models/deposit_switch_create_response.rb +1 -1
  114. data/lib/plaid/models/deposit_switch_get_request.rb +1 -1
  115. data/lib/plaid/models/deposit_switch_get_response.rb +74 -7
  116. data/lib/plaid/models/deposit_switch_state_update_webhook.rb +250 -0
  117. data/lib/plaid/models/deposit_switch_target_account.rb +1 -1
  118. data/lib/plaid/models/deposit_switch_target_user.rb +1 -1
  119. data/lib/plaid/models/deposit_switch_token_create_request.rb +1 -1
  120. data/lib/plaid/models/deposit_switch_token_create_response.rb +2 -2
  121. data/lib/plaid/models/depository_filter.rb +2 -2
  122. data/lib/plaid/models/email.rb +1 -1
  123. data/lib/plaid/models/employee.rb +6 -17
  124. data/lib/plaid/models/employee_income_summary_field_string.rb +1 -1
  125. data/lib/plaid/models/employer.rb +7 -3
  126. data/lib/plaid/models/employer_income_summary_field_string.rb +1 -1
  127. data/lib/plaid/models/employers_search_request.rb +1 -1
  128. data/lib/plaid/models/employers_search_response.rb +1 -1
  129. data/lib/plaid/models/error.rb +2 -9
  130. data/lib/plaid/models/external_payment_options.rb +61 -7
  131. data/lib/plaid/models/external_payment_refund_details.rb +7 -2
  132. data/lib/plaid/models/{external_payment_schedule.rb → external_payment_schedule_base.rb} +21 -25
  133. data/lib/plaid/models/external_payment_schedule_get.rb +19 -19
  134. data/lib/plaid/models/external_payment_schedule_request.rb +283 -0
  135. data/lib/plaid/models/health_incident.rb +18 -5
  136. data/lib/plaid/models/historical_balance.rb +3 -3
  137. data/lib/plaid/models/historical_update_webhook.rb +1 -1
  138. data/lib/plaid/models/holding.rb +3 -3
  139. data/lib/plaid/models/holdings_default_update_webhook.rb +1 -1
  140. data/lib/plaid/models/identity_get_request.rb +1 -1
  141. data/lib/plaid/models/identity_get_request_options.rb +1 -1
  142. data/lib/plaid/models/identity_get_response.rb +1 -1
  143. data/lib/plaid/models/incident_update.rb +4 -4
  144. data/lib/plaid/models/income_breakdown.rb +36 -2
  145. data/lib/plaid/models/income_summary.rb +26 -1
  146. data/lib/plaid/models/income_summary_field_number.rb +1 -1
  147. data/lib/plaid/models/income_summary_field_string.rb +1 -1
  148. data/lib/plaid/models/income_verification_create_request.rb +1 -1
  149. data/lib/plaid/models/income_verification_create_response.rb +1 -1
  150. data/lib/plaid/models/income_verification_documents_download_request.rb +1 -1
  151. data/lib/plaid/models/income_verification_documents_download_response.rb +1 -1
  152. data/lib/plaid/models/{income_verification_paystub_get_request.rb → income_verification_paystubs_get_request.rb} +5 -5
  153. data/lib/plaid/models/income_verification_paystubs_get_response.rb +241 -0
  154. data/lib/plaid/models/income_verification_refresh_request.rb +245 -0
  155. data/lib/plaid/models/income_verification_refresh_response.rb +239 -0
  156. data/lib/plaid/models/income_verification_status_webhook.rb +2 -2
  157. data/lib/plaid/models/income_verification_summary_get_request.rb +1 -1
  158. data/lib/plaid/models/income_verification_summary_get_response.rb +12 -2
  159. data/lib/plaid/models/income_verification_webhook_status.rb +1 -1
  160. data/lib/plaid/models/inflow_model.rb +1 -1
  161. data/lib/plaid/models/initial_update_webhook.rb +1 -1
  162. data/lib/plaid/models/institution.rb +2 -2
  163. data/lib/plaid/models/institution_status.rb +30 -3
  164. data/lib/plaid/models/institutions_get_by_id_request.rb +1 -1
  165. data/lib/plaid/models/institutions_get_by_id_request_options.rb +2 -2
  166. data/lib/plaid/models/institutions_get_by_id_response.rb +1 -1
  167. data/lib/plaid/models/institutions_get_request.rb +1 -1
  168. data/lib/plaid/models/institutions_get_request_options.rb +2 -2
  169. data/lib/plaid/models/institutions_get_response.rb +1 -1
  170. data/lib/plaid/models/institutions_search_account_filter.rb +1 -1
  171. data/lib/plaid/models/institutions_search_payment_initiation_options.rb +1 -1
  172. data/lib/plaid/models/institutions_search_request.rb +2 -2
  173. data/lib/plaid/models/institutions_search_request_options.rb +2 -2
  174. data/lib/plaid/models/institutions_search_response.rb +1 -1
  175. data/lib/plaid/models/investment_filter.rb +2 -2
  176. data/lib/plaid/models/investment_holdings_get_request_options.rb +1 -1
  177. data/lib/plaid/models/investment_transaction.rb +5 -5
  178. data/lib/plaid/models/investments_default_update_webhook.rb +1 -1
  179. data/lib/plaid/models/investments_holdings_get_request.rb +1 -1
  180. data/lib/plaid/models/investments_holdings_get_response.rb +1 -1
  181. data/lib/plaid/models/investments_transactions_get_request.rb +1 -1
  182. data/lib/plaid/models/investments_transactions_get_request_options.rb +1 -1
  183. data/lib/plaid/models/investments_transactions_get_response.rb +1 -1
  184. data/lib/plaid/models/item.rb +5 -5
  185. data/lib/plaid/models/item_access_token_invalidate_request.rb +1 -1
  186. data/lib/plaid/models/item_access_token_invalidate_response.rb +1 -1
  187. data/lib/plaid/models/item_application_list_request.rb +241 -0
  188. data/lib/plaid/models/item_application_list_response.rb +237 -0
  189. data/lib/plaid/models/item_application_list_user_auth.rb +232 -0
  190. data/lib/plaid/models/item_application_scopes_update_request.rb +274 -0
  191. data/lib/plaid/models/{income_verification_paystub_get_response.rb → item_application_scopes_update_response.rb} +11 -15
  192. data/lib/plaid/models/item_error_webhook.rb +1 -1
  193. data/lib/plaid/models/item_get_request.rb +1 -1
  194. data/lib/plaid/models/item_get_response.rb +2 -2
  195. data/lib/plaid/models/item_import_request.rb +1 -1
  196. data/lib/plaid/models/item_import_request_options.rb +1 -1
  197. data/lib/plaid/models/item_import_request_user_auth.rb +1 -1
  198. data/lib/plaid/models/item_import_response.rb +1 -1
  199. data/lib/plaid/models/item_product_ready_webhook.rb +1 -1
  200. data/lib/plaid/models/item_public_token_create_request.rb +1 -1
  201. data/lib/plaid/models/item_public_token_create_response.rb +1 -1
  202. data/lib/plaid/models/item_public_token_exchange_request.rb +1 -1
  203. data/lib/plaid/models/item_public_token_exchange_response.rb +1 -1
  204. data/lib/plaid/models/item_remove_request.rb +1 -1
  205. data/lib/plaid/models/item_remove_response.rb +1 -1
  206. data/lib/plaid/models/item_status.rb +7 -16
  207. data/lib/plaid/models/item_status_investments.rb +232 -0
  208. data/lib/plaid/models/{nullable_recipient_bacs.rb → item_status_last_webhook.rb} +22 -26
  209. data/lib/plaid/models/{nullable_item_status.rb → item_status_nullable.rb} +10 -19
  210. data/lib/plaid/models/item_status_transactions.rb +232 -0
  211. data/lib/plaid/models/item_webhook_update_request.rb +1 -1
  212. data/lib/plaid/models/item_webhook_update_response.rb +1 -1
  213. data/lib/plaid/models/jwk_public_key.rb +1 -1
  214. data/lib/plaid/models/jwt_header.rb +1 -1
  215. data/lib/plaid/models/liabilities_default_update_webhook.rb +27 -2
  216. data/lib/plaid/models/liabilities_get_request.rb +1 -1
  217. data/lib/plaid/models/liabilities_get_request_options.rb +1 -1
  218. data/lib/plaid/models/liabilities_get_response.rb +1 -1
  219. data/lib/plaid/models/liabilities_object.rb +4 -4
  220. data/lib/plaid/models/liability_override.rb +3 -3
  221. data/lib/plaid/models/link_token_account_filters.rb +2 -2
  222. data/lib/plaid/models/link_token_create_request.rb +12 -3
  223. data/lib/plaid/models/link_token_create_request_account_subtypes.rb +2 -2
  224. data/lib/plaid/models/link_token_create_request_auth.rb +1 -1
  225. data/lib/plaid/models/link_token_create_request_deposit_switch.rb +1 -1
  226. data/lib/plaid/models/link_token_create_request_income_verification.rb +2 -3
  227. data/lib/plaid/models/link_token_create_request_payment_initiation.rb +22 -1
  228. data/lib/plaid/models/link_token_create_request_user.rb +8 -8
  229. data/lib/plaid/models/link_token_create_response.rb +1 -1
  230. data/lib/plaid/models/link_token_eu_config.rb +220 -0
  231. data/lib/plaid/models/link_token_get_metadata_response.rb +11 -1
  232. data/lib/plaid/models/link_token_get_request.rb +1 -1
  233. data/lib/plaid/models/link_token_get_response.rb +11 -1
  234. data/lib/plaid/models/loan_filter.rb +2 -2
  235. data/lib/plaid/models/location.rb +1 -1
  236. data/lib/plaid/models/meta.rb +1 -1
  237. data/lib/plaid/models/mfa.rb +1 -1
  238. data/lib/plaid/models/mortgage_interest_rate.rb +1 -1
  239. data/lib/plaid/models/mortgage_liability.rb +20 -6
  240. data/lib/plaid/models/mortgage_property_address.rb +1 -1
  241. data/lib/plaid/models/numbers.rb +1 -41
  242. data/lib/plaid/models/numbers_ach.rb +2 -2
  243. data/lib/plaid/models/{nullable_numbers_ach.rb → numbers_ach_nullable.rb} +5 -5
  244. data/lib/plaid/models/numbers_bacs.rb +1 -1
  245. data/lib/plaid/models/{nullable_numbers_bacs.rb → numbers_bacs_nullable.rb} +4 -4
  246. data/lib/plaid/models/numbers_eft.rb +1 -1
  247. data/lib/plaid/models/{nullable_numbers_eft.rb → numbers_eft_nullable.rb} +4 -4
  248. data/lib/plaid/models/numbers_international.rb +1 -1
  249. data/lib/plaid/models/{nullable_numbers_international.rb → numbers_international_nullable.rb} +4 -4
  250. data/lib/plaid/models/override_account_type.rb +40 -0
  251. data/lib/plaid/models/override_accounts.rb +2 -2
  252. data/lib/plaid/models/owner.rb +1 -1
  253. data/lib/plaid/models/owner_override.rb +1 -1
  254. data/lib/plaid/models/pay_frequency.rb +1 -1
  255. data/lib/plaid/models/pay_period_details.rb +4 -4
  256. data/lib/plaid/models/payment_amount.rb +12 -1
  257. data/lib/plaid/models/payment_initiation_address.rb +118 -4
  258. data/lib/plaid/models/payment_initiation_metadata.rb +16 -1
  259. data/lib/plaid/models/payment_initiation_optional_restriction_bacs.rb +53 -1
  260. data/lib/plaid/models/payment_initiation_payment.rb +20 -2
  261. data/lib/plaid/models/payment_initiation_payment_create_request.rb +53 -3
  262. data/lib/plaid/models/payment_initiation_payment_create_response.rb +35 -1
  263. data/lib/plaid/models/payment_initiation_payment_get_request.rb +22 -1
  264. data/lib/plaid/models/payment_initiation_payment_get_response.rb +20 -2
  265. data/lib/plaid/models/payment_initiation_payment_list_request.rb +1 -18
  266. data/lib/plaid/models/payment_initiation_payment_list_response.rb +1 -1
  267. data/lib/plaid/models/payment_initiation_payment_token_create_request.rb +22 -1
  268. data/lib/plaid/models/payment_initiation_payment_token_create_response.rb +1 -1
  269. data/lib/plaid/models/payment_initiation_recipient.rb +2 -2
  270. data/lib/plaid/models/payment_initiation_recipient_create_request.rb +49 -2
  271. data/lib/plaid/models/payment_initiation_recipient_create_response.rb +1 -1
  272. data/lib/plaid/models/payment_initiation_recipient_get_request.rb +22 -1
  273. data/lib/plaid/models/payment_initiation_recipient_get_response.rb +2 -2
  274. data/lib/plaid/models/payment_initiation_recipient_get_response_all_of.rb +1 -1
  275. data/lib/plaid/models/payment_initiation_recipient_list_request.rb +1 -1
  276. data/lib/plaid/models/payment_initiation_recipient_list_response.rb +1 -1
  277. data/lib/plaid/models/payment_initiation_standing_order_metadata.rb +16 -1
  278. data/lib/plaid/models/payment_meta.rb +1 -1
  279. data/lib/plaid/models/payment_schedule_interval.rb +1 -1
  280. data/lib/plaid/models/payment_status_update_webhook.rb +2 -2
  281. data/lib/plaid/models/paystub.rb +3 -18
  282. data/lib/plaid/models/paystub_deduction.rb +1 -1
  283. data/lib/plaid/models/{nullable_access_token.rb → paystub_employer.rb} +17 -6
  284. data/lib/plaid/models/paystub_ytd_details.rb +2 -1
  285. data/lib/plaid/models/pending_expiration_webhook.rb +2 -2
  286. data/lib/plaid/models/phone_number.rb +11 -3
  287. data/lib/plaid/models/processor_apex_processor_token_create_request.rb +1 -1
  288. data/lib/plaid/models/processor_auth_get_request.rb +1 -1
  289. data/lib/plaid/models/processor_auth_get_response.rb +1 -1
  290. data/lib/plaid/models/processor_balance_get_request.rb +1 -1
  291. data/lib/plaid/models/processor_balance_get_response.rb +1 -1
  292. data/lib/plaid/models/processor_bank_transfer_create_request.rb +459 -0
  293. data/lib/plaid/models/processor_bank_transfer_create_response.rb +239 -0
  294. data/lib/plaid/models/processor_identity_get_request.rb +1 -1
  295. data/lib/plaid/models/processor_identity_get_response.rb +1 -1
  296. data/lib/plaid/models/processor_number.rb +5 -5
  297. data/lib/plaid/models/processor_stripe_bank_account_token_create_request.rb +1 -1
  298. data/lib/plaid/models/processor_stripe_bank_account_token_create_response.rb +1 -1
  299. data/lib/plaid/models/processor_token_create_request.rb +36 -2
  300. data/lib/plaid/models/processor_token_create_response.rb +1 -1
  301. data/lib/plaid/models/product_access.rb +262 -0
  302. data/lib/plaid/models/product_status.rb +3 -3
  303. data/lib/plaid/models/product_status_breakdown.rb +1 -2
  304. data/lib/plaid/models/products.rb +2 -1
  305. data/lib/plaid/models/projected_income_summary_field_number.rb +1 -1
  306. data/lib/plaid/models/pslf_status.rb +2 -2
  307. data/lib/plaid/models/recaptcha_required_error.rb +1 -1
  308. data/lib/plaid/models/recipient_bacs.rb +53 -1
  309. data/lib/plaid/models/recipient_bacs_nullable.rb +288 -0
  310. data/lib/plaid/models/requested_scopes.rb +261 -0
  311. data/lib/plaid/models/sandbox_bank_transfer_fire_webhook_request.rb +1 -1
  312. data/lib/plaid/models/sandbox_bank_transfer_fire_webhook_response.rb +1 -1
  313. data/lib/plaid/models/sandbox_bank_transfer_simulate_request.rb +1 -1
  314. data/lib/plaid/models/sandbox_bank_transfer_simulate_response.rb +1 -1
  315. data/lib/plaid/models/sandbox_income_fire_webhook_request.rb +309 -0
  316. data/lib/plaid/models/sandbox_income_fire_webhook_response.rb +225 -0
  317. data/lib/plaid/models/sandbox_item_fire_webhook_request.rb +1 -1
  318. data/lib/plaid/models/sandbox_item_fire_webhook_response.rb +1 -1
  319. data/lib/plaid/models/sandbox_item_reset_login_request.rb +1 -1
  320. data/lib/plaid/models/sandbox_item_reset_login_response.rb +1 -1
  321. data/lib/plaid/models/sandbox_item_set_verification_status_request.rb +1 -1
  322. data/lib/plaid/models/sandbox_item_set_verification_status_response.rb +1 -1
  323. data/lib/plaid/models/sandbox_oauth_select_accounts_request.rb +240 -0
  324. data/lib/plaid/models/sandbox_processor_token_create_request.rb +1 -1
  325. data/lib/plaid/models/sandbox_processor_token_create_request_options.rb +1 -1
  326. data/lib/plaid/models/sandbox_processor_token_create_response.rb +1 -1
  327. data/lib/plaid/models/sandbox_public_token_create_request.rb +1 -1
  328. data/lib/plaid/models/sandbox_public_token_create_request_options.rb +1 -1
  329. data/lib/plaid/models/sandbox_public_token_create_request_options_transactions.rb +4 -4
  330. data/lib/plaid/models/sandbox_public_token_create_response.rb +1 -1
  331. data/lib/plaid/models/scopes.rb +243 -0
  332. data/lib/plaid/models/scopes_nullable.rb +249 -0
  333. data/lib/plaid/models/security.rb +3 -3
  334. data/lib/plaid/models/sender_bacs_nullable.rb +288 -0
  335. data/lib/plaid/models/servicer_address_data.rb +1 -1
  336. data/lib/plaid/models/signal_address_data.rb +263 -0
  337. data/lib/plaid/models/signal_decision_report_request.rb +259 -0
  338. data/lib/plaid/models/signal_decision_report_response.rb +224 -0
  339. data/lib/plaid/models/signal_device.rb +232 -0
  340. data/lib/plaid/models/signal_evaluate_core_attributes.rb +584 -0
  341. data/lib/plaid/models/signal_evaluate_request.rb +355 -0
  342. data/lib/plaid/models/signal_evaluate_response.rb +252 -0
  343. data/lib/plaid/models/signal_person_name.rb +265 -0
  344. data/lib/plaid/models/signal_return_report_request.rb +259 -0
  345. data/lib/plaid/models/signal_return_report_response.rb +224 -0
  346. data/lib/plaid/models/signal_scores.rb +227 -0
  347. data/lib/plaid/models/signal_user.rb +252 -0
  348. data/lib/plaid/models/standalone_account_type.rb +1 -1
  349. data/lib/plaid/models/standalone_currency_code_list.rb +1 -1
  350. data/lib/plaid/models/standalone_investment_transaction_subtype.rb +1 -1
  351. data/lib/plaid/models/standalone_investment_transaction_type.rb +1 -1
  352. data/lib/plaid/models/student_loan.rb +27 -7
  353. data/lib/plaid/models/student_loan_repayment_model.rb +1 -1
  354. data/lib/plaid/models/student_loan_status.rb +2 -2
  355. data/lib/plaid/models/student_repayment_plan.rb +3 -3
  356. data/lib/plaid/models/transaction.rb +164 -124
  357. data/lib/plaid/models/transaction_all_of.rb +312 -0
  358. data/lib/plaid/models/transaction_base.rb +436 -0
  359. data/lib/plaid/models/transaction_code.rb +1 -1
  360. data/lib/plaid/models/transaction_data.rb +2 -2
  361. data/lib/plaid/models/transaction_override.rb +3 -3
  362. data/lib/plaid/models/transactions_get_request.rb +1 -1
  363. data/lib/plaid/models/transactions_get_request_options.rb +18 -5
  364. data/lib/plaid/models/transactions_get_response.rb +1 -1
  365. data/lib/plaid/models/transactions_refresh_request.rb +1 -1
  366. data/lib/plaid/models/transactions_refresh_response.rb +1 -1
  367. data/lib/plaid/models/transactions_removed_webhook.rb +1 -1
  368. data/lib/plaid/models/user_custom_password.rb +1 -1
  369. data/lib/plaid/models/user_permission_revoked_webhook.rb +1 -1
  370. data/lib/plaid/models/verification_expired_webhook.rb +1 -1
  371. data/lib/plaid/models/verification_refresh_status.rb +36 -0
  372. data/lib/plaid/models/verification_status.rb +1 -1
  373. data/lib/plaid/models/warning.rb +35 -1
  374. data/lib/plaid/models/webhook_update_acknowledged_webhook.rb +1 -1
  375. data/lib/plaid/models/webhook_verification_key_get_request.rb +1 -1
  376. data/lib/plaid/models/webhook_verification_key_get_response.rb +1 -1
  377. data/lib/plaid/models/ytd_gross_income_summary_field_number.rb +1 -1
  378. data/lib/plaid/models/ytd_net_income_summary_field_number.rb +1 -1
  379. data/lib/plaid/version.rb +2 -2
  380. data/pkg/plaid-14.0.0.beta.5.gem +0 -0
  381. data/plaid.gemspec +1 -1
  382. data/templates/ruby/api_client.mustache +3 -1
  383. data/test/test_bank_transfers.rb +1 -1
  384. data/test/test_item.rb +0 -9
  385. data/test/test_payment_initiation.rb +1 -1
  386. data/test/test_processor.rb +1 -16
  387. metadata +65 -16
@@ -0,0 +1,239 @@
1
+ =begin
2
+ #The Plaid API
3
+
4
+ #The Plaid REST API. Please see https://plaid.com/docs/api for more details.
5
+
6
+ The version of the OpenAPI document: 2020-09-14_1.20.6
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.1.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Plaid
17
+ # ProcessorBankTransferCreateResponse defines the response schema for `/processor/bank_transfer/create`
18
+ class ProcessorBankTransferCreateResponse
19
+ attr_accessor :bank_transfer
20
+
21
+ # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.
22
+ attr_accessor :request_id
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'bank_transfer' => :'bank_transfer',
28
+ :'request_id' => :'request_id'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'bank_transfer' => :'BankTransfer',
41
+ :'request_id' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorBankTransferCreateResponse` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorBankTransferCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'bank_transfer')
67
+ self.bank_transfer = attributes[:'bank_transfer']
68
+ end
69
+
70
+ if attributes.key?(:'request_id')
71
+ self.request_id = attributes[:'request_id']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ if @bank_transfer.nil?
80
+ invalid_properties.push('invalid value for "bank_transfer", bank_transfer cannot be nil.')
81
+ end
82
+
83
+ if @request_id.nil?
84
+ invalid_properties.push('invalid value for "request_id", request_id cannot be nil.')
85
+ end
86
+
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ return false if @bank_transfer.nil?
94
+ return false if @request_id.nil?
95
+ true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ bank_transfer == o.bank_transfer &&
104
+ request_id == o.request_id
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [bank_transfer, request_id].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ new.build_from_hash(attributes)
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ self.class.openapi_types.each_pair do |key, type|
132
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
133
+ self.send("#{key}=", nil)
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ end
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = Plaid.const_get(type)
187
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Plaid REST API. Please see https://plaid.com/docs/api for more details.
5
5
 
6
- The version of the OpenAPI document: 2020-09-14_1.16.6
6
+ The version of the OpenAPI document: 2020-09-14_1.20.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.1.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Plaid REST API. Please see https://plaid.com/docs/api for more details.
5
5
 
6
- The version of the OpenAPI document: 2020-09-14_1.16.6
6
+ The version of the OpenAPI document: 2020-09-14_1.20.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.1.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Plaid REST API. Please see https://plaid.com/docs/api for more details.
5
5
 
6
- The version of the OpenAPI document: 2020-09-14_1.16.6
6
+ The version of the OpenAPI document: 2020-09-14_1.20.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.1.0
@@ -42,10 +42,10 @@ module Plaid
42
42
  # Attribute type mapping.
43
43
  def self.openapi_types
44
44
  {
45
- :'ach' => :'NullableNumbersACH',
46
- :'eft' => :'NullableNumbersEFT',
47
- :'international' => :'NullableNumbersInternational',
48
- :'bacs' => :'NullableNumbersBACS'
45
+ :'ach' => :'NumbersACHNullable',
46
+ :'eft' => :'NumbersEFTNullable',
47
+ :'international' => :'NumbersInternationalNullable',
48
+ :'bacs' => :'NumbersBACSNullable'
49
49
  }
50
50
  end
51
51
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Plaid REST API. Please see https://plaid.com/docs/api for more details.
5
5
 
6
- The version of the OpenAPI document: 2020-09-14_1.16.6
6
+ The version of the OpenAPI document: 2020-09-14_1.20.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.1.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Plaid REST API. Please see https://plaid.com/docs/api for more details.
5
5
 
6
- The version of the OpenAPI document: 2020-09-14_1.16.6
6
+ The version of the OpenAPI document: 2020-09-14_1.20.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.1.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Plaid REST API. Please see https://plaid.com/docs/api for more details.
5
5
 
6
- The version of the OpenAPI document: 2020-09-14_1.16.6
6
+ The version of the OpenAPI document: 2020-09-14_1.20.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.1.0
@@ -28,9 +28,31 @@ module Plaid
28
28
  # The `account_id` value obtained from the `onSuccess` callback in Link
29
29
  attr_accessor :account_id
30
30
 
31
- # The processor you are integrating with. Valid values are `\"achq\"`, `\"check\"`, `\"checkbook\"`, `\"circle\"`, `\"drivewealth\"`, `\"dwolla\"`, `\"galileo\"`, \"`interactive_brokers`\", `\"modern_treasury\"`, `\"ocrolus\"`, `\"prime_trust\"`, `\"rize\"`, `\"sila_money\"`, `\"unit\"`, `\"vesta\"`, `\"vopay\"`, `\"wyre\"`
31
+ # The processor you are integrating with.
32
32
  attr_accessor :processor
33
33
 
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.include?(value)
53
+ end
54
+ end
55
+
34
56
  # Attribute mapping from ruby-style variable name to JSON key.
35
57
  def self.attribute_map
36
58
  {
@@ -125,9 +147,21 @@ module Plaid
125
147
  return false if @access_token.nil?
126
148
  return false if @account_id.nil?
127
149
  return false if @processor.nil?
150
+ processor_validator = EnumAttributeValidator.new('String', ["achq", "alpaca", "astra", "check", "checkbook", "circle", "drivewealth", "dwolla", "galileo", "lithic", "modern_treasury", "moov", "ocrolus", "prime_trust", "rize", "sila_money", "sbv_api", "unit", "vesta", "vopay", "wyre"])
151
+ return false unless processor_validator.valid?(@processor)
128
152
  true
129
153
  end
130
154
 
155
+ # Custom attribute writer method checking allowed values (enum).
156
+ # @param [Object] processor Object to be assigned
157
+ def processor=(processor)
158
+ validator = EnumAttributeValidator.new('String', ["achq", "alpaca", "astra", "check", "checkbook", "circle", "drivewealth", "dwolla", "galileo", "lithic", "modern_treasury", "moov", "ocrolus", "prime_trust", "rize", "sila_money", "sbv_api", "unit", "vesta", "vopay", "wyre"])
159
+ unless validator.valid?(processor)
160
+ fail ArgumentError, "invalid value for \"processor\", must be one of #{validator.allowable_values}."
161
+ end
162
+ @processor = processor
163
+ end
164
+
131
165
  # Checks equality by comparing each attribute.
132
166
  # @param [Object] Object to be compared
133
167
  def ==(o)
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Plaid REST API. Please see https://plaid.com/docs/api for more details.
5
5
 
6
- The version of the OpenAPI document: 2020-09-14_1.16.6
6
+ The version of the OpenAPI document: 2020-09-14_1.20.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.1.0
@@ -0,0 +1,262 @@
1
+ =begin
2
+ #The Plaid API
3
+
4
+ #The Plaid REST API. Please see https://plaid.com/docs/api for more details.
5
+
6
+ The version of the OpenAPI document: 2020-09-14_1.20.6
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.1.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Plaid
17
+ # The product access being requested. Used to or disallow product access across all accounts. If unset, defaults to all products allowed.
18
+ class ProductAccess
19
+ # Allow access to statements. If unset, defaults to `true`.
20
+ attr_accessor :statements
21
+
22
+ # Allow access to the Identity product (name, email, phone, address). If unset, defaults to `true`.
23
+ attr_accessor :identity
24
+
25
+ # Allow access to account number details. If unset, defaults to `true`.
26
+ attr_accessor :auth
27
+
28
+ # Allow access to transaction details. If unset, defaults to `true`.
29
+ attr_accessor :transactions
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'statements' => :'statements',
35
+ :'identity' => :'identity',
36
+ :'auth' => :'auth',
37
+ :'transactions' => :'transactions'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'statements' => :'Boolean',
50
+ :'identity' => :'Boolean',
51
+ :'auth' => :'Boolean',
52
+ :'transactions' => :'Boolean'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ :'statements',
60
+ :'identity',
61
+ :'auth',
62
+ :'transactions'
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProductAccess` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProductAccess`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'statements')
82
+ self.statements = attributes[:'statements']
83
+ else
84
+ self.statements = true
85
+ end
86
+
87
+ if attributes.key?(:'identity')
88
+ self.identity = attributes[:'identity']
89
+ else
90
+ self.identity = true
91
+ end
92
+
93
+ if attributes.key?(:'auth')
94
+ self.auth = attributes[:'auth']
95
+ else
96
+ self.auth = true
97
+ end
98
+
99
+ if attributes.key?(:'transactions')
100
+ self.transactions = attributes[:'transactions']
101
+ else
102
+ self.transactions = true
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ invalid_properties = Array.new
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ true
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ statements == o.statements &&
125
+ identity == o.identity &&
126
+ auth == o.auth &&
127
+ transactions == o.transactions
128
+ end
129
+
130
+ # @see the `==` method
131
+ # @param [Object] Object to be compared
132
+ def eql?(o)
133
+ self == o
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Integer] Hash code
138
+ def hash
139
+ [statements, identity, auth, transactions].hash
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def self.build_from_hash(attributes)
146
+ new.build_from_hash(attributes)
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ self.class.openapi_types.each_pair do |key, type|
155
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
156
+ self.send("#{key}=", nil)
157
+ elsif type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
161
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
162
+ end
163
+ elsif !attributes[self.class.attribute_map[key]].nil?
164
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
165
+ end
166
+ end
167
+
168
+ self
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def _deserialize(type, value)
176
+ case type.to_sym
177
+ when :Time
178
+ Time.parse(value)
179
+ when :Date
180
+ Date.parse(value)
181
+ when :String
182
+ value.to_s
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :Boolean
188
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
+ true
190
+ else
191
+ false
192
+ end
193
+ when :Object
194
+ # generic object (usually a Hash), return directly
195
+ value
196
+ when /\AArray<(?<inner_type>.+)>\z/
197
+ inner_type = Regexp.last_match[:inner_type]
198
+ value.map { |v| _deserialize(inner_type, v) }
199
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
+ k_type = Regexp.last_match[:k_type]
201
+ v_type = Regexp.last_match[:v_type]
202
+ {}.tap do |hash|
203
+ value.each do |k, v|
204
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
+ end
206
+ end
207
+ else # model
208
+ # models (e.g. Pet) or oneOf
209
+ klass = Plaid.const_get(type)
210
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ if value.nil?
233
+ is_nullable = self.class.openapi_nullable.include?(attr)
234
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
235
+ end
236
+
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ # Outputs non-array value in the form of hash
243
+ # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
246
+ def _to_hash(value)
247
+ if value.is_a?(Array)
248
+ value.compact.map { |v| _to_hash(v) }
249
+ elsif value.is_a?(Hash)
250
+ {}.tap do |hash|
251
+ value.each { |k, v| hash[k] = _to_hash(v) }
252
+ end
253
+ elsif value.respond_to? :to_hash
254
+ value.to_hash
255
+ else
256
+ value
257
+ end
258
+ end
259
+
260
+ end
261
+
262
+ end